Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornellcs!newsstand.cit.cornell.edu!portc01.blue.aol.com!news-res.gsl.net!news.gsl.net!news-peer.gsl.net!news.gsl.net!hunter.premier.net!news.mathworks.com!enews.sgi.com!EU.net!Belgium.EU.net!news.bel.alcatel.be!bln.sel.alcatel.de!slsv6bt!blackbush.xlink.net!ins.net!heeg.de!hmm
From: hmm@heeg.de (Hans-Martin Mosner)
Subject: Re: A bug (or misfeature) in the VW compiler
Message-ID: <Dy6Ctu.684@heeg.de>
Sender: uucp@heeg.de
Organization: Georg Heeg Objektorientierte Systeme, Dortmund, FRG
X-Newsreader: TIN [version 1.2 PL2]
References: <m3wwxxrcvv.fsf@wintermute.hip.cam.org> <51jk1v$nbg@vixen.cso.uiuc.edu>
Date: Mon, 23 Sep 1996 07:29:54 GMT
Lines: 30

Ralph Johnson (johnson@cs.uiuc.edu) wrote:
: Vassili Bykov <vbykov@cam.org> writes:

: >In Smalltalk/V and Dolphin empty blocks answer nil regardless of the
: >number of arguments, just as one would expect.

: Maybe it is what you expect, but it is not what *I* expect.  I think
: that blocks with no bodies are bizarre, and I have never seen one used,
: except in pluggable adaptors to define an action that does nothing.
: I would never think to use the value of a block with no body.  Of course,
: I've only used Smalltalk-80 variants, so perhaps there is a cultural
: difference between the Xerox-derived Smalltalks and the other ones.

Ralph, I don't want to question your experience, but one of the most-often
used idioms in my 10-year Smalltalk life is
	aDictionary at: key ifAbsent: []
It's almost encoded as a reflex in my fingers...

For consistency, I would like to have empty blocks return nil,
whether they have arguments or not. Disallowing empty blocks
altogether would break too much code without really gaining
something, IMHO.

Hans-Martin

--
+--- Hans-Martin Mosner -------- Senior Smalltalk Guru ---+
| These opinions are entirely ficticious.  Any similarity |
| to real opinions is purely coincidental and unintended. |
+--- <hmm@heeg.de> ------ URL:http://www.heeg.de/~hmm/ ---+
