Re: Using records as handles vs. complete representations

2014-05-23 Thread Stuart Sierra
I would say do one of: - define your own constructor functions like (defn user [id] ...) - use the map->User constructors created by defrecord - do not specify the non-required keys as fields in the defrecord - use plain maps On Friday, May 23, 2014 4:47:43 PM UTC-4, Elliot wrote: > > There see

Using records as handles vs. complete representations

2014-05-23 Thread Elliot
There seem to be two kinds of definitions of what a record could be: 1. A full representation of a resource,e.g. (defrecord User [id name age gender address]) 2. A *handle* to a resource, e.g. (defrecord User [id]), e.g. [wikipedia] below Some protocols only ever need a handle, not the full res