Re: sub foo ($x) returns ref($x)

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: On Mon, Aug 01, 2005 at 03:16:50PM +0200, "TSa (Thomas Sandla�)" wrote: sub equitype ( ::a $x, a $y) { ... } That's not a bad idea at all. I rather like it. I'd just still like an explicit type-unifying parens around ::a, just so people won't say I try to m

Re: sub foo ($x) returns ref($x)

2005-08-01 Thread Autrijus Tang
On Mon, Aug 01, 2005 at 03:16:50PM +0200, "TSa (Thomas Sandla�)" wrote: >sub equitype ( ::a $x, a $y) { ... } That's not a bad idea at all. I rather like it. I'd just still like an explicit type-unifying parens around ::a, just so people won't say sub foo (::Int $x) { ... } and acciden

Re: sub foo ($x) returns ref($x)

2005-08-01 Thread TSa (Thomas Sandlaß)
HaloO, Autrijus Tang wrote: [..] For example, assuming argument types are unified in a single phase, the example below does nothing useful: sub equitype ((::a) $x, (::a) $y) { ... } It won't not help even if we replace the implicit "does" with "of": sub equitype ($x of (::a), $y of (:

sub foo ($x) returns ref($x)

2005-07-30 Thread Autrijus Tang
Suppose we have a function that takes an argument and returns something with the same type as that argument. One previous suggestion is this: sub identity ((::a) $x) returns ::a { return(...) } This is fine if both invariants in the "the meaning of 'returns'" thread are observed, since the i