Multiple Returns, was Re: Common Lisp style macros inSmalltalk?

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Wed Jan 19 08:55:13 UTC 2000


On Tue, 18 Jan 2000, Dan Ingalls wrote:

> >On Tue, Jan 11, 2000, agree at carltonfields.com wrote:
> >[...]  
> >> The "strict" Smalltalkologist might observe (and it has been
> >> observed many times in these letters), that the proper
> >> methodological solution is that every such aggregating should have
> >> its own aggregating class.  Thus:
> >> 
> >> 	^ Foo with: expresion1 with: expression2 with: expression3.

There is (at least) one other "strict" solution to this, which already is
utilized throughout the image - a multiple arg block:

Something>>voltageCurrentTorqueIn: aBlock
	| voltage current startingTorque |
	voltage := ...
	current := ...
	startingTorque := ...
	^aBlock valueWithArgumnts: {voltage. current. startingTorque}

and the call would be

	something voltageCurrentTorqueIn:
		[ :voltage :current :startingTorque |
			do whatever with these values 
		]


  -Bert-





More information about the Squeak-dev mailing list