[squeak-dev] #valueWithExit inconsistency (?)

Jaromir m at jaromir.net
Tue Feb 16 13:05:11 UTC 2021


Current implementation of #valueWithExit seems a bit inconsistent in its
return value: it returns either nil (if the receiver exited using the exit
block) or the receiver.

Would it be worth modifying it to always return nil? (there are no senders
anyway)

valueWithExit 
-	  self value: [ ^nil ]
+	  ^self value: [ ^nil ]

Or using a nice complementary method #valueWithExit:

valueWithExit: aBlock 
	self value: [^aBlock value].
	^aBlock value

valueWithExit 
	^self valueWithExit: [nil]

Thanks



-----
Jaromir
^[^
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list