[squeak-dev] How to tell if you have a boolean when you care to
know
Jerome Peace
peace_the_dreamer at yahoo.com
Wed Mar 25 21:43:30 UTC 2009
Opps forgot to send to the list.
--- On Wed, 3/25/09, Jerome Peace <peace_the_dreamer at yahoo.com> wrote:
> From: Jerome Peace <peace_the_dreamer at yahoo.com>
> Subject: Re: [squeak-dev] How to tell if you have a boolean when you care to know
> To: "Michael van der Gulik" <mikevdg at gmail.com>
> Date: Wednesday, March 25, 2009, 5:42 PM
> --- On Wed, 3/25/09, Michael van der Gulik
> <mikevdg at gmail.com> wrote:
>
> > From: Michael van der Gulik <mikevdg at gmail.com>
> > Subject: Re: [squeak-dev] How to tell if you have a
> boolean when you care to know
> > To: peace_the_dreamer at yahoo.com, "The
> general-purpose Squeak developers list"
> <squeak-dev at lists.squeakfoundation.org>
> > Date: Wednesday, March 25, 2009, 5:01 PM
> > On 3/25/09, Jerome Peace
> <peace_the_dreamer at yahoo.com>
> > wrote:
> > >
> > >
> > > In another tread Keith Hodges wrote:
> > >
> > > 2009/3/24 Keith Hodges <keith_hodges at
> > yahoo.co.uk>
> > >
> > >> true xor: [ true ] => true
> > >>
> > >> discuss
> > >>
> > >> Keith
> > >
> > > a simple guard for a boolean can be written
> simply.
> > >
> > > true xor: bar aBoolean
> >
> > Don't you mean >>asBoolean?
>
> Absolutely NOT. Reread the original post.
>
> asBoolean returns true or false for all objects.
> The expectations is that objects other than Booleans will
> return true or false.
>
> The purpose of aBoolean is to throw an error when foo is
> not a boolean.
>
> The elaborate form of the message would be
>
> surelyYourABoolean
>
> "To which non Booleans would reply"
>
> ^self error: 'No I'm not a boolean and stop calling
> me Shirley.'
>
> Which I got from remembering Leslie Nielson in the movie
> Airplane. :)
>
> Thanks for giving me a chance to clear that up.
>
> Yours in curiosity and service, --Jerome Peace
More information about the Squeak-dev
mailing list
|