Feature request: function prototypes

Robert Fraser fraserofthenight at gmail.com
Fri Feb 8 10:58:14 PST 2008


Jarrett Billingsley wrote:
> "Robert Fraser" <fraserofthenight at gmail.com> wrote in message 
> news:fohlg3$acr$1 at digitalmars.com...
>> This may seem like a pretty stupid request, but since I use a lot of 
>> version() statements in my code; it'd be really cool to have something 
>> like function signatures at the top of my file. When I declare my 
>> versioned functions, I'd love to be able to have them checked against 
>> prototypes declared above their use, as a first line of defense (so I 
>> don't need to r-test it on different OSes and libraries if I make an 
>> obvious change to one of the signatures or something).
> 
> Would it be possible to put the version statement inside the function 
> bodies?  Yes, it's somewhat more typing, but it means you only have to 
> actually declare each function once (and write ddoc for them once, as a 
> bonus). 

That's what I'm mostly doing now, but I'd rather be able to group stuff 
together (i.e. "here's the Tango functions, here's the Phobos ones), and 
Ddoc the stuff up with the prototypes at the top. But maybe it's not a 
big enough deal to justify a language change.



More information about the Digitalmars-d mailing list