develooper Front page | perl.perl6.language | Postings from June 2010

Re: r31050 -[S03] refine hyper dwimminess to be more like APL, with modular semantics

Thread Previous | Thread Next
From:
Aaron Sherman
Date:
June 2, 2010 12:52
Subject:
Re: r31050 -[S03] refine hyper dwimminess to be more like APL, with modular semantics
Message ID:
AANLkTikiaUqKopRwQc0AB3LVc2JQDoMXap6DPdVx3Xps@mail.gmail.com
On Wed, Jun 2, 2010 at 12:51 PM, <pugs-commits@feather.perl6.nl> wrote:

> +
> +    (1,2,3,4) »+« (1,2)   # always error
> +    (1,2,3,4) «+» (1,2)   # 2,4,4,6     rhs dwims to ((1,2) xx *).batch(4)
> +    (1,2,3)   «+» (1,2)   # 2,4,4       rhs dwims to ((1,2) xx *).batch(3)
> +    (1,2,3,4) «+« (1,2)   # 2,4         lhs dwims to (1,2,3,4).batch(2)
> +    (1,2,3,4) »+» (1,2)   # 2,4,4,6     rhs dwims to ((1,2) xx *).batch(4)
> +    (1,2,3)   »+» (1,2)   # 2,4,4,6     rhs dwims to ((1,2) xx *).batch(3)
> +    (1,2,3)   »+» 1       # 2,4,4,6     rhs dwims to (1 xx *).batch(3)
>
>
Is there some automatic translation of these examples into tests? If not,
here's what they'd be:

ok(( (1,2,3,4) «+» (1,2) ) ~~ (2,4,4,6) )
ok(( (1,2,3)   «+» (1,2) ) ~~ (2,4,4)   )
ok(( (1,2,3,4) «+« (1,2) ) ~~ (2,4)     )
ok(( (1,2,3,4) »+» (1,2) ) ~~ (2,4,4,6) )
ok(( (1,2,3)   »+» (1,2) ) ~~ (2,4,4,6) )
ok(( (1,2,3)   »+»  1    ) ~~ (2,4,4,6) )

I tested these all with Rakudo, and they all currently fail, though I guess
that's not shocking.

-- 
Aaron Sherman
Email or GTalk: ajs@ajs.com
http://www.ajs.com/~ajs


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About