nil inspect

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

nil inspect

Nicolas Cellier
Anyone tried 'nil inspect' recently?
Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Sven Van Caekenberghe-2


> On 18 Nov 2017, at 21:56, Nicolas Cellier <[hidden email]> wrote:
>
> Anyone tried 'nil inspect' recently?

Yes, it opens a blank window with as title 'Inspector on an UndefinedObject (nil)' ... like it always does.

Pharo 7.0
Build information: Pharo-7.0+alpha.build.296.sha.fd94b640f8202d7e0c87b9d747b72496a228157b (32 Bit)
Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Aliaksei Syrel
In reply to this post by Nicolas Cellier
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?

Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Nicolas Cellier
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?


Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Stephane Ducasse-3
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?



Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

kilon.alios
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?



Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Denis Kudriashov
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?




Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

kilon.alios
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?




Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

kilon.alios
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?




Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Nicolas Cellier
The right way to verify this is with a snippet:

    nil isKindOf: Object.

Check the answer...

2017-11-23 11:14 GMT+01:00 Dimitris Chloupis <[hidden email]>:
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?





Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Guillermo Polito
In reply to this post by kilon.alios
Hi Dimitris,

nil **is** an object. A normal object.

From your wikipedia quote: The truefalse, and nil pseudo-variables are singleton instances.

You can try many things to try to convince yourself:

  - nil class => UndefinedObject
  - nil sizeInMemory => 8 (2 object headers, no instance variables)

You can also take a look at the bootstrap and see how it is created.

And it may make sense to have the same inspection tabs as any other normal object that has no instance variables.

On Thu, Nov 23, 2017 at 11:14 AM, Dimitris Chloupis <[hidden email]> wrote:
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?







--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: +33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

kilon.alios
yeah i see it now, I asked earlier on because I did not have access to a computer (was replying from my tablet). I see now that is an object, though its weird that nil is an instance of UndefinedObject but yet, that class has nil as instance variable

not one of the good designs of Smalltalk, if this is not Pharo specific.

I do not see the point of being an instance of a class and also an instance variable of that class. Is there a point ?

On Thu, Nov 23, 2017 at 12:23 PM Guillermo Polito <[hidden email]> wrote:
Hi Dimitris,

nil **is** an object. A normal object.

From your wikipedia quote: The truefalse, and nil pseudo-variables are singleton instances.

You can try many things to try to convince yourself:

  - nil class => UndefinedObject
  - nil sizeInMemory => 8 (2 object headers, no instance variables)

You can also take a look at the bootstrap and see how it is created.

And it may make sense to have the same inspection tabs as any other normal object that has no instance variables.

On Thu, Nov 23, 2017 at 11:14 AM, Dimitris Chloupis <[hidden email]> wrote:
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?







--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13

Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Sven Van Caekenberghe-2


> On 23 Nov 2017, at 17:01, Dimitris Chloupis <[hidden email]> wrote:
>
> yeah i see it now, I asked earlier on because I did not have access to a computer (was replying from my tablet). I see now that is an object, though its weird that nil is an instance of UndefinedObject but yet, that class has nil as instance variable

What do you mean ?

UndefinedObject has no instance variables, it is empty. It defines behaviour that is specific to its instances like any class. It just happens that there is only one unique system defined instance of it, with a reserved literal name. Just like true and false (classes True and False, subclasses of Boolean).

> not one of the good designs of Smalltalk, if this is not Pharo specific.

I would not make such comments unless you know what you are talking about ;-)

These are actually quite elegant design decisions.

> I do not see the point of being an instance of a class and also an instance variable of that class. Is there a point ?
>
> On Thu, Nov 23, 2017 at 12:23 PM Guillermo Polito <[hidden email]> wrote:
> Hi Dimitris,
>
> nil **is** an object. A normal object.
>
> From your wikipedia quote: The true, false, and nil pseudo-variables are singleton instances.
>
> You can try many things to try to convince yourself:
>
>   - nil class => UndefinedObject
>   - nil sizeInMemory => 8 (2 object headers, no instance variables)
>
> You can also take a look at the bootstrap and see how it is created.
>
> And it may make sense to have the same inspection tabs as any other normal object that has no instance variables.
>
> On Thu, Nov 23, 2017 at 11:14 AM, Dimitris Chloupis <[hidden email]> wrote:
> looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong
>
> "Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: true, false, nil, self, super, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The true, false, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"
>
> https://en.wikipedia.org/wiki/Smalltalk
>
> Or maybe there is more here tha meets the eye ?
>
> On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
> is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects.
>
> If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it.
>
> On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
> But it is not nothing. It is real object.
>
> 2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
> Personally I love it
>
>  what you find when you search for nothing ?
>
> Nothing
>
> :D
>
> On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
> Indeed I do not really like the blank window.
>
> On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
> Ah OK, it's expected then?
> I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:
>
> <Capture d’écran 2017-11-18 à 22.16.47.png>
>
> 2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
> Yes
>
> <Screen Shot 2017-11-18 at 22.03.22.png>
>
> Cheers,
> Alex
>
> On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
> Anyone tried 'nil inspect' recently?
>
>
>
>
>
>
>
> --
>    
> Guille Polito
> Research Engineer
>
> Centre de Recherche en Informatique, Signal et Automatique de Lille
> CRIStAL - UMR 9189
> French National Center for Scientific Research - http://www.cnrs.fr
>
> Web: http://guillep.github.io
> Phone: +33 06 52 70 66 13


Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

Denis Kudriashov
In reply to this post by kilon.alios

2017-11-23 17:01 GMT+01:00 Dimitris Chloupis <[hidden email]>:
yeah i see it now, I asked earlier on because I did not have access to a computer (was replying from my tablet). I see now that is an object, though its weird that nil is an instance of UndefinedObject but yet, that class has nil as instance variable

not one of the good designs of Smalltalk, if this is not Pharo specific.

I do not see the point of being an instance of a class and also an instance variable of that class. Is there a point ?

Where you find instance variable?
Class definition has no variables:

Object subclass: #UndefinedObject
instanceVariableNames: ''
classVariableNames: ''
package: 'Kernel-Objects'
UndefinedObject class
instanceVariableNames: ''
 

On Thu, Nov 23, 2017 at 12:23 PM Guillermo Polito <[hidden email]> wrote:
Hi Dimitris,

nil **is** an object. A normal object.

From your wikipedia quote: The truefalse, and nil pseudo-variables are singleton instances.

You can try many things to try to convince yourself:

  - nil class => UndefinedObject
  - nil sizeInMemory => 8 (2 object headers, no instance variables)

You can also take a look at the bootstrap and see how it is created.

And it may make sense to have the same inspection tabs as any other normal object that has no instance variables.

On Thu, Nov 23, 2017 at 11:14 AM, Dimitris Chloupis <[hidden email]> wrote:
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?







--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13


Reply | Threaded
Open this post in threaded view
|

Re: nil inspect

kilon.alios
ah ok my bad it was self that referred of course back to itself.

if you inspect nil , you get indeed UndefinedObject and if you look at instance variables, it has self and it references nil. I was confused by that because I did not notice it was self. 

On Thu, Nov 23, 2017 at 6:26 PM Denis Kudriashov <[hidden email]> wrote:
2017-11-23 17:01 GMT+01:00 Dimitris Chloupis <[hidden email]>:
yeah i see it now, I asked earlier on because I did not have access to a computer (was replying from my tablet). I see now that is an object, though its weird that nil is an instance of UndefinedObject but yet, that class has nil as instance variable

not one of the good designs of Smalltalk, if this is not Pharo specific.

I do not see the point of being an instance of a class and also an instance variable of that class. Is there a point ?

Where you find instance variable?
Class definition has no variables:

Object subclass: #UndefinedObject
instanceVariableNames: ''
classVariableNames: ''
package: 'Kernel-Objects'
UndefinedObject class
instanceVariableNames: ''
 

On Thu, Nov 23, 2017 at 12:23 PM Guillermo Polito <[hidden email]> wrote:
Hi Dimitris,

nil **is** an object. A normal object.

From your wikipedia quote: The truefalse, and nil pseudo-variables are singleton instances.

You can try many things to try to convince yourself:

  - nil class => UndefinedObject
  - nil sizeInMemory => 8 (2 object headers, no instance variables)

You can also take a look at the bootstrap and see how it is created.

And it may make sense to have the same inspection tabs as any other normal object that has no instance variables.

On Thu, Nov 23, 2017 at 11:14 AM, Dimitris Chloupis <[hidden email]> wrote:
looks like wikipedia agrees with me, but I have to confess never looked at the Pharo implementation so I may still be wrong

"Smalltalk-80 syntax is rather minimalist, based on only a handful of declarations and reserved words. In fact, only six "keywords" are reserved in Smalltalk: truefalsenilselfsuper, and thisContext. These are actually called pseudo-variables, identifiers that follow the rules for variable identifiers but denote bindings that the programmer cannot change. The truefalse, and nil pseudo-variables are singleton instances. self and super refer to the receiver of a message within a method activated in response to that message, but sends to super are looked up in the superclass of the method's defining class rather than the class of the receiver, which allows methods in subclasses to invoke methods of the same name in superclasses. thisContext refers to the current activation record. The only built-in language constructs are message sends, assignment, method return and literal syntax for some objects. From its origins as a language for children of all ages, standard Smalltalk syntax uses punctuation in a manner more like English than mainstream coding languages. The remainder of the language, including control structures for conditional evaluation and iteration, is implemented on top of the built-in constructs by the standard Smalltalk class library. (For performance reasons, implementations may recognize and treat as special some of those messages; however, this is only an optimization and is not hardwired into the language syntax.)"


Or maybe there is more here tha meets the eye ?

On Thu, Nov 23, 2017 at 12:10 PM Dimitris Chloupis <[hidden email]> wrote:
is it ? I always thought it was just one of those things that is not an object , together with super and self. I vaguelly remember that 5-6 words in Smalltalk are not objects. 

If it is an actual object and not something else wrapped in a very thin object, I can see the reason for inspection. Otherwise I cannot say I see it. 

On Thu, Nov 23, 2017 at 10:45 AM Denis Kudriashov <[hidden email]> wrote:
But it is not nothing. It is real object.

2017-11-23 9:03 GMT+01:00 Dimitris Chloupis <[hidden email]>:
Personally I love it

 what you find when you search for nothing ?

Nothing 

:D 

On Wed, Nov 22, 2017 at 10:23 PM Stephane Ducasse <[hidden email]> wrote:
Indeed I do not really like the blank window. 

On Sat, Nov 18, 2017 at 10:18 PM, Nicolas Cellier <[hidden email]> wrote:
Ah OK, it's expected then?
I find that surprising, because I could maybe want to look at meta side like I can for other elementary objects:

Images intégrées 1

2017-11-18 22:03 GMT+01:00 Aliaksei Syrel <[hidden email]>:
Yes

Inline images 1

Cheers,
Alex

On 18 November 2017 at 21:56, Nicolas Cellier <[hidden email]> wrote:
Anyone tried 'nil inspect' recently?







--

   

Guille Polito

Research Engineer

Centre de Recherche en Informatique, Signal et Automatique de Lille

CRIStAL - UMR 9189

French National Center for Scientific Research - http://www.cnrs.fr


Web: http://guillep.github.io

Phone: <a href="tel:+33%206%2052%2070%2066%2013" value="+33652706613" target="_blank">+33 06 52 70 66 13