<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><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><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><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></body></html>