Re: GParamSpec further funcs



Kevin Ryde wrote:

If the test suite still passes after these changes, we have a winner.

Plus a couple more tests for object, boxed, etc which now get the
generic method.  The "param" one tickles the NULL problem too, per other
message.

Thanks for the patch.  Some points:

+=for apidoc
+This is the C level C<value_set_default> method of GParamSpecClass.
+If C<$pspec> doesn't have a C<default_value> field the return is
+C<undef> (for example object or scalar).
+
+See also L<Glib::Param::Unichar> which has its own version of this method.
+=cut

I'm not sure the first sentence is useful to a Perl programmer.  Also, with
the custom get_default_value xsubs gone from the subclasses, there will be no
entry for it in their POD pages anymore.  It might be good to rectify this
with a POD paragraph in every subclass:

  =for apidoc get_default_value
  =for signature value = $pspec->get_default_value
  =cut

-gboolean
-get_default_value (GParamSpec * pspec_boolean)
-    CODE:
-       RETVAL = G_PARAM_SPEC_BOOLEAN (pspec_boolean)->default_value;
-    OUTPUT:
-       RETVAL

As you note in your ChangeLog entry (thanks for writing it!), this change is
not quite backwards compatible.  gperl_sv_from_value is really not handling
booleans correctly: it's treating them as integers with newSViv whereas it
should use boolSV, in my opinion.  boolSV is what the gboolean typemap ends up
using.  But it's too late to change gperl_sv_from_value.

So I think the old get_default_value for booleans should stay, for backwards
compatibility and because it's actually more correct.

muppet?

Also, your patch mixes spaces and tabs for indention.

Ah, that'll be a combination of cut and paste and me having
`indent-tabs' off normally.  I've yet to find an emacs setup that works
decently for xs.  I tend to use cc-mode with some settings, and then get
annoyed when it indents wrong, and then switch to text-mode or pod-mode
for the doc bits :-(

I have the same problems.  Newer emacsen automatically use ld-script-mode for
*.xs files which is not that bad for indention but which lacks syntax
highlighting completely.  There's an xs-mode.el on the emacs wiki[1], but I
haven't really tried it yet.

[1] <http://www.emacswiki.org/cgi-bin/emacs/xs-mode.el> linked to by
<http://www.emacswiki.org/cgi-bin/wiki/PerlLanguage>.

-- 
Bye,
-Torsten



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