Closure Compiler in 3.9 ?

Mathieu Suen mathk.sue at gmail.com
Tue May 8 22:33:40 UTC 2007


Actually you cantt execute it with the old compiler(with out Closure) 
because BlockContext can't be execute  more then twice at the same  
time (Because BlockContext hold the temps and the stack so  you will  
override them when executing the block again).

The only way of runing your coed is to unable the ClosureCompiler  
(have both preferences turn on in the Compiler category).
I have try your code and it work perfect in the workspace

Output is 20.

I don't really nuderstand how you could have your call stack because  
BlockClosure don't compare any association in #=.
Which version of the NewCompiler and AST do you have?

	Mth



On May 8, 2007, at 11:42 PM, Andrew P. Black wrote:

> OK, so I patched the McMczReader and got NewCompiler to load.   I  
> no longer get the "attempt to activate a block that is already  
> active" errors.  However, my code doesn't give the expected  
> results, and the debugger is no help at all in figuring out why,  
> since it doesn't understand the blocks.
>
> My confidence was not improved by running the NewCompiler tests —  
> they crashed the image.
>
> Before I tried that, I wrote one of my own tests — just a little  
> workspace code.
>
> i := 21. j := 0.
> b := [(i:= i-1) > 0 ifTrue: [j := j+1 . b value.] ifFalse:[j]] .
> b value
>
> I think that b value should print as 20 (plus or minus 1) ... but I  
> get 1.  Well, now I get 20.  But only if I execute the three  
> statements one at a time.
>
> If I put all three in the same doit, I get an infinite loop.
> 	Array(SequenceableCollection)>>= 					calls
> 	Array(SequenceableCollection)>>hasEqualElements 		calls
> 	Association>>=									calls
> 	BlockClosure>>=								calls
> 	Array(SequenceableCollection)>>=
>
> etc.
>
> Something is rotten here, I think, but I don't know where to start  
> in finding out exactly what.




More information about the Squeak-dev mailing list