Looking at the "expand" function in manual (http://www.newlisp.org/downloads/newlis ... tml#expand):
(set 'x 2 'a '(d e))
(set 'foo 'a)
(expand 'foo 'a) → (d e)
(expand '(a x b) 'x) → (a 2 b)
(expand '(a x (b c x)) 'x) → (a 2 (b c 2))
(expand '(a x (b c x)) 'x 'a) → ((d e) 2 (b c 2))
I have some strange results trying to repeat it. (expand 'foo 'a) gives me only "foo"
expand ('foo 'a)
-
- Posts: 388
- Joined: Thu May 08, 2008 1:24 am
- Location: Croatia
- Contact:
yes, you can expand on the top level, but there is not much usage for that:
but it would make sense here (not on the top level):
ps: the manual is corrected
Code: Select all
> (set 'foo '(d e))
(d e)
> (expand foo 'foo)
(d e)
>
Code: Select all
> (set 'bar '(x foo y))
(x foo y)
> (expand bar 'foo)
(x (d e) y)
>