At 11:13 PM 8/9/00 +0200, Bart Lateur wrote:
>On Wed, 09 Aug 2000 12:46:32 -0400, Dan Sugalski wrote:
>
> >> > @foo = @bar * @baz;
>
> >Given that the default action of the multiply routine for an array in
> >non-scalar context would be to die, allowing user-overrides of the
> >functions would probably be a good idea... :)
>
>[Is this still -internals? Or should we stop CC'ing?]
Nope, and we should stop.
>One problem: overloading requires objects, or at least one. Objects are
>(currently) scalars. You can't make an array into an object.
s/object\./object right now./;
If the current plan goes through, arrays and hashes will be typeable, and
therefore overloadable. (Think of it as a lightweight object--no method
calls, just overloading)
>but a problem is:
>
> @copy = @ary;
>
>which only copies the items by value, as a list, and thus ignores the
>blessing. @copy is a plain array.
Well...
What happens depends on the type of @copy, and what we decide to do with
whole-container assignments. It's reasonable to make @copy the same type as
@ary. And if @copy's not a generic scalar array (and is, instead, an
integer array, say) some sort of conversion might take place.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk