This forum is closed to new posts due to low activity and a deluge of spam. It is kept online as a static historical record. If you want to read about or discuss esoteric programming languages, the Esolang wiki is the place to go. An archive of the forum is available.
I needed a function that would accept an argument and store it in variable n. My first attempt was:
[xn=]
Needless to say, it didn't work. By looking at other Glass code, I figured out that this should work:
[xn1=,]
It does, but why? According to the Glass specificatgion, this should assign the value 1 to n, and then drop the argument. What exactly am I doing here? (I'm sorry, but I don't like using code I don't understand).
never mind, I figured it out :-)
Fill us in, what was wrong?
I misread the specification, leading me to think that 1 and <1> did the same. They do not, <1> pushes the value 1 to the stack, while 1 pushes the stack element below the topmost stack element to the stack.
Maybe I should get more sleep...