lists
Posted: Wed Feb 25, 2004 8:59 pm
Hello All,
Oooo im probably making the "newbe" greeting posting this one ;-)
Im trying to extend a list, now im using 'append or 'cons still the original
variable stays untouched (featured) when i dont use an extra (set 'var ...)
below the example..
> (set 'alist (list '(something)))
((something))
> (set 'alist (cons alist '(hello) ))
(((something)) hello)
> alist
(((something)) hello)
> (set 'alist ( append alist (list '(someone)) ) )
(((something)) hello (someone))
> alist
(((something)) hello (someone))
--- but is it possible to extend a list without the use of the "extra" 'set?
--- so that the original 'list is updated?
like ->
(append alist (list '(to-add)))
or
(cons alist '(new-one))
Regards,
Norman.
Oooo im probably making the "newbe" greeting posting this one ;-)
Im trying to extend a list, now im using 'append or 'cons still the original
variable stays untouched (featured) when i dont use an extra (set 'var ...)
below the example..
> (set 'alist (list '(something)))
((something))
> (set 'alist (cons alist '(hello) ))
(((something)) hello)
> alist
(((something)) hello)
> (set 'alist ( append alist (list '(someone)) ) )
(((something)) hello (someone))
> alist
(((something)) hello (someone))
--- but is it possible to extend a list without the use of the "extra" 'set?
--- so that the original 'list is updated?
like ->
(append alist (list '(to-add)))
or
(cons alist '(new-one))
Regards,
Norman.