Re: Clojure 1.3 Alpha 7

2011-05-24 Thread Ken Wesson
On Tue, May 24, 2011 at 8:28 PM, David Nolen wrote: > On Tue, May 24, 2011 at 7:54 PM, Ken Wesson wrote: >> >> IMO, records should support anything maps support -- in particular, >> they should support near-arbitrary numbers of entries. > > If performance is not a concern I don't see the point of

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread David Nolen
On Tue, May 24, 2011 at 7:54 PM, Ken Wesson wrote: > IMO, records should support anything maps support -- in particular, > they should support near-arbitrary numbers of entries. If performance is not a concern I don't see the point of not justing plain maps + multimethods. None of these problem

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread Ken Wesson
On Tue, May 24, 2011 at 5:36 PM, daly wrote: > I'm surprised that defrecord isn't a hashed trie data structure of > some sort, allowing the usual 2^32 entries. For speed, it's a Java class with instance variables for the predefined keys (and a hash trie for any non-standard-for-that-record keys t

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread daly
On Tue, 2011-05-24 at 13:12 -0700, Jules wrote: > > > I think this issue reinforces my belief that arbitrary limits are bad. > > Re. defrecord - Should we put the onus on everyone using defrecord to > manipulate wide datasets to remember that there is an arbitrary limit > of 19 fields, or put so

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread Ken Wesson
On Tue, May 24, 2011 at 4:12 PM, Jules wrote: > > > I think this issue reinforces my belief that arbitrary limits are bad. > > Re. defrecord - Should we put the onus on everyone using defrecord to > manipulate wide datasets to remember that there is an arbitrary limit of 19 > fields, or put some

Re: Clojure 1.3 Alpha 7

2011-05-24 Thread Jules
I think this issue reinforces my belief that arbitrary limits are bad. Re. defrecord - Should we put the onus on everyone using defrecord to manipulate wide datasets to remember that there is an arbitrary limit of 19 fields, or put some smarts into the defrecord macro ? I think we are in ag

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Ken Wesson
On Fri, May 20, 2011 at 2:24 PM, László Török wrote: > On May 20, 2011 7:55 PM, "Fogus" wrote: >> In the alpha7 release the defrecord macro was changed to generate a >> couple of auxiliary functions (for a record R) named map->R and ->R. >> The first takes a map and returns a function of its cont

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Fogus
I have a potential fix that handles the extra ->R parameters. However, there are some existing caveats: 1. The 20+ args path is much slower than the <20 args path. This is a limitation that may not go away unless the <20 function args limitation does. The speed difference comes from the ability

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Armando Blancas
That's right. Database tables are much flatter than the typical object composition, which you can do after you bring in a tuple into a record. Here's probably where this limitation in Clojure hurts the most, even when tables are fully normalized. On May 20, 11:37 am, pmbauer wrote: > Use Case: Au

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread pmbauer
Use Case: Auto-generated record -> relational mapping? Tables with more than 19 columns is not unheard of. -- 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 a

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread David Nolen
On Fri, May 20, 2011 at 1:55 PM, Fogus wrote: > In the alpha7 release the defrecord macro was changed to generate a > couple of auxiliary functions (for a record R) named map->R and ->R. > The first takes a map and returns a function of its contents. The > second takes the same number of argumen

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread László Török
Hi, What's the incremental runtime cost of increasing the max number of fields to 40? :-) Las sent from my mobile device On May 20, 2011 7:55 PM, "Fogus" wrote: In the alpha7 release the defrecord macro was changed to generate a couple of auxiliary functions (for a record R) named map->R and -

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Fogus
In the alpha7 release the defrecord macro was changed to generate a couple of auxiliary functions (for a record R) named map->R and ->R. The first takes a map and returns a function of its contents. The second takes the same number of arguments as the record constructor. It's the definition of thi

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Christopher Redinger
On Monday, May 16, 2011 4:42:15 AM UTC-4, Tassilo Horn wrote: > > Is there already a bug report for the hash collisions on protocol > dispatch? > http://dev.clojure.org/jira/browse/CLJ-801 -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Ken Wesson
On Fri, May 20, 2011 at 6:43 AM, Jules wrote: > Looks like a ?bug? has crept into defrecord somewhere - I know that there is > a limit to the number of params that a fn can take, but is it intentional > that the same limit applies to the number of slots that a record can have ? > > [jules@megalodo

Re: Clojure 1.3 Alpha 7

2011-05-20 Thread Jules
Looks like a ?bug? has crept into defrecord somewhere - I know that there is a limit to the number of params that a fn can take, but is it intentional that the same limit applies to the number of slots that a record can have ? : [jules@megalodon dada]$ java -jar ~/.m2/repository/org/clojure/cl

Re: Clojure 1.3 Alpha 7

2011-05-16 Thread Tassilo Horn
ataggart writes: Hi, > The min-hash function throwing that exception is no longer used by > case, though it is still used by the protocols internals, so that's > what's running into the collision. Ah, ok. I've thought protocols dispatch using `case', so I expected my problem being fixed. Is t

Re: Clojure 1.3 Alpha 7

2011-05-16 Thread ataggart
The min-hash function throwing that exception is no longer used by case, though it is still used by the protocols internals, so that's what's running into the collision. On May 15, 10:14 am, Tassilo Horn wrote: > Christopher Redinger writes: > > = 0 Changes from 1.3 Alpha 6 to 1.3 Alpha 7 (05/1

Re: Clojure 1.3 Alpha 7

2011-05-16 Thread Tassilo Horn
Christopher Redinger writes: Hi Christopher, > Can you supply a small example where this is happening? No, I don't have a small, standalone example. :-( The problem appeared when I converted my project from multimethods to protocols. You can clone my mercurial project and run the tests, which

Re: Clojure 1.3 Alpha 7

2011-05-15 Thread Christopher Redinger
On Sunday, May 15, 2011 8:34:06 PM UTC-4, Alan wrote: > > I'm not on alpha7 yet, but what about (case 49 "1" 'string 49 'int)? > "1" hashes to 49, so there's a hash collision. > user=> (case 49 "1" 'string 49 'int) int -- You received this message because you are subscribed to the Google Gr

Re: Clojure 1.3 Alpha 7

2011-05-15 Thread Alan
I'm not on alpha7 yet, but what about (case 49 "1" 'string 49 'int)? "1" hashes to 49, so there's a hash collision. On May 15, 5:26 pm, Christopher Redinger wrote: > On Sunday, May 15, 2011 1:14:20 PM UTC-4, Tassilo Horn wrote: > > >   java.lang.IllegalArgumentException: No distinct mapping found

Re: Clojure 1.3 Alpha 7

2011-05-15 Thread Christopher Redinger
On Sunday, May 15, 2011 1:14:20 PM UTC-4, Tassilo Horn wrote: > > java.lang.IllegalArgumentException: No distinct mapping found > at clojure.core$min_hash.invoke (core.clj:5805) > Can you supply a small example where this is happening? For reference, this code that failed in alpha6: user=>

Re: Clojure 1.3 Alpha 7

2011-05-15 Thread Tassilo Horn
Christopher Redinger writes: > = 0 Changes from 1.3 Alpha 6 to 1.3 Alpha 7 (05/13/2011) > > [...] > * case now handles hash collisions (CLJ-426) I've just updated my git master checkout, built it, and tried to use it in my project. But still I get a hash collision error: java.lang.Illega

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Sean Corfield
On Fri, May 13, 2011 at 2:07 PM, Christopher Redinger wrote: > You are correct, it was added in Alpha 7. Thanx Christopher. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Technologies, Inc. -- http://www.getr

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Christopher Redinger
On Friday, May 13, 2011 3:03:11 PM UTC-4, Sean Corfield wrote: > > To save me digging into git commits, do you (or anyone else) happen to > > know for sure when "realized?" was added? It's not in the release > notes below... I *think* it's new in Alpha 7...? > You are correct, it was added in Alph

Re: Clojure 1.3 Alpha 7

2011-05-13 Thread Sean Corfield
Thank you! To save me digging into git commits, do you (or anyone else) happen to know for sure when "realized?" was added? It's not in the release notes below... I *think* it's new in Alpha 7...? Sean On Fri, May 13, 2011 at 1:42 PM, Christopher Redinger wrote: > Clojure 1.3 Alpha 7 is now ava