Stuff related to the LOLCODE language.
1 post Page 1 of 1
Postby dkackman » Fri Sep 12, 2014 6:47 pm
IMHO LOLCODE needs to support exception handling in order to be a robust and modern competitor in the language landscape.

I would propose this syntax

AFAIK BTW open the try block
QUOSHUNT OF 10 AN 0
OMFG BTW end exception block, open handler block
FFS SMOOSH "You divided by zero" FML MKAY BTW FML is the implicit exception YARN, FFS throws a new YARN which concatenates FML and an additional string
OIC BTW close exception handler block

AFAIK - equivalent to try, implies I'm pretty sure this may work but who know, might not
All statements between AFAIK and OMFG tokens are within the exception handler
OMFG declares a catch block
FFS throws an exception - exceptions would always be typed as string/YARN
All thrown exceptions are captured implicitly in the FML variable. Every OMFG block has access to the implicit FML object which is the thrown string/YARN
OIC closes the catch block

Please consider this addition to the LOLCODE language specification
1 post Page 1 of 1

Login

Who is online

Users browsing this forum: No registered users and 1 guest

cron