[HACK] Re: doIfNotNil: -- let's bake the other half

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Sat Oct 21 16:05:57 UTC 2000


On Sat, 21 Oct 2000, Bob Arning wrote:

> Here's a shortcut - just use normal message sends in those cases.

Hey, that's great! Didn't think of this :)

Attached is a combined changeset. Now, is this ready for prime time?

"Change Set:		valueOpt-bf-raa
Date:			21 October 2000
Authors:		Bert Freudenberg, Bob Arning

If a block expects less arguments than given, do not fail, but just use
those args. For example:
	(1 to: 3) collect: [OrderedCollection new].
Also makes the ifNotNil: block take an optional argument:
	6 ifNotNil: [42]
	6 ifNotNil: [:x | x * 7]
Compiler accepts 0-or-1-arg blocks now. Still need to change
emitters and sizers. Any takers?
Bob Arning jumped in here:
(Always looking for the easy way out)
 - if there is an argument in the notNil block, simply fall back on normal
message sends
See MessageNode ifNilTests"

-- Bert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: valueOpt-bf-raa.2.cs.gz
Type: application/x-gzip
Size: 1926 bytes
Desc: 
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20001021/a87f0369/valueOpt-bf-raa.2.cs.bin


More information about the Squeak-dev mailing list