Re: Add method to one object only?

2016-06-10 Thread Jon Kleiser
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 wrote: > > On Fri, Jun 10, 2016 at 11:50:07AM +0200, Alexander Burger wrote: >> (push Obj (cons 'msg> '((X

Re: Add method to one object only?

2016-06-10 Thread Alexander Burger
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

Re: Add method to one object only?

2016-06-10 Thread Jon Kleiser
Thanks, Alex! That was nice and easy. /Jon > On 10. Jun, 2016, at 11:50, Alexander Burger wrote: > > Hi Jon, > >> If one has a few objects of the same class +C, would it be possible to >> add a new method to just one of these objects, without all the others >> also getting that new method? >

Re: Add method to one object only?

2016-06-10 Thread Alexander Burger
Hi Jon, > If one has a few objects of the same class +C, would it be possible to > add a new method to just one of these objects, without all the others > also getting that new method? You can add a method to an object (or also a class) by adding a cons pair (msg> . fun) to its value. (push O

Add method to one object only?

2016-06-10 Thread Jon Kleiser
Hi, If one has a few objects of the same class +C, would it be possible to add a new method to just one of these objects, without all the others also getting that new method? /Jon-- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe