F-Script is an object-oriented programming and array programming language, implemented as a scripting framework for the Mac OS X object system (Cocoa). In Objective-C programming with Cocoa, it is common practice to prevent excessive build up of autoreleased variables by bracketing code by the creation and destruction of an instance of NSAutoreleasePool. To do this in F-Script the NSAutoreleasePool should be wrapped in an instance of NSValue so that F-Script does not send a retain message to the NSAutoreleasePool (which is forbidden) when you assign it to an identifier. Here is an example of a block that uses an autorelease pool:

myBlock := 
	| pool |	"local-to-block variable definition"
	"Set up NSAutoreleasePool to localize memory allocation to within the block."
	"Can not let F-Script try to retain the NSAutoreleasePool, so use an NSValue to hold it."
	pool := NSValue valueWithNonretainedObject: NSAutoreleasePool alloc init.
	...do the calculations here that generate autoreleased objects...
	"Release all autoreleased objects"
	pool nonretainedObjectValue release.

If the block is executed a thousand times, for example,

1 to: 1000 do: myBlock.

the autoreleased objects are released at the end of each iteraction and the memory footprint remains small: just the footprint of a single loop plus whatever objects survive outside the block.