Table of Contents

LOLCODE Recommendation v1.0

Conditional Operators

Notice that these can be modified into the other three conditional operators with the NOT logical operator. For example, “NOT SMALR THAN” functionally equivalent to ”>=” in most other languages, and “NOT LIEK” is functionally equivalent to ”!=” in other languages.

Logical/Bitwise Operators

These should be self explanatory. While there is no offical operator precedence, these should be higher priority than the conditional operators listed above.

Assignment Operator

See: lol r and i has a

Computational Operators

I think the best way to show these is with examples. In them, if b is stated as ”[b]” it is optional, and (as shown in the standard column) defaults to 1 when not specified.

BTW LOLCODE   : // Standard
a UP b        : a + b
UPZ a!![b]    : a += b (b=1)
a NERF b      : a - b
NERFZ a!![b]  : a -= b (b=1)
a TIEMZ b     : a * b
TIEMZD a!![b] : a *= b (b=1)
a OVAR b      : a / b
OVARZ a!![b]  : a /= b (b=1)

Note that again, while there is no formal recommendation on prededence, the non-mutating operators (not +=, etc) should have lower precedence than all other operators, and the mutating should have the same (very low) precedence as the assignment statement.)


I highly recommend looking at signify-order: RPN seems like the way to handle precedence and grouping. — Adam, 2007/05/31 10:08

Make “Polish Reverse Notation” an optional mode, or a function: named PRON:

I HAS A noob ITZ PRON 2 3 UP 7 TIEM 7 OVAR 
LOL noob R PRON noob 1 7 OVAR NERF 

What about a modulo operator?


The two immediate words that popped into my head are MODZ and CEPTN, although now I'm wanting LEFTOVERZ…


Here's a proposal for Modulus and Exponent:

Modulus:

I HAS A num ITZ 8 LEFTOVER 3       BTW returns 2
I HAS A num2 ITZ LEFTOVERZ 9!!4    BTW returns 1

Exponent:

I HAS A num3 ITZ 3 BOOM 3          BTW returns 27
I HAS A num4 ITZ BOOMZ 2!!10       BTW returns 1024