I know I can do it with: (foreach x 'in seq) and use (is 2nd-arg 'in).
This is probably the most intuitive approach, but since foreach is a macro, you don't need to quote in.
arc> (mac foreach (var in expr . body)
`(each ,var ,expr
,@body))
#(tagged mac #<procedure: foreach>)
arc> (foreach x in '(a b c) ; in, not 'in
(prn x))
a
b
c
nil
My definition is silly because it doesn't do anything with the in arg. It doesn't even require that the arg be in!
arc> (foreach x fruitloops '(o o o)
(prn "yum"))
yum
yum
yum
nil
More interesting things are certainly possible, though. :)
I think the colon is his convention for within the definition, as a visual marker to distinguish keyword parameters from others. When you later call a function or macro defined as such, you won't need to prepend the colon to arg you're passing (similar to how mine was called in within the definition but could be fruitloops when I called it).
Edit: On second thought, probably does use the colon when calling the function as well.
The prettiness wasn't a concern; as programmers we're used to needing hyphens or underscores, to ignoring parentheses and focusing on indentation. The colon's like that.