User Defined Attributes

Max Samukha maxsamukha at gmail.com
Tue Nov 6 10:42:00 PST 2012


On Tuesday, 6 November 2012 at 17:17:50 UTC, Walter Bright wrote:
> On 11/6/2012 9:06 AM, deadalnix wrote:> Le 06/11/2012 16:15, 
> Walter Bright a écrit :
> >> On 11/6/2012 5:14 AM, Adam D. Ruppe wrote:
> >>> Hmmm, it didn't work on the most important place for my use
> case,
> >>> function
> >>> parameters:
> >>
> >> It didn't occur to me to enable that.
> >>
> >
> > It should work everywhere or not work at all.
>
> You can't have @pure attributes on function parameters, either. 
> Parameters don't work like regular declarations, never have, 
> and I don't know of a language where they do. They even have a 
> different grammar.

C# allows custom attributes on function parameters, including the 
return value. Actually, it allows custom meta-data everywhere. 
See a use case here 
http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx.
I believe Java does the same.


More information about the Digitalmars-d-announce mailing list