[Grace-core] initialisation & checking

Michael Homer mwh at ecs.vuw.ac.nz
Sat Apr 27 01:28:22 PDT 2013


On Sat, Apr 27, 2013 at 8:18 PM, Michael Homer <mwh at ecs.vuw.ac.nz> wrote:
> On Sat, Apr 27, 2013 at 7:06 PM, James Noble <kjx at ecs.vuw.ac.nz> wrote:
>> Hi Andrew
>>
>> so reflecting on things while packing - I thought:
>> even if the O'CAML rule is the "Right Thing" - why would
>> we want to bake that into the language spec?
>>
>> (the O'CAML rule is basically that self may not be used
>> in code in object constructors or field initialisers or blocks
>> inside either --- its as if that code ran in the containing scope)
> There goes procedures-first.
i.e., this is no longer a valid module:
    method greet(name : String) {
        print "Hello, {name}."
    }
    greet "visitor"
because the last line is a self-call during construction.
-Michael


More information about the Grace-core mailing list