Hey Luc,
That's a cool casting strategy to cleanly build a standard way to get at
the person piece of any type of applicable record. In the pure composition
case, it's actually a nice solution to build functions know how to unpack
the Person aspect of a subtype.
However, I think which strateg
I think it's misleading to use inheritance to reduce code duplication.
Inheritance is about indicating function typing and creating typed
contracts, both of which are fairly un-idiomatic in Clojure.
However, there is another way to prevent code duplication: use composition
instead. Instead of
I see two fairly straightforward paths to simulating multiple returns
without breaking existing callers. Both take advantage of thread-local
state and establish one convention for the caller: before calling the
function again, every caller interested the extra return values must
ask for these extra
Instead of using a ref, you might consider using a closure, which
seems a little more functional.
So every child would simply store a function that when called would
return the map of the parent, map you capture using a closure. This
would also reduce your printing problems because functions just
(defn insert [v at el]
(flatten (assoc v at [el (v at)]))
You get a lazy seq back, so further operations are probably not as
performant as they should be. But that would be as performant as a
regular assoc for just that one operation. What you do from then
on.
Mark
On Aug 26, 10:33 am, C
I have my own custom version where I bind the generated keys in the
metadata of the returned seq. I think that's only valuable for
clojure 1.2 though.
The problem with returning an int is that many keys might be
generated, though by the far the most common usage is simply an
autoincrement column
You might also want to check out Redis, which is supposed to act like
disk persistent data structures in memory. The author just added a
virtual memory module, so now Redis can handle datasets larger than
the memory you assign it.
Mark
On Jun 22, 10:57 am, Timothy Baldridge wrote:
> Greetings,
Was the name Leiningen inspired by the Esquire short story "Leiningen
vs. Ants"? That would be a brilliantly obscure way to challenge the
predominance of ant. Or did you have another reference in mind.
Mark
On Nov 18, 2:29 am, Phil Hagelberg wrote:
> I'm pleased to announce the initial release
I like the name Clojure Archive.
On another note, I always wondered why xml was such a requirement for
Java dependency management. Couldn't we design some sort of url
schema, that you could just pass to a package importer in the
program. First time you run, it could fetch the packages or
automa
Hey all,
I couldn't find a good set of bindings that wrapped most of the BDB's
features so I wrote my own. This library covers most of its basic
feature, wrapping cursors, transactions, and key value functionality
in more idiomatic clojure.
You can check it out on http://bitbucket.org/mebaran/b
10 matches
Mail list logo