On Mar 9, 10:48 am, timc timgcl...@gmail.com wrote:
Can someone please see what's wrong with this.
(defn getArg [arg]
Return a [keyword value] depending on the form of the string arg:
1. arg is of the form +x == [:x true].
2. arg is of the form -x == [:x false].
On Mar 9, 2009, at 5:48 AM, timc wrote:
(re-seq #([a-zA-Z_0-9]+)=([^ ]+) arg))]
Two small suggestions--it's easier, and more legible to use \S to
match non-whitespace characters:
(re-seq #([a-zA-Z_0-9]+)=(\S+) arg)
And you've basically defined the word character class \w
Hi Tim,
your getArg function is actually a nice use case
of a not very often used of condp: :.
Please note in the following example: as David
Nolen said, we have to use seq after re-seq since
re-seq doesn't return a nil but the empty list.
Hence I used comp to chain the two together.
Also