Private default arguments?

Maxim Fomin maxim at maxim-fomin.ru
Fri Dec 28 10:00:49 PST 2012


On Friday, 28 December 2012 at 15:42:03 UTC, bearophile wrote:
> Maxim Fomin:
>
>> What happens when function with private argument is stored in 
>> a function pointer?
>
> You have to supply all arguments. I've written this in the 
> detailed proposal:
> http://d.puremagic.com/issues/show_bug.cgi?id=9229
>
>
>> I don't like a name for this feature because it breaks logic 
>> that private is accessible within module. Perhaps a new name?
>
> I understand. I think proposing a new keyword, or a @keyword, 
> in infeasible, because all this stuff not important enough :-(
>
>
>> I think your private argument constraint can be as easily 
>> broken:
>
> I am not concerned by ways to force the usage of those private 
> arguments (like taking the address and using it to call the 
> function). It's like the yellow-black plastic strips you see 
> around. They are there to tell you to not go forward, for a 
> real danger or a legal danger, but they don't actually stop you.
>
> Thank you,
> bye,
> bearophile

I see. Another ideas how to use it:

void radixSort3(uint[] items, private in uint shiftBits=24) // 
original
void radixSort3(uint[] items, uint shiftBits is 24)
void radixSort3(uint[] items, uint shiftBits=24 const)
void radixSort3(uint[] items, static uint shiftBits=24)


More information about the Digitalmars-d mailing list