Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 10:50 AM, Brandon Allbery wrote: "dd" is a built in Data::Dumper, in Perl 5 terms, not a conversion routine. I wanted it to show clearly the types, but it's not as clear as it might have been because I was dumping expressions instead of variables (where it would have shown name

Re: start up delay?

2018-08-07 Thread ToddAndMargo
On 08/07/2018 01:39 PM, ToddAndMargo wrote: On Wed, 1 Aug 2018 at 19:15, ToddAndMargo wrote: Hi All, Is it just me or does Perl 6 take about three times as long to start up as Perl 5?  I do have a very fast machine and it takes about seven see for some of my Perl 6 stuff to get past the

Re: start up delay?

2018-08-07 Thread ToddAndMargo
On Wed, 1 Aug 2018 at 19:15, ToddAndMargo wrote: Hi All, Is it just me or does Perl 6 take about three times as long to start up as Perl 5? I do have a very fast machine and it takes about seven see for some of my Perl 6 stuff to get past the ruminating phase and start running. Any

Re: Force integers in an array?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 04:38 PM, ToddAndMargo wrote: Hi All, Is there a way to force all the members of an array to be integers and to error out is a non-integer is written to one of its cells? Many thanks, -T On 08/06/2018 01:40 PM, Benji wrote: > my Int @a = 1, 2, 3; > > @a.push: 'a'; > > # Type

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 04:58 PM, ToddAndMargo wrote: Hi All, How do I assign a string that looks like an integer into an interger? $str = "601"  -- > $int = 601 Many thanks, -T On 08/06/2018 02:00 PM, Benji wrote: > my $i = "601".Int > > Thank you!

Re: string to integer?

2018-08-07 Thread Brandon Allbery
"dd" is a built in Data::Dumper, in Perl 5 terms, not a conversion routine. I wanted it to show clearly the types, but it's not as clear as it might have been because I was dumping expressions instead of variables (where it would have shown name and type as well). On Tue, Aug 7, 2018 at 3:03 AM

Re: string to integer?

2018-08-07 Thread Timo Paulssen
oops, i only now saw the thread you had about it. never mind, then! On 07/08/18 15:31, Timo Paulssen wrote: > dd is a function that outputs a value, and dd returns Nil. You're > assigning the result of dd to $x, which resets the variable to its > default value, which is the (Str) you see, i.e.

Re: string to integer?

2018-08-07 Thread Timo Paulssen
dd is a function that outputs a value, and dd returns Nil. You're assigning the result of dd to $x, which resets the variable to its default value, which is the (Str) you see, i.e. an undefined String. Just throw out the dd, you don't need it to stringify things, only the ~ or + prefix is

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread Simon Proctor
Moarvm is the Perl6 Virtual Machine that is one of the targets Rakudo compiles to (the JVM is another). Basically at the moment when people talk about Perl6 that mostly mean Perl6 compiled with Rakudo running on MoarVM. (As I understand it). the dd bit was not in the example as part of string

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On 08/06/2018 01:58 PM, ToddAndMargo wrote: Hi All, How do I assign a string that looks like an integer into an interger? $str = "601"  -- > $int = 601 Many thanks, -T Follow up. My notes on String to Integer and Integer to String: Perl 6: convert String to Integer and Integer to

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread ToddAndMargo
On Tue, 7 Aug 2018, 08:16 ToddAndMargo, > wrote: Hi All, I am confused. This line will convert a string into an integer, but will print out and extra line with "(Int)" on it: $ p6 'my Str $x = "5"; my Int $y = dd +$x; say $y' 5

Re: Why use dd to convert a string to an integer?

2018-08-07 Thread Simon Proctor
dd is the moarvm specific data dump command. You don't need it. On Tue, 7 Aug 2018, 08:16 ToddAndMargo, wrote: > Hi All, > > I am confused. > > This line will convert a string into an integer, but > will print out and extra line with "(Int)" on it: > > $ p6 'my Str $x = "5"; my Int $y = dd

Re: string to integer?

2018-08-07 Thread ToddAndMargo
On Mon, Aug 6, 2018 at 4:59 PM ToddAndMargo > wrote: Hi All, How do I assign a string that looks like an integer into an interger? $str = "601" -- > $int = 601 Many thanks, -T On 08/06/2018 02:01 PM, Brandon Allbery wrote: Prefix +