[BUG] recursive block calls

Roel Wuyts rwuyts at vub.ac.be
Wed Jul 19 13:05:17 UTC 2000


This is a long standing problem (as people who are around in Squeak much 
langet than me can tell you). Block's in Squeak are not full closures. For
the things that we do (our lab, that is), this is very annoying (we generate
and use blocks while doing logic interpretation). To fix this, somebody has
to stand up and modify the Compiler (if I am correct). I would do it, but I
am not sure what has to be done (and how to do it). I guess I am not the
only one...

> Hmm. I've just run in to the most puzzling problem. This seems to be
> something written in to the VM. If I define a block of code, I can't get
> that block to call itself! - This cannot be right.. as it's something
> I've done with IBM ST before.
>
> | factorial |
> factorial :=
>     [:n :z |
>     n == 0
>         ifTrue: [z]
>         ifFalse: [factorial value: (n-1) value: (z*n)]].
>
> Transcript show: (factorial value: 4 value: 1) printString
>
> It works if I actually make 'factorial' a method. Please dont bother
> criticising the fact that I'm re-writing code that already exists in the
> system. I'm doing this for person reasons, and I was trying to see if my
> bit of code would run faster under Squeak than under IBM ST.
> But.. yeah... why does it say:
>
> 'Attempt to evaluate a block that is already being evaluated.' ?
>
> Michael.
>


--
Roel Wuyts                    Programming Technology Lab
rwuyts at vub.ac.be              Vrije Universiteit Brussel
http://prog.vub.ac.be/~rwuyts
Webmaster of European Smalltalk User Group: www.esug.org





More information about the Squeak-dev mailing list