Well, Perl has one simple and two composite data types, but the composite data types are indeed data types in their own right, the way classes are data types in Java.

Again, as I said in conclusion — Perl is certainly a less than ordinary example of a strongly typed language. But by the letter of the definition, that is what it is. :-) Funny thought, I know.

As for your ramblings, I'd stipulate that what you really want to look into is Perl6's object system with its traits model. Extensive contextual polymorphy like what you describe sounds more dangerous than advisable to me. I like contextuality in Perl5, I'm not sure it is really necessary, and I sometimes wonder if we couldn't have done just as well without it. As well, overloading mechanisms are considered easily abusable for a reason. I used to be a huge fan; nowadays, I'm not so sure. Just to confirm my worries, I've only recently had some run-ins with overloading (in Class::DBI) that reminded me very pointedly that it's a mixed blessing at best. I do believe that a language should provide such deep hooks; but they're not really for use in application programming.

Makeshifts last the longest.


In reply to Re^16: use fields; # damnit by Aristotle
in thread use fields; # damnit by nothingmuch

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, details, 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, summary, 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.