This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 00/19] New completer API


On 08/07/2015 11:44 PM, Andrew Burgess wrote:
>> I don't like boolean return values in this case. Forget knowing what
>> happens under the covers (or now that you've read the proposed API).
>> Just by reading "bool add_completion (struct completer_data *, const
>> char *);" can you tell what the boolean return value means?
> 
> No. But you could rename to
> add_completion_then_should_more_completions_be_added (he jokes)
> (though maybe add_completion_and_continue would work?).  But
> I would have just assumed a good comment was enough.

I'll have to try and sneak something like that past Doug on some other
series. :-)

>> But now I wonder if I am missing something. Is defining an enum going to
>> choke some compiler? Does it violate, or is it ambiguous in, the
>> language? Or is it simply a matter of style?
> 
> My response was certainly _not_ on any technical grounds, simply a
> matter of style.  As a general rule when I see every use of a
> function be:
> 
>    function_call (args) == SAME_VALUE
> 
> I tend to think, can't we just push the comparison (effectively) up
> into the function_call.

That's a valid point. Thank you for reminding me of that. With large
patches like this (with multiple revisions), I can sometimes not see the
proverbial forest, or I forget it's even there.

> Anyway, it was just a passing thought based on a mild interest in this
> code, having recently touched it, I don't think it's a big issue.

I appreciate your comments. Keep 'em coming!

Keith


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]