> And what will aSub decide is it's context?
>
> @foo = (1, 2, 3, aSub)
>
> If I have to write scalar(aSub) then I see no point in this RFC.
>
> And why shouldn't the caller decide? What is the gain in having perl
> do the dirty work.
I agree. I don't see any reason to have to define 2 subs:
@ sub mysub {
# whole bunch of stuff happens
return @array;
}
$ sub mysub {
# same stuff that happens above happens here too
return $scalar;
}
Instead of just one:
sub mysub {
# whole bunch of stuff happens
if ( want 'ARRAY' ) {
return @array;
} else {
return $scalar;
}
}
This doesn't make any sense to me, I don't see any win here. Not being
mean, just being honest.
-Nate
- RFC 98 (v1) context-based method overloading Perl6 RFC Librarian
- Re: RFC 98 (v1) context-based method overloading Ask Bjoern Hansen
- Re: RFC 98 (v1) context-based method overload... Chaim Frenkel
- Re: RFC 98 (v1) context-based method over... Nathan Wiger
- Re: RFC 98 (v1) context-based method ... David L. Nicol
- Re: RFC 98 (v1) context-based me... Nathan Wiger
- Re: RFC 98 (v1) context-based me... Graham Barr
- Re: RFC 98 (v1) context-based me... Nick Ing-Simmons
- Re: RFC 98 (v1) context-based method overloading Hildo Biersma
- Re: RFC 98 (v1) context-based method overload... David L. Nicol
- Re: RFC 98 (v1) context-based method overloading Ken Fox
- Re: RFC 98 (v1) context-based method overloading John Porter
