HaloO,

Daniel Ruoso wrote:
Em Ter, 2009-02-17 às 09:19 -0300, Daniel Ruoso escreveu:
multi infix:<+> (int where { 2 } $i, int where { 2 } $j) {...}

As masak++ and moritz++ pointed out, this should be written

multi infix:<+> (int $i where 2, int $j where 2) {...}

Hmm, both these forms strike me as odd because the where clause
should return a boolean and thus has to be written 'where { $_ == 2}'.
The form above is true unconditionally! That is, it's identical to
'where {True}' which sort of is one way of writing Any. How should
the generic where clause parser know to default to numeric equality?
Through smart matching? Is that the default for a where clause with
no operator?

BTW, what is the supposed difference between these two forms?
I would favour the first on the footing that the where clause
belongs to the type.


Regards, TSa.
--

"The unavoidable price of reliability is simplicity" -- C.A.R. Hoare
"Simplicity does not precede complexity, but follows it." -- A.J. Perlis
1 + 2 + 3 + 4 + ... = -1/12  -- Srinivasa Ramanujan

Reply via email to