Re: Please explain this to me

2018-09-16 Thread Brandon Allbery
Binding, iirc. You are binding a value directly instead of making a box to assign it to. On Mon, Sep 17, 2018 at 1:47 AM ToddAndMargo wrote: > >> On Sun, Sep 16, 2018 at 9:02 PM ToddAndMargo >> > wrote: > >> > >> On 09/16/2018 05:58 PM, Curt Tilmes wrote: > >>

Re: Please explain this to me

2018-09-16 Thread Brad Gilbert
I think I have an idea of where your thinking is going wrong. The trouble is going to be to describe it so that you can understand. First, I think you may be misunderstanding what we mean by defined and undefined. So I will use "instance" and "class" --- class Foo {}; say Foo; # <-

Re: Please explain this to me

2018-09-16 Thread ToddAndMargo
On Sun, Sep 16, 2018 at 9:02 PM ToddAndMargo > wrote: On 09/16/2018 05:58 PM, Curt Tilmes wrote: > Read this: > https://perl6advent.wordpress.com/2017/12/02/perl-6-sigils-variables-and-containers/ > > Then go back and read it again. It t

Re: Please explain this to me

2018-09-16 Thread Brandon Allbery
If you say "my $foo = 42", you are saying that $x is a box, and you are putting 42 into it. You can put something else into that box later. If you say "my $foo := 42", you are saying that $x is 42 itself, not a box containing 42. You can think of it as a constant of sorts. Because it's not a box,

Re: Please explain this to me

2018-09-16 Thread ToddAndMargo
On 09/16/2018 06:41 PM, ToddAndMargo wrote: Hi Mark, I am sorry, but books don't work for me.  Manuals do. And correspondences do too.   That is just the way my brain works. And, yes, I know I am weird. -T Videos don't work either. When I am forced to watch one to figure something out (Inksc

RE: Please explain this to me

2018-09-16 Thread Mark Devine
I get it. Different angles of approach. Some methods don't make a dent with me (I.e. rote). Mark -Original Message- From: ToddAndMargo Sent: Sunday, September 16, 2018 21:42 To: perl6-users@perl.org Subject: Re: Please explain this to me On 09/16/2018 06:23 PM, Mark Devine

Re: Please explain this to me

2018-09-16 Thread ToddAndMargo
On 09/16/2018 06:23 PM, Mark Devine wrote: foy, brian d. Learning Perl 6: Keeping the Easy, Hard, and Impossible Within Reach (Kindle Location 557). O'Reilly Media. Kindle Edition. Chapter 2: Binding and Assignment: "There’s an important concept here that you should learn early." [[ what foll

RE: Please explain this to me

2018-09-16 Thread Mark Devine
ust right and I'm having mini-epiphanies one after another. So recommended... Mark -Original Message- From: ToddAndMargo Sent: Sunday, September 16, 2018 21:02 To: perl6-users@perl.org Subject: Re: Please explain this to me On 09/16/2018 05:58 PM, Curt Tilmes wrote: > Read thi

Re: Please explain this to me

2018-09-16 Thread ToddAndMargo
On 09/16/2018 05:58 PM, Curt Tilmes wrote: Read this: https://perl6advent.wordpress.com/2017/12/02/perl-6-sigils-variables-and-containers/ Then go back and read it again.  It took me several times, and I'm still not sure I get it all :) I am spacing on the difference between my $foo = 4

Re: Please explain this to me

2018-09-16 Thread Curt Tilmes
Read this: https://perl6advent.wordpress.com/2017/12/02/perl-6-sigils-variables-and-containers/ Then go back and read it again. It took me several times, and I'm still not sure I get it all :) On Sun, Sep 16, 2018 at 8:49 PM ToddAndMargo wrote: > On 09/14/2018 08:07 PM, ToddAndMargo wrote: >

Re: Please explain this to me

2018-09-16 Thread ToddAndMargo
On 09/14/2018 08:07 PM, ToddAndMargo wrote: ":D"     means it wants actual data in the string and not a Nil.     The jargon for this requirement is that is is constrained     to an actual value     If it wanted a Nil, it would say ":U" or constrained to     a Nil Iteration 3: ":D" m

Re: Please explain this to me

2018-09-16 Thread yary
":D" means it wants actual data in the string and not a Nil. The jargon for this requirement is that is is constrained to an actual value If it wanted a Nil, it would say ":U" or constrained to a Nil Think of :D as a"defined" and :U as "Undefined" - Nil is a special thing, eve

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

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

2018-09-13 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-13 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, explai

Re: Please explain this to me

2018-09-13 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. That's rather a dynamic way of not budging. Cheers JJ I wrote you off list giving you my reasoni

Re: Please explain this to me

2018-09-13 Thread Todd Chester
On 09/12/2018 10:34 AM, Larry Wall wrote: 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

Re: Please explain this to me

2018-09-13 Thread JJ Merelo
Hi, El vie., 14 sept. 2018 a las 7:11, Todd Chester () escribió: > > > On 09/11/2018 05:05 AM, Simon Proctor wrote: > > Please note the Perl5 docs have had decades of people working on them > > the Perl6 ones less so. There's bound to be some difference in scope. > > Hi Simon, > > That you fo

Re: Please explain this to me

2018-09-13 Thread Todd Chester
On 09/11/2018 05:05 AM, Simon Proctor wrote: Please note the Perl5 docs have had decades of people working on them the Perl6 ones less so. There's bound to be some difference in scope. Hi Simon, That you for the tutorial. I have it tagged to read over again really SSSLLLOOOWWLY As for

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 ki

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:

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:09 AM, ToddAndMargo wrote: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) Okay, I know that    Str is a string    Cool is an object that can be treated as both a string and a number    $needle is the second optional parameter What is "D"? $needle is optional

Re: Please explain this to me

2018-09-11 Thread Curt Tilmes
There's a talk for that too: https://www.youtube.com/watch?v=7mkmZVIizFY 2016 - Basic OO in Perl 6‎ - Dave Rolsky On Tue, Sep 11, 2018 at 1:42 PM 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

Re: Please explain this to me

2018-09-11 Thread Brandon Allbery
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. On Tue, Sep 11, 2018 at 8:34 AM Simon Proctor wrote: > Also Todd I gave a talk on signatures types a

Re: Please explain this to me

2018-09-11 Thread Simon Proctor
Also Todd I gave a talk on signatures types and multi methods at The Perl Conference this year. https://www.youtube.com/watch?v=Sy-qb5nXKyc&t=8606s That should be just before the start. https://www.slideshare.net/SimonProctor8/perl6-signatures-types-and-multicall Slides are here. Hope this hel

Re: Please explain this to me

2018-09-11 Thread Simon Proctor
1) why is it a "method" and not a "function"? methods are all on instance of a Class (or Role) they can locally access the instances data via self or $ or ... see below. 1-1/2) why is there a color after a$? What happens to $a? You can as an extra option give your instance object a different n

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:30 AM, JJ Merelo wrote: Also, "is no help whatsoever" is no help whatsoever. Saying what part of it is not clear enough, or could be explained better, is. Well now, > method ($a: @b, %c) {}; # first argument is the invocant 1) why is it a "method" and not a "function

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:50, ToddAndMargo wrote: > On 09/11/2018 03:09 AM, ToddAndMargo wrote: >> multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) > > What the heck (not my exact word) is "multi method"? > > What is wrong with calling it a "function"? Multi Methods are methods that do "multipl

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:09 AM, ToddAndMargo wrote: multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) What the heck (not my exact word) is "multi method"? What is wrong with calling it a "function"?

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:38, Curt Tilmes wrote: > > On Tue, Sep 11, 2018 at 6:27 AM ToddAndMargo > wrote: > > method ($a: @b, %c) {};       # first argument is the invocant > > > I might say rather that $a is a parameter for the invocant.  The @b > parameter holds all the p

Re: Please explain this to me

2018-09-11 Thread Curt Tilmes
On Tue, Sep 11, 2018 at 6:27 AM ToddAndMargo wrote: > method ($a: @b, %c) {}; # first argument is the invocant > I might say rather that $a is a parameter for the invocant. The @b parameter holds all the positional arguments, %c holds the named arguments. > class Foo { > method who

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:23, ToddAndMargo wrote: > As I understand it $needle? is the second optional parameter > and it is an integer, not "Cool" (both a string and a number). Where did you get "$needle?" from? I'm looking at the docs for method "contains" of type Str right now and it only says that $pos i

Re: Please explain this to me

2018-09-11 Thread JJ Merelo
El mar., 11 sept. 2018 a las 12:26, ToddAndMargo () escribió: > On 09/11/2018 03:22 AM, Timo Paulssen wrote: > > On 11/09/18 12:18, JJ Merelo wrote: > >> > >> > >> El mar., 11 sept. 2018 a las 12:15, Timo Paulssen ( >> >) escribió: > >> > >> The colon at the end of "St

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:22 AM, Timo Paulssen wrote: On 11/09/18 12:18, JJ Merelo wrote: El mar., 11 sept. 2018 a las 12:15, Timo Paulssen (>) escribió: The colon at the end of "Str:D:" signifies that it's a type constraint on what you call the method on. For example

Re: Please explain this to me

2018-09-11 Thread ToddAndMargo
On 09/11/2018 03:14 AM, Timo Paulssen wrote: The colon at the end of "Str:D:" signifies that it's a type constraint on what you call the method on. For example: my Str $foo; $foo.contains("hello", 0); won't work because $foo is currently not defined, i.e. doesn't pass the :D constraint. The :

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
On 11/09/18 12:18, JJ Merelo wrote: > > > El mar., 11 sept. 2018 a las 12:15, Timo Paulssen ( >) escribió: > > The colon at the end of "Str:D:" signifies that it's a type > constraint on what you call the method on. For example: > > > That, of course, is also in the

Re: Please explain this to me

2018-09-11 Thread JJ Merelo
El mar., 11 sept. 2018 a las 12:15, Timo Paulssen () escribió: > The colon at the end of "Str:D:" signifies that it's a type constraint on > what you call the method on. For example: > That, of course, is also in the documentation: https://docs.perl6.org/type/Signature#index-entry-type_constraint

Re: Please explain this to me

2018-09-11 Thread Timo Paulssen
The colon at the end of "Str:D:" signifies that it's a type constraint on what you call the method on. For example: my Str $foo; $foo.contains("hello", 0); won't work because $foo is currently not defined, i.e. doesn't pass the :D constraint. The : at the end means that the constraint "Str:D" app

Please explain this to me

2018-09-11 Thread ToddAndMargo
multi method contains(Str:D: Cool:D $needle, Int(Cool:D) $pos) Okay, I know that Str is a string Cool is an object that can be treated as both a string and a number $needle is the second optional parameter What is "D"? $needle is optional, why is it not stated as "$needle?" How is bot