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 answers have >> to be found in perlsyn or perldata, etc. Which is exactly what you >> have been complaining about with respect to perl 6 doing the same >> kind of thing. > > Geez Louise Bradley! The above is a really bad argument! > > "perldocs -f xxx" is a bazillion times easier to understand > than Perl 6's manual, regardless if you know Perl 5 or not. > > And, by the way, I wonder just how may are coming to Perl 6 > without ANY Perl 5 experience? > > In every instance I can look up, perldocs puts Perl 6's > documentation to shame. > > A simple comparison: which one leaves you knowing how to use > the function and which one leaves you wondering "What the h***???" > > $ perldoc -f join > join EXPR,LIST > Joins the separate strings of LIST into a single string with > fields separated by the value of EXPR, and returns that new > string. Example: > > my $rec = join(':', > $login,$passwd,$uid,$gid,$gcos,$home,$shell); > > Beware that unlike "split", "join" doesn't take a pattern > as its first argument. Compare "split". > > > > https://docs.perl6.org/routine/join#(List)_routine_join > > (List) routine join > > Defined as: > > sub join($separator, *@list --> Str:D) > method join(List:D: $separator --> Str:D) > > Treats the elements of the list as strings, interleaves > them with $separator and concatenates everything into a > single string. > > Example: > > join ', ', <a b c>; # RESULT: «a, b, c» > > Note that the method form does not flatten sublists: > > say (1, <a b c>).join('|'); # OUTPUT: «1|a b c» >
I actually found the Perl 6 description more readable. And the example is better too. But I think the example should show the slurpy part too. (join ', ', 1, 2, 3) > > Oh and what the &*@% is a "*@list"? It seems you want to read a signature without learning how signatures work. https://docs.perl6.org/type/Signature#Slurpy_%28A.K.A._variadic%29_parameters > And why does the sub have one > and the method does not? They are suppose to be identical. > > -T 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. People have suggested you to try a book and you have disagreed. But to me it looks like you are reading different chapters of a book different people are writing for you on the mailing list.