some questions about S02(type)

2009-04-03 Thread Xiao Yafeng
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

Re: junctions and conditionals

2009-04-03 Thread Miroslav Silovic
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;

Re: some questions about S02(type)

2009-04-03 Thread Moritz Lenz
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 new

Re: some questions about S02(type)

2009-04-03 Thread Moritz Lenz
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' think that's

Re: some questions about S02(type)

2009-04-03 Thread Timothy S. Nelson
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 think