lolcode-spec
lolcode-spec copied to clipboard
Introduce structured data types to LOLCODE
I am in favor of the following syntax for declaring a structured data type:
DIS IS A <class_name> KINDA LIKE A <base_class_name> BUT
IT GOT A <variable>
IT GOT A <variable> ITZ <value>
IT CAN <function_name>
OKIE
Instantiation can be done with: I HAS A <instance_name> ITZ <class_name> BORN WIF <arguments>
, or <instance_name> R <class_name> BORN WIF <arguments>
Accessing elements of the structure can be done with I HAS A <variable> ITZ DA <field_name> OV <instance_name>
, or <variable> R DA <field_name> OV <instance_name>
.
Other syntax could be used - but I would certainly like structured data types!
I HAS A <class_name> WIF <constructor args>
maybe?
also,
... BUT
MEK WIF <arguments> FO
<statements>
OKIE
OKIE
That syntax looks good to me!