I want to high-five your brain.

Have a great weekend!

On Thu, Oct 14, 2010 at 10:56 PM, Sean Corfield <[email protected]>wrote:

>
> On Thu, Oct 14, 2010 at 7:39 PM, Gerald Guido <[email protected]>
> wrote:
> > Very nice. I thought my function was terse. bravo!
>
> Oh, if you want terse, try the Clojure version - assuming you only
> want to know _if_ there are duplicates:
>
> (defn dupes? [struct] (not (= (count struct) (count (set (vals struct))))))
>
> There's probably a more efficient solution but 5,000 iterations over a
> 25 element struct (form scope with 25 fields) takes about 67ms:
>
> (time (dotimes [n 5000] (dupes? m25)))
> "Elapsed time: 66.691 msecs"
>
> m25 is a struct with 25 keys with unique values.
> --
> Sean A Corfield -- (904) 302-SEAN
> Railo Technologies, Inc. -- http://getrailo.com/
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338228
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to