On Fri, 3 Apr 2009, Moritz Lenz wrote:
Xiao Yafeng wrote:
1. Could I set multi-return type?like
sub test as (Int, Str) {...}
"as" is coercion - so to what would it coerce? Int or Str? How could the
compiler know? Or do you mean something like a tuple?
I thin
Moritz Lenz wrote:
>> 2. set is unordered collection of values, subset is new type. People are
>> apt to confuse the two concepts.
>
> Note that people never write "subset" in their code, the write things like
> sub f($x where { ... } ) and the "where" constructs the subset type. I
> don' thi
Xiao Yafeng wrote:
> 1. Could I set multi-return type?like
> sub test as (Int, Str) {...}
"as" is coercion - so to what would it coerce? Int or Str? How could the
compiler know? Or do you mean something like a tuple?
> 2. set is unordered collection of values, subset is n
Dave Whipp wrote:
I'm thinking that the solution to this issue may be a little more
radical than to-date: don't permit junctions to be stored in $
variables! Instead, require junctions to use a twiggle, to alert the
reader that the surprises may be lurking.
my $x = 1|2; #error
my $|x = 1|2; #
1. Could I set multi-return type?like
sub test as (Int, Str) {...}
my (Int, Str) sub test {...}
or my (Int|Num, Str) sub test{...}
2. set is unordered collection of values, subset is new type. People are
apt to confuse th