[Antik-devel] Bug in antik/.../sample/low-discrepancy-sequence.lisp ?
Liam Healy
lhealy at common-lisp.net
Wed Apr 17 21:06:11 UTC 2013
I don't bother trying to fix things up for CLISP, it is too broken to
be worth the effort. This looks like it has to do with iterate (vs.
Antik) anyway, so you might take it to the iterate maintainers, though
it wouldn't surprise me that you get the same reaction there.
Liam
On Sat, Dec 8, 2012 at 10:59 AM, Mirko Vukovic <mirko.vukovic at gmail.com> wrote:
> Hello,
>
> this is on clisp 2.48 on cygwin.
>
> The function low-discrepancy-sample could not compile because iterate could
> not digest loop
>
> *****
> Iterate, in clause (COLLECT
> (APPLY MAKE-FUNCTION
> (APPEND FIXED-PARAMETERS
> (MAPCAN
> (LAMBDA (X SEQ)
> (LIST (FIRST X) (VAL-FROM-RANGE (GREF V SEQ) (SECOND X) (THIRD X))))
> SWEEP-PARAMETERS
> (LOOP FOR I FROM 0 BELOW (LENGTH SWEEP-PARAMETERS) COLLECT I))))):
> Iterate does not know how to handle the special form (MACROLET
> ((LOOP-FINISH NIL (SYSTEM::LOOP-FINISH-ERROR)))
> (BLOCK NIL
> (LET ((I 0) (#:LIMIT-273656 (LENGTH SWEEP-PARAMETERS)))
> (PROGN
> (LET ((#:ACCULIST-VAR-273657 NIL))
> (MACROLET ((LOOP-FINISH NIL '(GO SYSTEM::END-LOOP)))
> (TAGBODY SYSTEM::BEGIN-LOOP
> (WHEN (COMMON-LISP:>= I #:LIMIT-273656) (LOOP-FINISH))
> (PROGN (SETQ #:ACCULIST-VAR-273657 (CONS I #:ACCULIST-VAR-273657)))
> (PSETQ I (COMMON-LISP:+ I 1)) (GO SYSTEM::BEGIN-LOOP)
> SYSTEM::END-LOOP
> (MACROLET
> ((LOOP-FINISH NIL (SYSTEM::LOOP-FINISH-WARN) '(GO
> SYSTEM::END-LOOP)))
> (RETURN-FROM NIL (SYSTEM::LIST-NREVERSE
> #:ACCULIST-VAR-273657))))))))))
> It will not be walked, which means that Iterate clauses inside it will not
> be seen.
> *****
>
> If I replaced the loop form with the much more verbose
>
> (let (res)
> (dotimes (i (length sweep-parameters) (nreverse res))
> (push i res)))
>
> the code compiled cleanly.
>
> The same error can be seen with a much simpler:
> (iter:iter
> (iter:for v iter:in '(1 2 3 4))
> (iter:collect (loop for i in v)))
>
> Another alternative is to use iter instead of loop
>
> (iter:iter
> (iter:for i from 0 below (length sweep-parameters))
> (iter:collect i))
>
> It compiles cleanly, but I did not test the function accuracy.
>
> Mirko
>
> _______________________________________________
> Antik-devel mailing list
> Antik-devel at common-lisp.net
> http://lists.common-lisp.net/cgi-bin/mailman/listinfo/antik-devel
>
More information about the antik-devel
mailing list