Try alt (or control)-period



________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Viktor Kerkez
Sent: Tuesday, January 19, 2010 7:53 PM
To: [email protected]
Subject: Re: [Pharo-project] Question on recursive structures

I tried that first, but it doesn't work :( I'm using Pharo on Linux (Ubuntu).

On Wed, Jan 20, 2010 at 1:47 AM, Tudor Girba 
<[email protected]<mailto:[email protected]>> wrote:
Hi,

You can force an interrupt by CMD+i or CTRL+i (depending on the platform).

Cheers,
Doru



On 20 Jan 2010, at 01:44, Viktor Kerkez wrote:

Hi,

Since this is my first post on the list, first I want to thank you all for the 
great job you're doing on Pharo :) It was a real revelation when I discovered 
it :)

Now to the question:

I'm reading the Pharo by Example, and came to this part:

The problem with deepCopy is that it will not terminate when applied to a 
mutually recursive structure:
a1 := { 'harry' }.
a2 := { a1 }.
a1 at: 1 put: a2.
a1 deepCopy −! ... does not terminate!

(Pharo actually get stuck at the step: a1 at: 1 put: a2. but that's not the 
question :) )

1. Isn't this behaviour (the complete environment get stuck and there is no way 
to unfreeze it) considered a bug? I mean the environment shouldn't let you 
shoot yourself in the foot (at least not so easily). Actually the same 
behaviour can be created just doing: [true] whileTrue: []...

2. Shouldn't Pharo recognize recursive structures in some way?


I'm asking because I'm coming from a Python world, which is very similar to 
smalltalk in some manners and I'm trying to make a big picture comparison in my 
head.

1. I know that this doesn't really compares to Pharo which is a graphical 
environment, but in python you can always hit Ctrl-C and break the statements 
that block...

>>> while True:
...     pass
...
^CTraceback (most recent call last):
 File "<stdin>", line 1, in <module>
KeyboardInterrupt
>>>

Shouldn't the UI thread always be responsive?

2. And Python recognizes recursive structures:

>>> a = []
>>> a
[]
>>> a.append(5
...
KeyboardInterrupt
>>> a = []
>>> a
[]
>>> a.append(5)
>>> a
[5]
>>> a.append(a)
>>> a
[5, [...]]
>>> a[0]
5
>>> a[1]
[5, [...]]
>>> a[1][1][1][1][0]
5
>>>


Don't get me wrong, I'm not trying to start a language war :) I wouldn't got to 
page 171 if I'm not really interested in Smalltalk :-D I'm just trying to get a 
clearer vision if these are some things that are there for some reason (design 
decision), or they are just not yet implemented, or they cannot be implemented 
for some other reasons?

Thank you in advance for your time :),
Viktor

_______________________________________________
Pharo-project mailing list
[email protected]<mailto:[email protected]>
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

--
www.tudorgirba.com<http://www.tudorgirba.com>

"Every now and then stop and ask yourself if the war you're fighting is the 
right one."




_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to