Dear Rick,

I am probably missing something rather simple, but I am unable to write a loop 
in Sal where the accumulated results are returned and bound to a variable. For 
example, how can I translate the following Scheme code into Sal?

(define test
  (loop for i from 1 to 10
      collect i))

Alternatively, how do I translate the following? 

(define test
  (loop with res = '()
      for i from 1 to 10
      do
      (set! res (cons i res))
      finally (return res)))

When I translate it then the variable test remains undefined.

Thank you! 

Best,
Torsten


_______________________________________________
Cmdist mailing list
[email protected]
http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist

Reply via email to