[squeak-dev] Protocol extension proposal: Boolean>>asBit ?

Cédrick Béler cdrick65 at gmail.com
Sun Dec 6 13:39:19 UTC 2009

2009/12/5 Stéphane Rollandin <lecteur at zogotounga.net>

> yes, yes.  But real Smalltalk programs have to interface with external
>> programming languages, typically through a C-inlfuenced ABI.  In that
>> context it makes sense.  I second Bert's proposal,  true asInteger == 1 and:
>> [false asInteger == 0].
> why not use a brand new selector ? the purpose of getting 1 or 0 from a
> Boolean has nothing to do with an actual conversion, better it is some kind
> of an encoding, si IMO neither #asBit nor #asInteger are meaningful here.
> #as0or1 would do the job. and you could even implement #as0orMinus1 besides
> if you like.

I agree. Maybe #asBitNumber is a valid selector...

> Stef

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20091206/19c4f678/attachment.htm

More information about the Squeak-dev mailing list