in reply to a strong UNIVERSAL class

Multi-thread support should be built into UNIVERSAL, instead of being put into threads and threads::share. This would make it much easier for designers to design multi-theaded OO program in a more integrated way;.

Why?

I don't mean to sound facetious, but I don't see any gains in moving thread handling into UNIVERSAL. What behaviour would you like to see? What would be made easier?

As for moving tie to UNIVERSAL I don't understand how this could possibly work. There isn't a single "UNIVERSAL" tie interface - they are separate for scalars, hashes, etc.

Can you give some examples of what you would like to see?

Replies are listed 'Best First'.
Re: Re: a strong UNIVERSAL class
by theorbtwo (Prior) on Nov 24, 2002 at 21:31 UTC

    Mild correction, BTW. UNIVERSAL is the same for all class implementations; they're methods UNIVERSAL to all objects, and an object is just a blessed reference--to anything. There's also only one tie, but different TIE* methods.

    theorbtwo corrects his typos from tye to tie.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

      Fair point :-)

      What I was trying to say (badly) was that I didn't see how tie and UNIVERSAL would fit together.

      1. Not all objects are tied objects and need to support the tie methods - so it doesn't make sense for them to be UNIVERSAL
      2. Tied scalars, arrays, etc. are different and support different methods - so having them all inherit from the same class doesn't make a lot of sense either

      I guess you could argue for a virtual class Tied, with subclasses of Tied::Scalar, Tied::Hash, etc. but it's probably not worth the effort, and would annoy the people who don't think of tie in an OO way.