hi folks,

i want to write a compiler for a small prototype-based language that
should target parrot. as a reminder: prototype-based means that i have
objects, and objects are cloned from other objects, but i have no
classes. objects consist of methods and variables that are only
accessible to methods on the same object.

my question is: how should such code look on pir level? has anyone done
something like it before? my current solution is to have a namespace for
each object, with methods in it:

  .namespace [ "Foo" ]          

  .sub _meth :method            
     print "in meth\n"
  .end

  .sub _other_meth :method      
     print "in other_meth\n"   
  .end 

and to store the variables in some hash and access them via a C callback. 
does not look right to me. so i am looking for suggestions or pointers
on how to implement such a language in PIR, any help welcome!

thanks  robert

-- 
Robert Lemmen                               http://www.semistable.com 

Attachment: signature.asc
Description: Digital signature

Reply via email to