Dan Sugalski <[EMAIL PROTECTED]> writes: > >I've been considering adding all the 'basic' operations (simple math, >repetition, maybe comparisons) into the base vtable. That'd mean that, >while the core perl might have *no* idea what to do with: > > @foo = @bar * 12; > >the slots would be there in case the clever PDL folks want to define it. I like it. The problem is (as with overloading) is deciding which operand's vtable gets to do the op and "who" is responsible for upgrading the "lesser" operand. >Or any clever folks, I suppose. I have no idea what multiplication in list >(or would it be array? Probably actually array context, though we don't >have that at the moment) context does, but someone else might. It is pretty obvious what above should do: @foo = (); foreach my $elem (@bar) { push(@foo,$elem * 12); } -- Nick Ing-Simmons <[EMAIL PROTECTED]> Via, but not speaking for: Texas Instruments Ltd.
- Re: vtables (was Re: Ramblings on "base class"... Hildo Biersma
- Re: vtables (was Re: Ramblings on "base class"... Dan Sugalski
- Re: Ramblings on "base class" for SV etc. Chaim Frenkel
- Re: Ramblings on "base class" for SV etc. Nick Ing-Simmons
- Re: Ramblings on "base class" for SV etc. Chaim Frenkel
- Re: Ramblings on "base class" for SV etc. Dan Sugalski
- Re: Ramblings on "base class" for SV etc. Chaim Frenkel
- Re: Ramblings on "base class" for SV etc. Ken Fox
- Re: Ramblings on "base class" for SV etc. Dan Sugalski
- Re: Ramblings on "base class" for SV etc. Bryan C . Warnock
- Re: Ramblings on "base class" for SV etc. Nick Ing-Simmons
- Re: Ramblings on "base class" for SV etc. Bart Lateur
- Hooks for array notation (was Re: Ramblings on "bas... Jeremy Howard
- Re: Hooks for array notation (was Re: Ramblings on "... Dan Sugalski
- Re: Hooks for array notation (was Re: Ramblings on "... Bart Lateur
- Re: Hooks for array notation (was Re: Ramblings on "... Dan Sugalski
- Re: Hooks for array notation (was Re: Ramblings on "... Bart Lateur
- Re: Hooks for array notation (was Re: Ramblings on "... Bart Lateur
- Re: Hooks for array notation (was Re: Ramblings on "... Dan Sugalski
- Re: PDL-P: Re: Hooks for array notation (was Re: Ramblin... Karl Glazebrook
- Re: PDL-P: Re: Hooks for array notation (was Re: Ramblin... Dan Sugalski