[nem-en] [Proposal] Extend Record or Accesor macro to create POD
types
Kamil Skalski
kamil.skalski at gmail.com
Mon Jan 8 08:52:22 CET 2007
I would prefer a separate macro to mark (chosen) members with (any)
attribute. It could look like
[MarkWithAttribute (Public, Fields, Include = [foo, bar])]
class A {
foo : int;
bar : int;
waa : int;
}
I'm not sure, maybe the "fields" part could be omitted.
Then we could add this attribute also in Record, since "record"
usually implies that this is plain storage with public fields.
2007/1/7, Andrey Khropov <andrey.khropov at gmail.com>:
>
> Hello all!
>
> Sometimes all we want in simple cases is a Plain Old Data type with no
> encapsulation (i.e. all fields public). To reduce declaration clutter it would
> be nice to have a special version of Record Macro:
>
> -----------------------------------------
> [Record(Public)]
> struct Person
> {
> name : string;
> surname : string;
> id : int;
> }
> -----------------------------------------
>
> which would be just equivalent to
> -----------------------------------------
> [Record]
> struct Person
> {
> public name : string;
> public surname : string;
> public id : int;
> }
> -----------------------------------------
>
> --
> AKhropov
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list