Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread Jonathan Lang
Luke Palmer wrote: > Of course, this was introduced for a reason: > > sub min($x,$y) { > $x <= $y ?? $x !! $y > } > sub min2($x, $y) { > if $x <= $y { return $x } > if $x > $y { return $y } > } > > In the presence of junctions, these two functions are not equ

Re: S3 vs. S4: parallel lists

2006-01-04 Thread Larry Wall
On Tue, Jan 03, 2006 at 11:58:38PM -0800, Jonathan Lang wrote: : I think there might be a discrepency between S3 and S4. You are correct--S4 was out of date. Thanks. Larry

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread TSa
HaloO, Luke Palmer wrote: But junctions are so "special", that this abstraction wouldn't work. Well my point is that I dought that it is tractible for the compiler to come up with the dwimmery to pull the invocation of .values on the return value out of toomany and leave the cardinality check

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread TSa
HaloO, Rob Kinyon wrote: I'm confused at the confusion. To me, junctions are just magical values, not magical scalars. In theory, one should be able to create junctions of arrays, hashes, or subs just as easily. my @junc = any( @a, @b, @c ); my %junc = any( %a, %b, %c ); Hmm, and this

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread Luke Palmer
On 1/4/06, Rob Kinyon <[EMAIL PROTECTED]> wrote: > Luke Palmer wrote: > > The point was that you should know when you're passing a named > > argument, always. Objects that behave specially when passed to a > > function prevent the ability to abstract uniformly using functions.[1] > > ... > > [1] T

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread Rob Kinyon
On 1/2/06, TSa <[EMAIL PROTECTED]> wrote: > HaloO, > > Luke Palmer wrote: > > The point was that you should know when you're passing a named > > argument, always. Objects that behave specially when passed to a > > function prevent the ability to abstract uniformly using functions.[1] > > ... > > [

Re: choice of signatures

2006-01-04 Thread Miroslav Silovic
[EMAIL PROTECTED] wrote: Jonathan Lang wrote: Instead of multi sub *infix:<~>(ArabicStr $s1, ArabicStr $s2) {...} multi sub *infix:<~>(Str $s1, ArabicStr $s2) {...} multi sub *infix:<~>(ArabicStr $s1, Str $s2) {...} as S13 say multi sub infix:<+> (Us $us, Them $them) is c

Re: choice of signatures

2006-01-04 Thread Fayland Lam
Jonathan Lang wrote: Instead of multi sub *infix:<~>(ArabicStr $s1, ArabicStr $s2) {...} multi sub *infix:<~>(Str $s1, ArabicStr $s2) {...} multi sub *infix:<~>(ArabicStr $s1, Str $s2) {...} as S13 say multi sub infix:<+> (Us $us, Them $them) is commutative { myadd($us,$them

Re: Junctions again (was Re: binding arguments)

2006-01-04 Thread TSa
HaloO, Luke Palmer wrote: Junctions are frightfully more abstract than that. They only take on meaning when you evaluate them in boolean context. Before that, they represent only a potential to become a boolean test. This is very well spoken err written---except that I would use beautifully

choice of signatures

2006-01-04 Thread Jonathan Lang
Instead of multi sub *infix:<~>(ArabicStr $s1, ArabicStr $s2) {...} multi sub *infix:<~>(Str $s1, ArabicStr $s2) {...} multi sub *infix:<~>(ArabicStr $s1, Str $s2) {...} could you say multi sub *infix:<~>(ArabicStr $s1, ArabicStr | Str $s2) | (Str $s1, ArabicStr $s2) {...} or so