On Wed, Feb 5, 2014 at 5:34 PM, Alexander Burger <a...@software-lab.de> 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 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).

Not sure. I don't understand `copy` enough to tell you.
This seems to be «by ref» to me (or maybe it's like in Java! refs are
passed by value (or the contrary!)). See here: the change of the value of a
is not propagated to b.

: (setq a "hello")
-> "hello"
: (alias 'a 'b)
-> b
: b
-> "hello"
: (setq a "yo")
-> "yo"
: b
-> "hello"

Anyway, I'm happy with you alias!



http://profgra.org/lycee/ (site pro)
http://delicious.com/profgraorg (liens, favoris)
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to