error in 'letn'

Started by Fanda, January 08, 2006, 11:07:01 PM

Previous topic - Next topic

Fanda

It looks that there is an error in 'letn':


(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:
arg  = (1 2)

arg  = (2 1)
rarg = (2 1)


I believe that 'test2' should return:
arg  = (1 2)
rarg = (2 1)


Fanda



PS: I am using newLISP v.8.7.7 on Win32 MinGW.

Dmi

#1
reverse is destructive function - arg is modified by it.
WBR, Dmi

Fanda

#2
Oh, I didn't know that! Thanks!



Fanda