Things that make writing a clean binding system more difficult

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Aug 5 01:40:04 PDT 2016


On Friday, 5 August 2016 at 08:15:37 UTC, Ethan Watson wrote:
> So that's technically a bug. But. Before I go running off to 
> the Bugzilla Walter made. Should a user declaring and then 
> later defining a function be forced to 100% replicate that 
> function definition before defining it? If yes, then the 
> compiler needs to error. If no, then there'll need to be some 
> rules made up for it because I can already see how that will be 
> open to abuse.

i think that actual declaration should match in signature *only*; 
linkage and UDAs should be taken from prototype declaration. some 
rationale: this feature is useful mostly for binding generators 
(the only times i've seen it requested were for binding 
generators! ;-), so let's make programmer's lives easier here. 
checking for actual arg and return types is ok (as D doesn't have 
`()` syntax for "any args", we can't do "wildcard matching"), but 
there is absolutely no need to repeat other information.

let's hope that other people will agree, or the feature will stay 
barely useful, as it is now. ;-)


More information about the Digitalmars-d mailing list