IS AN HERO would be used to remove a variable from the closest enclosing block containing the variable. It's not really needed unless we implement dynamic scope, in which case it would act like C++'s delete or C's free; unless we implement type checking, in which case you should probably just make two variables; or unless we implement classes, in which case this would be a good way to call the class's destructor.

Example usage on a variable (Assume we're doing type checking, thus reassigning VAR would not work.):

HAI
I HAS A VAR ITZ "LET ME SHOW YOU MY VAR"
VISIBLE VAR
VAR IS AN HERO
I HAS A VAR ITZ 8
UP VAR!!1
VISIBLE VAR
KTHXBYE

Should produce:

LET ME SHOW YOU MY VAR
9

Michael Buckley, 2007/05/30 18:18


As far as can be told, LOLCODE is dynamically typed. What's wrong with writing the code above as

      HAI
I HAS A VAR ITZ "LET ME SHOW YOU MY VAR"
VISIBLE VAR
I HAS A VAR ITZ 8
UP VAR!!1
VISIBLE VAR
KTHXBYE

Jacob Krall, 2007/05/30 19:57


Like I said, it could only be used in that way if LOLCODE was not dynamically typed. There's a discussion in typing about whether to introduce static typing. However, it would also be useful in two other instances:

Of course, neither object-orientation or or the ability to allocate objects on the heap (similar to C's malloc or C++'s new) have been implemented yet, so I didn't provide examples for usage for those cases. IS AN HERO is useless for the moment. I wrote it thinking about the less immediate future of the language.

Michael Buckley, 2007/05/31 04:09