Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[perl #96872] CV * typemap entry should support overloading

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


perlbug-followup at perl

May 21, 2012, 11:07 PM

Post #1 of 3 (91 views)
Permalink
[perl #96872] CV * typemap entry should support overloading

On Fri Aug 12 10:16:55 2011, smueller [at] cpan wrote:
> On 08/12/2011 05:29 PM, perlbug @ plan9 . de wrote:
> > # New Ticket Created by perlbug [at] plan9
> > # Please include the string: [perl #96872]
> > # in the subject line of all future correspondence about this issue.
> > #<URL: https://rt.perl.org:443/rt3/Ticket/Display.html?id=96872>
>
> > lib/ExtUtils/typemap current defines CV * (T_CVREF) in terms of
> > scalar references to code:
> >
> > if (SvROK(xsub_tmp_sv)&& SvTYPE(SvRV(xsub_tmp_sv)) == SVt_PVCV){
> >
> > However, this does not correlate well with how perl defines "thing you
> > call like a function", for example overloaded objects.
>
> [...]
>
> > Basically, it's a straightforward application of sv_2cv, which should be
> > both future-proof and very compatible, i.e. it gives me a CV for about
> > anything that I can call in perl, and certainly for any RV-to-CV, so
is a
> > superset of what older typemaps do.
>
> For what it's worth, I can't see a problem with this, have used similar
> functions for the same purpose, and am all in favour of modifying the
> typemap accordingly.
>
> If nobody opposes, I'll modify the typemap. No promises that I won't
> forget, though.

Did you ever make this change? It seems to ring a bell.

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=96872


perlbug-followup at perl

May 22, 2012, 11:12 AM

Post #2 of 3 (86 views)
Permalink
[perl #96872] CV * typemap entry should support overloading [In reply to]

On Tue May 22 09:07:31 2012, smueller [at] cpan wrote:
> On 05/22/2012 08:56 AM, Eric Brine wrote:
> > On Tue, May 22, 2012 at 2:07 AM, Father Chrysostomos via RT
> > <perlbug-followup [at] perl <mailto:perlbug-followup [at] perl>>
> wrote:
> >
> > On Fri Aug 12 10:16:55 2011, smueller [at] cpan
> > <mailto:smueller [at] cpan> wrote:
> > > If nobody opposes, I'll modify the typemap. No promises that
> I won't
> > > forget, though.
> >
> > Did you ever make this change? It seems to ring a bell.
> >
> >
> > It wasn't committed to blead if so.
>
> Then I most certainly failed to follow through. Apologies to everyone
> involved. :(
>
> Running tests now, but I probably won't be able to commit anything
> before tomorrow.
>
> Would the following naive change work?
>
> STMT_START {
> HV *st;
> GV *gvp;
> SV * const xsub_tmp_sv = $arg;
> SvGETMAGIC(xsub_tmp_sv);
> $var = sv_2cv(xsub_tmp_sv, &st, &gvp, 0);
> if (!$var) {
> Perl_croak(aTHX_ \"%s: %s is not a CODE reference\",
> ${$ALIAS?\q[GvNAME(CvGV(cv))]:\qq[\"$pname\"]},
> \"$var\");
> }
> } STMT_END

I believe so. It would also allow globs, but that’s probably a good
thing, for consistency’s sake. In other words, it will be Just Like &{...}

--

Father Chrysostomos


---
via perlbug: queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=96872


perlbug-comment at perl

May 22, 2012, 2:06 PM

Post #3 of 3 (86 views)
Permalink
[perl #96872] CV * typemap entry should support overloading [In reply to]

Change applied as 8465c88d321256783d00b03482a840dab3ad16be. Sorry again
for dropping the ball on this before and thanks for the reminder.

Best regards,
Steffen

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.