language icon indicating copy to clipboard operation
language copied to clipboard

Update augmentation specification.

Open lrhn opened this issue 1 year ago • 2 comments

  • Says that the entire class scope is in the lexical scope for members.

  • Update augemented specification, include constructors.

    • Only reserved inside expressions and bodies of augmenting member-like declarations, not type-like declarations.
    • Try to give grammar. It's really a parameterized grammar per kind of declaration. We don't have good parameterized grammars, so it's said in prose.
  • Changes specification for non-redirecting generative constructors.

    • Adds order of initialization of instance variables with initializers.
    • Says that body cannot use augmented.
    • Therefore no longer needs to reuse variable bindings, so don't.
    • Each augmenting declaration binds actuals to formals, remember any super parameters or super initializers, executes initializer list entries, and then executes its augmented declaration. When that comes back, it executes its body.
    • (Layering an augmentation on top of an NRG-constructor auto-calls augmented at the end of its initializer list.)

    The initializing formals and super parameters need more work.

  • Some small tweaks to disallow invalid combinations.

lrhn avatar Oct 07 '24 18:10 lrhn

Needs more work. No updated version/changelog, pretty sure the rules for using initializing formals and super parameters are inconsistent, aka. not updated everywhere, and super-parameters need more formal specification.

Still: WDYT? How far is it from what we want?

lrhn avatar Oct 07 '24 18:10 lrhn

I just stumbled onto this still-open PR. I guess it's invalid now? Want to close?

munificent avatar May 29 '25 20:05 munificent