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

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

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

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 us

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 sett

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

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 no

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 $ p6

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 n

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

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 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: need p5/p6 :: help

2018-09-15 Thread Larry Wall
On Fri, Sep 14, 2018 at 06:12:15PM -0400, Vadim Belman wrote: : Though technically this aspect was clear to me, but to settle things down in my mind completely: for now ordinary (not 'our') sub belongs not to the package object but to the block which belongs to that package. Is it correct way to

Re: need p5/p6 :: help

2018-09-15 Thread Brent Laabs
Now that Larry has spoken on the issue of vocabulary, it's lexicanonical. On Fri, Sep 14, 2018 at 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 wa