Re: I need help with IO.e

2020-05-22 Thread ToddAndMargo via perl6-users
On 2020-05-19 05:17, Peter Pentchev wrote: ...control structures, I mean. G'luck, Peter No problem, I appreciate all the help! :-) -T

Re: I need help with IO.e

2020-05-19 Thread Peter Pentchev
On Tue, May 19, 2020 at 03:16:41PM +0300, Peter Pentchev wrote: > On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wrote: > > On 2020-05-18 17:14, Peter Pentchev wrote: > > > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users > > > wrote: > > > > In

Re: I need help with IO.e

2020-05-19 Thread Peter Pentchev
On Mon, May 18, 2020 at 10:58:26PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 17:14, Peter Pentchev wrote: > > On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users > > wrote: > > > In 2020-05-18 16:11, Peter Pentchev wrote: > > > > As an exercise for the reader:

Re: I need help with IO.e

2020-05-19 Thread Tom Browder
On Tue, May 19, 2020 at 03:44 Richard Hainsworth wrote: > The transcendental abundance of purple in Raku :) Ah, Richard, thanks for a trip down memory lane! In my youth I discovered the joys of science fiction a few years after that piece was published. -Tom

Re: I need help with IO.e

2020-05-19 Thread Richard Hainsworth
Peter, What a genius answer! The transcendental abundance of purple in Raku :) On 18/05/2020 22:26, Peter Pentchev wrote: It's the internal representation of the program you told Raku to parse and execute; the truth is that, just like in a sci-fi story about a machine that is supposed to

Re: I need help with IO.e

2020-05-19 Thread ToddAndMargo via perl6-users
On 2020-05-18 22:58, ToddAndMargo via perl6-users wrote: On 2020-05-18 17:14, Peter Pentchev wrote: On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 17:14, Peter Pentchev wrote: On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly will "say if 'h:/'.IO.d" do? It returns the the result of

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 04:53:31PM -0700, ToddAndMargo via perl6-users wrote: > In 2020-05-18 16:11, Peter Pentchev wrote: > > As an exercise for the reader: once the above sinks in, what exactly > > will "say if 'h:/'.IO.d" do? > > It returns the the result of the expression that > "if"

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
In 2020-05-18 16:11, Peter Pentchev wrote: As an exercise for the reader: once the above sinks in, what exactly will "say if 'h:/'.IO.d" do? It returns the the result of the expression that "if" evaluated. I do know all this. It is easier for me to read the other way.

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 16:01, Tom Browder wrote: Since you don't like to listen to advice I give up. Tom! I listen to your advice ALL-THE-TIME. I was just interested in something else. And when I did not understand the result, your way or my way, I abandoned the effort, especially since I did not

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 03:51:30PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 15:44, Tom Browder wrote: > > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users > > mailto:perl6-us...@perl.org>> wrote: > > > > On 2020-05-18 13:28, Tom Browder wrote: > > > > ... > > > >

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 17:51 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-18 15:44, Tom Browder wrote: > > On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users > > mailto:perl6-us...@perl.org>> wrote: > > > > On 2020-05-18 13:28, Tom Browder wrote: > > > >

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 15:44, Tom Browder wrote: On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-05-18 13:28, Tom Browder wrote: ... > Try: > > 'say so "test".IO.d' Todd, you didn't try what I suggested. Once again, look a

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 16:19 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-18 13:28, Tom Browder wrote: ... > > Try: > > > > 'say so "test".IO.d' Todd, you didn't try what I suggested. Once again, look a the line above^^ There is no "if" there. -Tom

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 15:38, Peter Pentchev wrote: On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-18 14:35, Peter Pentchev wrote: My point is that you put a bare "say" without telling it*what* to say, which does something quite specific in both Perl and Raku.

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 03:18:26PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 14:35, Peter Pentchev wrote: > > My point is that you put a bare "say" without telling it*what* to say, > > which does something quite specific in both Perl and Raku. That should, > > at least, explain

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 14:35, Peter Pentchev wrote: My point is that you put a bare "say" without telling it*what* to say, which does something quite specific in both Perl and Raku. That should, at least, explain the error-like message. G'luck, Peter What I was after was to see what impact I had

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 02:32:49PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-18 14:22, Peter Pentchev wrote: > > Please note that in my example a couple of messages ago I did not write > > "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference > > is very important

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 14:22, Peter Pentchev wrote: Please note that in my example a couple of messages ago I did not write "say if 'h:/'.IO.d", I wrote "say 'yes' if 'h:/'.IO.d". The difference is very important and leads directly to the error-like message you got. Hi Peter, I as interested in the

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Tue, May 19, 2020 at 12:22:55AM +0300, Peter Pentchev wrote: > On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wrote: > > On 2020-05-17 22:28, Paul Procacci wrote: > > > Don't 'say' anything.  Just let the optimizer spit out the QAST that you > > > are interested in

Re: I need help with IO.e

2020-05-18 Thread Peter Pentchev
On Mon, May 18, 2020 at 12:35:47PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 22:28, Paul Procacci wrote: > > Don't 'say' anything.  Just let the optimizer spit out the QAST that you > > are interested in looking at. > > The following spits out a diff after optimization: > > > > #

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-18 13:28, Tom Browder wrote: On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users mailto:perl6-us...@perl.org>> wrote: On 2020-05-17 22:28, Paul Procacci wrote: ... 'say if "test".IO.d',  and 'say "test".IO.d.Bool' Try: 'say so "test".IO.d' I have mo clue

Re: I need help with IO.e

2020-05-18 Thread Tom Browder
On Mon, May 18, 2020 at 14:36 ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 22:28, Paul Procacci wrote: ... > 'say if "test".IO.d', and > 'say "test".IO.d.Bool' Try: 'say so "test".IO.d'

Re: I need help with IO.e

2020-05-18 Thread ToddAndMargo via perl6-users
On 2020-05-17 22:28, Paul Procacci wrote: Don't 'say' anything.  Just let the optimizer spit out the QAST that you are interested in looking at. The following spits out a diff after optimization: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
Don't 'say' anything. Just let the optimizer spit out the QAST that you are interested in looking at. The following spits out a diff after optimization: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') >> Huh. Not sure what I am looking at

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 21:48, Paul Procacci wrote: You can check this yourself by looking at the QAST nodes after the static analyzer has had its fill: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') Huh. Not sure what I am looking at $ diff

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
You can check this yourself by looking at the QAST nodes after the static analyzer has had its fill: # diff -u <(perl6 --target=optimize -e '"test".IO.e') <(perl6 --target=optimize -e '"test".IO.e.Bool') On Mon, May 18, 2020 at 12:25 AM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote:

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 21:19, ToddAndMargo via perl6-users wrote: On 2020-05-17 20:28, Paul Procacci wrote: So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) Hi Paul, Especially when I can

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 20:28, Paul Procacci wrote: So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) Hi Paul, Especially when I can never remember when IO.someletter will return a full True

Re: I need help with IO.e

2020-05-17 Thread Paul Procacci
So tack a .Bool at the end. You are coercing a bool to a bool by doing so and hopefully the optimizer is smart enough for people who like to be redundant. ;) On Sun, May 17, 2020 at 6:10 PM ToddAndMargo via perl6-users < perl6-us...@perl.org> wrote: > On 2020-05-17 14:43, ToddAndMargo via

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 14:43, ToddAndMargo via perl6-users wrote: Although    "say 'yes' if 'h:/'.IO.d" is obscure to me and    "say 'h:/'.IO.d.Bool" is very easy for me to understand. Hi Peter, I think it would help if you knew how my mind worked. `if` to me is a Boolean function. If this

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 13:04, Peter Pentchev wrote: On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 03:36, Peter Pentchev wrote: On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 02:30, Peter Pentchev wrote: You

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 12:12:51PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 03:36, Peter Pentchev wrote: > > On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-17 02:30, Peter Pentchev wrote: > > > > You said that you would tack

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 03:50, Elizabeth Mattijsen wrote: [11:50:21]you don.t need the .Bool, .e already returns a Bool [11:53:07] sometimes IO.someletter returns True of Fail, not False. Tacking .Bool on the end, means I don't have to remember which ones [11:57:23] True or Fail. Typo

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 03:36, Peter Pentchev wrote: On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-17 02:30, Peter Pentchev wrote: You said that you would tack Bool at the end in "if" statements, too. Hi Peter, No wonder. I do not remember saying that, but

Re: I need help with IO.e

2020-05-17 Thread Elizabeth Mattijsen
[11:50:21] you don.t need the .Bool, .e already returns a Bool [11:53:07]sometimes IO.someletter returns True of Fail, not False. Tacking .Bool on the end, means I don't have to remember which ones [11:57:23]True or Fail. Typo [11:58:21] A Failure is always false

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 03:01:34AM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 02:30, Peter Pentchev wrote: > > You said that you would tack Bool at the end in "if" statements, too. > > Hi Peter, > > No wonder. I do not remember saying that, but I could > have. My `if`

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 02:30, Peter Pentchev wrote: You said that you would tack Bool at the end in "if" statements, too. Hi Peter, No wonder. I do not remember saying that, but I could have. My `if` statements look like: if not "%Options".IO.d.Bool { say "Creating %Options";

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sun, May 17, 2020 at 02:18:30AM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-17 01:23, Peter Pentchev wrote: > > On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-16 17:44, Peter Pentchev wrote: > > > > On Sat, May 16, 2020 at

Re: I need help with IO.e

2020-05-17 Thread ToddAndMargo via perl6-users
On 2020-05-17 01:23, Peter Pentchev wrote: On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 17:44, Peter Pentchev wrote: On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 06:38, Peter Pentchev wrote: $ raku

Re: I need help with IO.e

2020-05-17 Thread Peter Pentchev
On Sat, May 16, 2020 at 06:57:53PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-16 17:44, Peter Pentchev wrote: > > On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users > > wrote: > > > On 2020-05-16 06:38, Peter Pentchev wrote: > > > > > $ raku *-e* "your one-liner

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 17:44, Peter Pentchev wrote: On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: On 2020-05-16 06:38, Peter Pentchev wrote: $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those

Re: I need help with IO.e

2020-05-16 Thread Peter Pentchev
On Sat, May 16, 2020 at 03:19:05PM -0700, ToddAndMargo via perl6-users wrote: > On 2020-05-16 06:38, Peter Pentchev wrote: > > > $ raku *-e* "your one-liner script here" > > And also you might want to put some quotes around the paths to let Raku > > know that those are strings and not some

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 06:38, Peter Pentchev wrote: $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those are strings and not some identifiers or something. G'luck, Peter Hi Peter, This is what goofed me up: $ alias p5

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-16 05:34, Kevin Pye wrote: The documentation for .d states: Returns |True| if the invocant is a path that exists and is a directory. The method will |fail|  with |X::IO::DoesNotExist| if the path points to a non-existent filesystem entity.

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
> Le sam. 16 mai 2020 à 12:16, ToddAndMargo via perl6-users > mailto:perl6-us...@perl.org>> a écrit : > > On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: > > Hi All,. > > > > Windows 7, sp1, x64 > > > > >raku -v > > This is Rakudo version 2020.01 built

Re: I need help with IO.e

2020-05-16 Thread Peter Pentchev
On Sat, May 16, 2020 at 01:29:12PM +0200, Laurent Rosenfeld via perl6-users wrote: > Hi, > > it should be: > > $ raku *-e* "your one-liner script here" And also you might want to put some quotes around the paths to let Raku know that those are strings and not some identifiers or something.

Re: I need help with IO.e

2020-05-16 Thread Kevin Pye
There are three possibilities for the.d test -- the file exists and is a directory, the files exists and is not a directory, and the file does not exist. The test needs to distinguish between these three cases. The documentation for .d states: Returns True if the invocant is a path that exists

Re: I need help with IO.e

2020-05-16 Thread Laurent Rosenfeld via perl6-users
Hi, it should be: $ raku *-e* "your one-liner script here" Best regards, Laurent. Le sam. 16 mai 2020 à 12:16, ToddAndMargo via perl6-users < perl6-us...@perl.org> a écrit : > On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: > > Hi All,. > > > > Windows 7, sp1, x64 > > > > >raku -v >

Re: I need help with IO.e

2020-05-16 Thread ToddAndMargo via perl6-users
On 2020-05-15 22:30, ToddAndMargo via perl6-users wrote: Hi All,. Windows 7, sp1, x64 >raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am trying to get perl to tell me if a drive letter exists This is from Git's df command: >df -kPT H:\

I need help with IO.e

2020-05-15 Thread ToddAndMargo via perl6-users
Hi All,. Windows 7, sp1, x64 >raku -v This is Rakudo version 2020.01 built on MoarVM version 2020.01.1 implementing Perl 6.d. I am trying to get perl to tell me if a drive letter exists This is from Git's df command: >df -kPT H:\ Filesystem Type 1024-blocks Used Available Capacity