mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
e251f8b2d9
* temp * working, but type pass got really slow * clean up * changelog and flip order * clean up and add tests * fix zero size array * handle lambdas correctly * another windows fix
28 lines
664 B
Common Lisp
28 lines
664 B
Common Lisp
(deftype behavior-test-type (basic)
|
|
((foo int))
|
|
(:methods
|
|
(test (_type_ basic) int :behavior behavior-test-type)
|
|
)
|
|
)
|
|
|
|
(defmethod test behavior-test-type ((obj behavior-test-type) (arg0 basic))
|
|
(format #t "method obj: ~D self: ~D~%" (-> obj foo) (-> self foo))
|
|
0
|
|
)
|
|
|
|
(defbehavior test-bfunc behavior-test-type ((arg0 basic))
|
|
(format #t "function self: ~D~%" (-> self foo))
|
|
)
|
|
|
|
|
|
(let ((obj1 (new 'static 'behavior-test-type :foo 123))
|
|
(obj2 (new 'static 'behavior-test-type :foo 456)))
|
|
(with-pp
|
|
(protect (pp)
|
|
(set! pp (the process obj1))
|
|
(test-bfunc #f)
|
|
(test obj2 #f)
|
|
)
|
|
)
|
|
)
|
|
0 |