named parameters to functions

Bill Baxter dnewsgroup at billbaxter.com
Thu Oct 11 17:07:24 PDT 2007


BCS wrote:
> Reply to Bill,
> 
>> BCS wrote:
>>
>>> It's have been proposed and favorably received. It's now on the list
>>> of things to do at some point in the not to distant future.
>>>
>> Favorably received by whom?  I recall lengthy discussions -- I started
>> one of them with a post remarkably like Zola's as one of my first
>> posts to the D newsgroup -- but I don't recall any favorable reception
>> except by other D users. 
> 
> Who else matters? As I recall Walter didn't say no.

Positive community feedback only matters if it's *overwhelmingly* 
positive community feedback.  Just my observation.  And Walter hasn't 
said no to a lot of things he doesn't have any intention of adding to D. 
  The only useful indicator that he likes an idea is if he says "yes".

>> And the fact that it didn't make it into
>> the WalterAndrei.pdf makes me think that if D gets it at all it will
>> be after all that stuff, so methinks it will be "distant future" at
>> best.
>>
> 
> I was thinking "somewhere between 6 months and D3.0"
> 
> 
>>> For now you can sort of fake it with struct literals.
>>>
>> Not really.  Struct literals
>> (http://www.digitalmars.com/d/1.0/struct.html#StructLiteral) don't
>> give you pick-and-choose initialization.
> [...]
>>
>> Static struct initializers, on the other hand, have the right look,
>> x={name:"fred", title:"director"}, but since they only work with
>> constants they're not much practical use either.
>>
> [...]
>> Were you thinking of something else?
> 
> <grumble/>
> I though that the {...} form would handle non const. Any Idea why it 
> doesn't?

No idea.  Not even C is that limited.  I'm pretty sure {..} struct 
initializers work for any initialization.  And with C99 you can do 
keyword initializations too (using the syntax 
x={.name="walter",.title="BDFL"} ).

--bb



More information about the Digitalmars-d mailing list