> 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
- Re: RFC 109 (v1) Less line noise - let's ... Jonathan Scott Duff
- Re: RFC 109 (v1) Less line noise - le... John Porter
- Re: RFC 109 (v1) Less line noise - let's ... Jarkko Hietaniemi
- Re: RFC 109 (v1) Less line noise - let's get rid of @% Andy Wardley
- Re: RFC 109 (v1) Less line noise - let's get rid of @% John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid ... Ariel Scolnicov
- Re: RFC 109 (v1) Less line noise - let's get ... John Porter
- Re: RFC 109 (v1) Less line noise - let's ... Ariel Scolnicov
- Re: RFC 109 (v1) Less line noise - le... David Corbin
- Re: RFC 109 (v1) Less line noise... David Corbin
- Re: RFC 109 (v1) Less line noise - let's get rid of @% John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid of @% John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid ... John Barnette
- Re: RFC 109 (v1) Less line noise - let's get ... Jonathan Scott Duff
- Re: RFC 109 (v1) Less line noise - let's ... John Barnette
- Re: RFC 109 (v1) Less line noise - let's get ... John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid ... Russ Allbery
- Re: RFC 109 (v1) Less line noise - let's get rid of @% John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid ... Nathan Torkington
- Re: RFC 109 (v1) Less line noise - let's get ... John Porter
- Re: RFC 109 (v1) Less line noise - let's get rid of @% Steve Fink