Re: tip: that annoying character at the end

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 10:11 PM ToddAndMargo wrote: > > On 09/14/2018 07:34 PM, Brad Gilbert wrote: > > $x ~~ s/ <:Cc>+ $ //; > > What exactly is <:Cc> again? < and > inside of a regular expression is for advanced features If the first character is : then it knows to look for Unicode

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: Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:48 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 6:03 PM ToddAndMargo wrote: On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo mailto:toddandma...@zoho.com>> wrote: Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how would the

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: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:34 PM, Brad Gilbert wrote: $x ~~ s/ <:Cc>+ $ //; What exactly is <:Cc> again?

Re: Please explain this to me

2018-09-14 Thread ToddAndMargo
Okay, see if I got it right, finally: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos --> Bool) "multi method" This means there are multiple ways to address this, as in multi method contains(Str:D: Cool:D $needle --> Bool) multi method contains(Str:D:

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: Can methods have multiple inputs?

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 6:03 PM ToddAndMargo wrote: > > >> On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo >> > wrote: > >> > >> Hi All, > >> > >> Can a method be given multiple inputs? > >> > >> ( $a, $b ).foo > >> > >> and how would the docs

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: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On 09/14/2018 07:34 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 7:49 PM ToddAndMargo wrote: On Fri, Sep 14, 2018 at 5:22 PM ToddAndMargo wrote: Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of 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: tip: that annoying character at the end

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 7:49 PM ToddAndMargo wrote: > > > On Fri, Sep 14, 2018 at 5:22 PM ToddAndMargo wrote: > >> > >> Hi All, > >> > >> A tip to share. > >> > >> I work a lot with downloaded web pages. I cut > >> out things like revision numbers and download > >> locations. > >> > >> One of

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: Please explain this to me

2018-09-14 Thread ToddAndMargo
On 09/11/2018 10:41 AM, Brandon Allbery wrote: I'd like to point out that Todd is from Perl 5, which doesn't distinguish between subs and methods because its built-in OO is a minimalist hack. An introduction to true objects might be in order. I never used a method in p5. When I found them in

Re: method vs multi method

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:33 PM, Ralph Mellor wrote:      multi method kv ... Use of `multi` means there *may* be more than one *declaration* using the same declared routine name (`kv` in this case). There usually *will* be more than one. (Otherwise, why was it declared `multi`?) The normal

Re: tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 5:22 PM ToddAndMargo wrote: Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of the things that use to drive me a bit nuts was that web pages can come with all kind of weird line

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 05:33 PM, Brad Gilbert wrote: On Fri, Sep 14, 2018 at 7:10 PM ToddAndMargo wrote: On 09/14/2018 04:37 PM, Brandon Allbery wrote: "{$x}::{$y}" Most of my programming before Perl 5 was bash. I did a lot of "${x}abc" to keep the variables from being confused with each other.

Re: tip: that annoying character at the end

2018-09-14 Thread Brad Gilbert
You can just remove the control characters my $x="abc.zip"~chr(7)~chr(138); $x .= subst(/<:Cc>+ $/,''); say $x; Note that 13 is carriage return and 10 is newline If the only ending values are (13,10), 13, or 10 you can use .chomp to remove them my $x="abc.zip"~chr(13)~chr(10);

Re: need p5/p6 :: help

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 7:10 PM ToddAndMargo wrote: > > On 09/14/2018 04:37 PM, Brandon Allbery wrote: > > > "{$x}::{$y}" > > Most of my programming before Perl 5 was bash. I > did a lot of "${x}abc" to keep the variables > from being confused with each other. > > I carried the practice over to

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 04:37 PM, Brandon Allbery wrote: "{$x}::{$y}" Most of my programming before Perl 5 was bash. I did a lot of "${x}abc" to keep the variables from being confused with each other. I carried the practice over to perl 6 with "{$x}abc" but the developers over on the chat line told

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 7:32 PM ToddAndMargo > wrote: What is this all about? $ p6 'my $x="abc"; my $y="def"; say "$x::$y";' ===SORRY!=== Error while compiling -e Malformed lookup of ::$y; please use ::('$y'), ::{'$y'}, or ::<$y> at -e:1

Re: need p5/p6 :: help

2018-09-14 Thread Brandon Allbery
It thinks it's interpolating a variable $x::... and then it gets stuck because it sees $y instead of the rest of a variable name. You can use braces to control what's part of the name: pyanfar Z$ 6 'my $x = "abc"; my $y = "def"; say "{$x}::{$y}"' abc::def Otherwise, you couldn't interpolate the

Re: .new?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:39 AM, Timo Paulssen wrote: Telemetry::Sampler isn't a routine, it's a class. You can follow the link labelled "from Telemetry::Sampler" to get to the documentation of the class by that name, which explains what it is, how you get it, and how you use it. I'll file a bug for the

Re: method vs multi method

2018-09-14 Thread Ralph Mellor
> multi method kv ... Use of `multi` means there *may* be more than one *declaration* using the same declared routine name (`kv` in this case). There usually *will* be more than one. (Otherwise, why was it declared `multi`?) The normal way to *use* a routine is to call it. If you declare

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
What is this all about? $ p6 'my $x="abc"; my $y="def"; say "$x::$y";' ===SORRY!=== Error while compiling -e Malformed lookup of ::$y; please use ::('$y'), ::{'$y'}, or ::<$y> at -e:1 --> my $x="abc"; my $y="def"; say "$x⏏::$y"; $ p6 'my $x="abc"; my $y="def"; say "$x\::$y";' abc::def $

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:49 PM, Larry Wall wrote: On Fri, Sep 14, 2018 at 04:15:02AM -0700, Todd Chester wrote: : Also, did you answer my question about "::" and did it : just go over my head? The implication was that "::" didn't change, but the default package scoping of p5 that you're relying on is

Re: Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo > wrote: Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how would the docs write it? method foo(Any:D Any:D: -->Bool) Is there a comma or a space between the

Re: need p5/p6 :: help

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:49 PM, Larry Wall wrote: I would like to see a citation of this use of the word "lexiconical". In the first place, the word "lexiconical" has not been used in perl5-porters in living memory, and if had been used there, it is unlikely to have meant "figured out on the fly". Hi

Re: Can methods have multiple inputs?

2018-09-14 Thread Brandon Allbery
In that case, you're not giving it two items; you are giving it a single List that happens to have two items within it. A method has one invocant. If you are invoking method foo on that, its invocant is a List. > my $a; my $b; say ($a, $b).^name List On Fri, Sep 14, 2018 at 6:47 PM ToddAndMargo

Re: .kv ?

2018-09-14 Thread Brandon Allbery
They do different things if it's defined vs. if it's undefined. This is preferred to having an if-then test in a single implementation, if they're different enough that you're really writing two functions anyway. And List is supposed to be vague there. At the level of Any, it can be a list of

Can methods have multiple inputs?

2018-09-14 Thread ToddAndMargo
Hi All, Can a method be given multiple inputs? ( $a, $b ).foo and how would the docs write it? method foo(Any:D Any:D: -->Bool) Is there a comma or a space between the two "any"'s? Many thanks, -T

method vs multi method

2018-09-14 Thread ToddAndMargo
Hi All, In the following: https://docs.perl6.org/routine/kv multi method kv(Any:U: -->List) multi method kv(Any:D: -->List) Does the "multi" mean ther are moe than one way to use the method, as in see the two instances above? Or something else? Also, it there was only one way to use

Re: need p5/p6 :: help

2018-09-14 Thread Elizabeth Mattijsen
> On 15 Sep 2018, at 00:12, Vadim Belman wrote: >> In Perl 6 culture we never mix them up either, but we also never put subs >> into packages by default. The reason Foo::bar notation doesn't work is >> because bar isn't in Foo anymore unless you explicitly put it there. > Though technically this

Re: .kv ?

2018-09-14 Thread ToddAndMargo
On 09/14/2018 03:10 PM, Brandon Allbery wrote: 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

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

tip: that annoying character at the end

2018-09-14 Thread ToddAndMargo
Hi All, A tip to share. I work a lot with downloaded web pages. I cut out things like revision numbers and download locations. One of the things that use to drive me a bit nuts was that web pages can come with all kind of weird line terminators. I'd wind up with a link location that bombed

Re: need p5/p6 :: help

2018-09-14 Thread Vadim Belman
> > In Perl 6 culture we never mix them up either, but we also never put subs > into packages by default. The reason Foo::bar notation doesn't work is > because bar isn't in Foo anymore unless you explicitly put it there. > > Larry > Though technically this aspect was clear to me, but to

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

2018-09-14 Thread Parrot Raiser
On 9/14/18, Brandon Allbery wrote: > And then you discover <->. > Elbows?

Re: ->

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 5:10 PM Parrot Raiser <1parr...@gmail.com > wrote: Obviously, discussions about "->" will be easier if it has a name. How about "lance", or, if you want to be less martial, "poker'? On 09/14/2018 02:11 PM, Brandon Allbery wrote: And

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

2018-09-14 Thread Brandon Allbery
And then you discover <->. On Fri, Sep 14, 2018 at 5:10 PM Parrot Raiser <1parr...@gmail.com> wrote: > Obviously, discussions about "->" will be easier if it has a name. How > about "lance", or, if you want to be less martial, "poker'? > -- brandon s allbery kf8nh allber...@gmail.com

Re: ->

2018-09-14 Thread Parrot Raiser
Obviously, discussions about "->" will be easier if it has a name. How about "lance", or, if you want to be less martial, "poker'?

Re: ->

2018-09-14 Thread Brandon Allbery
Pick a glyph, any glyph…. On Fri, Sep 14, 2018 at 4:54 PM ToddAndMargo wrote: > On 09/14/2018 01:09 PM, Mike Stok wrote: > > > > > >> On Sep 14, 2018, at 4:03 PM, ToddAndMargo > wrote: > >> > >> On 09/14/2018 01:00 PM, Larry Wall wrote: > >>> > >>> "-> is how we spell λ in Perl 6" > >>>

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 01:09 PM, Mike Stok wrote: On Sep 14, 2018, at 4:03 PM, ToddAndMargo wrote: On 09/14/2018 01:00 PM, Larry Wall wrote: "-> is how we spell λ in Perl 6" Larry Hysterical! Thank you! I would like to think

Re: ->

2018-09-14 Thread ToddAndMargo
On Fri, Sep 14, 2018 at 4:16 PM ToddAndMargo > wrote: On 09/14/2018 12:27 PM, ToddAndMargo wrote: > Hi All, > > I use `->` all the time. What is its official name? > > for @x.kv -> $I, $Line {...} > > Many thanks, > -T

Re: ->

2018-09-14 Thread Brandon Allbery
It's still reading the block signature (parameters and return type) that it expects after the ->, until it sees the start of the block/closure. Think of what follows it as a sub declaration without the sub name or parentheses. A semicolon there says that what follows are optional parameters, so

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 12:27 PM, ToddAndMargo wrote: Hi All, I use `->` all the time.  What is its official name? for @x.kv -> $I, $Line {...} Many thanks, -T Me thinks I am pushing "pointy" here! #!/usr/bin/env perl6 sub Stooges() { return ( "Larry", "Curley", "Moe" ); } my $x; my $y; my $z; #

Re: ->

2018-09-14 Thread Mike Stok
> On Sep 14, 2018, at 4:03 PM, ToddAndMargo wrote: > > On 09/14/2018 01:00 PM, Larry Wall wrote: >> >> "-> is how we spell λ in Perl 6" >> Larry > > > Hysterical! Thank you! I would like to think https://kwangyulseo.com/2015/06/23/the-origin-of-notation-λ-in-lambda-calculus/ is the

Re: ->

2018-09-14 Thread ToddAndMargo
On 09/14/2018 01:00 PM, Larry Wall wrote: On Fri, Sep 14, 2018 at 09:30:51PM +0200, Elizabeth Mattijsen wrote: : The combination of “->” and “{ }” is sometimes referred to as a “pointy block”, or even maybe just a “pointy”. Note that "pointy" is specifically referring to the syntax here, not

Re: ->

2018-09-14 Thread Larry Wall
On Fri, Sep 14, 2018 at 09:30:51PM +0200, Elizabeth Mattijsen wrote: : The combination of “->” and “{ }” is sometimes referred to as a “pointy block”, or even maybe just a “pointy”. Note that "pointy" is specifically referring to the syntax here, not the semantics. People use other terms when

Re: need p5/p6 :: help

2018-09-14 Thread Larry Wall
On Fri, Sep 14, 2018 at 04:15:02AM -0700, Todd Chester wrote: : Also, did you answer my question about "::" and did it : just go over my head? The implication was that "::" didn't change, but the default package scoping of p5 that you're relying on is no longer the default in p6. : The p5 guys

Re: ->

2018-09-14 Thread Brandon Allbery
It's part of a "pointy block". But this doesn't seem to be documented directly as such, it's only mentioned at https://docs.perl6.org/language/control#for . On Fri, Sep 14, 2018 at 3:28 PM ToddAndMargo wrote: > Hi All, > > I use `->` all the time. What is its official name? > > for @x.kv ->

Re: ->

2018-09-14 Thread Elizabeth Mattijsen
The combination of “->” and “{ }” is sometimes referred to as a “pointy block”, or even maybe just a “pointy”. The thing(s) inbetween the “->” and “{ }” are the “signature” of the “pointy block”. > On 14 Sep 2018, at 21:27, ToddAndMargo wrote: > > Hi All, > > I use `->` all the time. What

->

2018-09-14 Thread ToddAndMargo
Hi All, I use `->` all the time. What is its official name? for @x.kv -> $I, $Line {...} Many thanks, -T

Re: need p5/p6 :: help

2018-09-14 Thread Brad Gilbert
lexical means it is only available within that scope, or in sub-scopes { my $a; { $a = 42; } } $a # error { sub foo (){} # my sub foo (){} # identical { foo(); } } foo() # error --- Note that sub foo (){} is really short for my only sub

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

2018-09-14 Thread Brad Gilbert
On Fri, Sep 14, 2018 at 6:19 AM Todd Chester wrote: > > > > On 09/14/2018 03:34 AM, Simon Proctor wrote: > > I think the docs of objects (sorry on my phone no link) describe object > > creation and the default new quite well. > > They most probably are and most developers would have no issues >

Re: .new?

2018-09-14 Thread Parrot Raiser
> Do a search for objects. What do you mean? Into you favourite search engine, e.g. duckduckgo, type perl6 objects

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

2018-09-14 Thread Todd Chester
On 09/14/2018 03:34 AM, Simon Proctor wrote: I think the docs of objects (sorry on my phone no link) describe object creation and the default new quite well. They most probably are and most developers would have no issues figuring them out. If a common user can't make heads or tails out of

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

Re: need p5/p6 :: help

2018-09-14 Thread Todd Chester
> On 14/09/2018 12:59, Todd Chester wrote: >> Hi All, >> >> I am in the process of converting a YUGE program I wrote in >> Perl 5 to Perl 6. I used "xx::yy" at lot for readability >> so I could tell where something came from. >> >> I take it "::" means something different is Perl 6 than Perl 5.

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: I need -M help

2018-09-14 Thread Todd Chester
> On 14/09/2018 12:52, Todd Chester wrote: >> Hi All, >> >> With a one liner, how to I load a module that resides in the >> current directory? On 09/14/2018 03:58 AM, Timo Paulssen wrote: The equivalent of "use lib 'blah'" on the commandline is "-I blah", just like "-M bloop" is the equivalent

Re: need p5/p6 :: help

2018-09-14 Thread Timo Paulssen
It's important for the PrintRed sub inside PrintColors to be declared "our", otherwise it is "my" scoped, i.e. limited to the lexical extent of the module file. On 14/09/2018 12:59, Todd Chester wrote: > Hi All, > > I am in the process of converting a YUGE program I wrote in > Perl 5 to Perl 6. 

Re: .kv ?

2018-09-14 Thread Simon Proctor
: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. So if you have my Int $a; you have said this should hold and Int but it's

Re: .new?

2018-09-14 Thread Todd Chester
On 09/14/2018 03:37 AM, Elizabeth Mattijsen wrote: Good catch! I am not sure exactly what I tripped across, but as I tell my wife "sometimes it pays to be an idiot." :-) -T

need p5/p6 :: help

2018-09-14 Thread Todd Chester
Hi All, I am in the process of converting a YUGE program I wrote in Perl 5 to Perl 6. I used "xx::yy" at lot for readability so I could tell where something came from. I take it "::" means something different is Perl 6 than Perl 5. $ p6 'use lib "/home/linuxutil"; use PrintColors;

Re: I need -M help

2018-09-14 Thread Timo Paulssen
The equivalent of "use lib 'blah'" on the commandline is "-I blah", just like "-M bloop" is the equivalent of "use 'bloop'" in code. HTH   - Timo On 14/09/2018 12:52, Todd Chester wrote: > Hi All, > > With a one liner, how to I load a module that resides in the > current directory? > > $ ls

I need -M help

2018-09-14 Thread Todd Chester
Hi All, With a one liner, how to I load a module that resides in the current directory? $ ls PrintColors.pm6 PrintColors.pm6 $ perl6 -MPrintColors -e 'PrintRed "Hi";' ===SORRY!=== Could not find PrintColors at line 1 in: /home/tony/.perl6 /opt/rakudo-pkg/share/perl6/site

Re: .kv ?

2018-09-14 Thread Todd Chester
On Fri, 14 Sep 2018, 11:22 Todd Chester, > 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 look at:

Re: .new?

2018-09-14 Thread Timo Paulssen
The doc website creates the pages under "routine/" by collecting every type's methods and relevant subs of that name and putting them all on a page. It's a very unfortunate accident that the one for Telemetry::Sampler ends up at the top, because right below that is the one for Mu, which is the

Re: .new?

2018-09-14 Thread Elizabeth Mattijsen
Good catch! I think that one is worth a documentation issue. The perl6doc builder gathered information about all “new” methods it could find *without any context*, and put them into one file. For a method such as “new” not the best thing to do. I would argue that this page should be

Re: .new?

2018-09-14 Thread Simon Proctor
I think the docs of objects (sorry on my phone no link) describe object creation and the default new quite well. Do a search for objects. On Fri, 14 Sep 2018, 11:30 Todd Chester, wrote: > Hi All, > > What exactly is going on with .new? > >https://docs.perl6.org/routine/new >method

.new?

2018-09-14 Thread Todd Chester
Hi All, What exactly is going on with .new? https://docs.perl6.org/routine/new method new(Telemetry::Sampler: @instruments --> Telemetry::Sampler:D) The whole thing went over my head. It looks like specifications for the developers, but I really can't tell. And it looks like it might be

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: > > $ p6 'for "abc\n23\n4.56".lines.kv

.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: -->List) Okay, here is what I see: "method"

Re: Please explain this to me

2018-09-14 Thread Todd Chester
On 09/13/2018 10:24 PM, JJ Merelo wrote: Last time I counted, there were a dozen comments and 3 commits in the issue I created to try and improve the description. 2 files were modified by me. Is there some where I can look at these comments? That's rather a dynamic way of not budging.

Re: Please explain this to me

2018-09-14 Thread Todd Chester
On 09/12/2018 12:19 AM, Simon Proctor wrote: In answer to "why the : between Str:D and Cool:D and why Int(Cool:D) ?" can I just point out the video I linked (or the slides) which answer both of these questions. Hi Simon, Larry Wall, who has a unique gift for making the complex easy,