Re: for by 3?

2019-11-23 Thread Raymond Dresens
Hello, This seems possible: > my @x = (1, 2, 3, 4, 8, 16, 32, 64, 128); [1 2 3 4 8 16 32 64 128] Then: > for @x -> $x, $y, $z { $x.say } 1 4 32 And: > for @x -> $x, Any, Any { $x.say } 1 4 32 ...assigning to 'Any' seems to 'just work'. Assigning to 'Ni

Re: need windows loop help

2019-11-22 Thread Raymond Dresens
Hello, What is the function of the 'lines' method call (in @Result.lines.kv) in your for loop? If you remove it, does it 'just do what you want'? I ask this because of the following interaction on the REPL: > my @x = (1, 2, 3, 4, 5, 6, 7, 8); [1 2 3 4 5 6 7 8] > @x.kv (0 1 1 2 2 3 3 4 4 5 5 6

Re: Question about "colon syntax" for calling other methods on 'self' inside a method

2019-11-18 Thread Raymond Dresens
thout the dollar sign. Right now you're calling .print on the > anonymous variable '$' > > -y > > > On Mon, Nov 18, 2019 at 8:38 AM yary wrote: > >> looks like a bug to me-file an issue on the rakudo GitHub >> >> On Sat, Nov 16, 2019 at 5:29 AM Ray

Question about "colon syntax" for calling other methods on 'self' inside a method

2019-11-16 Thread Raymond Dresens
Hello, I have a question related to the 'colon syntax' of Raku, which allows you to call methods without parenthesis like this: class Foo { method print($x, $y) { say "bar: {$x}, {$y}" } } my $a = Foo.new; $a.print: 3, 5; # ...this is what

Re: perl6-regex: retaining $/.pos after an unsuccesful match without a temporary variable?

2019-08-20 Thread Raymond Dresens
Hello everyone, and thanks everyone for their comments and code snippets with full of syntax that I haven't discovered as of yet, Today I managed to figure out how my provided example code could be rewritten in Perl 6 almost 'verbatim': see the program below in this message. I implemented a '~~~'

Re: perl6-regex: retaining $/.pos after an unsuccesful match without a temporary variable?

2019-08-18 Thread Raymond Dresens
t; You could get the same structure out of a single regex as well. > > $test ~~ m { > ^ > $ = \s+ > $ = [foo \s+] > [ > | $ = willnotmatch > | $ = bar > ] > } > > I'm not sure if you want to i

perl6-regex: retaining $/.pos after an unsuccesful match without a temporary variable?

2019-08-18 Thread Raymond Dresens
t;$P = $/.pos;" assignments. Is there a way to retain this match like in Perl 5? Is there a better way in general? ... perhaps it's time to look into grammars? ;) Thanks! Regards, Raymond Dresens.

Basic question about lexical binding in relationship with "list assignment"

2018-12-27 Thread Raymond Dresens
piler perspective?). Perhaps this shouldn't be and the compiler should also complain in this list assignment case, or perhaps generate a warning? I'm not that confident to state that this is a bug ;) Hence the reason why I kind-of report this, I hope this is somewhat useful, Thanks for your time, Regards, Raymond Dresens.