Copy a symbol to another (value, properties…)

2014-02-05 Thread Christophe Gragnic
Hi, 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. The copy can be «by value» or «by ref». Both available separatly would

subscribe

2014-02-05 Thread Keith Kim
Hello "Keith Kim" :-) You are now subscribed -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Re: Copy a symbol to another (

2014-02-05 Thread Alexander Burger
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" "Sym

Re: Copy a symbol to another (

2014-02-05 Thread Christophe Gragnic
On Wed, Feb 5, 2014 at 5:34 PM, Alexander Burger wrote: > > You could do > >(de alias ("Sym1" "Sym2") > (set "Sym2" (val "Sym1")) > (putl "Sym2" (getl "Sym1")) > "Sym2" ) Indeed. This works fine (except for `set` that is not implemented in EmuLisp!). >> The copy can be «by

Re: Copy a symbol to another (

2014-02-05 Thread Alexander Burger
On Wed, Feb 05, 2014 at 08:41:43PM +0100, Christophe Gragnic wrote: > >> 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