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

2018-09-16 Thread ToddAndMargo
On 9/16/18 7:37 PM, Curt Tilmes wrote: Rat is a type (a 'class'). It is also a method on class Numeric.  You can take anything Numeric, and call .Rat() on it to get an equivalent Rat (well, within $epsilon) You can't, for example, say my Rat $x = pi; Since pi is not rational -- it won't fit

Re: Rat

2018-09-16 Thread ToddAndMargo
On 9/16/18 7:34 PM, Vadim Belman wrote: You're messing up a type and a method to convert into that type. For example, dd "1.2".Rat will output you a rational whereas dd "1.2" will output a string. Again, search for Rat on docs gives you a line just under the Class section. I had to learn

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

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 9/16/18 8:59 PM, Brandon Allbery wrote: Also, going by math calling the "real numbers" misses that math treats integers as a subset of real numbers; there is no hard distinction between them in math. Computers need hard distinctions here because integral, rational, and floating point

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 9/16/18 9:10 PM, Brandon Allbery wrote: Sort of. A role is a "package" of components available to build classes from. This allows someone to write a sub or method that works for any kind of number by using the role instead of having to write the same thing over and over for every numeric

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 9/16/18 9:02 PM, ToddAndMargo wrote: On 9/16/18 8:51 PM, Brandon Allbery wrote: You're assuming "Real" means "a float of some kind". It's not; it defines all the operations in common over non-Complex numbers (Int, Rat, Num, etc.). What you are looking for, Perl 6 calls Num.

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
Sort of. A role is a "package" of components available to build classes from. This allows someone to write a sub or method that works for any kind of number by using the role instead of having to write the same thing over and over for every numeric class, or every class representing a non-complex

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: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 9/16/18 8:51 PM, Brandon Allbery wrote: You're assuming "Real" means "a float of some kind". It's not; it defines all the operations in common over non-Complex numbers (Int, Rat, Num, etc.). What you are looking for, Perl 6 calls Num. https://docs.perl6.org/type.html: Real role

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
Also, going by math calling the "real numbers" misses that math treats integers as a subset of real numbers; there is no hard distinction between them in math. Computers need hard distinctions here because integral, rational, and floating point numbers must be stored in different ways, unless they

Re: metamorphosis or alchemy?

2018-09-16 Thread Brandon Allbery
You're assuming "Real" means "a float of some kind". It's not; it defines all the operations in common over non-Complex numbers (Int, Rat, Num, etc.). What you are looking for, Perl 6 calls Num. On Sun, Sep 16, 2018 at 8:53 PM ToddAndMargo wrote: > Hi All, > > I am confused, again: > > > $ p6

Re: metamorphosis or alchemy?

2018-09-16 Thread Vadim Belman
Actually what I meant was my Real $x = 3; $x = Nil; $x.WHO.say What you must read undoubtedly are this: https://docs.perl6.org/language/containers and this: https://opensource.com/article/18/8/containers-perl-6

Re: Rat

2018-09-16 Thread Curt Tilmes
Rat is a type (a 'class'). It is also a method on class Numeric. You can take anything Numeric, and call .Rat() on it to get an equivalent Rat (well, within $epsilon) You can't, for example, say my Rat $x = pi; Since pi is not rational -- it won't fit in that box. You can, however, ask pi to

Re: Rat

2018-09-16 Thread Vadim Belman
You're messing up a type and a method to convert into that type. For example, dd "1.2".Rat will output you a rational whereas dd "1.2" will output a string. Again, search for Rat on docs gives you a line just under the Class section. > 16 вер. 2018 р. о 22:29 ToddAndMargo написав(ла): >

Re: metamorphosis or alchemy?

2018-09-16 Thread Curt Tilmes
Note that 'dd' is not part of Perl 6. It is a Rakudo enhancement. (I agree it should be documented, but some disagree..) dd is describing the value, not the container. it is describing the value you've got in the container, not the container. You can use ".VAR" to check out the container

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
16 вер. 2018 р. о 22:11 Curt Tilmes > написав(ла): It isn't changing anything. You've still got a box ('container') that can only hold something 'Real'. You just happen to have a value in that box that is a 'Rat'. It is perfectly fine to put a Rat value in a Real box,

Rat

2018-09-16 Thread ToddAndMargo
Hi All, What in the world are they trying to say here? https://docs.perl6.org/routine/Rat (Numeric) method Rat method Rat(Numeric:D: Real $epsilon = 1.0e-6 --> Rat:D) If this Numeric is equivalent to a Real, return a Rat which is within $epsilon of that Real's value. Fail

Re: metamorphosis or alchemy?

2018-09-16 Thread Vadim Belman
Actually, typing 'dd' in the searchbox on docs.perl6.org gives you a long list with dd in 'Reference' section of that list. > > https://docs.perl6.org/routine/dd > 404: Page Not Found > > Search does not work either. > Best regards, Vadim Belman

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On Sun, Sep 16, 2018 at 10:07 PM ToddAndMargo > wrote: On 09/16/2018 06:50 PM, Curt Tilmes wrote: > Note that an object that is a Rat also does Real (see > https://docs.perl6.org/type/Rat#Type_Graph) > > say Rat ~~ Real > > True

Re: metamorphosis or alchemy?

2018-09-16 Thread Vadim Belman
I would add on top of Curt's explanation. Try assigning Nil to $x and then ask for its type. You'll get your Real back! > 16 вер. 2018 р. о 22:11 Curt Tilmes написав(ла): > > It isn't changing anything. > > You've still got a box ('container') that can only hold something 'Real'. > > You

Re: metamorphosis or alchemy?

2018-09-16 Thread Curt Tilmes
It isn't changing anything. You've still got a box ('container') that can only hold something 'Real'. You just happen to have a value in that box that is a 'Rat'. It is perfectly fine to put a Rat value in a Real box, because a Rat is also a Real (does the 'Real' role). You can still stick

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 09/16/2018 06:50 PM, Curt Tilmes wrote: Note that an object that is a Rat also does Real (see https://docs.perl6.org/type/Rat#Type_Graph) say Rat ~~ Real True Your're making a box that takes a Real, then putting a Rat (that also does Real) into that box. It then says "yes, you've got a

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

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

Re: metamorphosis or alchemy?

2018-09-16 Thread Curt Tilmes
Note that an object that is a Rat also does Real (see https://docs.perl6.org/type/Rat#Type_Graph) say Rat ~~ Real True Your're making a box that takes a Real, then putting a Rat (that also does Real) into that box. It then says "yes, you've got a Rat in there". On Sun, Sep 16, 2018 at 9:35

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

Re: metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
On 09/16/2018 05:52 PM, ToddAndMargo wrote: Hi All, I am confused, again: $ p6 'my $x=3; dd $x' Int $x = 3 Makes sense $ p6 'my $x; dd $x' Any $x = Any Makes Sense $ p6 'my Real $x; dd $x' Real $x = Real makes sense $ p6 'my Real $x = 3; dd $x' Int $x = 3 What Integer ?  Did I or

RE: Please explain this to me

2018-09-16 Thread Mark Devine
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 follows in the most concise and understandable

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 =

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

metamorphosis or alchemy?

2018-09-16 Thread ToddAndMargo
Hi All, I am confused, again: $ p6 'my $x=3; dd $x' Int $x = 3 Makes sense $ p6 'my $x; dd $x' Any $x = Any Makes Sense $ p6 'my Real $x; dd $x' Real $x = Real makes sense $ p6 'my Real $x = 3; dd $x' Int $x = 3 What Integer ? Did I or did I not just tell it is was a "Real" ?

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"

Re: escape codes

2018-09-16 Thread ToddAndMargo
On 09/16/2018 10:46 AM, yary wrote: escape sequence Hi All, Once I knew what they were called, I found a list. It is for Java, but I do believe most of its words in Parl6 And, besides, the more grouchy members of comp.lang.perl.misc, think Perl 6 is Java anyway. Just added this: RFE: May be

Re: escape codes

2018-09-16 Thread yary
One way to think about the word "escape" in "escape sequence" is about escaping one string language for another. In the normal string language, every character in is the same character out. Escape via \ and it's another language where t is tab, r is carriage return, etc. -y On Sun, Sep 16, 2018

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,

Re: escape codes

2018-09-16 Thread The Sidhekin
On Sun, Sep 16, 2018 at 3:45 PM Parrot Raiser <1parr...@gmail.com> wrote: > -- Forwarded message -- > From: Parrot Raiser <1parr...@gmail.com> > Date: Sun, 16 Sep 2018 09:41:44 -0400 > Subject: Re: escape codes > To: ToddAndMargo > > Those (\t & \n) aren't "escape characters",

Fwd: escape codes

2018-09-16 Thread Parrot Raiser
-- Forwarded message -- From: Parrot Raiser <1parr...@gmail.com> Date: Sun, 16 Sep 2018 09:41:44 -0400 Subject: Re: escape codes To: ToddAndMargo Those (\t & \n) aren't "escape characters", (though the \ is an escape, so you might classify t & n a "escaped"). I think the term

Re: Is this a bug?

2018-09-16 Thread Elizabeth Mattijsen
I don’t think we have a separate queue for REPL, so https://github.com/rakudo/rakudo/issues is the place > On 16 Sep 2018, at 15:01, Fernando Santagata > wrote: > > Should I report this here: https://github.com/rakudo/rakudo/ or there's a > specific location for the REPL? > > On Sun, Sep

Re: Is this a bug?

2018-09-16 Thread Fernando Santagata
Should I report this here: https://github.com/rakudo/rakudo/ or there's a specific location for the REPL? On Sun, Sep 16, 2018 at 2:28 PM Elizabeth Mattijsen wrote: > Definitely a bug. Which seems to be limited to the REPL only, fortunately. > > > On 16 Sep 2018, at 12:57, Fernando Santagata

Re: Is this a bug?

2018-09-16 Thread Elizabeth Mattijsen
Definitely a bug. Which seems to be limited to the REPL only, fortunately. > On 16 Sep 2018, at 12:57, Fernando Santagata > wrote: > > Hello, > > I found this behavior quite strange: > >> my int32 $a = 2 > 2 >> $a.^name > Int >> $a.WHAT > At Frame 1, Instruction 20, op 'getlex_ni', operand

Information about Perl 6 internals

2018-09-16 Thread Fernando Santagata
Hello, I'm developing an interface to libfftw3 (Fastest Fourier Transform in the West). The library provides a function to allocate SIMD-aligned memory (Single Instruction Multiple Data), in order to maximize access speed to data. Before I start to investigate a way to blandish a CArray into

Is this a bug?

2018-09-16 Thread Fernando Santagata
Hello, I found this behavior quite strange: > my int32 $a = 2 2 > $a.^name Int > $a.WHAT At Frame 1, Instruction 20, op 'getlex_ni', operand 0, MAST::Local of wrong type (3) specified; expected 4 > my num64 $b = 1.23e-2 0.0123 > $b.^name Num > $b.WHAT (Num) This is Rakudo version 2018.08 built

escape codes

2018-09-16 Thread ToddAndMargo
Hi All, Two question: 1) What is the official name for the escape codes used in strings? print "Hi\tBye\n"; 2) is there a list of them somewhere? Many thanks, -T -- ~ When we ask for advice, we are usually looking

Re: .kv ?

2018-09-16 Thread ToddAndMargo
On 09/15/2018 03:16 PM, Brad Gilbert wrote: Anyway I edited the Option Types post. Hi Brad, I like it! That took some thinking. You kicked it! To designate that it must have a defined value assigned to it (not be in the null state), use the :D "smiley" designation. It is

Re: .kv ?

2018-09-16 Thread ToddAndMargo
On 09/15/2018 03:16 PM, Brad Gilbert wrote: I'm just saying that brains are wired differently. Hi Brad, Oh no fooling. I mainly make my living off of troubleshooting. I am I.T. for small businesses: Windows, Linux, and Mac. (25 years at this now) When I arrive, I am frequently not the first

Re: Need regex help

2018-09-16 Thread ToddAndMargo
On 09/15/2018 07:32 PM, Larry Wall wrote: On Sat, Sep 15, 2018 at 06:45:33PM -0700, ToddAndMargo wrote: : Hi All, : : I have been doing a bunch with regex's lately. : I just throw them out based on prior experience : and they most all work now. I only sometimes have to : ask for help. (The