Hi Thorsten,

>  1. get a nested list representation of an object or class?

   (cons (val Obj) (getl Obj))


>  2. to turn a nested list that resembles the 'nested list representation an
>     object or class' into a new object (or class) without using PicoLisp's

With 'set' and 'putl', e.g.

   (let X (cons (val Obj) (getl Obj))
      ...
      (prog1 (new (car X))
         (putl @ (cdr X)) ) )

which is the same as

   (let X (cons (val Obj) (getl Obj))
      ...
      (prog1 (new)
         (set @ (car X))
         (putl @ (cdr X)) ) )


Instead of 'new' you could also use 'box', or some other existing (e. g.
internal or transient) symbol.

Note that the above doesn't work to create an external symbol. For that,
you must use

   (prog1 (new T (car X))
      ...

or

   (prog1 (new <some-file-number> (car X))
      ...
   

> Can I tell PicoLisp directly that such a list represents an object (assuming

There is no formal distinction between objects and/or classes. They are
just symbols. It is the value and the property list that lets the
programmer give them such a "meaning".

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to