An excellent point about ambiguity.  The two examples

  process ifNotNil:#terminate

and

   something ifTrue:1 ifFlalse:0

appear to ask for perform and assign, respectively.  Writing the brackets for 
the latter is not a big chore, and the first example is solved with a new 
message (#terminateMe) understood by both Process (self #terminate) and 
UndefinedObject (noop).

Bill



________________________________________
From: [email protected] 
[[email protected]] On Behalf Of Randal L. Schwartz 
[[email protected]]
Sent: Sunday, October 10, 2010 10:34 AM
To: Igor Stasenko
Cc: Pharo Development; The general-purpose Squeak developers list
Subject: Re: [Pharo-project] [squeak-dev] Compiler pedantic about ifNotNil:     
argument

>>>>> "Igor" == Igor Stasenko <[email protected]> writes:

Igor> i am also missing:

Igor> someThing ifTrue: 1 ifFalse: 0

Down that path lies ambiguity though.

If you had

  actionSymbol := aBoolean ifTrue: #doThis else: #doThat.

do you want the symbol assigned, or performed?

Please don't add so much dwimmery here.  I like it that Smalltalk is
fairly strict with these basic forms.

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[email protected]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.posterous.com/ for Smalltalk discussion

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to