<div dir="ltr">Ok now this is making sense, for some reason Orm's message went to my spam bin. Sorry for the confusion. <div><br></div><div>Thanks Orm, I'll look through the various places you recommended.</div><div><br></div><div>iain</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 19, 2020 at 12:52 AM Orm Finnendahl <<a href="mailto:orm.finnendahl@selma.hfmdk-frankfurt.de">orm.finnendahl@selma.hfmdk-frankfurt.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Iain,<br>
<br>
some of the differences out of my head:<br>
<br>
- no argument destructuring like<br>
<br>
(loop for (x y . rest) on seq<br>
while y<br>
do (display (format "~a~%" (cons (+ x y) rest))))<br>
<br>
- no array traversal like<br>
<br>
(loop for x across my-array do (display (format "~a~%" x))<br>
<br>
- no hash table traversal like<br>
<br>
(loop for k<br>
being the hash-key<br>
using (hash-value v) of h<br>
do (display (format "~a ~a~%" k v)))<br>
<br>
There are more things loop provides which weren't considered essential<br>
or even useful in the context of a process. IIRC things like<br>
"collect", "append" or "into" aren't present. To assemble a complete<br>
list check the loop chapter in cltl2 here:<br>
<br>
<a href="https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node235.html#SECTION003000000000000000000" rel="noreferrer" target="_blank">https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node235.html#SECTION003000000000000000000</a><br>
<br>
More importantly there are bugs in the code when variables reference<br>
each other like this:<br>
<br>
(sprout<br>
(process<br>
for a in '(0 1 2)<br>
for b = a then (+ a 1)<br>
do (display (format "a: ~a, b: ~a~%" a b))))<br>
<br>
-> a: 0, b: #f<br>
-> a: 1, b: 1<br>
-> a: 2, b: 2<br>
<br>
The expected output would be:<br>
<br>
-> a: 0, b: 0<br>
-> a: 1, b: 2<br>
-> a: 2, b: 3<br>
<br>
I fixed it in the CL code base in my github repository of CM. It<br>
shouldn't be too difficult to translate that into scheme.<br>
<br>
With the current code base I think it's a good idea to advise users<br>
against cross referencing variables in the initialization and updating<br>
phase of the process form.<br>
<br>
--<br>
Orm<br>
<br>
<br>
Am Samstag, den 18. April 2020 um 18:53:29 Uhr (-0700) schrieb Iain Duncan:<br>
> Hi everyone, there was a comment a while back that the loop macro provided<br>
> by the CM scheme code is not a perfect implementation of CL's loop. I'd<br>
> like to use it in Scheme for Max, but as I don't know either CL or CM well,<br>
> can anyone tell me more about where this diverges or doesn't implement the<br>
> "normal" CL loop macro? I want to make sure I document this properly for<br>
> users coming from CL.<br>
> <br>
> thanks<br>
> iain<br>
<br>
> _______________________________________________<br>
> Cmdist mailing list<br>
> <a href="mailto:Cmdist@ccrma.stanford.edu" target="_blank">Cmdist@ccrma.stanford.edu</a><br>
> <a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist" rel="noreferrer" target="_blank">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
<br>
_______________________________________________<br>
Cmdist mailing list<br>
<a href="mailto:Cmdist@ccrma.stanford.edu" target="_blank">Cmdist@ccrma.stanford.edu</a><br>
<a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist" rel="noreferrer" target="_blank">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a><br>
<br>
</blockquote></div>