Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • \$\begingroup\$ Why is arg1 rather than ³? \$\endgroup\$ Commented Mar 26, 2021 at 22:09
  • 2
    \$\begingroup\$ @ChartZBelatedly - Er, it's a bit non-intuitive at first... Husk program arguments are numbered in reverse, using even numbers starting at zero: so with 3 program args, arg1 is 4, arg2 is 2, and arg3 is 0. But... if we use the odd numbers, then an additional copy is automatically added to the end of the program (so that we don't need to waste a character specifying it twice). So, in this case, arg3 and arg1 are both appended to the end of the program to be used by X (and so use odd-numbered indices), and arg2 is only used once (so gets the even-numbered index). \$\endgroup\$ Commented Mar 26, 2021 at 22:13
  • \$\begingroup\$ @ChartZBelatedly - probably a better explanation here \$\endgroup\$ Commented Mar 26, 2021 at 22:15