On Thu, Dec 18, 2008 at 9:08 PM, Stuart Sierra
<the.stuart.sie...@gmail.com> wrote:
>
> On Dec 18, 6:05 pm, "Mark Volkmann" <r.mark.volkm...@gmail.com> wrote:
>> If I understand correctly,
>>
>> (are (< 1 2, 5 7))
>>
>> is equivalent to
>>
>> (is (< 1 2))
>> (is (< 5 7))
>
> Not exactly.  The first argument to "are" is a template expression,
> which is sort of like #().  The arguments to the template are symbols
> named "_1", "_2", "_3", "_4", and so on.  The remaining arguments of
> "are" fill in the arguments to the template.  So:
>
> (are (< _1 _2) 5 7 8 10)
> ;=> expands to (do (is (< 5 7)) (is (< 8 10))
>
> Make sense?  This is roughly equivalent to
> (map (fn [x y] (is (< x y))) [[5 7] [8 10]])
> but it happens at compile time.

Thanks! I understand it now.

There's still the issue though that if I use it incorrectly like this:

(are < 1 2, 5 7)

it hangs forever instead of giving me an error.

-- 
R. Mark Volkmann
Object Computing, Inc.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to