Re: defrecord and overriding empty

2012-12-15 Thread Joseph Smith
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 nd...@sfu.cajavascript: wrote: Should IPersistentCollection

Re: defrecord and overriding empty

2012-12-15 Thread David Nolen
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 Tuesday,

defrecord and overriding empty

2011-09-27 Thread Nathan Sorenson
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

Re: defrecord and overriding empty

2011-09-27 Thread David Nolen
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 n...@sfu.ca wrote: I'm using clojure.walk/postwalk to rewrite terms in nested data

Re: defrecord and overriding empty

2011-09-27 Thread Nathan Sorenson
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