LOLCODE recommendation 1.0

HISTORICAL

31 May 2007

The following was generated in an IRC meeting as a way of providing a baseline for implementors. Many of the decisions are being revisited in version 1.1 and beyond, through discussion, consensus, and fiat in the forum.

  1. Statements are separated by [\n.]+
  2. CAN HAS <module/“file”>?
    1. for inclusion/requirement
  3. GIMMEH [(LINE|WORD|LETTAR)] <VAR> [OUTTA <filedesc>]
    1. with default being LINE and STDIN
  4. HAI
  5. KTHXBYE
    1. only closes HAI and exits with good condition
  6. DIAF [<num> [<text>]]
    1. Exits the program (failure)
    2. Status code: <num>
    3. Printed to stderr or equivalent: <text>
  7. BYES [<num> [<text>]]
  8. KTHX
    1. is the universal “closing bracket” line
    2. for any if block, looping block, function, etc… except HAI
  9. IM IN YR [<loop label>]
    1. label has no effect
  10. VISIBLE <stuff>[!]
    1. prints stuff as minimally as possible and with a newline (unless !)
  11. I HAS A <l_value> [ITZ …]
    1. Everything is an array. muahahahaha.
      1. To clarify, every VARIABLE is an array, and it knows its own dimensions.
    2. By default, the variable has one element
    3. ITZ … has been tabled for future usage
  12. [## IN MAH]* <var>
    1. Since all variables are arrays, with no IN MAH it references the array as a whole.
    2. Multiple occurences of this index sub-levels of the array.
      1. 1 IN MAH 2 IN MAH arr ⇔ arr[2][1]
        1. IN MAH clarifies the dimension of the array itself, it is not meant to “return” a smaller array. So, 0 IN MAH 0 IN MAH VAR must only be used in a two-dimensional array, just like **arr should only be used in a 2-D array in C.
    3. Does NOT expand the size of the array (except as l_value of assignment)
      1. Throws error/dies on out of bounds?
  13. LOL <var> R <val>
    1. Assigns value into l_value specified by var.
    2. Extends the size of var if necessary
    3. If no index is specified, applies to all elements? (one by default)
  14. IZ <cond> [?] [(.|\n) YARLY] (.|\n) <code> (.|\n) [NOWAI (.|\n) <code>] KTHX
    1. Conditional syntax. See examples.
  15. Comparison operators: [NOT] ((BIGR|SMALR) THAN|LIEK)
    1. See example and keywords:operators
  16. Logical/Bitwise operators: (NOT|AND|OR|XOR)
    1. See example and keywords:operators
  17. Operators (all math, as of v1.0, is integer math)
    1. a UP b : a +
    2. UPZ a!![b : a += b (b=1)
    3. a NERF b : a - b
    4. NERFZ a!![b] : a -= b (b=1)
    5. a TIEMZ b : a * b
    6. TIEMZD a!![b] : a *= b (b=1)
    7. a OVAR b : a / b
    8. OVARZ a!![b] : a /= b (b=1)