[nem-en] Re: Perform macro on members defined by macro.
Ivan A Eryshov
ivan.eryshov at gmail.com
Sat Mar 10 11:20:08 CET 2007
So, is there are any workaround?
Actually, I want to extend the Record macro as I wrote before:
Ex: [Record(Include = [_ilGenerator <= [NotNull], _isStaticMethod])]
I had tired from writing constructors where it can be done by the Record
macro. But I should write constructors, because of the NotNull check and
other checks (that's can be made by the Requires macro) are necessary in
constructors.
> -----Original Message-----
> From: devel-en-bounces at nemerle.org [mailto:devel-en-bounces at nemerle.org]
> On Behalf Of Kamil Skalski
> Sent: Saturday, March 10, 2007 3:25 PM
> To: devel-en at nemerle.org
> Subject: Re: [nem-en] Re: Perform macro on members defined by macro.
>
> The first thing that comes to my mind is that the NotNull is added to
> method too late - that is when it was already processed (typed). This
> shouldn't happen though, since you process the macros before any
> method body gets typed - which gets us to suspicion, that this is not
> true.
>
> 2007/3/10, Ivan A Eryshov <ivan.eryshov at gmail.com>:
> > I was investigating this problem. Seems that I don't know about some
> > secrets, because of things that I discover were surprise me.
> >
> > First of all, method TypeBuilder.add_macros_from_parsedmems(...) works
> as
> > expected. It adds macro expansion to TypesManager which adds expansion
> to
> > attribute_macros_queue.
> > Then the expansion of the AddMethWithNotNullParam macro is finished. And
> the
> > expansion on the NotNull macro is started. When the NotNull macro is
> > performed the method's body contains the assertion:
> > <nemerle>
> > {
> > assert ((_prm : object) != null,
> > "The ``NotNull'' contract of parameter `"
> > + "_prm" + "' has been violated.");
> > object ()
> > }
> > </nemerle>
> > But, when the compilation is completed, assertion is disappearing. I
> have no
> > ideas why this is so. Please advice.
> >
> > ==
> > BWR, Ivan Eryshov.
> >
> > > -----Original Message-----
> > > From: devel-en-bounces at nemerle.org [mailto:devel-en-
> bounces at nemerle.org]
> > > On Behalf Of Michal Moskal
> > > Sent: Friday, March 02, 2007 5:11 PM
> > > To: devel-en at nemerle.org
> > > Subject: Re: [nem-en] Re: Perform macro on members defined by macro.
> > >
> > > On 2/28/07, Ivan A Eryshov <ivan.eryshov at gmail.com> wrote:
> > > > Kamil, Michal,
> > > > What method TypeBuilder.add_macros_from_parsedmems(...) does?
> > >
> > > It's supposed to run the NotNull macro in your example. It seems
> > > somethings doesn't work though...
> > >
> > >
> > > --
> > > Michal
> >
> >
> > _______________________________________________
> > https://nemerle.org/mailman/listinfo/devel-en
> >
>
>
> --
> Kamil Skalski
> http://nazgul.omega.pl
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
More information about the devel-en
mailing list