Instanciating True or False

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

Instanciating True or False

Fernando Rodríguez
Hi,

Since Boolean class>>new raises a shouldNotImplement error, how were
true and false (the singleton instances) created?

Thanks


Reply | Threaded
Open this post in threaded view
|

Re: Instanciating True or False

Charlie Adams
Smalltalk has five reserved words: self, super, nil, true and false.

"Fernando" <[hidden email]> wrote in message
news:[hidden email]...
> Hi,
>
> Since Boolean class>>new raises a shouldNotImplement error, how were
> true and false (the singleton instances) created?
>
> Thanks
>


Reply | Threaded
Open this post in threaded view
|

Re: Instanciating True or False

Hans-Martin Mosner
In reply to this post by Fernando Rodríguez
"Fernando" <[hidden email]> wrote:
> Hi,
>
> Since Boolean class>>new raises a shouldNotImplement error, how were
> true and false (the singleton instances) created?
One explanation: before the method Boolean>>new was implemented.
Of course, this is probably not the true genesis of true and false.
I suspect that the initial image building process created some classes
and instances out of thin air by just writing the bit patterns into
memory which would later be interpreted as true and false etc.

Cheers,
Hans-Martin