lolcode-spec icon indicating copy to clipboard operation
lolcode-spec copied to clipboard

Introduce structured data types to LOLCODE

Open AlexisGoodfellow opened this issue 6 years ago • 3 comments

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!

AlexisGoodfellow avatar Sep 26 '18 15:09 AlexisGoodfellow

I HAS A <class_name> WIF <constructor args> maybe?

kierajreed avatar Sep 27 '18 20:09 kierajreed

also,

... BUT
   MEK WIF <arguments> FO
      <statements>
   OKIE
OKIE

kierajreed avatar Sep 27 '18 20:09 kierajreed

That syntax looks good to me!

AlexisGoodfellow avatar Sep 27 '18 21:09 AlexisGoodfellow