|
Re: block in recursion, Any cure for that kind of situation?: msg#00108lang.smalltalk.squeak.beginners
On Jan 23, 2008, at 1:00 AM, Marcin Tustin wrote: So am I right in thinking that if I get newCompiler, blocks will work as I would expect them to (like lambdas)? You can find it on squeaksource. http://www.squeaksource.com/NewCompiler.html You first need to load AST NewParser RefactoringEgine and SmaccRuntime. In other to load them all you could use the NewCompilerLoader availible one the NewCompiler squeaksource repository. Simply invoke: NewCompilerLoader new loadPackage. This will recompile the complete image using the NewCompiler. To avoid the recompilation you can look at the loadPackage method. You could also load the NewCompiler throw the Universe browser. After loading the compiler you have 2 way to compile code. 1. Use the NewCompiler but don't make full block closure. (Preference browser section compile #compileUseNewCompiler) In this mode the block still remain the same and temp are share among the home context. That the reason why you could not invoke recursively a block. 2. Enable the block closure. (Preference browser section compile #compileBlocksAsClosures) With this preference the block while be transform in full block closure. You could then recursively invoke a block. Block while then create a environment to store temps whenever is needed. HTH Cheers,
Mth
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: block in recursion, Any cure for that kind of situation?, Marcin Tustin |
|---|---|
| Next by Date: | Re: block in recursion, Any cure for that kind of situation?, Hilaire Fernandes |
| Previous by Thread: | Re: block in recursion, Any cure for that kind of situation?, Marcin Tustin |
| Next by Thread: | Re: block in recursion, Any cure for that kind of situation?, Hilaire Fernandes |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |