<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large">Hi Timothy,</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Oct 24, 2020 at 3:32 AM gettimothy via Squeak-dev <<a href="mailto:squeak-dev@lists.squeakfoundation.org">squeak-dev@lists.squeakfoundation.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u><div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt"><div dir="auto"><div>Hi Folks,<br></div><div><br></div><div>Pardon the noobish "eyes of wonder" on the following. </div><div><br></div><div>Recently, Eliot asked...<br></div></div><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div><div>   what is the value of<br></div><div>      { (Float infinity basicAt: 1) hex.<br></div><div>        (Float infinity basicAt: 2) hex.<br></div><div>        (BoxedFloat64 infinity basicAt: 1) hex.<br></div><div>        (BoxedFloat64 infinity basicAt: 2) hex.<br></div><div>         BoxedFloat64 infinity == Float infinity }<br></div><div><br></div></div></blockquote><div>The result is:<br></div><div><br></div><div><br></div><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>#('16r7FF00000' '16r0' '16r7FF00000' '16r0' true)<br></div></blockquote><div>This shows that the stuff in an Array is evaluated BEFORE the array is "produced".<br></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:large">These are called Array Tuples, and Dan Ingalls added them to Squeak many years ago.  They are lovely concise forms, way more convenient than Array with: with: with: ... and not limited in size.  Since Dan adding them several dialects have followed suit.  Alas we've yet to see a new edition of the Blue Book to mention these and other great improvements (e.g. ByteArray literals, Vassili Bykov's ifNil:ifNotNil:, closures) although I do dream of doing a revised blue book with a modern VM specification in the last section.  And I'd love to see a Red Book on the Squeak tools.  Monticello is, for example, very beautiful, and should be more widely praised, used, and documented.</div><div class="gmail_default" style="font-size:large"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt"><div></div><div><br></div><div>This is NOT in the Terse Guide and I do not recall seeing it in the books I read when I first started Squeak.<br></div></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:large">It should be :-)</div><div class="gmail_default" style="font-size:large"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:10pt"><div></div><div><br></div><div>It is a very handy tool.<br></div><div><br></div><div>I guess the behavior makes sense, as an Array is not a Block . Also, putting the same stuff in an OrderedCollection gives the same behavior.<br></div><div><br></div><div><br></div><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div><div>|x|<br></div><div>x := OrderedCollection new.<br></div><div>x add:(Float infinity basicAt: 1) hex.<br></div><div>x add:(Float infinity basicAt: 2) hex.<br></div><div>x add:(BoxedFloat64 infinity basicAt: 1) hex.<br></div><div>x add:(BoxedFloat64 infinity basicAt: 2) hex.<br></div><div>x add: BoxedFloat64 infinity == Float infinity .<br></div><div>x inspect.<br></div><div><br></div></div></blockquote><div><br></div><div>The construct is very reminiscent of on of the early lessons in the SICP series, <br></div><div><br></div><div><br></div><div>Anyhoo, one more cool thing to add to the toolbox.<br></div><div><br></div><div>cheers.</div></div><br></div><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>