Interesting Hugo behavior

Post a reply


This question is a means of preventing automated form submissions by spambots.
Smilies
:smile: :sad: :eek: :shock: :cool: :-x :razz: :oops: :evil: :twisted: :wink: :idea: :arrow: :neutral: :mrgreen:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Interesting Hugo behavior

Interesting Hugo behavior

by Tdarcos » Fri Nov 08, 2019 9:04 am

See if you can figure out what will happen without compiling. (Okay, I cheated, but if I hadn't tried compiling and running it I'd never have found out what it was doing.)

Code: Select all

verb "x2"
	*                                DoX2

verb "x3"
  *                                DoX3

verb "x2"
  *                                DoX22

verb "x3"
  *                                DoX32

verb "x3"
    *                                DoX33

verb "x4"
  *                                DoX4
  
  
outine DoX2
{
  "For X2, the first routine was used."
  return true
}

routine DoX22
{
  "For X2, the second routine was used."
  return true
}

routine DoX3
{
  "For X3, the first routine was used."
  return true

}

routine DoX32
{
  "For X3, the second routine was used."
  return true

}

routine DoX33
{
  "For X3, the third routine was used."
  return true
}

routine DoX4
{
  "For X4, the first routine was used."
  return true
}
Now the questions:
  1. Which routine does verb X2 call?
  2. Does X3 compile without error?
  3. If so, which routine does verb X3 call?
  4. What is the result if routine DoX4 is changed to replace DoX4
Remember, I already know the answers, I want to see how you think.

Top