Interesting Hugo behavior

Hugo programming discussion. http://www.generalcoffee.com/hugo
Hugo By Example: http://hugo.gerynarsabode.org/index.php?title=Main_Page
Roody Yogurt's Hugo Blog: http://notdeadhugo.blogspot.com

Moderators: Ice Cream Jonsey, AArdvark

User avatar
Tdarcos
Posts: 5609
Joined: Fri May 16, 2008 9:25 am
Location: Arlington, Virginia
Contact:

Interesting Hugo behavior

Post 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.
"I know what you're doing, I see it all too clear."
- Duncan Sheik, Barely Breathing