[M3devel] [M3commit] CVS Update: cm3

Rodney M. Bates rodney.bates at wichita.edu
Fri Jan 11 18:10:36 CET 2008


I use what I think is the pattern you refer to regularly.  A callback
"visit" procedure (which is nested) is passed as a parameter and it
accesses nonlocal variables.  I just reran a test driver main program
that does massive tests of a particular module and uses this pattern
extensively.  No problems showed up, using PM3 integrated backend, PM3
with gcc backend, and a recent CM3.

I still run a lot of stuff PM3-compiled, but my PM3 has somehow diverged
significantly from the official distribution, and every time I start to
resolve this, it quickly gets a lot deeper than I want to take time for.

Mika Nystrom wrote:
> This reminds me, there used to be a bug in PM3... has it been fixed?  This code
> was unreliable:
> 
> PROCEDURE P() =
> 
>   VAR a : T;
> 
>   PROCEDURE Q(b : U) =
>     BEGIN a := saveSomethingAbout(b) END Q;
> 
>   BEGIN CallVisitor(Q) END P;
> 
> (Note that the M3 report says that while inner procedures may not
> be assigned to variables, they may be passed as procedure parameters.
> The workaround for the compiler bug is to use something called
> "object-oriented programming".)
> 
-- 
-------------------------------------------------------------
Rodney M. Bates, retired assistant professor
Dept. of Computer Science, Wichita State University
Wichita, KS 67260-0083
316-978-3922
rodney.bates at wichita.edu



More information about the M3devel mailing list