Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

> Where did you read the word "need"?

Implicitly. It's an interpretation of how you replied.

Perhaps you should read to the end?

What's an obvious way to implement that?

"An obvious way" is very much not "the only way".

But I don't see why changing the first AV with the "sigiled" keys to a HV with indexes to the value AVs shouldt be a problem in C.

Because, as I noted, we don't have sigils for every type of slot in a typeglob. The "in C" part was about there being different value types. To have a value type that could be any of the 6 or so typeglob slot types would be at least complex. It would be complex enough that I would have qualms about that choice.

It turns out that a Perl 5 SV can already be any of those types. But SVs didn't even exist in Perl 4 so they couldn't be how typeglobs were implemented (in Perl 1.0).

The polymorphic SVs are indeed quite complex. The "normal" SV types have much better motivation for how they were done, to my mind, because an SV can transition between those different flavors. Stuffing formats and "IO"s into the polymorphic SV family of structs makes much less sense to me. I couldn't find any part of the Perl source code where this fact was actually useful (I didn't spend that long trying, though) and yet it adds significant complexity, IMHO.

Searching for "PVFM" in the Perl source code mostly finds places where such are not supported.

I'm glad Larry didn't start off trying to implement fully polymorphic SVs in Perl 1.

- tye        


In reply to Re^5: Why does Perl have typeglobs? (C, HV) by tye
in thread Why does Perl have typeglobs? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (6)
    As of 2019-12-12 13:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found

      Notices?