[nem-en] Re: How field initializers are parsed?

Andrey Khropov andrey.khropov at gmail.com
Sat Dec 16 20:19:47 CET 2006


Kamil Skalski wrote:

> This is caused by some fake code generated in
> macros/Internals.n
> 
>    when (Nemerle.Macros.ImplicitCTX().Manager.IsIntelliSenseMode)
>    { // Add fake method whith body of field initialiser.
>      def n = "_N_field_initialiser__" + f.Name;
>      //Fixme: VladD2: I not understand how add
> NemerleAttributes.SpecialName to this method.
>      Util.locate(val.Location,
>        t.Define (<[ decl: private $(n : usesite) () : void { _ = $val; } ]>));
>    }
> 
> 
> No idea why Vlad added this stuff...

Oh, I was unable to find it because I searched only in 'ncc'.

Why don't we just have something like 'initializer : TExpr' (or TExpr.Literal
if only literal values are allowed) in FieldBuilder? A far as I can see
'const_value' is valid only for constants.

-- 
AKhropov




More information about the devel-en mailing list