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