Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!newlisp
- ;; Is it a FOOP peculiarity?
- ;; http://www.newlispfanclub.alh.net/forum/viewtopic.php?t=4557&p=22467
- (new Class 'One)
- (new One 'Two)
- (context One)
- (define (put v)
- (setf (self 1) v))
- (context Two)
- (define (Two:Two one x)
- (:put one x)
- (list (context) one x))
- (context MAIN)
- (setf uno:uno (One "A"))
- (println "Before: " uno:uno) ;-> Before: (One "A")
- (setf duo:duo (Two uno "B"))
- (println "After: " uno:uno) ;-> After: (One "B")
- (println duo " of " duo:duo) ;-> duo of (Two uno "B")
- (println (Two (One "X") "Y")) ;-> (Two (One "Y") "Y")
- (exit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement