[Pharo-project] A Lazy Inspector?
Hello all, I was wondering what actually the inspector does in the following case: When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess) Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this: Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: '' Foo>>initialize bar:= Bar new Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: '' Foo>>initialize bar:= Foo new Thanks in advance. P.S.: How can I stop my execution in the pharo image when it is in a infinite loop? I can't remember what the shortcut was.
I don't know the first question's answer, but, you can stop an execution code using Alt+. (or similar key + .) -- Estudiante de IngenierÃa Civil en Computación Departamento de Ciencias de la Computación Universidad de Chile http://www.dcc.uchile.cl/~fvalverd/public_key.asc
On Mon, Oct 18, 2010 at 4:40 AM, Oscar E A Callau <oalvarez@dcc.uchile.cl>wrote:
Hello all,
I was wondering what actually the inspector does in the following case:
When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess)
Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this:
Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Bar new
Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Foo new
Thanks in advance.
That's a good question. I have no idea how it is hanlder.
P.S.: How can I stop my execution in the pharo image when it is in a infinite loop? I can't remember what the shortcut was.
http://book.pharo-project.org/book/TipsAndTricks/InterruptKey/
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Mon, Oct 18, 2010 at 4:40 AM, Oscar E A Callau <oalvarez@dcc.uchile.cl>wrote:
Hello all,
I was wondering what actually the inspector does in the following case:
When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess)
Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this:
Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Bar new
Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Foo new
here should be foo := Foo new. Anyway, you should be able to browse these classes without problems. The problems is in instance creation. For example, if you evaluate: Foo new. Cheers mariano
Thanks in advance.
P.S.: How can I stop my execution in the pharo image when it is in a infinite loop? I can't remember what the shortcut was.
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
On Oct 18, 2010, at 14:44 , Mariano Martinez Peck wrote:
On Mon, Oct 18, 2010 at 4:40 AM, Oscar E A Callau <oalvarez@dcc.uchile.cl> wrote: Hello all,
I was wondering what actually the inspector does in the following case:
When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess)
Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this:
Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Bar new
Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Foo new
here should be foo := Foo new.
Anyway, you should be able to browse these classes without problems. The problems is in instance creation. For example, if you evaluate: Foo new.
Thanks Mariano. May be my question was not well explained. Of course if I evaluate: Foo new, I get into a infinite loop. 1st question, when I'm inspecting, I'm evaluating? In the case that I mention above (Class enviroment) I got all classes in the system and each of them has an environment, that is all classes, and so on. Here, we have a infinite recursion. So, how the inspector get a lazy visualization of the it? Greetings
2010/10/18 Oscar E A Callau <oalvarez@dcc.uchile.cl>
On Oct 18, 2010, at 14:44 , Mariano Martinez Peck wrote:
On Mon, Oct 18, 2010 at 4:40 AM, Oscar E A Callau <oalvarez@dcc.uchile.cl> wrote:
Hello all,
I was wondering what actually the inspector does in the following case:
When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess)
Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this:
Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Bar new
Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Foo new
here should be foo := Foo new.
Anyway, you should be able to browse these classes without problems. The problems is in instance creation. For example, if you evaluate: Foo new.
Thanks Mariano. May be my question was not well explained. Of course if I evaluate: Foo new, I get into a infinite loop. 1st question, when I'm inspecting, I'm evaluating?
hehehehe yes :) Just open a Transcript and inspect: Transcript show: 'welooo' and you will see 'welooo' in the transcript ;) What you actually inspect, is the result of the expression.
In the case that I mention above (Class enviroment) I got all classes in the system and each of them has an environment, that is all classes, and so on. Here, we have a infinite recursion.
I understand now.
So, how the inspector get a lazy visualization of the it?
I have no idea. But in this case, #environment is a method, not an instVar as your case. Maybe in the case of the methods, they are only displayed when clicking on it (they just execute the compiledMethod). But this is just a guess. You should check the class Inspector and NewInspector. Cheers Mariano
Greetings
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Thanks Mariano. Now I understand :-) Cheers Ãscar E A Callau On 18 Oct 2010, at 16:52, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
2010/10/18 Oscar E A Callau <oalvarez@dcc.uchile.cl>
On Oct 18, 2010, at 14:44 , Mariano Martinez Peck wrote:
On Mon, Oct 18, 2010 at 4:40 AM, Oscar E A Callau <oalvarez@dcc.uchile.cl> wrote: Hello all,
I was wondering what actually the inspector does in the following case:
When you explore (or inspect) the expression: Class environment you get all classes in the system dictionary. If you navigate inside a class, for example AColorSelectorMorph, you can see all its properties and one of them is environment, if you go inside it, you get again all classes in the system dictionary. So, you can repeat this infinitely (or until you get run out of memory, I guess)
Is it the behavior of a lazy inspector? If true, why I cannot inspect a mutually-recursive class definition, like this:
Object subclass: #Foo instanceVariableNames: 'bar' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Bar new
Object subclass: #Bar instanceVariableNames: 'foo' classVariableNames: '' poolDictionaries: '' category: ''
Foo>>initialize bar:= Foo new
here should be foo := Foo new.
Anyway, you should be able to browse these classes without problems. The problems is in instance creation. For example, if you evaluate: Foo new.
Thanks Mariano. May be my question was not well explained. Of course if I evaluate: Foo new, I get into a infinite loop. 1st question, when I'm inspecting, I'm evaluating?
hehehehe yes :) Just open a Transcript and inspect: Transcript show: 'welooo' and you will see 'welooo' in the transcript ;)
What you actually inspect, is the result of the expression.
In the case that I mention above (Class enviroment) I got all classes in the system and each of them has an environment, that is all classes, and so on. Here, we have a infinite recursion.
I understand now.
So, how the inspector get a lazy visualization of the it?
I have no idea. But in this case, #environment is a method, not an instVar as your case. Maybe in the case of the methods, they are only displayed when clicking on it (they just execute the compiledMethod). But this is just a guess. You should check the class Inspector and NewInspector.
Cheers
Mariano
Greetings
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (3)
-
Felipe Ignacio Valverde Campos -
Mariano Martinez Peck -
Oscar E A Callau