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 als

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 pattern

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 hole?

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;           $x

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 metho

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 https://en.wikipedia.or

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
t > > is the way 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 a

Re: .kv ?

2018-09-14 Thread ToddAndMargo
his 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 Brandon, Thank you! My use for the "smileys" is in methods definitions. It tell

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 pre-sal

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 now

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 easi

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 issue

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 constra

Re: .kv ?

2018-09-14 Thread Simon Proctor
Assigned, created or defined. Basically the object has a value. On Fri, 14 Sep 2018, 12:08 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

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; # OUTPUT

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 o

Re: .kv ?

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

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 t

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" meth

.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:

[perl #120739] @a[*]:kv / %a{*}:kv -> $k, $v dies

2014-09-25 Thread Christian Bartolomaeus via RT
I added a test to S03-operators/subscript-adverbs.t with the following commit: https://github.com/perl6/roast/commit/7f16f13f8c9610d57a6efb3eca0e846edbb6ed07

[perl #120739] @a[*]:kv / %a{*}:kv -> $k, $v dies

2013-12-09 Thread via RT
# New Ticket Created by Elizabeth Mattijsen # Please include the string: [perl #120739] # in the subject line of all future correspondence about this issue. # https://rt.perl.org/Ticket/Display.html?id=120739 > [23:18:52] r: my %a; for %a{*}:kv -> $k, $v { } [23:18:55] <

Re: r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread Jon Lang
How does a Match compare to a Parcel? -- Jonathan "Dataweaver" Lang

r31972 -[S05] specify what .keys, .values and .kv do on Match objects

2010-08-12 Thread pugs-commits
Author: moritz Date: 2010-08-12 21:10:33 +0200 (Thu, 12 Aug 2010) New Revision: 31972 Modified: docs/Perl6/Spec/S05-regex.pod Log: [S05] specify what .keys, .values and .kv do on Match objects Modified: docs/Perl6/Spec/S05-regex.pod

[perl #71086] [BUG] Unexpected result when doing .kv from within the List class in Rakudo

2009-12-07 Thread Carl Mäsak
# New Ticket Created by "Carl Mäsak" # Please include the string: [perl #71086] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=71086 > rakudo: for .kv { .say } rakudo 7ef386: 0␤a␤1␤b␤2␤c␤ rakudo: class

[perl #68356] [BUG] .kv problems in Rakudo

2009-08-10 Thread Patrick R. Michaud via RT
On Sun Aug 09 14:56:24 2009, moritz wrote: > It seems that the :foo[...] colonpair syntax doesn't set up the array > sufficiently non-flattening: Correct, Rakudo doesn't handle the non-paren colonpair syntaxes yet (they were recently refactored in STD.pm and haven't caught up). This ticket is rea

[perl #68356] [BUG] .kv problems in Rakudo

2009-08-10 Thread Carl Mäsak
:bar[ baz => 42, sloth => 43 ]; say .kv.perl for $x, $y rakudo 61f269: OUTPUT«["bar", ["baz" => 42, "sloth" => 43]]␤["bar", baz" => 42, "sloth" => 43]␤» is this a bug? if so, is it new? .kv changed recently today, that is it

[perl #68294] [PATCH] kv in the setting

2009-08-08 Thread via RT
# New Ticket Created by dakkar # Please include the string: [perl #68294] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=68294 > second patch from Lisbon: kv in the setting >From db44fb60bde4009d148ac699c0a9b8383a

Re: Any kv() question

2009-03-12 Thread Moritz Lenz
Hi, Cory Spencer wrote: > In the spectest suite (specifically in: t/spec/S32-array/kv.t), the last > several tests seem to be testing for named arguments to kv: > > # check the non-invocant form with named arguments > my @array = ; > my @kv = kv(:array(@array)

Any kv() question

2009-03-12 Thread Cory Spencer
In the spectest suite (specifically in: t/spec/S32-array/kv.t), the last several tests seem to be testing for named arguments to kv: # check the non-invocant form with named arguments my @array = ; my @kv = kv(:array(@array)); #?rakudo skip 'named args' is(+...@

Re: .kv

2008-12-14 Thread Patrick R. Michaud
On Sun, Dec 14, 2008 at 11:55:54PM +1000, Илья wrote: > (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&

Re: .kv

2008-12-14 Thread Carl Mäsak
Илья (>): > (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) i

.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

Are keys, values, kv, pairs, etc. named unaries?

2008-09-21 Thread Patrick R. Michaud
According to the test suite (t/spec/S29-array/kv.t), the .kv method is defined on arrays to produce an interleaved list of indices and values: my @array = ; say @array.kv.perl; # [ 0, "a", 1, "b", 2, "c", 3, "d" ] The kv.t file also shows a

Re: .kv, .keys, .values, on Array vs. List

2008-05-29 Thread Larry Wall
On the theory that a List is just a Capture that happens to contain only positionals, I'd say Lists should try to behave like Arrays when used as one. The only counterargument would be if it forces unnecessary mutation of otherwise immutable values, but that doesn't seem to be required for readonl

.kv, .keys, .values, on Array vs. List

2008-05-29 Thread Patrick R. Michaud
The draft Synopsis 29 [*] shows that the .keys, .kv, .pairs, and .values methods are defined for Array but not List. [*] http://svn.pugscode.org/pugs/docs/Perl6/Spec/Functions.pod However, t/spec/S29-array/kv.t has entries like: # (1,).kv works correctly { my @a = (); @a

[perl #53666] [PATCH] Implementation of "kv" method for rakudo's hashes.

2008-05-04 Thread via RT
# New Ticket Created by Vasily Chekalkin # Please include the string: [perl #53666] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=53666 > Hello. There is implementation of "kv" method for rakudo. Only langu