User Defined Attributes
David Nadlinger
see at klickverbot.at
Wed Nov 14 05:03:17 PST 2012
On Wednesday, 14 November 2012 at 11:18:28 UTC, Tove wrote:
> There was the example with Thrift...
>
> struct UserProfile {
> 1: i32 uid,
> 2: string name,
> 3: string blurb
> }
> service UserStorage {
> void store(1: UserProfile user),
> UserProfile retrieve(1: i32 uid)
> }
>
> You could use a user defined type for the struct... but for the
> members it would make sense to use the native type directly...
> and if you traverse the annotation in sequence rather than as
> standalone entities.. it's perfectly safe to use 1,2,3 as
> annotation...
But what if you want to use that struct with another library as
well, for which you might also want to tack some ids on the
fields? I'm the author of the current D implementation in Thrift,
and if/when user defined attributes become stable and I'll amend
it to take advantage of UDAs, I'll definitely not go for raw
literals…
David
More information about the Digitalmars-d-announce
mailing list