Interpreter: argument lists shared across function calls

[email protected] (Ludovic Courtès)
Newsgroups gmane.lisp.scheme.bigloo
Message-ID <[email protected]>
The interpreter does not always pass fresh rest argument lists, leading
to unexpected behavior:

--8<---------------cut here---------------start------------->8---
1:=> (module foo (library srfi1))
#unspecified
1:=> (define (foo . args) (apply circular-list args) args)
foo
1:=> (foo 1 2 3)
(1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3 1 ...
--8<---------------cut here---------------end--------------->8---

‘circular-list’ should be working on a fresh list, so that ‘foo’ would
return (1 2 3) (info "(r5rs) Procedures").

Thanks,
Ludo’.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.