On Sat, Feb 21, 2009 at 5:01 PM, David Nolen <[email protected]> wrote:
> (defmacro again [n & body]
>   `(dotimes [~'_ ~n] ~...@body))
> (again 3 (println "Ho"))
> On Sat, Feb 21, 2009 at 5:51 PM, samppi <[email protected]> wrote:
>>
>> For now, I do:
>> (dotimes [_ 3] (print "Ho"))
>>
>> But I also think it would be a nice, natural addition.
>>
>> On Feb 21, 3:07 pm, Timothy Pratley <[email protected]> wrote:
>> > +1

I see a theme here. There are many Clojure functions that take an
argument that must be some kind of sequence where it is frequently the
case that only a single value is needed. Is the main reason that these
don't support passing either a single value or a sequence that the
overhead of checking that would hurt performance?

Here's another example where this theme makes the code look a bit complicated.

(use '[clojure.contrib.str-utils :only (str-join)])

It would be great if this could be written as

(use '[clojure.contrib.str-utils :only str-join])

or even

(use 'clojure.contrib.str-utils :only 'str-join)

It's not clear to me why the use function couldn't figure out what to
do with these simpler arguments.

-- 
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to