This can't be right....

Yoshiki.Ohshima at acm.org Yoshiki.Ohshima at acm.org
Fri Jun 27 07:31:38 UTC 2003


  Rick,

  The uppercase False is a class.  Its sole instance, the false
object, is called lowercase 'false'.

  I think you saw the pink notifier window that says
"NonBooleanReceiver...".  One of the difference many people would
point out is that false in Smalltalk is a real object.  The other
important difference I'd like to point out is that an exception flys
toward the top of the stack by default.  You can inspect the live
object in the notifier and check what went wrong.  In Java you can
only see the "dead" stack dump and have to guess what went wrong from
it.

  (Well, I admit that I don't know too much about the advanced Java
IDEs.  There may be some IDE for Java that allows you to capture the
live state when something goes wrong.)

-- Yoshiki

At Fri, 27 Jun 2003 00:07:36 -0700,
Rick McGeer wrote:
> 
> [1  <text/html; us-ascii (7bit)>]
> I'd like to write some Smalltalk code equivalent to the Java fragment:
> 
> boolean ok = false;
> while (!ok) {
>     ...
>     ok = <condition>;
> }
> 
> So I try:
> 
> ok _ False.
> [ok] whileFalse: [.... ok _ <condition>.]
> 
> which fails.  On the other hand:
> 
> ok _ 0.
> [ok > 0] whileFalse: [....  ok _ (<condition>) ifTrue:[1] ifFalse:[0]]
> 
> which works just fine.  This is perverse; shouldn't the two fragments have identical functionality?
> 
> I'm using the 3.4 image.
> 
> --
> 
> Rick McGeer                                                                                                               
> 50 Diablo View Road                                                     Phone: (925) 254-2524                             
> Orinda, CA, 94563                                                       FAX: (925) 253-0623                               
> rick at mcgeer.com                                                         Cell: (510) 334-6004                              
> Yahoo IM: rickmcgeer                                                    AOL IM: rickmcgeer 1                              
> MSN IM: rickmcgeer at hotmail.com                                                                                            
> 
> 
> [2  <text/plain; us-ascii (7bit)>]
> 



More information about the Squeak-dev mailing list