Re: lazy gather?

2017-03-14 Thread Andreas Mueller

  or in one line in REPL:

  ((1,1,*+* ... *).rotor(2=>-1).map:{[/] $_}) ... (*-*).abs < 1e-10

  -am

On 14.03.17 12:37, Siavash wrote:
> 
> Note that you can also use a map:
> 
> my \approx= fib.rotor(2 => -1).map: { .[1] ÷ .[0] };
> 
> On 2017-03-14 09:00:34 GMT, Marc Chantreux wrote:
> > On Mon, Mar 13, 2017 at 08:33:05PM +0330, Siavash wrote:
> >> I may be wrong, but I think the code should be:
> >> my \golden= (1 + sqrt 5) ÷ 2;
> >> my \fib   = 1, 1, * + * ... ∞ ;
> >> my \approx= gather for fib.rotor(2 => -1) { take .[1] ÷ .[0] };
> >> my \distances = approx.map: (golden - *).abs;
> >> say distances[^1000];
> >
> > excellent! i updated my perl6 and tested this code and it works well!
> > thank you everyone.

-- 
Andreas Müller - Raum: 35/114b - Tel: 2875


Re: I need help with pattern matching

2017-03-13 Thread Andreas Mueller
 $ perl6 -e 'my $x="abc(123)def"; say $x ~~ m/(abc)(\(123\))(def)/;'

-am

On 13.03.17 00:27, ToddAndMargo wrote:
> Hi All,
> 
> What am I doing wrong here?
> 
> $ perl6 -e 'my $x="abc\(123\)def"; $x ~~ m/(abc\))(123)(\(def)/; say
> "$x\n\$0=<$0>  \$1=<$1>  \$2=<$2>\n";'
> 
> Use of Nil in string context
>   in block  at -e line 1
> Use of Nil in string context
>   in block  at -e line 1
> Use of Nil in string context
>   in block  at -e line 1
> 
> abc(123)def
> $0=<>  $1=<>  $2=<>
> 
> 
> Many thanks,
> -T
> 
> 
> -- 
> 
> Yesterday it worked.
> Today it is not working.
> Windows is like that.
> 

-- 
Andreas Müller - Raum: 35/114b - Tel: 2875


Re: Your thoughts on Padre?

2017-03-09 Thread Andreas Mueller

  how funny is that ??   
  =:-)   (please watch the clip)

  but I think we need an editor written in perl6 - not in Java
  ;)

  -am

On 08.03.17 23:29, ToddAndMargo wrote:
> Hi All,
> 
> The guys on the chat line told me to look at
> 
> https://atom.io/
> 
> as it is specifically written for Perl 6

-- 
Andreas Müller - Raum: 35/114b - Tel: 2875


Install Drive on Windows

2017-03-07 Thread Andreas Mueller
  Hi,

  why do I have to install rakudo on drive C:\ ?

  Greetings
  Andreas

-- 
Andreas Müller


Re: can Perl 6 bootstrap itself

2016-08-26 Thread Andreas Mueller

  on Windows i have to install git to download a Module

  maybe, one day there is a 'git' written in P6


  Andreas

On 25.08.16 17:56, Parrot Raiser wrote:
> It's going to be easier to demonstrate stand-alone Perl 6 on Windows
> than an *nix machine. If you remove Perl from them, the result will
> probably be a broken system.
>