Strange behavior

Started by cameyo, April 19, 2024, 12:28:25 PM

Previous topic - Next topic

cameyo


(define (test a) (extend '() (sequence 1 a)))
(test 4)
;-> (1 2 3 4)
(test 4)
;-> (1 2 3 4 1 2 3 4)
(test 4)
;-> (1 2 3 4 1 2 3 4 1 2 3 4)
test
;-> (lambda (a) (extend '(1 2 3 4 1 2 3 4) (sequence 1 a)))

fdb

extend is destructive, so in place extending the list. if you do not want this use append