Re: gtk_label_get_text() string duping



Darin Adler <darin@eazel.com> writes: 
> For the simplest code the "peek"-type calls are way handier, but they are
> poorer at encapsulation, which is why I prefer "get" to be the default and
> have the most straightforward name.
> 

Owen mentioned the same point earlier today, and I was already
thinking along these lines.

I do think it's unfortunate to expose to callers of a function whether
or not the string happens to already be stored somewhere. This is a
pretty strong argument for the always-return-a-copy behavior for _get_
IMO. Perhaps we should look at renaming the non-copying functions
_peek_ instead of renaming the copying functions _dup_.

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]