librelist archives

« back to archive

Wider usage of default_create?

Wider usage of default_create?

From:
Paolo Redaelli
Date:
2011-11-04 @ 10:39
Is there a particular reason that require to write

foo is
   local x,y: LINKED_LIST[STRING]
   do
     create x.make ....

instead of
foo is
   local x,y: LINKED_LIST[STRING]
   do
     create x; create y?

I would naively say that it makes source code a little more prolix 
without adding relevant informations to the readers.
If you agree I would like to add default_create to creation procedures 
of our collections making it a synonim of "create an empty collection".

Re: [libertyeiffel] Wider usage of default_create?

From:
Cyril Adrian
Date:
2011-11-05 @ 12:58
2011/11/4 Paolo Redaelli <paolo.redaelli@gmail.com>

> Is there a particular reason that require to write
>
> foo is
>   local x,y: LINKED_LIST[STRING]
>   do
>     create x.make ....
>
> instead of
> foo is
>   local x,y: LINKED_LIST[STRING]
>   do
>     create x; create y?
>

Not really, except historical (pre default_create). My main objection
against using default_create was its wide export clause, but even that is
voided by the insert (instead of inherit) ANY + explicit export clause.

I would naively say that it makes source code a little more prolix
> without adding relevant informations to the readers.
>

Yes, not anymore, except it makes the creation pattern more regular (create
entity.something) -- but I guess that's a matter of taste.

If you agree I would like to add default_create to creation procedures
> of our collections making it a synonim of "create an empty collection".
>

I don't mind, although I'm not sure I will personally use it :-)

Cheers

 *Cyril ADRIAN*
*http://www.cadrian.net/cyril*
[image: Facebook] <https://www.facebook.com/cyril.adrian> [image:
Twitter]<https://twitter.com/cadbart> [image:
LinkedIn] <http://fr.linkedin.com/in/cadrian> [image: Google
Plus]<https://plus.google.com/100388810006463519079/posts> [image:
Google 
Calendar]<https://www.google.com/calendar/embed?src=1t93vvvrdc26ee0f83p0cunj60%40group.calendar.google.com&ctz=Europe/Paris>
Contact me: [image: Google Talk] cyril.adrian@gmail.com
 [image: Twitter] <http://twitter.com/cadbart> Latest tweet: [Liberty]
http://t.co/q6wvjgvh Cyril Adrian - using debug keys instead of always
commenting in/out the debug compounds
Follow @cadbart <http://twitter.com/cadbart> Reply

<http://twitter.com/?status=@cadbart%20&in_reply_to_status_id=129056316374261760&in_reply_to=cadbart>
Retweet

<http://twitter.com/?status=RT%20%40cadbart%3A%20%5BLiberty%5D%20http%3A%2F%2Ft.co%2Fq6wvjgvh%20Cyril%20Adrian%20-%20using%20debug%20keys%20instead%20of%20always%20commenting%20in%2Fout%20the%20debug%20compounds>
 06:46 Oct-26<http://twitter.com/cadbart/statuses/129056316374261760>
  Get this email app!

<http://www.wisestamp.com/apps/twitter?utm_source=extension&utm_medium=email&utm_term=twitter&utm_campaign=apps>

 [image: Google Plus] <http://plus.google.com/100388810006463519079> My
latest G+: Nicolas Remy originally shared this post: The True Size Of
Africa <http://plus.google.com/100388810006463519079/posts/9FB9PWDFBSy/>
My G+ <http://plus.google.com/100388810006463519079> -
Posts<http://plus.google.com/100388810006463519079/posts/>- Add
to Circles <http://plus.google.com/100388810006463519079/about/> - 20:51
Oct-26 <http://plus.google.com/100388810006463519079/about/>
  Get this email app!

<http://www.wisestamp.com/apps/plus?utm_source=extension&utm_medium=email&utm_term=plus&utm_campaign=apps>

[image: My QR VCard]
  Get a signature like this.

<http://r1.wisestamp.com/r/landing?promo=17&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_17>
CLICK

HERE.<http://r1.wisestamp.com/r/landing?promo=17&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_17>