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-users@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-users@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-users@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-users@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: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
On Mon, May 18, 2020 at 10:18 AM Brad Gilbert wrote: > > You are misunderstanding what `put` does. > > It does not print the internal representation. > > What it does do is turn the value into a `Str` object, then print it with a > trailing newline. > > It just so happens that objects will by

Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
On Mon, May 18, 2020 at 4:03 AM Patrick R. Michaud wrote: > > "say $x" is essentially equivalent to "put $x.gist". > > Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a > string value of "Nil" and can be printed. However, attempting to convert Nil > directly into 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-users@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-users@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-users@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: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread Brad Gilbert
You are misunderstanding what `put` does. It does not print the internal representation. What it does do is turn the value into a `Str` object, then print it with a trailing newline. It just so happens that objects will by default return something that looks like an internal representation when

Re: Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread Patrick R. Michaud
"say $x" is essentially equivalent to "put $x.gist". Since Nil is undefined (roughly equivalent to a type object), Nil.gist has a string value of "Nil" and can be printed. However, attempting to convert Nil directly into a Str throws an error because that's attempting to stringify an

Different return values with "say" vs "put" (Nil representation... )

2020-05-18 Thread William Michels via perl6-users
Hello, I'm interested in knowing the differences between the return values when "say" is used compared to "put". My understanding is that "put" returns Raku's internal representation of a value held by a variable, while "say" is merely "put" with the .gist method called on it (a "human readable",