Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: And since the when modifier counts as a conditional, you can rewrite grep Dog, @mammals as $_ when Dog for @mammals; So perhaps will see a lot of subtypes used this way: subset Odd if Int where { $_ % 2 }; @evens = ($_ * 2 when

Re: Meditations on a Loop

2009-05-22 Thread Jon Lang
On Thu, May 21, 2009 at 11:25 PM, John M. Dlugosz 2nb81l...@sneakemail.com wrote: Larry Wall larry-at-wall.org |Perl 6| wrote: And since the when modifier counts as a conditional, you can rewrite    grep Dog, @mammals as    $_ when Dog for @mammals; So perhaps will see a lot of subtypes

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
Em Sex, 2009-05-22 às 01:25 -0500, John M. Dlugosz escreveu: @primes = do $_ if prime($_) for 1..100; becomes @primes = $_ when prime($_) for 1..100; you gained one stroke, it's certainly better... I think it's time to play golf with Perl 6 already ;) jokes aside, $_ when prime($_)

Re: Meditations on a Loop

2009-05-22 Thread Jonathan Worthington
Daniel Ruoso wrote: Em Sex, 2009-05-22 às 01:25 -0500, John M. Dlugosz escreveu: @primes = do $_ if prime($_) for 1..100; becomes @primes = $_ when prime($_) for 1..100; you gained one stroke, it's certainly better... I think it's time to play golf with Perl 6 already ;)

Re: Meditations on a Loop

2009-05-22 Thread Timothy S. Nelson
On Fri, 22 May 2009, Jonathan Worthington wrote: Daniel Ruoso wrote: Em Sex, 2009-05-22 às 01:25 -0500, John M. Dlugosz escreveu: @primes = do $_ if prime($_) for 1..100; becomes @primes = $_ when prime($_) for 1..100; you gained one stroke, it's certainly better... I think it's

Re: Meditations on a Loop

2009-05-22 Thread Jon Lang
On Fri, May 22, 2009 at 5:34 AM, Timothy S. Nelson wayl...@wayland.id.au wrote: On Fri, 22 May 2009, Jonathan Worthington wrote: Daniel Ruoso wrote: Em Sex, 2009-05-22 às 01:25 -0500, John M. Dlugosz escreveu:   �...@primes = do $_ if prime($_) for 1..100; becomes   �...@primes = $_ when

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Patrick R. Michaud pmichaud-at-pobox.com |Perl 6| wrote: The page currently says: The reason this [.prime] works is because the method-call syntax will call an ordinary non-member sub also. I think this is no longer the case (and hasn't been for some time). Pm Wow, that's news

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
Em Qui, 2009-05-21 às 20:21 -0500, John M. Dlugosz escreveu: but it was crudly inserted, so just before it the text still reads, The dot form and the indirect object form DEFAULT to method calls. All other prefix calls DEFAULT to subroutine calls. (emphasis mine), That's because dot is an

r26912 - docs/Perl6/Spec

2009-05-22 Thread pugs-commits
Author: jnthn Date: 2009-05-22 23:59:49 +0200 (Fri, 22 May 2009) New Revision: 26912 Modified: docs/Perl6/Spec/S12-objects.pod Log: [spec] We now always require the candidate to be passed to bless, otherwise there's potential for confusion with the first auto-vivifying type object. Modified:

r26914 - docs/Perl6/Spec

2009-05-22 Thread pugs-commits
Author: jnthn Date: 2009-05-23 00:34:34 +0200 (Sat, 23 May 2009) New Revision: 26914 Modified: docs/Perl6/Spec/S12-objects.pod Log: [spec] Oops, forgot to save before commit. Modified: docs/Perl6/Spec/S12-objects.pod === ---

Array variables as formal parameters ???

2009-05-22 Thread John M. Dlugosz
Please take a look at http://www.dlugosz.com/Perl6/web/passing_examples.html. I started working through how the detailed behavior of the Capture and passing rules need to work, and I ran into something that startled me. There's no examples in S06 of formal parameters, other than the special

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Daniel Ruoso wrote: Em Qui, 2009-05-21 às 20:21 -0500, John M. Dlugosz escreveu: but it was crudly inserted, so just before it the text still reads, The dot form and the indirect object form DEFAULT to method calls. All other prefix calls DEFAULT to subroutine calls. (emphasis mine),

Re: Meditations on a Loop

2009-05-22 Thread Daniel Ruoso
Em Sex, 2009-05-22 às 18:27 -0500, John M. Dlugosz escreveu: Daniel Ruoso wrote: That's because dot is an operator as well and might be subject to be overriden... but don't tell anyone that... You mean by installing a different dispatcher for the object? By hooking the grammar at a lower

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Daniel Ruoso daniel-at-ruoso.com |Perl 6| wrote: Em Sex, 2009-05-22 às 18:27 -0500, John M. Dlugosz escreveu: Daniel Ruoso wrote: That's because dot is an operator as well and might be subject to be overriden... but don't tell anyone that... You mean by installing a different

Re: Meditations on a Loop

2009-05-22 Thread Sartak
On Fri, May 22, 2009 at 7:52 PM, John M. Dlugosz 2nb81l...@sneakemail.com wrote: That sounds like a circular reference problem.  If the dot is a simple multi sub and is expected to dispatch based on type (different types may have different dispatchers), what type are you keying off of to pick

Re: Meditations on a Loop

2009-05-22 Thread John M. Dlugosz
Sartak sartak-at-gmail.com |Perl 6| wrote: On Fri, May 22, 2009 at 7:52 PM, John M. Dlugosz 2nb81l...@sneakemail.com wrote: That sounds like a circular reference problem. If the dot is a simple multi sub and is expected to dispatch based on type (different types may have different