[nem-en] Field initializers specification

Kamil Skalski kamil.skalski at gmail.com
Sun Mar 18 15:45:18 CET 2007


You are right - MaybeAddBaseCall is currently executed before typing
method, so it will ignore that 'base' calls generated by macros. So I
think it would be best to replace it with the approach I mentioned
before - have a flag in Typer, which would detect the presence of
base() anywhere in the method. So after typing of constructor's body
it would be known for sure if base call occured or if we should insert
the default 'base()'

2007/3/18, Dmitry Ivankov <divanorama at gmail.com>:
>
> >
> > >
> >
> Oh, looks like it should be done when body is typed (or when it is being
> typed), because macros are expanded simultaneously with typing :(
>
> Before macro expansion we can analyze
> match (cond){
> | true => base (1)
> | _ => base()
> }
> but not
> if (cond)
>  base (1)
> else
>  base ()
>
> Does macro.Run rely on the order of typing?
> Can we expand macros just before typing whole method body?
> I think it'll be better to manipulate PExpr to inject
> base()/field_init than TExpr
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
>


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



More information about the devel-en mailing list