On Tue, May 24, 2011 at 5:36 PM, daly <d...@axiom-developer.org> 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 that are added to a particular instance). IMO, records should support anything maps support -- in particular, they should support near-arbitrary numbers of entries. If that means that bigger ones (in terms of numbers of predefined keys) switch to a less performant hash trie for their predefined keys, so be it. It's not unlike promoting integers to BigIntegers in arithmetic that way. (Similarly, fns should be overloadable for specific arities over 20, with any call with over 20 parameters going through .applyTo instead of a .invoke, and then being checked for arity. For instance, if the fn can take 1, 15, 25, or 30 & more arguments, and you pass it 27, applyTo gets called and then blows up since it wants either 25 or over 29 arguments, but not 27, in that case. There'll be a performance penalty in calling it with over 20 arguments without varargs, the same as calling it with varargs or with apply, caused by having to box the args into a seq and unbox them again, but that beats it not working at all.) -- Protege: What is this seething mass of parentheses?! Master: Your father's Lisp REPL. This is the language of a true hacker. Not as clumsy or random as C++; a language for a more civilized age. -- 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