inline enum in function declaration

Lionello Lunesu lio at lunesu.remove.com
Mon Jun 12 22:52:10 PDT 2006


Andrei Khropov wrote:
> Deewiant wrote:
> 
>> Lionello Lunesu wrote:
>>> I'm cutting back on the use of "bool" as a function parameter, since the
>>> words "true" and "false" are rarely applicable to the respective
>>> parameter, for example:
>>>
>>> #void Invalidate( bool redraw );
>>>
>>> This declaration seems ok, but when reading the code:
>>>
>>> #Invalidate(true);
>>>
>>> you have no idea what that "true" is referring to. I guess everybody
>>> knows what I'm talking about with "cutting back on the bool".
>>>
>>> Obviously "enum" is the right replacement:
>> I'd prefer just being able to pass the names of function parameters when
>> calling:
> Yeah, I like the idea too. It's possible in Python.

Python needs it also for being able to pass the parameters of a function 
in a different order.

Anyway, the two proposals are compatible and complementary, so they 
should be discussed in separate threads, I suppose :)

L.



More information about the Digitalmars-d mailing list