Re: .kv ?

2018-09-16 Thread ToddAndMargo
On 09/15/2018 03:16 PM, Brad Gilbert wrote: Anyway I edited the Option Types post. Hi Brad, I like it! That took some thinking. You kicked it! To designate that it must have a defined value assigned to it (not be in the null state), use the :D "smiley" designation. It is

Re: .kv ?

2018-09-16 Thread ToddAndMargo
On 09/15/2018 03:16 PM, Brad Gilbert wrote: I'm just saying that brains are wired differently. Hi Brad, Oh no fooling. I mainly make my living off of troubleshooting. I am I.T. for small businesses: Windows, Linux, and Mac. (25 years at this now) When I arrive, I am frequently not the first

Re: .kv ?

2018-09-15 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 10:37 PM ToddAndMargo wrote: > > On 09/14/2018 08:09 PM, Brad Gilbert wrote: > > I think that it is because of how you read. > > > > The way your brain figures out what is written, is slow. > > That is how the human the human brain works. It is > always looking for

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 08:09 PM, Brad Gilbert wrote: I think that it is because of how you read. The way your brain figures out what is written, is slow. That is how the human the human brain works. It is always looking for patterns. Depth perception for instance. Is that a shadow or an actual

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:52 PM, Curt Tilmes wrote: On Fri, Sep 14, 2018 at 10:42 PM ToddAndMargo > wrote: When I said "yet", I presumed the a variable can be redefined at will: $ p6 'my $x; say $x.perl;           $x="abc"; say $x.perl;          

Re: .kv ?

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 9:42 PM ToddAndMargo wrote: > > On 09/14/2018 07:16 PM, Brad Gilbert wrote: > > The author greatly appreciates the time spent on writing this critique. > > > > (I'm the author) > > > > Responses written inline > > > > On Fri, Sep 14, 2018 at 4:55 PM ToddAndMargo wrote: >

Re: .kv ?

2018-09-14 Thread Curt Tilmes
On Fri, Sep 14, 2018 at 10:52 PM Curt Tilmes wrote: > > > On Fri, Sep 14, 2018 at 10:42 PM ToddAndMargo > wrote: > >> When I said "yet", I presumed the a variable can be >> redefined at will: >> >> $ p6 'my $x; say $x.perl; >> $x="abc"; say $x.perl; >> $x=Nil; say $x.perl;'

Re: .kv ?

2018-09-14 Thread Curt Tilmes
On Fri, Sep 14, 2018 at 10:42 PM ToddAndMargo wrote: > When I said "yet", I presumed the a variable can be > redefined at will: > > $ p6 'my $x; say $x.perl; > $x="abc"; say $x.perl; > $x=Nil; say $x.perl;' > Any > "abc" > Any > > And that the receiving method only cares what

Re: .kv ?

2018-09-14 Thread Brandon Allbery
But the point of this is the method is saying up front that it must be given a variable that is defined; it's not waiting to test it or possibly just bomb out later. This produces better error messages (the user doesn't have to know about what's going on inside the method, the error cites the

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:16 PM, Brad Gilbert wrote: The author greatly appreciates the time spent on writing this critique. (I'm the author) Responses written inline On Fri, Sep 14, 2018 at 4:55 PM ToddAndMargo wrote: On 09/14/2018 09:26 AM, Brad Gilbert wrote: You can read

Re: .kv ?

2018-09-14 Thread Brad Gilbert
The author greatly appreciates the time spent on writing this critique. (I'm the author) Responses written inline On Fri, Sep 14, 2018 at 4:55 PM ToddAndMargo wrote: > > On 09/14/2018 09:26 AM, Brad Gilbert wrote: > > You can read https://en.wikipedia.org/wiki/Option_type for more information

Re: .kv ?

2018-09-14 Thread Brandon Allbery
they evolve. All variables start out as :U. > > > > > > This is the same misunderstanding: what is now, is not guaranteed to be > > so in the future. :U and :D provide such guarantees. Merely being > > defined or undefined right now says nothing about the future. > > > Hi

Re: .kv ?

2018-09-14 Thread ToddAndMargo
ame misunderstanding: what is now, is not guaranteed to be so in the future. :U and :D provide such guarantees. Merely being defined or undefined right now says nothing about the future. Hi Brandon, Thank you! My use for the "smileys" is in methods definitions. It tells me that th

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:03 PM, ToddAndMargo wrote: On 09/14/2018 02:55 PM, ToddAndMargo wrote: In Perl, variables are structures.  There is a bunch of house keeping involved.  The "my" declaration triggers this house keeping including where it is and all the rules to access it.  The variable is

Re: .kv ?

2018-09-14 Thread Brandon Allbery
On Fri, Sep 14, 2018 at 5:56 PM ToddAndMargo wrote: > 'To opt into a non-nullable version of a type add the :D > "smiley" to it." > > This is confusing. And I don't think correct, but I could be wrong. > Curt stated it a lot better: > >If I say "my Int $x", >$x is

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 02:55 PM, ToddAndMargo wrote: In Perl, variables are structures.  There is a bunch of house keeping involved.  The "my" declaration triggers this house keeping including where it is and all the rules to access it.  The variable is pre-salted" (null) very much so.  Perl is a ton

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:31 AM, Simon Proctor wrote: Just look at Curt's explanation. I found it last night. I rather admire his technical writing ability. He made the complex look simple. And that is a talent.

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 09:26 AM, Brad Gilbert wrote: You can read https://en.wikipedia.org/wiki/Option_type for more information Tell me if you find any of the Perl 6 section confusing. https://en.wikipedia.org/wiki/Option_type#Perl_6 Hi Brad, I had to read to top over very slowly. Part of the

Re: .kv ?

2018-09-14 Thread Brad Gilbert
You can read https://en.wikipedia.org/wiki/Option_type for more information Tell me if you find any of the Perl 6 section confusing. https://en.wikipedia.org/wiki/Option_type#Perl_6 On Fri, Sep 14, 2018 at 6:21 AM Todd Chester wrote: > > >> On Fri, Sep 14, 2018 at 7:08 AM Todd Chester >>

Re: .kv ?

2018-09-14 Thread Simon Proctor
Just look at Curt's explanation. On Fri, 14 Sep 2018, 12:22 Todd Chester, wrote: > > > On 09/14/2018 04:18 AM, Simon Proctor wrote: > > Assigned, created or defined. > > > > Basically the object has a value. > > Not following. Are there three of them? >

Re: .kv ?

2018-09-14 Thread Todd Chester
On 09/14/2018 04:18 AM, Simon Proctor wrote: Assigned, created or defined. Basically the object has a value. Not following. Are there three of them?

Re: .kv ?

2018-09-14 Thread Todd Chester
On Fri, Sep 14, 2018 at 7:08 AM Todd Chester > wrote: On 09/14/2018 04:01 AM, Simon Proctor wrote: > :D is a type constraint requiring an instantiated (or defined) object of > the given type (or a subtype of it). > > :U is a type

Re: .kv ?

2018-09-14 Thread Curt Tilmes
See https://docs.perl6.org/type/Signature#Constraining_defined_and_undefined_values If I say "my Int $x", $x is now an Int, but an undefined Int. If I say "my Int $x = 42", $x is an Int, but set to a defined value, 42. Both are Int: say 42 ~~ Int; # OUTPUT: «True␤» say Int ~~ Int; #

Re: .kv ?

2018-09-14 Thread Todd Chester
On 09/14/2018 04:01 AM, Simon Proctor wrote: :D is a type constraint requiring an instantiated (or defined) object of the given type (or a subtype of it). :U is a type constraint saying you have a container specified for the given type that hasn't been instantiated. Hi Simon, Your went

Re: .kv ?

2018-09-14 Thread Simon Proctor
wrote: > >> > >> Hi All, > >> > >> I adore the "kv" method: > >> > >> $ p6 'for "abc\n23\n4.56".lines.kv -> $i, $j { say "$i $j" };' > >> 0 abc > >> 1 23 > >>

Re: .kv ?

2018-09-14 Thread Todd Chester
On Fri, 14 Sep 2018, 11:22 Todd Chester, <mailto:toddandma...@zoho.com>> wrote: Hi All, I adore the "kv" method: $ p6 'for "abc\n23\n4.56".lines.kv -> $i, $j { say "$i $j" };' 0 abc 1 23 2 4.56 So, I decided to go and l

Re: .kv ?

2018-09-14 Thread Simon Proctor
:D means a defined value. So it's when you have an instance. :U is undefined so it's when you call kv as a classethod. Pair.kv would be :U. (A => "b").kv would be :D On Fri, 14 Sep 2018, 11:22 Todd Chester, wrote: > Hi All, > > I adore the "kv" method: > &

.kv ?

2018-09-14 Thread Todd Chester
Hi All, I adore the "kv" method: $ p6 'for "abc\n23\n4.56".lines.kv -> $i, $j { say "$i $j" };' 0 abc 1 23 2 4.56 So, I decided to go and look at: https://docs.perl6.org/routine/kv multi method kv(Any:U: -->List) multi method kv(Any:D: -->Lis

.kv

2008-12-14 Thread Илья
(23:24:09) ihrd: hi (23:24:28) ihrd: question about .kv (23:24:39) ihrd: rakudo: my @a = {a = 1}, {b =2}; my %h = foo = @a; say %h.kv.perl; (23:24:41) p6eval: rakudo 33880: OUTPUT[[foo, {a = 1}, {b = 2}]␤] (23:24:59) ihrd: rakudo: say ({ foo = [{a=1}, {b=1}]}).perl; (23:25:02) p6eval: rakudo 33880