[squeak-dev] Accessing temp variables bindings in a BlockClosure

Stéphane Rollandin lecteur at zogotounga.net
Sun Apr 19 16:18:53 UTC 2020


Hello,

Is there a way to map the temp variables stored in a BlockClosure with 
their names as they appear in the decompileString?

For example we have:

	| y |
	y := 10.
	[:x | y + x] basicAt: 1		"returns 10"

and

	| y |
	y := 10.
	[:x | y + x] decompileString	"returns '[:x | y + x]'"


What I would like is something like

	| y |
	y := 10.
	[:x | y + x] tempBindingAt: 1 	"would return #y -> 10"


Stef


More information about the Squeak-dev mailing list