Shouldn't ifEmpty return self?

Boris Popov boris at deepcovelabs.com
Mon Jun 12 18:55:21 UTC 2006


Umm, no, receiver of a doit should have nothing to do with the code being
executed. Here's a VisualWorks implementation, which is more correct given
the intent of these methods, 

#(1) ifEmpty: [nil]	#(1)
#() ifNotEmpty: [nil]	#() 

Cheers!

-Boris

-- 
+1.604.689.0322
DeepCove Labs Ltd.
4th floor 595 Howe Street
Vancouver, Canada V6C 2T5

boris at deepcovelabs.com

CONFIDENTIALITY NOTICE

This email is intended only for the persons named in the message
header. Unless otherwise indicated, it contains information that is
private and confidential. If you have received it in error, please
notify the sender and delete the entire message including any
attachments.

Thank you.

-----Original Message-----
From: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] On Behalf Of marcelo
Cortez
Sent: Monday, June 12, 2006 11:49 AM
To: Ron at USMedRec.com; The general-purpose Squeak developers list
Subject: Re: Shouldn't ifEmpty return self?

Ron

 in your example ( with doit)

   #(1) ifEmpty: [nil]  

  ifEmpty block don't qualify, so return the receiver.
  the receiver of Doit is UndefinedObject
  from there you have nil  how result
 best regards 
   MDC
 --- Ron Teitelbaum <Ron at USMedRec.com> escribió:

> Shouldn't ifEmpty: return self?
> 
>  
> 
> #(1) ifEmpty: [nil]  ->      Returns nil
> 
> #(1) ifNil: [nil].       ->      Returns #(1)
> 
>  
> 
> Ron Teitelbaum
> 
>  
> 
> > 
> 


__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis! 
¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3370 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20060612/3994e0b5/smime.bin


More information about the Squeak-dev mailing list