[nem-en] Multiple project solutions
Kamil Skalski
kamil.skalski at gmail.com
Tue Jan 9 23:30:09 CET 2007
> > I know it might be quite disturbing for a user... but macro must be
> > somehow compiled to be executed - may it be the actual compilation
> > done by compiler or maybe some "hidden" temporary compilation by VS
> > itself.
>
> Yes, I agree. Exactly for this reason I suggest to toughen division assembly
> on macro-assembly and simple code assembly.
Why? I mean that you could always switch between injecting
TypeBuilders and using real library reference. So if the assembly is
compiled in the background (to have macros available), then its all
types could also be loaded from there.
>
> Also I suggest forbid add top level code for expression macro. We compile
> methods bodies on demand. And if body will contain macro which add class
> (for example), we get big problems.
> Top level code must be added only by macro-attributes.
No way... This is a VERY nice feature. For exampe I use logging
macros, which generate the log4j logger as field in current class on
need - if my
log (DEBUG, "...")
generates some code I add some stuff to current class
Also, we have seen interesing examples of macros generating whole classes:
metaclass myMeta { x : int; y : string };
assert (myMeta (1, "").X == 1);
assert (myMeta (2, "a").Y == "a");
>
> > Note that there is similar issue with VS designer - it must have the
> > compiled version of your Form to show it in designer. It does some
> > magic to achieve it (which unfortunately fails VERY often for me), but
> > the issue is essentially the same.
>
> No. VS Forms Designer don't compile anything. It only read code. Transform
> it to CodeDom. And interpret CodeDom. Really in Forms Designer form always
> represent by System.Windows.Forms.Form class. It's behavior create some
> problems, but designer can work even if user code of form damaged.
So this is an argument to just leave the macros as they are - if user
compile the macro assembly, then current project should catch the
recent assembly and start executing macros from it.
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list