Is there a way to browse the ecosystem of objects in a Smalltalk image? I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
David Holiday ------------------------------------------------- San Diego State University neuburge@rohan.sdsu.edu
Hi David,
In the Browser on any class right click, then 'more' then 'inspect instances'. You get an I inspector on an Array with all instances. Click on any instance, Press Alt + i for an inspector on this particular instance or Alt + I (capitol I) for an Explorer. Explorer gets slow on big collections.
Works on any object. I suggest you browse Squeak by Example to learn more about the tools in Squeak. (references, chase pointers for exploring the ecosystem of objects)
Cheers
Herbert
Am 31.12.2013 08:53, schrieb David Holiday:
Is there a way to browse the ecosystem of objects in a Smalltalk image? I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
David Holiday
San Diego State University neuburge@rohan.sdsu.edu mailto:neuburge@rohan.sdsu.edu
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Oh and if you have an image to waste:
In a workspace "Object allSubInstances explore" (!!!DON'T DO IT!!!) This is just so you learn how to get an Explorer or inspector on the result of an expression.
You can do: (1.0 + 1) inspect, but how boring is that :-))
Cheers
Herbert
Am 31.12.2013 10:08, schrieb Herbert König:
Hi David,
In the Browser on any class right click, then 'more' then 'inspect instances'. You get an I inspector on an Array with all instances. Click on any instance, Press Alt + i for an inspector on this particular instance or Alt + I (capitol I) for an Explorer. Explorer gets slow on big collections.
Works on any object. I suggest you browse Squeak by Example to learn more about the tools in Squeak. (references, chase pointers for exploring the ecosystem of objects)
Cheers
Herbert
Am 31.12.2013 08:53, schrieb David Holiday:
Is there a way to browse the ecosystem of objects in a Smalltalk image? I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
David Holiday
San Diego State University neuburge@rohan.sdsu.edu mailto:neuburge@rohan.sdsu.edu
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Make a Welcome Workspace with this info :-)
Cheers, Karl
On Tue, Dec 31, 2013 at 11:27 AM, Bert Freudenberg bert@freudenbergs.dewrote:
On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way
to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Hey, I wrote it, you make the workspace, deal? ;)
Happy New Year, btw.
- Bert -
On 31.12.2013, at 12:37, karl ramberg karlramberg@gmail.com wrote:
Make a Welcome Workspace with this info :-)
Cheers, Karl
On Tue, Dec 31, 2013 at 11:27 AM, Bert Freudenberg bert@freudenbergs.de wrote: On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
I do it :-)
Happy new year!
Cheers, Karl
On Tue, Dec 31, 2013 at 12:40 PM, Bert Freudenberg bert@freudenbergs.dewrote:
Hey, I wrote it, you make the workspace, deal? ;)
Happy New Year, btw.
- Bert -
On 31.12.2013, at 12:37, karl ramberg karlramberg@gmail.com wrote:
Make a Welcome Workspace with this info :-)
Cheers, Karl
On Tue, Dec 31, 2013 at 11:27 AM, Bert Freudenberg bert@freudenbergs.dewrote:
On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way
to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Posted to the inbox. I don't have login for trunk
Karl
On Tue, Dec 31, 2013 at 12:40 PM, Bert Freudenberg bert@freudenbergs.dewrote:
Hey, I wrote it, you make the workspace, deal? ;)
Happy New Year, btw.
- Bert -
On 31.12.2013, at 12:37, karl ramberg karlramberg@gmail.com wrote:
Make a Welcome Workspace with this info :-)
Cheers, Karl
On Tue, Dec 31, 2013 at 11:27 AM, Bert Freudenberg bert@freudenbergs.dewrote:
On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way
to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
On 04.01.2014, at 20:03, karl ramberg karlramberg@gmail.com wrote:
Posted to the inbox. I don't have login for trunk
Karl
Thanks! Moved to trunk.
- Bert -
Great post, I learned some new things.
On Tue, Dec 31, 2013 at 4:27 AM, Bert Freudenberg bert@freudenbergs.de wrote:
On 31.12.2013, at 08:53, David Holiday neuburge@rohan.sdsu.edu wrote:
Is there a way to browse the ecosystem of objects in a Smalltalk image?
Yes, multiple ones in fact. This is a major reason working in Smalltalk feels more immediate than in other environments.
I'm not talking about the class browser, what I'm looking for is a way to see what objects have actually been instantiated and what their state is.
The basic tool for this is called an Inspector. Whenever you have an expression, like "3 + 4", you press cmd-i to "inspect it", which opens an inspector on the result. This works in any text area. Try for example inspecting "self" in a class browser, and you will inspect the underlying class object (which the browser shows a high-level view of).
In the Inspector you see the objects referenced by this object (via instance variables or indexed fields) in the left panel. Select any of them and choose "inspect" from the context menu (or press cmd-i again). This way you can inspect all the objects in the system.
A more modern tool than the Inspector (which was around 40 years ago already) is the Object Explorer. It presents you a tree view of an object and its "children", which again are the instance variables and indexed fields of the object. Open it with cmd-shift-i (or "explore" in the context menu).
You can also do the reverse. If you choose "objects pointing to this value" you get an inspector showing all the objects that directly point to this object. Similarly there is a "reverse explorer", which you can open by selecting "explore pointers".
There are two roots to all the objects in the system:
Smalltalk specialObjectsArray
which basically holds everything the Virtual Machine needs to know about, and in turn almost every object in the whole image, and
thisContext
which is the current execution context, holding onto temporary objects. When a garbage collection is performed, any object not reachable form either of these two roots is removed from memory.
An "interesting" global object to explore is
Project current
which holds your current workspace, in particular
Project current world
, the root of all morphs in the world. And of course
Smalltalk
itself is the dictionary that holds all global objects, including all classes (unless they are defined in a non-global environment).
There is also a low-level way to enumerate all objects in memory. "self someObject" will return the very first object in memory (which happens to be the nil object), and "anObject nextObject" will return the next one:
| object count | count := 0. object := self someObject. [0 == object] whileFalse: [count := count + 1. object := object nextObject]. count
Interestingly, this also finds objects that are due to be garbage-collected. For example, if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like
ByteString allInstances last: 10
This makes use of the someInstance/nextInstance methods, which are similar to someObject/nextObject, but restricted to instances of one class only.
Hope you have fun poking around in the world of objects :)
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Bert Freudenberg wrote
if you accidentally closed a text window, there is a good chance its contents will still be in memory, and can be retrieved using an expression like ByteString allInstances last: 10
Oh boy, that's great… really could've used that a few times ;)
----- Cheers, Sean -- View this message in context: http://forum.world.st/object-instance-browser-tp4733210p4734118.html Sent from the Squeak - Beginners mailing list archive at Nabble.com.
beginners@lists.squeakfoundation.org