On Sat, Aug 4, 2012 at 5:30 PM, Softaddicts <lprefonta...@softaddicts.ca> wrote:
> Just use a high order fn as a factory to create your records and place it
> along you record definition in the same name space with proper documentation.
>
> High order fns can be passed around and this can be quite valuable to be able
> to specify a factory fn as a parameter.
>
> In my opinion, your suggestion is a "feature" in search of a problem to solve 
> :)

I agree. Since you have to write a function anyway if you want a
record that does more than just construct a map, why not adopt the
idiom of a make-myrecord factory function?

If I was using plain maps instead of records and wanted some sort of
"constructor" function, I'd just write a make-whatever factory
function anyway so I don't see why this is not appropriate with
records too.

(and to be honest, Warren, I think you're beating yourself up somewhat
by trying to shoehorn OO practices into Clojure in the first place but
maybe that's something everyone goes thru if they are heavily steeped
in OO thinking, when they first try to adopt an FP language?)

p.s. to be honest, I still don't see enough benefits in records that
outweigh their limitations to use them in the first place - unless I
needed a type that would interop with Java or I was using protocols...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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

Reply via email to