Hi Christophe,

> I'm embedding a language in PicoLisp and would like to have aliases
> for certain commands. Is there a way to duplicate a symbol?
> Like:
> : (setq a "hello")
> : (alias 'a 'b)
> : b
> -> "hello"
> 
> I'd like b to also have a's properties.

You could do

   (de alias ("Sym1" "Sym2")
      (set "Sym2" (val "Sym1"))
      (putl "Sym2" (getl "Sym1"))
      "Sym2" )

> The copy can be «by value» or «by ref».
> Both available separatly would be great!

I'm not sure. Lisp values are always references to cells. Do you mean
some kind of 'copy'ing?

   (set "Sym2" (copy (val "Sym1")))
   (putl "Sym2" (copy (getl "Sym1")))

This will copy the top-levels of list arguments (while atomic arguments
are just passed through).

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

Reply via email to