Closed irvinshen closed 10 years ago
The latest push involves two possibilities moving forward (if you think of another, please say so!)
First which involves the use of parentheses:
HAI
VISIBLE("hello world")
KTHXBAI
Second which doesn't have parentheses (but is arguably worse since it requires a prefix object Lol:
Lol VISIBLE "hello world 2"
The second example will also require currying to pass multiple arguments
I think using parenthesis is fine, I don't mind them.
I've noticed a difference in execution between the two, with the parentheses behaving as expected. The Lol VISIBLE seems to print to console as soon as it is parsed, while the VISIBLE does not execute until all instructions have been parsed.
I am not sure which one we want.
The Baysick code I was referencing did the latter, so when I was copying, that's what I did. It's a simple code change from one to the other, I think.
It may be wiser to go through and parse the instructions first though (a la mySimpl) so that we can make sure to keep functions correctly (which Baysick doesn't have).
edit: Actually, I'm not sure if LOLCODE has functions.
Functions are defined in one of the links you posted.
According to this source, the syntax is:
HOW DUZ I <function name> [YR <argument1> [AN YR <argument2> …]]
<code block>
IF U SAY SO
Seems a little funky, but we can worry about functions later on :+1:
We have decided to use parenthesis
Just playing around with the Baysick code, it seems as if the implicit def classes require a line number (or some other Any)
requires: [Int] Class args
The regular def classes don't, but the only way that they pass parameters is with parentheses.
requires: ASSIGN(x)