>    print @{ $cars->{$model} };
>    print "Welcome back, $fullname, to $website!\n";

O.k., I'm convinced.


> Only $scalars can hold objects. Now, @arrays and %hashes can
> hold groups of objects, but only $scalars can hold objects.

That's not quite correct.  @array or %hash can "hold" an object, via tie.


> The real problem is that we lack true object polymorphism. That is,
> objects are useless in number and string contexts. This is the problem
> that needs to be addressed.

You mean overloading needs to be fixed and finished?


> However, if you have object polymorphism, then you don't have this
> problem. Objects are automatically converted to numbers and strings
> on-demand.

Why should strings and numbers be so special?  Shouldn't I want my
object converted to an array or a hash on demand?  And if it's context
that drives the conversion, then the following should all be equally
reasonable:

        $s = "$obj";  # convert to string
        $n = $obj+0;  # convert to number
        $x = $obj[1]; # convert to array
        $x = $obj{y}; # convert to hash


-- 
John Porter

Reply via email to