[nem-en] No parsetree body accessible

Kamil Skalski kamil.skalski at gmail.com
Tue Jun 19 22:05:13 CEST 2007


2007/6/19, Dmitry Ivankov <divanorama at gmail.com>:
>
>
> On 6/20/07, Kamil Skalski <kamil.skalski at gmail.com > wrote:
> > Most probably this is because of initializer. At the moment of typing
> > method body constructors are already typed and you cannot add the
> > initialization code to them.
>
> Yes, looks like it.
> Nested class with static initialized field seems to work, I'll
> try to use it instead.
>
> On 6/20/07, Michal Moskal <michal.moskal at gmail.com> wrote:
> > Maybe we should hack the compiler, to type the static constructor last
> > (and maybe normal constructors next to last)? I don't see this being
> > problematic in any case, and in some cases (like this one) it would be
> > useful.
> I agree, it would be useful hack. But probably typing in
> that order isn't always possible, so it shouldn't
> be relied on too much :)

I think this would fix all similar scenarios, when you want to
generate initializer during typing, which would be good. I don't think
it could cause any problems - order of typing methods is not
important.

>
>
> And returning to wiki & tb.CannotFinalize : should it be just
> removed from examples, or that property was somehow renamed
> or replaced with another one?
>

  public CannotFinalize : bool
  {
    get { cannot_finalize }
    internal set { cannot_finalize = value; }
  }

Looks like the setter  bacame internal (or was such always?) I'm not
sure why it is needed - all examples in ncc/testsuite/macrolib.n  just
uses Compile...

-- 
Kamil Skalski
http://nazgul.omega.pl



More information about the devel-en mailing list