Hello,

Chouser has commented extensively, so I'll just put in my two cents.

On Mar 3, 6:40 am, David Sletten <da...@bosatsu.net> wrote:
>
> Incidentally, the "cond" form in roman-to-arabic-aux seems to me  
> harder to read in Clojure than it would be in CL with its additional  
> set of grouping parentheses. When you can't fit both the predicate  
> and the consequent expression on the same line it gets confusing.
>
I find that rather confusing too, formatting wise.

> I'd appreciate any feedback regarding my Clojure style. Any more  
> natural ways to do things?
>
> Aloha,
> David Sletten
>
> (def roman-values-map {\I 1 \V 5 \X 10 \L 50 \C 100 \D 500 \M 1000})
>
> (defn value [roman]
>    (get roman-values-map (Character/toUpperCase roman)))
>
One really neat thing in Clojure is that a collection can be treated
as a function that map from an index (or a key) to a value. So in this
case, this works:

(roman-values-map (Character/toUpperCase roman))

Regards,

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