Re: A comparison between P5 docs and p6 docs

2018-09-12 Thread Peter Scott
Ordinarily I would agree with you. But I know my own brain and how it works. I only learn by doing. Have tried to change that and can't. A good tutorial book *will* make you "do." The brian d foy book does exactly that with things to try, and questions to explore in your own code. It

Re: A comparison between P5 docs and p6 docs

2018-09-12 Thread Brad Gilbert
The signatures in the docs are often the exact same signatures as the code they are documenting. > Str.^lookup('contains').candidates.map: *.signature.say (Str:D: Cool:D $needle, *%_) (Str:D: Str:D $needle, *%_) (Str:D: Cool:D $needle, Cool:D $pos, *%_) (Str:D: Str:D $needle,

Re: Functions and subroutines?

2018-09-12 Thread Elizabeth Mattijsen
> On 12 Sep 2018, at 22:56, Joseph Brenner wrote: > With perl6, I find myself stumbling over what to call the built-ins... > "functions", "commands", "keywords”? perhaps “builtins"? Liz

Re: Functions and subroutines?

2018-09-12 Thread Joseph Brenner
> they were all just subs. With perl5 code, I've gravitated to talking about "routines" when I don't want to worry about whether something is technically a function or a method. It doesn't seem to confuse anyone. (On the other hand, I've had people make fun of me for using the word

Re: Please explain this to me

2018-09-12 Thread Larry Wall
On Tue, Sep 11, 2018 at 10:28:27PM -0700, ToddAndMargo wrote: : Okay, foul! :Str:D: Cool:D $needle : why is there not a comma between "Str:D:" and "Cool:D"? : And what is with the extra ":". By chance is the extra ":" : a confusing way of using a comma for a separator? Well, "confusing" is

Re: Nil ?

2018-09-12 Thread Larry Wall
Basically, ignore any advice to treat Nil as a normal value, because it really is intended to represent the *absence* of a value as much as possible. It's a bit like the way solid-state electronics treats "holes" as if they were real particles, and gets away with it much of the time. But not all

Re: how do I do this index in p6?

2018-09-12 Thread Parrot Raiser
Neat. The answer's round about right. On 9/12/18, Fernando Santagata wrote: > Patched :-) > say (e**(i*pi)+1).round(10⁻¹²) > > On Wed, Sep 12, 2018 at 4:28 PM Parrot Raiser <1parr...@gmail.com> wrote: > >> Just for giggles, say e**(i*pi) + 1 prints 0+1.2246467991473532e-16i >> which isn't

Re: how do I do this index in p6?

2018-09-12 Thread Fernando Santagata
Patched :-) say (e**(i*pi)+1).round(10⁻¹²) On Wed, Sep 12, 2018 at 4:28 PM Parrot Raiser <1parr...@gmail.com> wrote: > Just for giggles, say e**(i*pi) + 1 prints 0+1.2246467991473532e-16i > which isn't exactly right, but close enough for government work. > (You could call it really right, the

Re: Nil ?

2018-09-12 Thread JJ Merelo
When you assign Nil to a string or any object, it takes its default value. Cheers El mié., 12 sept. 2018 a las 10:23, Simon Proctor () escribió: > O learn something new everyday :) > > On Wed, 12 Sep 2018 at 08:46 Elizabeth Mattijsen wrote: > >> Also: >> >> my $a is default(Nil); >> >> >

Re: Nil ?

2018-09-12 Thread Simon Proctor
O learn something new everyday :) On Wed, 12 Sep 2018 at 08:46 Elizabeth Mattijsen wrote: > Also: > > my $a is default(Nil); > > > On 12 Sep 2018, at 09:25, Simon Proctor wrote: > > > > If you don't define the type of a Scalar and don't assign to it you'll > have an undefined Any (the

Re: Nil ?

2018-09-12 Thread Elizabeth Mattijsen
Also: my $a is default(Nil); > On 12 Sep 2018, at 09:25, Simon Proctor wrote: > > If you don't define the type of a Scalar and don't assign to it you'll have > an undefined Any (the Parent class of all the other types). If you assign Nil > to it then you have the same effect. > > You can

Re: Nil ?

2018-09-12 Thread Simon Proctor
If you don't define the type of a Scalar and don't assign to it you'll have an undefined Any (the Parent class of all the other types). If you assign Nil to it then you have the same effect. You can make $x to be Nil by iether casting it : my Nil $x; or binding it to Nil; my $x; $x := Nil;

Re: Please explain this to me

2018-09-12 Thread Simon Proctor
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. On Wed, 12 Sep 2018 at 06:29 ToddAndMargo wrote: > On 09/11/2018 03:09 AM, ToddAndMargo wrote: > > multi method contains(Str:D: