In core.logic we have a protocol called IUninitialized that you can
implement. That works well enough for our needs.
On Saturday, December 15, 2012, Joseph Smith wrote:
> Well here I am over a year later with the same problem. I'm curious, what
> was your solution for the time being?
>
> On Tuesd
Well here I am over a year later with the same problem. I'm curious, what
was your solution for the time being?
On Tuesday, September 27, 2011 1:06:37 PM UTC-5, David Nolen wrote:
>
> On Tue, Sep 27, 2011 at 1:54 PM, Nathan Sorenson
> > wrote:
>
>> Should IPersistentCollection even be defining '
On Tue, Sep 27, 2011 at 1:54 PM, Nathan Sorenson wrote:
> Should IPersistentCollection even be defining 'empty', if one of the
> language's key data types doesn't support it? I think it would be better to
> either pull 'empty' into it's own protocol so clojure.walk doesn't match on
> IPersistentC
You're right that my use isn't strictly returning a collection with a size
of zero-- I'm treating empty more like 'default'. I'm thinking of its use in
clojure.walk, which simply creates a "blank" version of an arbitrary
collection in which to place the altered sub-forms. I can't find any other
The problem is what does empty mean in the context of defrecord? A new
instance of a defrecord is not "empty", it has those fields and they are set
to nil.
David
On Tue, Sep 27, 2011 at 3:48 AM, Nathan Sorenson wrote:
> I'm using clojure.walk/postwalk to rewrite terms in nested data
> structure
I'm using clojure.walk/postwalk to rewrite terms in nested data
structures. However, I am unable to do this with types as defined by
defrecord, because they specify that the function "empty" throw a not-
implemented exception.
If I were able to over-ride this default implementation of 'empty' I
b