You can easily code positional keyword parameters yourself. It takes
only a few minutes for a basic version. Here's an admittedly not very
pretty example:

http://gist.github.com/360145

-Per

On Thu, Apr 8, 2010 at 9:13 PM, Sophie <itsme...@hotmail.com> wrote:
> On Apr 7, 7:56 am, David Nolen <dnolen.li...@gmail.com> wrote:
>> The runtime cost of destructuring is not worth getting worked up
>> about. It's easy to check this yourself with (time ...)
>
> Results below:
>
> user=> (defn fk [& {:keys [a b c]}] (+ a b c))
>
> user=> (defn fp [a b c] (+ a b c))
>
> user=> (time (dotimes [_ 1000000] (fk :a 2 :b 2 :c 2)))
> "Elapsed time: 1582.178 msecs"
>
> user=> (time (dotimes [_ 1000000] (fp 2 2 2)))
> "Elapsed time: 319.243 msecs"
>
> Not sure how significant that would be in user code, but I'd rather
> not have to choose less a less readable version because of the hit.
> Positional keywords would give the readable function calls without the
> run-time hit (and we could still use optional &keys if they were
> somehow distinguished in the function calls).
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> 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

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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

To unsubscribe, reply using "remove me" as the subject.

Reply via email to