Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Where did you read the word "need"?

If you want to use Perl's PADs as part of an argument against how symbol tables were implemented, then you probably should learn more about Perl's PADs first. Perl's PADs don't support looking things up by name so they'd really suck as an implementation of a symbol table. That's why that module has "walker" in its name. Plus PADs only support about half of the slot types of a typeglob.

The obvious two choices are 1) a hash by name where each value has N slots for N types of things; 2) N hashes. If you have a complete set of sigils, then the third obvious choice is 3) a hash by "$sigil.$name" (where the values are of various types) but that might not be the best choice in C (and we don't have a complete set of sigils).

The choice of typeglobs is more obvious in older features of Perl where "open FOO" then "write FOO" will use $FOO as the name of the file to open, *FOO as the handle to open, and FOO as the format to write. Even more slots of *ARGV are used together.

- tye        


In reply to Re^3: Why does Perl have typeglobs? (pads) 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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (2)
As of 2024-04-26 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found