<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18852">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hi,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>>yes, yes. But real Smalltalk programs
have to interface with external</FONT></DIV>
<DIV><FONT size=2 face=Arial>> programming languages, typically through
a C-inlfuenced ABI. In that</FONT></DIV>
<DIV><FONT size=2 face=Arial>> context it makes sense. I second
Bert's proposal, true asInteger == 1</FONT></DIV>
<DIV><FONT size=2 face=Arial>> and: [false asInteger == 0].</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>IMHO, we have started from one concrete &
repetitive situation</FONT></DIV>
<DIV><FONT size=2 face=Arial> and now the focus has gone to something
completelly diferent, abstract,</FONT></DIV>
<DIV><FONT size=2 face=Arial> in the field of
"ideas/ideaLs"...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Igor asked on how to solve the
"problem" revealed by an expression like</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial> value := aComputation + (aBoolean ifTrue: [
oneConstant ] ifFalse: [ bConstant ])</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>The "problem is solved" if we avoid instantiating
the problem.</FONT></DIV>
<DIV><FONT size=2 face=Arial>Please consider WHY you have aBoolean
there</FONT></DIV>
<DIV><FONT size=2 face=Arial> and define/use a name for it;</FONT></DIV>
<DIV><FONT size=2 face=Arial> I mean a name in correct scope (method,
class, pool, etc) that is set</FONT></DIV>
<DIV><FONT size=2 face=Arial> to the value(s) you need for computation and
use that name instead</FONT></DIV>
<DIV><FONT size=2 face=Arial> of "aBoolean".</FONT></DIV>
<DIV><FONT size=2 face=Arial>Check the place you instantiated aBoolean, imo, you
will find that it</FONT></DIV>
<DIV><FONT size=2 face=Arial> is in a place inside the same context
(scope) of the expression. If it</FONT></DIV>
<DIV><FONT size=2 face=Arial> is not the case, you should consider it in
context of a tool (foreign,</FONT></DIV>
<DIV><FONT size=2 face=Arial> more abstract) and provide at that level
management for the naming</FONT></DIV>
<DIV><FONT size=2 face=Arial> schema.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Most times we can solve problems this way;
rejecting the fact</FONT></DIV>
<DIV><FONT size=2 face=Arial> that they occurs and that make our systems
more independent</FONT></DIV>
<DIV><FONT size=2 face=Arial> and scalable without suffering
obesity.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>cheers,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Ale.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=eliot.miranda@gmail.com href="mailto:eliot.miranda@gmail.com">Eliot
Miranda</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
title=squeak-dev@lists.squeakfoundation.org
href="mailto:squeak-dev@lists.squeakfoundation.org">The general-purpose Squeak
developers list</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, December 05, 2009 6:09
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [squeak-dev] Protocol
extension proposal: Boolean>>asBit ?</DIV>
<DIV><BR></DIV><BR><BR>
<DIV class=gmail_quote>On Sat, Dec 5, 2009 at 11:18 AM, David T. Lewis <SPAN
dir=ltr><<A
href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</A>></SPAN>
wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV class=im>On Sat, Dec 05, 2009 at 02:48:21PM +0100, Bert Freudenberg
wrote:<BR>> On 05.12.2009, at 14:29, Randal L. Schwartz wrote:<BR>>
><BR>> >>>>>> "Bert" == Bert Freudenberg <<A
href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</A>>
writes:<BR>> ><BR>> > Bert> I don't think it would break any
sane application. #asInteger is<BR>> > Bert> descriptive, and
"feels right" to me. Reading "asBit" I'd expect it to<BR>> > Bert>
return an instance of Bit.<BR>> ><BR>> > Bert> I have not
really felt the need for such a method, but I can see how<BR>> >
Bert> it's tempting to have, in particular when porting code.<BR>>
><BR>> > It's also "according to who". 0 as false, 1 as true
is only one encoding,<BR>> > and clearly not universal. I've
worked with systems where 0 is false,<BR>> > and -1 is
true.<BR>><BR>> I knew someone would bring this up ;) I also like to
KISS.<BR>><BR>> This is not about internal representation, but about
doing arithmetic with<BR>> booleans. I don't think any other mapping than
"true asInteger = 1" and<BR>> "false asInteger = 0" makes sense in that
context.<BR><BR></DIV>I don't think that arithmetic with booleans makes
sense in any context.<BR><BR>Is this convenience method really worth
muddying up the distinction between<BR>numbers and booleans? Think of all
the C programmers with bad habits<BR>(like me for example) who have had to
stop and think twice about assuming<BR>that a number means the same thing as
true or false.<BR><BR>It seems to me that maintaining a clear distinction
between numbers and<BR>booleans is a Good Idea even if it does require some
extra typing.<BR></BLOCKQUOTE>
<DIV><BR></DIV>
<DIV>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].</DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote><BR>$0.02<BR><BR>Dave<BR><BR><BR></BLOCKQUOTE></DIV><BR>
<P>
<HR>
<P></P><BR></BLOCKQUOTE></BODY></HTML>