No. It is lucid! Re: Could this be any more obscure?

2018-09-30 Thread Richard Hainsworth
Todd, I've already added to this conversation given that your 'perl' box was corrupted. But when I read this post last week, I felt it needed some response. You actually have touched on some deep issues. Please allow for some humour below. First off, courses, beginners books, and the

Re: A problem with native CArrays

2018-09-30 Thread Brad Gilbert
The [+] works because of an optimization. If you use the core :<+> it instead calls the .sum() method. Since CArray has a sum method, that gets called instead. On Sun, Sep 30, 2018 at 4:28 AM Fernando Santagata wrote: > > Hi, > > I was hunting for a bug in my code, this one: > > my @a :=

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 7:07 AM, Peter Scott wrote: gain, covered in the excellent tutorial material that you are determined not to read and are instead extracting message by message from the members of this list. That latter approach is going to end up being more frustrating and alienating for you in the

Re: Could this be any more obscure?

2018-09-30 Thread Richard Hainsworth
Todd, Since your 'perl box' got corrupted, may be you missed Yary's message (copied below). Yary shared a frank viewpoint that I entirely agree with. Several people have said 'read a book'. Reading a book - even if it can be hard sometimes - is a courteous thing to do in a community that has

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
Hi All, My "Perl" box got corrupted and in the process of rebuilding it I lost this thread except for one one message from JJ. Anyway, I am not deliberately ignoring anyone, I just lost the thread. :'( -T

Re: Package Compile Question

2018-09-30 Thread JJ Merelo
Is that taken verbatim from the docs? I'll create an issue if that's the case. JJ

Re: Could this be any more obscure?

2018-09-30 Thread yary
Todd, allow me to distill the situation from my POV. There are many sources of Perl 5 docs. "perldoc -f ..." is one of them, and it works well for you. There are also a choice of Perl 6 docs. "https://docs.perl6.org/; is one of them, and it doesn't work well for you, but of all the perl6 docs,

Re: A problem with native CArrays

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 15:54, Fernando Santagata (< nando.santag...@gmail.com>) escribió: > What I was pointing out is that the '*' operator outputs an error, and I > was expecting that, while the '+' doesn't. > Besides, the '+' delivers the correct result, which apparently indicates > that

Re: A problem with native CArrays

2018-09-30 Thread Brandon Allbery
Might be because there's a prefix form of + with a wider type? "Every DWIM has a WAT" On Sun, Sep 30, 2018 at 9:55 AM Fernando Santagata < nando.santag...@gmail.com> wrote: > What I was pointing out is that the '*' operator outputs an error, and I > was expecting that, while the '+' doesn't. >

Re: Could this be any more obscure?

2018-09-30 Thread Peter Scott
On 9/30/18 2:45 AM, ToddAndMargo wrote: The manual need to be written for the common user to understand, not just developer level and very advanced users.  They don't need the manual anyway. Of course we do. I constantly refer to the Perl 5 manual rather than waste memory on rote

Re: A problem with native CArrays

2018-09-30 Thread Fernando Santagata
What I was pointing out is that the '*' operator outputs an error, and I was expecting that, while the '+' doesn't. Besides, the '+' delivers the correct result, which apparently indicates that the two operators are treated differently. I was trying to understand whether this behavior is inherent

Package Compile Question

2018-09-30 Thread Richard Hogaboom
This does not compile; I think it should: use v6; class Foo {     class Bar {     our $quux = 42;     } } say $Foo::Bar::quux;  # works - 42 say Foo::Bar::<$quux>;  # works - 42 my $bar = 'Bar'; say $Foo::($bar)::quux;  # works - 42 # shouldn't this work too? say Foo::($bar)::<$quux>;  #

Re: join questions

2018-09-30 Thread Simon Proctor
On Sun, 30 Sep 2018, 12:05 ToddAndMargo, wrote: > Hi All, > > https://docs.perl6.org/routine/join#(List)_routine_join > > method join(List:D: $separator --> Str:D) > > $ p6 'say (1, ).join("|");' > 1|a b c > > > In this instance you have passed in two objects the Int 1 and a list of > Str's (<>

Re: Could this be any more obscure?

2018-09-30 Thread Siavash
In the second line of my reply I was referring to the difference in flattening. In the first line I was saying that sub takes a list, but method doesn't, its invocant is a list. On 2018-09-30 14:18:53 +0330, ToddAndMargo wrote: > On 9/30/18 3:02 AM, Siavash wrote: >> Because one is a method

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:48 AM, JJ Merelo wrote: Nothing less that good Oklahoma tar and turkey feathers will do. JJ Will do! Perl6 is a shining example of kaisen. Every new thing I learn about it, I adore it.

join questions

2018-09-30 Thread ToddAndMargo
Hi All, https://docs.perl6.org/routine/join#(List)_routine_join method join(List:D: $separator --> Str:D) $ p6 'say (1, ).join("|");' 1|a b c It states in the manual that this will happen. Questions: 1) why? 2) where in the method definition does it state this will happen?

Re: Could this be any more obscure?

2018-09-30 Thread Laurent Rosenfeld via perl6-users
Hi Todd, I disagree with you. The P6 documentation can certainly be improved, but it is quite good and clear already. Remember that it is technical documentation, not a tutorial. And the example you chose to give does not support your point: the P6 documentation for join is just at least as clear

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 12:51, ToddAndMargo () escribió: > On 9/30/18 3:00 AM, JJ Merelo wrote: > > Hi > > > > El dom., 30 sept. 2018 a las 11:18, ToddAndMargo ( > >) escribió: > > > > On 9/30/18 1:21 AM, JJ Merelo wrote: > > > > > > > > > El

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:00 AM, JJ Merelo wrote: Hi El dom., 30 sept. 2018 a las 11:18, ToddAndMargo (>) escribió: On 9/30/18 1:21 AM, JJ Merelo wrote: > > > El dom., 30 sept. 2018 a las 10:15, Laurent Rosenfeld via perl6-users >

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 12:35, ToddAndMargo () escribió: > On 9/30/18 3:17 AM, JJ Merelo wrote: > > > > I actually found the Perl 6 description more readable. And the example > > is better too. > > I was showing the different philosophies. And I do agree, > the Perl 6 was one of the better

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 12:31, ToddAndMargo () escribió: > On 9/30/18 3:03 AM, JJ Merelo wrote: > > > > > > El dom., 30 sept. 2018 a las 11:32, ToddAndMargo ( > >) escribió: > > > > On 9/26/18 7:27 PM, Brandon Allbery wrote: > > > And again: this is

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:02 AM, Siavash wrote: Because one is a method and the other is a sub. Look at "List:D:". And they are not identical, the last example showed the difference. The sub sure seems like it slurps to me. $ p6 'join( ", ", 1, 2, 3).say;' 1, 2, 3 What am I missing?

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:17 AM, JJ Merelo wrote: I actually found the Perl 6 description more readable. And the example is better too. I was showing the different philosophies. And I do agree, the Perl 6 was one of the better descriptions. Perl 6 usually gets it butt kicked by perldocs.

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:17 AM, JJ Merelo wrote: But I think the example should show the slurpy part too. (join ', ', 1, 2, 3) It does now https://github.com/perl6/doc/issues/2344 Thanks for the suggestion. Cheers How about showing it both as a sub and as a method?

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:02 AM, Siavash wrote: People have suggested you to try a book and you have disagreed. Square peg, round hole

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 3:03 AM, JJ Merelo wrote: El dom., 30 sept. 2018 a las 11:32, ToddAndMargo (>) escribió: On 9/26/18 7:27 PM, Brandon Allbery wrote: > And again: this is only because you know perl 5. People are not born > knowing perl 5; to someone who

Re: A problem with native CArrays

2018-09-30 Thread JJ Merelo
This works: my int32 $a = 3; my int32 $b = 7; say $a * $b # OUTPUT: «21␤» El dom., 30 sept. 2018 a las 11:28, Fernando Santagata (< nando.santag...@gmail.com>) escribió: > Hi, > > I was hunting for a bug in my code, this one: > > my @a := CArray[int32].new: 6,3; > say [+] @a; # it should be

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 2:55 AM, Laurent Rosenfeld via perl6-users wrote: The star in the signature states that @list is a slurpy (or variadic) parameter, i.e. that @list will slurp up all remaining arguments provided to the subroutine. See:

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/26/18 6:12 PM, Peter Scott wrote: On 9/26/2018 3:21 PM, ToddAndMargo wrote: I use words all the time.  I never would have figured it out from     multi method words(Str:D $input: $limit = Inf --> Positional) Do your really think any beginner would be able to figure out "words" from the

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 12:04, Siavash () escribió: > > On 2018-09-30 13:01:32 +0330, ToddAndMargo wrote: > > On 9/26/18 7:27 PM, Brandon Allbery wrote: > >> And again: this is only because you know perl 5. People are not born > >> knowing perl 5; to someone who doesn't know it, perldoc

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 11:32, ToddAndMargo () escribió: > On 9/26/18 7:27 PM, Brandon Allbery wrote: > > And again: this is only because you know perl 5. People are not born > > knowing perl 5; to someone who doesn't know it, perldoc raises the same > > kinds of questions you have been

Re: Could this be any more obscure?

2018-09-30 Thread Siavash
On 2018-09-30 13:01:32 +0330, ToddAndMargo wrote: > On 9/26/18 7:27 PM, Brandon Allbery wrote: >> And again: this is only because you know perl 5. People are not born >> knowing perl 5; to someone who doesn't know it, perldoc raises the >> same kinds of questions you have been asking, and the

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
Hi El dom., 30 sept. 2018 a las 11:18, ToddAndMargo () escribió: > On 9/30/18 1:21 AM, JJ Merelo wrote: > > > > > > El dom., 30 sept. 2018 a las 10:15, Laurent Rosenfeld via perl6-users > > (mailto:perl6-users@perl.org>>) escribió: > > > > the words method is extracting items from an input

Re: Could this be any more obscure?

2018-09-30 Thread Laurent Rosenfeld via perl6-users
The star in the signature states that @list is a slurpy (or variadic) parameter, i.e. that @list will slurp up all remaining arguments provided to the subroutine. See: https://docs.perl6.org/type/Signature#index-entry-slurpy_argument Le dim. 30 sept. 2018 à 11:32, ToddAndMargo a écrit : > On

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 2:37 AM, Laurent Rosenfeld via perl6-users wrote: There is no need for a question mark after the $limit parameter, since supplying a default value for a parameter is sufficient to make this parameter optional. In this instance "yes", it is redundant. But, other instances where a

Re: Could this be any more obscure?

2018-09-30 Thread Laurent Rosenfeld via perl6-users
There is no need for a question mark after the $limit parameter, since supplying a default value for a parameter is sufficient to make this parameter optional. Le dim. 30 sept. 2018 à 11:17, ToddAndMargo a écrit : > On 9/30/18 1:21 AM, JJ Merelo wrote: > > > > > > El dom., 30 sept. 2018 a las

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/26/18 7:27 PM, Brandon Allbery wrote: And again: this is only because you know perl 5. People are not born knowing perl 5; to someone who doesn't know it, perldoc raises the same kinds of questions you have been asking, and the answers have to be found in perlsyn or perldata, etc. Which

A problem with native CArrays

2018-09-30 Thread Fernando Santagata
Hi, I was hunting for a bug in my code, this one: my @a := CArray[int32].new: 6,3; say [+] @a; # it should be "say [+] @a.list;" That statement prints "9", while changing the '+' with a '*' it generates an error, as it should: Cannot resolve caller Numeric(NativeCall::Types::CArray[int32]: );

Re: Could this be any more obscure?

2018-09-30 Thread ToddAndMargo
On 9/30/18 1:21 AM, JJ Merelo wrote: El dom., 30 sept. 2018 a las 10:15, Laurent Rosenfeld via perl6-users (mailto:perl6-users@perl.org>>) escribió: the words method is extracting items from an input string. The $limit parameter tells the words method to extract not more than

Re: Could this be any more obscure?

2018-09-30 Thread JJ Merelo
El dom., 30 sept. 2018 a las 10:15, Laurent Rosenfeld via perl6-users (< perl6-users@perl.org>) escribió: > the words method is extracting items from an input string. The $limit > parameter tells the words method to extract not more than $limit items from > the string. Setting the default to Inf

Re: Could this be any more obscure?

2018-09-30 Thread Laurent Rosenfeld via perl6-users
the words method is extracting items from an input string. The $limit parameter tells the words method to extract not more than $limit items from the string. Setting the default to Inf only tells the method to extract as many items as it can from the input (i.e. to process the whole string),