Ingo Blechschmidt skribis 2005-09-21 17:24 (+0200):
>     multi prefix:<\> (Item $item) {...}
>     multi prefix:<\> (@array)     {...}
>     multi prefix:<\> (%hash)      {...}

I keep forgetting. What's the rule for determining that the (Item $item)
is used, rather than (@array), when one uses \$aref? It'd be bad if
$aref dereferenced first :)

Is "Item" really a type? Isn't the type actually Scalar? (I thought one
of the reasons to use "item context" instead of "scalar context" was
that "Scalar" and "scalar" looked too much alike -- having both "item"
and "Item" would reintroduce this problem.)

>     # (The necessary magic needed for dealing with the proposed
>     # [EMAIL PROTECTED], which would be equivalent to map { \$_ } @array,
>     # is not included here.)

Also, the magic for handling multiple arguments is missing.

What's the syntax for accepting a variable number of arguments, each of
which can be anything, regardless of context? How do you find out what
you got (array or scalar)?

Does it even make sense to implement \ in Perl? Does it make sense to
try and figure out a Perl signature for it?

> Because the comma operator supplies list context, (@a, @b) flattens
> @a and @b, so it's like @a.concat(@b).

Ah, comma supplies list context regardless of the context the comma is
in? Is this current, or part of your proposal? I thought comma would
propagate context.

> BTW, &list ::= &infix:<,>:

This clarifies much. Thanks.


Reply via email to