Re: #50215 - g_param_spec_string_c is a very cryptic function name



Tim Janik <timj gtk org> writes:

> On 26 Mar 2001, Owen Taylor wrote:
> 
> > 
> > I see that g_param_spec_string_c has been renamed to g_param_spec_stringc.
> > 
> > I don't think this makes it much clearer ;-)
> > 
> > 
> > What the function appears to do is to create a string parameter spec
> > with a validation rule equivalent to that for C indentifiers.
> > 
> > But that has nothing to do with C strings are, and the single letter
> > 'c' is generally rather confusing without further context.
> > 
> > How about g_param_spec_identifier?
> 
> shouldn't it say that it's a C identifier? i.e. through
> g_param_spec_cidentifier() ?

I think g_signal_newc has filled the niche for "random additions of 
the letter c".

I think plain g_param_spec_identifier() is fine. It's not like we are
goign to have g_param_spec_fortranidentifier any time soon.

> btw, i don't feel strongly about having this function in glib at all,
> i don't know if it will be broadly used, the main reasons i added it were:
> 1) i had to have it anyways because BSE uses this type of string
>    for Object::name
> 2) it shows how to have an alternative param spec creation
>    function, needed because the common creator doesn't need that type
>    of versatility
> 3) it gives an idea of how fine grained validation should work

I certainly don't expect to be using it very often... You could always
just move it to the documentation if you want it there as an
example. ;-)

                                        Owen




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