Re: question on differences between images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: question on differences between images

jdelgado
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

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: question on differences between images

Edgar J. De Cleene



El 1/30/07 9:31 AM, "Jordi Delgado" <[hidden email]> escribió:

> 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

You could try SqueakLight from http://www.squeak.org/Download/

I have a most stripped one, 3.7 derived also

If you do, I wish know any problems.

Edgar



       

       
               
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya!
http://www.yahoo.com.ar/respuestas

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: question on differences between images

Göran Krampe
In reply to this post by jdelgado
Hi!

> 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

Odd code though. Arrays created using the literal syntax "#( blab bla )"
should not be modified - it is very bad style. The Array is created at
*compile time*, not on method activation time. This is why it only has nil
in it the first time you call #m1.

> 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).

First of all - Squeak is not a "dead" implementation of Smalltalk-80 or
ANSI X3J20. It evolves. The recent largest change is of course the
addition of Traits in version 3.9.

In this case you are seeing a difference in how literal Arrays are parsed.
I don't have a 3.0 image handy but I bet that if you do an "inspect it"
on:

  #( nil )

...you will seen an instance of Array with a Symbol in it, *NOT* nil. The
Symbol #nil is not the same thing as the object referenced by nil (the
sole instance of class UndefinedObject). :)

I have a recollection that the parsing of literal Arrays was changed
relatively recently, perhaps it was in 3.9 even (or 3.8), so that the
special case of "nil" was parsed into a reference to the object nil, and
not parsed into a Symbol. I also vaguely recall that this created lots of
interesting problems in old code - but I think it was reasonably worked
out.

> 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?).

Check with Aaron Reichow - the Squeak-on-PDAs-expert. :)

regards, Göran

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: question on differences between images

Klaus D. Witzel
In reply to this post by jdelgado
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


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners