On Tue, Feb 15, 2005 at 04:20:28PM -0600, Rod Adams wrote: : chromatic wrote: : : >>So I'm interested in hearing what pushes Arrays and Hashes over the edge : >>for needing their own container and sigil, whereas Junctions/Sets do not. : >> : >> : > : >Perl isn't a "pure" object-oriented language. : > : > : Rephrasing my question: : : What characteristics would _any_ new structure or class have to have to : merit becoming a first class container with it's own sigil, rather than : being just another class?
It would have to be very much basic to the way we classify nouns in our heads. So I think that sort of thing should be added about as often as a natural language adds a new case or number marker, which is not very. To be sure, English is not a great example of clarity here. English junctions cause a great deal of confusion on the subject of singular and plural verbs: If any of you are coming to the store... If any of you is coming to the store... : Or is Perl close enough to "pure" object-oriented these days, where only : grandfathered classes make the cut? Well, the reason we grandfather the grandfathers is that we wouldn't be here without them. There's a precedence to things such that descendents don't happen without ancestors. The very fact that something is historical means that it has generally had more influence than anything derived from it. By that argument, Perl programmers have spent a great deal more time thinking about plural values as arrays than as junctions or sets or objects. That's not the only way to think--and I've certainly realized that in studying Japanese, wherein there is no grammatical singular/plural distinction--but it's how a lot of English speakers think, and a lot of existing Perl programmers too. But as far as English is concerned, sets are just objects that have a singular outside and a (potentially) plural inside, much like almost any other object. At least, that's how concrete sets work. The problem is that as soon as you start throwing junctionals around, you're now talking about abstract set definitions with all sorts of interesting entanglements inside. That's the basic problem with 0 < $x < 10 after all--the problem with rewriting that as 0 < $x and $x < 10 is that it should only work as long as the two values of $x remain entangled so that the always refer to the same abstract value. : As a separate question, is there a relatively easy way to create a : user-defined class with it's own sigil? (w/o having to modify half the : parse rules). Certainly, just say macro term:<¢> ($name) is parsed(m:p/<Perl::name>/) {...} or some such. (Making it interpolate would be a little more work.) Larry