[Grace-core] Fwd: minigrace oddness

Timothy Jones tim at ecs.vuw.ac.nz
Wed Jun 25 16:50:57 PDT 2014


On 25/06, Kim Bruce wrote:
> Is this the right thing that should happen?  While "for" is a built-in control
> structure, I would have assumed that it would be treated as a top-level
> method, at least enough so to get access with an "outer".  Of course this may
> just be an accidental issue with the current minigrace implementation.  What
> do we want the answer to be?  My inclination is that annotating it as "outer"
> should have worked, but I'd be happy to hear arguments to the contrary.

The outer reference gives you the self object at the relevant scope. In this
case, outer refers to the module object, and for() do() is not defined there, it
is defined in the scope above that. 'outer.outer.for() do()' is what you are
looking for.

The prelude has a definition named 'prelude' in it that refers directly to the
prelude object, so 'prelude.for() do()' is probably what you really want here.

-- 
Tim


More information about the Grace-core mailing list