4 ms·
LOOP is just a little bit more complex than BASIC: (LOOP FOR I FROM 0 BELOW (LENGTH S) THEREIS FOR CH = (CHAR S I) WHEN (< I 0) ALWAYS DO (RETURN CH))
by timonoko 6y ago
LOOP is just a little bit more complex than BASIC:
(LOOP FOR I FROM 0 BELOW (LENGTH S) THEREIS FOR
CH = (CHAR S I) WHEN (< I 0) ALWAYS DO (RETURN CH))
*** - loop: illegal syntax near for in
(loop for i from 0 below (length s) thereis
for ch =
(char s i) when (< i 0) always do (return ch))
- guenthert 6y agoThat might be the case, the same approach would work here though I think. There is even less a pretention of proper English grammar and why should there be? I can't remember the exact syntax of all the LOOP terms for the life of me and generally try to keep it simple. https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node240.html#SECTION003032000000000000000 https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node240.html#... states that "The thereis construct takes one form" so that will be your error. Not quite sure, as I don't know what you intend to express. when (< i 0) makes no sense as i is always positive. http://www.gigamonkeys.com/book/loop-for-black-belts.html http://www.gigamonkeys.com/book/loop-for-black-belts.html might be of help.