> What are your concerns re: apply? Are there performance issues? Or is
> it not being able to call qsort on a collection directly?
I just want the code to look pretty, no deeper concerns than that. :-)
--~--~-~--~~~---~--~~
You received this message because you
Hi Stuart,
Am 20.10.2008 um 20:00 schrieb Stuart Halloway:
> Nice--I like this one, except for needing to apply. What I really want
> is arity overloading *within* the first argument, which is what led me
> down the path to multimethods.
Yes, sadly arity matching is only available at the top le
On Oct 20, 10:43 am, Stuart Halloway <[EMAIL PROTECTED]>
wrote:
> Hi Steve,
>
> Thanks! I like quicksort-4. It all fixes a problem that bugged me in
> all the other examples, which is that "bigger" is a lie. The real
> semantic is "not smaller", which quicksort-4 captures perfectly.
>
> I will
Hi Achim,
Nice--I like this one, except for needing to apply. What I really want
is arity overloading *within* the first argument, which is what led me
down the path to multimethods.
Is there a reason to prefer concat over lazy-cat here?
Cheers,
Stuart
> Hi!
>
> Here's a variadic version:
Hi Steve,
Thanks! I like quicksort-4. It all fixes a problem that bugged me in
all the other examples, which is that "bigger" is a lie. The real
semantic is "not smaller", which quicksort-4 captures perfectly.
I will have to get used to thinking of "remove" as the opposite of
"filter." The
Hi!
Here's a variadic version:
(defn qsort
([] [])
([x & xs] (concat (apply qsort (filter #(< % x) xs))
(cons x (apply qsort (filter #(>= % x) xs))
user> (qsort 1234 56 789 0)
(0 56 789 1234)
Kind regards,
achim
Am 2
On Oct 20, 2008, at 11:16 AM, Stuart Halloway wrote:
> Hi all,
>
> I seem to recall Rich saying "I like the destructuring part of pattern
> matching." In my efforts to appreciate that statement, I am playing
> around with porting simple Haskell examples to Clojure, trying to use
> destructuring (
Hi all,
I seem to recall Rich saying "I like the destructuring part of pattern
matching." In my efforts to appreciate that statement, I am playing
around with porting simple Haskell examples to Clojure, trying to use
destructuring (and multimethods) where the Haskell does pattern matches.