Damian Conway wrote:
> 
> The LIST/SCALAR/VOID distinction is always the second value returned
> (see the examples in the RFC). So your dispatcher is:
> 
>         my $func = lc (want)[1] . "_func";
>         return &$func(@_);

I think I'd much rather it be the first. This seems to jive much more
closely with what I'd expect:

   $want = want;       # What do I want?

Plus, in one email I suggested this

   if (want(want(want))) { }

To backtrace context, but you said that this was impossible because

   want want;

Should always return true. I don't see how this could be unless you had
the first arg returned be the context:

   $want = want;    # HASH
   want $want;      # want 'HASH'

If you wanted to be efficient, you still can be:

   if ( my $ret_num = want 'LIST' ) 

There's nothing claiming that when called with an argument the return
list has to be the same as when not called with one. In fact, it seems
to make the most sense to do something like this:

   ($num_wanted, @other_args) = want 'LIST';    # one-arg form
   ($context, $num_wanted, @args) = want;       # no-arg form

I was trying to dig through the email archives for this discussion, but
they don't appear to exist...


>    > Since RFC 21 is still on v1, my question is: Which is it?
> 
> The one you I<don't> like (as usual ;-)

Aaaaaaaarrrrrrrrgh! :-{
 
>    > if in a scalar context want() returned a polymorphic object:
> 
> Retro me, Satanas!!!

;-)

-Nate

Reply via email to