On Thu, Dec 18, 2008 at 5:26 PM, Meikel Brandmeyer <m...@kotka.de> wrote:
> Hi,
>
> I reworked my initial proposal according to the comments
> of Rich. The syntax now looks as follows:
>
> (condp predicate expr
>  test-expr result-expr
>  test-expr :> result-expr

What is ":>"? Is that just a keyword whose name is ">"? I think adding
more characters with special meaning makes code harder to read, so I
hope we don't add more of these.

>  ...
>  default-expr)
>
> A result-expr is chosen according to (predicate test-expr expr).
> In the first form, result-expr is simply evaluated and the result
> is returned. In the second form, result-expr is expected to
> evaluate to a function. This function gets passed the return
> value of the predicate call. Whatever the function returns
> is returned by condp.
>
> If no test-expr leads to a success the default-expr is evaluated
> and the result returned. If no default-expr is supplied an
> exception is thrown.
>
> The patch is attached at the issue tracker.
> http://code.google.com/p/clojure/issues/detail?id=6#c2
>
> Comments appreciated.
>
> Sincerely
> Meikel
>
>



-- 
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