[Newbies] Re: question on differences between images
Klaus D. Witzel
klaus.witzel at cobss.com
Tue Jan 30 14:31:06 UTC 2007
Hi Jordi,
you could try " Transcript show: 'Put 1'; cr; endEntry " without anything
around it. This should guarantee that something is send to Transcript
*and* displayed (#endEntry forces to display things which are as yet not
displayed).
It is perhaps so that older Squeak does not do #endEntry when you just use
#show: (as it was the case with Squeak's anchestors).
If #endEntry doesn't help then replace it by #halt to get an idea if your
code is really executed.
HTH.
/Klaus
On Tue, 30 Jan 2007 13:31:50 +0100, Jordi wrote:
> Hi,
>
> Thanks for your answer. I guess I understand now
> why it is image 3.9 who provides the right answer.
>
>> Now... back to that code of yours, it is a serious mess. :)
>> (...)
>>
>> So... I wonder what the 2.5 image does to end up with a BlockContext,
>> don't have one handy. Perhaps it does some funny stuff if the argument
>> to Compiler is an Array?
>
> Yes, the code was a mess. The same result is obtained by printing the
> result of:
>
> (Compiler evaluate: #([ Transcript show: 'Some Text' ])) class
>
> image 2.5 --> BlockContext
> image 3.9 --> Array
>
> I've been playing a little bit more with Squeak, and I found another
> strange (to me; please, consider that I am still a newbie) thing.
> In some lectures by Stephane Ducasse there is an example illustrating the
> difference between literal arrays and arrays created with new:. In
> particular,
> adding the following method to class SmallInteger:
>
> m1
>
> | anArray |
> anArray := #( nil ).
> (anArray at: 1) isNil
> ifTrue: [ Transcript show: 'Put 1'; cr. anArray at: 1 put: 1. ]
>
> and executing
>
> 1 m1
>
> should display the message 'Put 1' only once. And this is how it works...
> in image 3.9
>
> But if we repeat the experiment in image 3.0, it displays nothing in the
> Transcript (not even the first execution). Again, I am puzzled by this
> behavior (I am always assuming that these experiments that behave
> differently
> in different Squeak images are standard Smalltalk).
>
> One more thing. Perhaps there is people wondering why someone should
> worry
> about the behavior of an old image. The answer is that I am using a
> stripped
> version of image 3.0 to play with Squeak on a Jornada 720. More recent
> complete
> images are too heavy for the J720 (at least that is my experience; any
> clue
> on how to improve that?).
>
> Well, thanks in advance for your answers
>
> Bests
>
> Jordi
More information about the Beginners
mailing list