Q&A's, tips, howto's
-
Fanda
- Posts: 253
- Joined: Tue Aug 02, 2005 6:40 am
-
Contact:
Post
by Fanda »
It looks that there is an error in 'letn':
Code: Select all
(define (test1)
(let (arg (args))
(println "arg = " arg)))
(define (test2)
(letn (arg (args) rarg (reverse arg))
(println "arg = " arg)
(println "rarg = " rarg)))
(test1 1 2)
(println)
(test2 1 2)
Output:
Code: Select all
arg = (1 2)
arg = (2 1)
rarg = (2 1)
I believe that 'test2' should return:
Fanda
PS: I am using newLISP v.8.7.7 on Win32 MinGW.
-
Dmi
- Posts: 408
- Joined: Sat Jun 04, 2005 4:16 pm
- Location: Russia
-
Contact:
Post
by Dmi »
reverse is destructive function - arg is modified by it.
WBR, Dmi
-
Fanda
- Posts: 253
- Joined: Tue Aug 02, 2005 6:40 am
-
Contact:
Post
by Fanda »
Oh, I didn't know that! Thanks!
Fanda