dollabs / pamela

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

Instantiating unknown classes #133

Closed pmdoll closed 5 years ago

pmdoll commented 7 years ago

Instantiating an unknown class should produce an error.

; Example to show bad class instantiation issue
(defpclass some_class []

           :methods [(defpmethod do_x
                                 [])

                     (defpmethod do_y
                                 [a b])])
; Compile as `pamela -i bad_constructor.pamela -o bad_constructor -t "(main.main)" htn`
; error: Call from main.main to fake_class.do_x: method not defined
(defpclass main []

           :fields {
                    :ab (fake_class :id "id1")          ; This is a bug because there is no class fake_class. But pamela is not complaining.
                    }
           :methods [(defpmethod main []
                                 (sequence

                                   (ab.do_x); pamela complains here

                                   (ab.do_y 5 0.5)))])