<!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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&gt;yes, yes. &nbsp;But real Smalltalk programs 
have to interface with external</FONT></DIV>
<DIV><FONT size=2 face=Arial>&gt;&nbsp;programming languages, typically through 
a C-inlfuenced ABI. &nbsp;In that</FONT></DIV>
<DIV><FONT size=2 face=Arial>&gt;&nbsp;context it makes sense. &nbsp;I second 
Bert's proposal, &nbsp;true asInteger == 1</FONT></DIV>
<DIV><FONT size=2 face=Arial>&gt;&nbsp;and: [false asInteger == 0].</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>IMHO, we have started from one concrete &amp; 
repetitive situation</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;and now the focus has gone to something 
completelly diferent, abstract,</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;in the field of 
"ideas/ideaLs"...</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Igor asked on how to solve the 
"problem"&nbsp;revealed&nbsp;by an&nbsp;expression like</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;value := aComputation + (aBoolean ifTrue: [ 
oneConstant ] ifFalse: [ bConstant ])</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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>&nbsp;and define/use a name for it;</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;I mean a name in correct scope (method, 
class, pool, etc) that is set</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;to the value(s) you need for computation and 
use that name instead</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;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>&nbsp;is in a place inside the same&nbsp;context 
(scope)&nbsp;of the expression. If it</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;is not the case, you should consider it in 
context of a tool (foreign,</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;more abstract) and provide at that level 
management for the naming</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;schema.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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>&nbsp;that they occurs and that make our systems 
more independent</FONT></DIV>
<DIV><FONT size=2 face=Arial>&nbsp;and scalable without suffering 
obesity.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</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&gt;&gt;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>&lt;<A 
  href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</A>&gt;</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>&gt; On 05.12.2009, at 14:29, Randal L. Schwartz wrote:<BR>&gt; 
    &gt;<BR>&gt; &gt;&gt;&gt;&gt;&gt;&gt; "Bert" == Bert Freudenberg &lt;<A 
    href="mailto:bert@freudenbergs.de">bert@freudenbergs.de</A>&gt; 
    writes:<BR>&gt; &gt;<BR>&gt; &gt; Bert&gt; I don't think it would break any 
    sane application. #asInteger is<BR>&gt; &gt; Bert&gt; descriptive, and 
    "feels right" to me. Reading "asBit" I'd expect it to<BR>&gt; &gt; Bert&gt; 
    return an instance of Bit.<BR>&gt; &gt;<BR>&gt; &gt; Bert&gt; I have not 
    really felt the need for such a method, but I can see how<BR>&gt; &gt; 
    Bert&gt; it's tempting to have, in particular when porting code.<BR>&gt; 
    &gt;<BR>&gt; &gt; It's also "according to who". &nbsp;0 as false, 1 as true 
    is only one encoding,<BR>&gt; &gt; and clearly not universal. &nbsp;I've 
    worked with systems where 0 is false,<BR>&gt; &gt; and -1 is 
    true.<BR>&gt;<BR>&gt; I knew someone would bring this up ;) I also like to 
    KISS.<BR>&gt;<BR>&gt; This is not about internal representation, but about 
    doing arithmetic with<BR>&gt; booleans. I don't think any other mapping than 
    "true asInteger = 1" and<BR>&gt; "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. &nbsp;But real Smalltalk programs have to interface with 
  external programming languages, typically through a C-inlfuenced ABI. &nbsp;In 
  that context it makes sense. &nbsp;I second Bert's proposal, &nbsp;true 
  asInteger == 1 and: [false asInteger == 0].</DIV>
  <DIV>&nbsp;</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>