Re: odd and even

2018-04-30 Thread JJ Merelo
Check out the docs.perl6.org page... And no, we don't. El lun., 30 abr. 2018 a las 8:48, ToddAndMargo () escribió: > Hi All, > > I know it would only take me 25 seconds to write one, > but do we have an odd and even function build in? > > > Many thanks, > -T > > $ perl6 -e 'my $x=3; say $x.odd;'

Re: odd and even

2018-04-30 Thread ToddAndMargo
On 04/30/2018 12:04 AM, JJ Merelo wrote: Check out the docs.perl6.org page... And no, we don't. Love the docs. Not always really helpful though.

Re: odd and even

2018-04-30 Thread JJ Merelo
When they are not, please raise an issue. We'll try to solve it ASAP. El lun., 30 abr. 2018 a las 9:46, ToddAndMargo () escribió: > On 04/30/2018 12:04 AM, JJ Merelo wrote: > > Check out the docs.perl6.org page... And no, we > > don't. > > Love the docs. Not always really

inheritance and default attributes

2018-04-30 Thread Theo van den Heuvel
Hi all, trying to make sense of the following excerpt from the documentation on object construction: Due to the default behavior of BUILDALL and BUILD submethods, named arguments to the constructor new derived from Mu can correspond directly to public attributes of any of the classes in th

Re: inheritance and default attributes

2018-04-30 Thread Elizabeth Mattijsen
> On 30 Apr 2018, at 10:55, Theo van den Heuvel wrote: > > Hi all, > > trying to make sense of the following excerpt from the documentation on > object construction: > > Due to the default behavior of BUILDALL and BUILD submethods, named arguments > to the constructor new derived from Mu > ca

Re: odd and even

2018-04-30 Thread ToddAndMargo
El lun., 30 abr. 2018 a las 9:46, ToddAndMargo (>) escribió: On 04/30/2018 12:04 AM, JJ Merelo wrote: > Check out the docs.perl6.org page... And no, we > don't. Love the docs. Not always really

Re: inheritance and default attributes

2018-04-30 Thread JJ Merelo
El lun., 30 abr. 2018 a las 11:08, Elizabeth Mattijsen () escribió: > > On 30 Apr 2018, at 10:55, Theo van den Heuvel > wrote: > > > > Hi all, > > > > trying to make sense of the following excerpt from the documentation on > object construction: > > > > Due to the default behavior of BUILDALL and

Re: inheritance and default attributes

2018-04-30 Thread Theo van den Heuvel
Thanks Elibeth and JJMerelo, stupid mistake. I use stack overflow all the time. Thanks, Theo https://stackoverflow.com/questions/50031400/inheriting-private-attributes-in-perl-6 And this is why I always encourage people to post questions to StackOverflow. Or also to StackOverflow :-) JJ -

Re: odd and even

2018-04-30 Thread Martin Barth
Are you aware of the %% operator? $var %% 2 checks wether it is dividable by 2. Am 30.04.2018 um 08:47 schrieb ToddAndMargo: Hi All, I know it would only take me 25 seconds to write one, but do we have an odd and even function build in? Many thanks, -T $ perl6 -e 'my $x=3; say $x.odd;' No

Re: odd and even

2018-04-30 Thread ToddAndMargo
Am 30.04.2018 um 08:47 schrieb ToddAndMargo: Hi All, I know it would only take me 25 seconds to write one, but do we have an odd and even function build in? Many thanks, -T $ perl6 -e 'my $x=3; say $x.odd;' No such method 'odd' for invocant of type 'Int'. Did you mean 'ord'?   in block at

Re: nil mystery

2018-04-30 Thread ToddAndMargo
On Sun, Apr 29, 2018 at 10:20:48PM -0700, ToddAndMargo wrote: On 04/29/2018 10:12 PM, ToddAndMargo wrote: On 04/29/2018 09:32 PM, Andrew Kirkpatrick wrote: There is not enough context to answer or even reproduce the problem - how are the variables declared and what values do they have just pr

Re: odd and even

2018-04-30 Thread Elizabeth Mattijsen
> On 30 Apr 2018, at 12:43, ToddAndMargo wrote: > > >> Am 30.04.2018 um 08:47 schrieb ToddAndMargo: >>> Hi All, >>> >>> I know it would only take me 25 seconds to write one, >>> but do we have an odd and even function build in? >>> >>> >>> Many thanks, >>> -T >>> >>> $ perl6 -e 'my $x=3; sa

.sub confusion

2018-04-30 Thread ToddAndMargo
Hi All, I am confused. With this sub: sub odd( $Num ) { return $Num % 2; } Why does this work: if odd $LineNum { $PartsStr ~= ''; } # Green else { $PartsStr ~= ''; } # Purple And this one throw an error: if $LineNum.odd { $PartsStr ~= ''

Re: odd and even

2018-04-30 Thread ToddAndMargo
On 04/30/2018 05:44 AM, Elizabeth Mattijsen wrote: On 30 Apr 2018, at 12:43, ToddAndMargo wrote: Am 30.04.2018 um 08:47 schrieb ToddAndMargo: Hi All, I know it would only take me 25 seconds to write one, but do we have an odd and even function build in? Many thanks, -T $ perl6 -e 'my $

Re: .sub confusion

2018-04-30 Thread Elizabeth Mattijsen
> On 30 Apr 2018, at 15:04, ToddAndMargo wrote: > > Hi All, > > I am confused. > > With this sub: > >sub odd( $Num ) { return $Num % 2; } > > > Why does this work: > > if odd $LineNum > { $PartsStr ~= ''; } # Green >else { $PartsStr ~= ''; } # Purple > > And

Re: odd and even

2018-04-30 Thread Elizabeth Mattijsen
> On 30 Apr 2018, at 15:12, ToddAndMargo wrote: > > On 04/30/2018 05:44 AM, Elizabeth Mattijsen wrote: >>> On 30 Apr 2018, at 12:43, ToddAndMargo wrote: >>> >>> Am 30.04.2018 um 08:47 schrieb ToddAndMargo: > Hi All, > > I know it would only take me 25 seconds to write one, >

Re: odd and even

2018-04-30 Thread Elizabeth Mattijsen
> On 30 Apr 2018, at 15:12, ToddAndMargo wrote: > > On 04/30/2018 05:44 AM, Elizabeth Mattijsen wrote: >>> On 30 Apr 2018, at 12:43, ToddAndMargo wrote: >>> >>> Am 30.04.2018 um 08:47 schrieb ToddAndMargo: > Hi All, > > I know it would only take me 25 seconds to write one, >

Re: odd and even

2018-04-30 Thread Theo van den Heuvel
Hi Todd, different people have different ways of learning things. Diving into the documentation isn't ideal for all of us. I find the book by Laurent Rosenfeld, "Think Perl 6", O'Reilly, extremely helpful in addition to the docs. My problem is that I am working with many and quite different

Re: .sub confusion

2018-04-30 Thread Bruce Gray
> On Apr 30, 2018, at 8:04 AM, ToddAndMargo wrote: > > Hi All, > > I am confused. > > With this sub: > >sub odd( $Num ) { return $Num % 2; } > > > Why does this work: > > if odd $LineNum > { $PartsStr ~= ''; } # Green >else { $PartsStr ~= ''; } # Purple > >

[perl #130774] [BUG] Rational.REDUCE-ME has a data race

2018-04-30 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
The issue with .unique was resolved in these commits Rakudo: https://github.com/rakudo/rakudo/commit/8cd70d1ee3e17fad78ae5daf0890d1cfb74c2deb Roast: https://github.com/perl6/roast/commit/ad38801161c518a3cf3bca9012db973851c4b0c3 Roast: https://github.com/perl6/roast/commit/032ce8df8533da3c5ff85c227

Re: nil mystery

2018-04-30 Thread Andrew Kirkpatrick
The original error you quoted was about use of Nil. I couldn't reproduce this by assigning Nil to a variable, turns out that's because such an assignment is specified to set the variable to the default value of the type of the variable. my $x = Nil gives (Any), my Str $y = Nil gives (Str), and only

Re: nil mystery

2018-04-30 Thread ToddAndMargo
On 04/30/2018 05:20 PM, Andrew Kirkpatrick wrote: I couldn't reproduce this by assigning Nil to a variable Well as it transpires, when I tested the {$x} version, I forgot to press "save". Also, a one liner operated differently than a program. And to top things off, when reading "this" data b