<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
It all boils down to shorter code. You can write<br>
<br>
myArray := Array<br>
with: self this<br>
with self that<br>
with: aVariable<br>
with: #foo.<br>
<br>
<br>
But after you want more than 4 dynamic elements, you will need <br>
to do something else, such as create an OrderedCollection and<br>
start adding things to it, and then perhaps convert it to Array. <br>
You might decide to define a binary alias for #add:, like #<- <br>
to save a few keystrokes. <br>
<br>
The downside for adding extra syntax for this purpose is that<br>
it makes the standard thicker, and the language harder to learn.<br>
Harder to learn means easier to make mistakes, and errors.<br>
<br>
For me I don't know which one is better, it's a question of <br>
Obama vs. Hillary.<br>
<br>
-Panu Viljamaa<br>
<br>
<br>
<br>
<br>
<br>
Andres Valloud wrote:
<blockquote
cite="mid:491b84df0803221344r79edb075sc1710186a8910c6d@mail.gmail.com"
type="cite">I think something that is being left unaddressed is
whether using
literal arrays that allow code expressions (e.g.: the brace syntax in
Squeak) is a good practice or not. In my experience, I have not felt
the need for such things, but maybe I have not been exposed to
particular circumstances in which they become useful. Does anybody
have some slam dunk examples that can be shared so that we can evaluate
this better?<br>
<br>
Andres.<br>
<br>
<div class="gmail_quote">On Tue, Mar 18, 2008 at 9:57 AM, Eliot
Miranda <<a moz-do-not-send="true"
href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>>
wrote:<br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Mon, Mar 17, 2008 at 2:11 PM, Craig Latta <<a
moz-do-not-send="true" href="mailto:craig@netjam.org" target="_blank">craig@netjam.org</a>>
wrote:<br>
</div>
<div class="gmail_quote">
<div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
> Defining new language elements is hard. The worst that could
happen<br>
> to this project, is to have extremely long threads with no
conclusion<br>
> as on the Squeak list.<br>
<br>
Indeed, although for what it's worth there's no lingering debate<br>
there on this particular issue[1]. ;)<br>
<br>
<br>
-C<br>
<br>
[1]<br>
<br>
Namely, the short form of...<br>
<br>
Array with: #foo with: #bar<br>
<br>
is...<br>
<br>
#(foo bar)<br>
<br>
as in Smalltalk-80, and the short form of...<br>
<br>
Array with: #foo with: true<br>
<br>
is...<br>
<br>
{#foo. true}</blockquote>
</div>
<div><br>
Well, in Squeak 3.9 I get<br>
<br>
Welcome to the finale version of 3.9 of 7 of November 2006<br>
#(nil true false foo) collect: [:ea| ea class] {UndefinedObject . True
. False . ByteSymbol}<br>
#(nil true false foo) printString '#(nil true false #foo)'<br>
<br>
</div>
<div>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
But I suspect the appropriate standard use of curly brackets<br>
across multiple dialects is a whole other morass. :)</blockquote>
</div>
<div><br>
Having been living with Squeak for a while now I really, really like
the curly brace syntax. I also note that it doesn't conflict with e.g.
VisualWorks use of #{name} for binding references. So I have a strong
personal preference for it, but that's just personal.<br>
<br>
</div>
</div>
<br>
<br>
_______________________________________________<br>
ANSI-Smalltalk mailing list<br>
<a moz-do-not-send="true"
href="mailto:ANSI-Smalltalk@lists.openskills.org" target="_blank">ANSI-Smalltalk@lists.openskills.org</a><br>
<a moz-do-not-send="true"
href="http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk"
target="_blank">http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk</a><br>
<br>
</blockquote>
</div>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
ANSI-Smalltalk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:ANSI-Smalltalk@lists.openskills.org">ANSI-Smalltalk@lists.openskills.org</a>
<a class="moz-txt-link-freetext" href="http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk">http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk</a>
</pre>
</blockquote>
<br>
</body>
</html>