dollabs / pamela

Probabalistic Advanced Modeling and Execution Learning Architecture
Apache License 2.0
233 stars 13 forks source link

Add a reference to self/this, available as a pclass-ctor-arg #189

Open dcerys opened 5 years ago

dcerys commented 5 years ago

Add the ability to specify a reference to the current pclass instance, available as a pclass-ctor-arg in field initial values. This would be analogous to this or self, special symbols available in other languages (e.g., Python and Java).

(defpclass finger [my-hand]
  :fields {hand my-hand})

(defpclass hand []
  ;; A two-digit hand...
  :fields {finger1 (finger this)
           finger2 (finger this)
           }
  :methods [(defpmethod main []
              )])