Pre-v1.0
Variable declaration and initialisation. Variables are untyped, as far as we can tell so far.
LOLCODE Recommendation v1.0
I HAS A <var> ITZ ...Declare a variable. Note the following:
- Every variable is an array.
- ITZ … has been reserved for future usage and should not be used (except possibly for initialization of single-element arrays)
- At present, all arrays are heterogeneous (they can have different types of values in them). This may change in the future!
All values are typed, and the types are:
- NUMBAR (signed integer, at least 32 bits wide)
- YARN (string)
- ARRAY (contains NUMBARs and/or YARNs and/or ARRAYs)
Currently the interpreter and/or compiler does type checking at compile and/or runtime. This may get nailed down to one or the other in future recommendations.
See in mah
The keyword ARRAY needs to be replaced with BUKKIT. BUKKIT is far more LOLCAT.
Totally agree with the BUKKIT; came to suggest the same thing.
I like BUKKIT, too, and in addition I'd like to suggest a slightly weird change. I think if you could have 3 “implicitly-defined” default variables whose types were type names and which could be used without declaration, it would make for more “readable” LOLCODE.
By this, I mean that if you referenced or assigned a variable named NUMBAR, YARN, or BUKKIT, it would be implicitly declared as a variable of the appropriate type. That way, you could have statements like:
GIMMEH NUMBAR
LOL NUMBAR IN-MAH BUKKIT R YARN
Just a thought. kthxbye.