run line question

2019-11-23 Thread ToddAndMargo via perl6-users
Hi All, When folks write programs that read the run line like /a abc /r xyz or /r xyz /a aaabc or dd bs=4096 if=xxx.iso of=/dev/sdc basically, in any order. How do they keep track of what goes where? Many thanks, -T

Re: which windows am I in?

2019-11-23 Thread ToddAndMargo via perl6-users
On 2019-11-22 23:41, ToddAndMargo via perl6-users wrote: > Hi All, > > In Perl6 for Windows, how do I tell if I am > in Windows 7 or 10? > > Many thanks, > -T What I have so far: Windows 6. I am not even going to ask... Windows version:

Re: for by 3?

2019-11-23 Thread ToddAndMargo via perl6-users
On 2019-11-23 04:19, Elizabeth Mattijsen wrote: for lines.rotor(3) -> ($,$,$third) { dd $third } $ p6 ' my @x=; for @x.rotor(3) -> ($,$,$third) { dd $third };' "c" "F" "j"

Re: for by 3?

2019-11-23 Thread ToddAndMargo via perl6-users
On Sat, 23 Nov 2019 at 07:00, ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: Hi All, In a "for" loop, what is the syntax for "by 3"? for @x.lines by 3 In other words, every third line. Many thanks, -T On 2019-11-23 03:30, Raymond Dresens wr

Re: for by 3?

2019-11-23 Thread ToddAndMargo via perl6-users
On 2019-11-23 04:19, Elizabeth Mattijsen wrote: for lines.rotor(3) -> ($,$,$third) { dd $third } Thank you!

Re: which windows am I in?

2019-11-23 Thread Brad Gilbert
Windows before Windows 10 had different internal and external numbers. https://www.gaijin.at/en/infos/windows-version-numbers On Sat, Nov 23, 2019, 2:03 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2019-11-22 23:41, ToddAndMargo via perl6-users wrote: > > Hi All, > > > > I

Re: comment: Perl6 vs batch

2019-11-23 Thread Veesh Goldman
There are other indications that Windows was designed by the devil, like the line ending format and the fact that they use UTF-16LE instead of UTF-8 in excel. Who the heck uses utf16! On Sat, Nov 23, 2019 at 10:12 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > Hi All, > > I brok

Re: for by 3?

2019-11-23 Thread Elizabeth Mattijsen
for lines.rotor(3) -> ($,$,$third) { dd $third } > On 23 Nov 2019, at 13:06, ToddAndMargo via perl6-users > wrote: > > On 2019-11-23 03:35, Elizabeth Mattijsen wrote: >> If you don't want any results with less than 3 lines: >> for lines.rotor(3) -> @a { >>dd @a; >> } >> If you *

Re: for by 3?

2019-11-23 Thread ToddAndMargo via perl6-users
On 2019-11-23 03:35, Elizabeth Mattijsen wrote: If you don't want any results with less than 3 lines: for lines.rotor(3) -> @a { dd @a; } If you *do* want results with 3 lines: for lines.rotor(3, :partial) -> @a { dd @a; } Alternately as shown below:

Re: for by 3?

2019-11-23 Thread Elizabeth Mattijsen
Ah, yes, .rotor may be overkill for this. .batch(3) will do fine as well :-) > On 23 Nov 2019, at 12:34, Simon Proctor wrote: > > If you want to read you lines in groups of 3 then you want batch : > > for @x.lines.batch(3) -> @b > > If you just want the third line and throw away the first I

Re: for by 3?

2019-11-23 Thread Elizabeth Mattijsen
If you don't want any results with less than 3 lines: for lines.rotor(3) -> @a { dd @a; } If you *do* want results with 3 lines: for lines.rotor(3, :partial) -> @a { dd @a; } Alternately as shown below: for lines -> $x, $y?, $z? { dd $x, $y, $z }

Re: for by 3?

2019-11-23 Thread Simon Proctor
If you want to read you lines in groups of 3 then you want batch : for @x.lines.batch(3) -> @b If you just want the third line and throw away the first I'd probably do a tail on that. for @x.lines.batch(3).map( *.tail ) -> $l Note you need to map the tail on each batch of three not slap it on t

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

comment: Perl6 vs batch

2019-11-23 Thread ToddAndMargo via perl6-users
Hi All, I broke down and installed Perl6 on my two Windows Virtual Machine: w7 and w-Nein (w10). OH HOLY MOLLY it is easier to program in Perl6 than batch!!! I think batch may have been designed by the devil himself! Okay, maybe not, but I feel stupid I did not do it years ago! -T

Re: which windows am I in?

2019-11-23 Thread ToddAndMargo via perl6-users
On 2019-11-22 23:41, ToddAndMargo via perl6-users wrote: Hi All, In Perl6 for Windows, how do I tell if I am in Windows 7 or 10? Many thanks, -T What I have so far: Windows 6. I am not even going to ask... Windows version: Windows 10: C:\>ver Microsoft Windows [Version 10.0.18363.476]