Re: $flags->as_arrayref directly



Torsten Schoenfeld <kaffeetisch gmx de> writes:

I don't know why the PROTOTYPE: line doesn't have the desired effect.

I guess it only sticks a prototype on the sub, without changing how the
generated code actually checks the args.  Does that sound right?  In
which case if as_arrayref is only ever used as a method then I guess a
prototype has no effect.

The one on bool() likewise I suppose.  Is that func meant to be used as
a method?  Maybe it could helpfully lose b and swap the same
as_arrayref.  For that matter the other methods could similarly lose or
default to false their "swap".  union() and intersect() in particular
seem likely candidates to call as methods, for those who might prefer a
name over the operators.

Index: GType.xs
===================================================================
--- GType.xs    (revision 1055)
+++ GType.xs    (working copy)
@@ -2764,7 +2764,6 @@
 =cut
 int
 bool (SV *a, b, swap)
-    PROTOTYPE: $;@
     CODE:
         RETVAL = !!gperl_convert_flags (
                      gperl_fundamental_type_from_package (
@@ -2781,7 +2780,6 @@
 =cut
 SV *
 as_arrayref (SV *a, ...)
-    PROTOTYPE: $;@
     CODE:
 {
        /* overload @{} calls here with the usual three args "a,b,swap", but


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