Thanks. In my case I wanted the object itself to create the new method, so I did like this:
(push This '(newMsg> () (prinl "Yes!"))) /Jon > On 10. Jun, 2016, at 13:07, Alexander Burger <a...@software-lab.de> wrote: > > On Fri, Jun 10, 2016 at 11:50:07AM +0200, Alexander Burger wrote: >> (push Obj (cons 'msg> '((X) (bar)))) >> >> or >> >> (push Obj '(msg> (X) (bar))) > > Two notes: > > 1. If the symbol 'msg>' is not yet defined as a message in another > context (e.g. with (dm msg> ...)), then you can do that on the fly > with: > > (setq msg> meth) > > 2. Instead of 'push'ing the method into the value as above, you may > sometimes pass it already when creating the object: > > (setq Obj > (new '((msg> (N) (+ (: a) N)) +Cls) > 'a 7 > 's "abc" ) ) > > (msg> Obj 1) > -> 8 > > ♪♫ Alex