Count me as a fan I designed and wrote complex systems in assembly language
many of them above 10k lines.

Contrary to many commonly used languages, most assemblers have powerful macros,
that feature alone allows you to implement sophisticated designs.

As far as your OO related comments, may I point to you that in Java you will
find a common pattern (I hate this pattern concept) called a factory.

In Java you will find factories everywhere to create and wire objects based on
external conditions. There are no complex setters or constructors
defined whatsoever in the manufactured object class itself,
the factory is responsible for wiring the instance using it's own logic.

Adding constructors to meet your need is against what OO does these days.
On what basis other than OO then should Clojure support constructors as
you suggest to allow some complex tweaking when creating a record ?

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

Luc P.



> 
> 
> On Saturday, August 4, 2012 1:15:13 PM UTC-4, Jim foo.bar wrote:
> >
> > for setting up  objects as you say, I'm fine using (doto Object ... ... 
> > ...).  Records, as everything else in Clojure promote immutability and 
> > so setting fields doesn't really make sense unless you're consuming 
> > external java classes in which case 'doto' suffices...at least that is 
> > the way I see it...I originally thought you were  asking about how to 
> > create a record at runtime via a macro or a function, which is actually 
> > quite tricky (and I can certainly help), but what you're asking sort of 
> > exists doesn't it? 
> >
> > Jim 
> >
> >
> >
> Here I am still creating immutable objects. You may say I am "setting" 
> things, but that is for creating a new object. The new object itself is 
> still immutable. It makes sense because when you create an object, the 
> values of the fields may need to meet certain integrity requirements, or 
> some transformation from the caller's arguments.
> 
> Functionally, of course we can do it, as you can create a record with any 
> values for the fields. But in my view it is not the main objective to say 
> "it works" , "it is powerful", "it give user freedom" when designing a 
> language. My classic answer to those arguments is: how about assembly 
> language? It definitely works, definitely powerful, and put no restrictions 
> on the user. I know nobody who is a fan of such language.
> 
> 
> 
> 
>  
> 
> -- 
> 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
--
Softaddicts<lprefonta...@softaddicts.ca> sent by ibisMail from my ipad!

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