PharoView this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide)

Compiler plugins

A new class (merged into Pharo 7) called "OCCompilerDynamicASTPlugin" allows for the dynamic creation of compiler plugins






Object compiler
	addPlugin: 
		(OCCompilerDynamicASTPlugin 
			newFromTransformBlock: [ :ast | (RBParseTreeRewriter replaceLiteral: 42 with: 'meaning of life') executeTree: ast. ast. ]
			andPriority: 0
		);
	evaluate: '42'.


This would give 'meaning of life'

-----------

Link to this Page