Is there anywhere, a list of the keywords that can introduce a new clause in the LOOP macro? http://www.lispworks.com/documentation/lw51/CLHS/Body/m_loop.htm is informative, but I'm still not clear about which words in the provided grammar are literal keywords as opposed to production names, and whether there are some keywords that can only occur within a clause, as opposed to introducing a new clause.
1 Answer
Here they are. These can introduce a clause:
Name Clause
named
Variable Clauses
initially finally for as with
Main Clauses
do collect collecting append
appending nconc nconcing into count
counting sum summing maximize return
maximizing minimize minimizing doing
thereis always never if when
unless repeat while until
These don’t introduce clauses
= and it else end from upfrom
above below to upto downto downfrom
in on then across being each the hash-key
hash-keys of using hash-value hash-values
symbol symbols present-symbol
present-symbols external-symbol
external-symbols fixnum float t nil of-type
But note that it’s the parsing that determines what is a keyword. For example in:
(loop for key in hash-values)
Only for
and in
are keywords.