develooper Front page | perl.perl5.porters | Postings from August 2012

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
David Golden
August 25, 2012 18:01
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
On Sat, Aug 25, 2012 at 8:20 PM, Ricardo Signes

> The other non-reference scalar type is vstring, but I think we're just fine
> with using string equality there.  Open to rebuttal!

You mean pure v-strings, not version objects?  String equality should be
fine.  I suspect the main reason the extra v-string information is attached
in magic is so that can handle alphas correctly should the
v-string ever get used to initialize a version object.

$ perl -MDevel::Peek -wE '$v=v1.2_3; Dump $v'
SV = PVMG(0x17653c0) at 0x1760738
  REFCNT = 1
  IV = 0
  NV = 0
  PV = 0x1750ca0 "\1\27"\0
  CUR = 2
  LEN = 16
  MAGIC = 0x175a560
    MG_VIRTUAL = &PL_vtbl_vstring
    MG_TYPE = PERL_MAGIC_vstring(V)
    MG_LEN = 6
    MG_PTR = 0x1762460 "v1.2_3"

*David Golden* <>
*Take back your inbox!* →
Twitter/IRC: @xdg

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About