<> thank you

2018-10-04 Thread Todd Chester
Hi All, I went to reply to someone, I think it was Brandon for sending me an eMail to my private address and the stinker disappeared! Anyway whoever sent me $ p6 'say [0,2];' (the brown) I was trying to figure out why this bombed: $ p6 ' say "a b c d"[3,1];' Index out of range

Re: bitwise or?

2018-10-04 Thread Todd Chester
On 10/4/18 12:13 PM, Brandon Allbery wrote: It's fine syntactically, but I think has no effect because it'd be '$v = $v' after the '+|='. Conceivably some future version of rakudo could warn about it having no effect. That explains it. Thank you!

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
I figure they'll evolve with wider use, but we certainly aren't there yet. On the other hand, discussions like this will help shape that evolution. On Thu, Oct 4, 2018 at 3:35 PM JJ Merelo wrote: > > > El jue., 4 oct. 2018 21:21, Brandon Allbery > escribió: > >> I don't think we've reached the

Re: routine declaration line question

2018-10-04 Thread JJ Merelo
El jue., 4 oct. 2018 21:21, Brandon Allbery escribió: > I don't think we've reached the point of such conventions yet. And there's > some history here, in --> not having done anything in the early days except > possibly slow things down, and between --> and 'returns' (which is now > deprecated).

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
I don't think we've reached the point of such conventions yet. And there's some history here, in --> not having done anything in the early days except possibly slow things down, and between --> and 'returns' (which is now deprecated). On Thu, Oct 4, 2018 at 3:13 PM Trey Harris wrote: > Right; th

Re: bitwise or?

2018-10-04 Thread Brandon Allbery
It's fine syntactically, but I think has no effect because it'd be '$v = $v' after the '+|='. Conceivably some future version of rakudo could warn about it having no effect. On Thu, Oct 4, 2018 at 3:09 PM ToddAndMargo wrote: > On 10/4/18 12:06 PM, ToddAndMargo wrote: > > On 10/4/18 12:00 PM, JJ

Re: routine declaration line question

2018-10-04 Thread Trey Harris
Right; that's what I meant by "stylistically" — a `--> Mu` can highlight that something is being returned (and that side-effects are not the primary purpose), while nothing indicates that the return value, though it exists, is incidental and probably from "falling off the end" or using `return` as

Re: bitwise or?

2018-10-04 Thread ToddAndMargo
On 10/4/18 12:00 PM, JJ Merelo wrote: El jue., 4 oct. 2018 a las 20:58, ToddAndMargo (>) escribió: Hi All, I am trying to come up with something like +=       $ p6 'my $v = 32; $v += 2; say $v;'       34 to replace       $ p6 'my $v

Re: routine declaration line question

2018-10-04 Thread ToddAndMargo
On 10/4/18 12:04 PM, Brandon Allbery wrote: Arguably it should be --> Any, since Mu vs. Any has meaning with respect to Junctions. But in this case it's just not stating a redundancy. The way you'd phrased it makes it sound like it's an explicit no-meaningful-result, as opposed to 'we don't kn

Re: bitwise or?

2018-10-04 Thread ToddAndMargo
On 10/4/18 12:06 PM, ToddAndMargo wrote: On 10/4/18 12:00 PM, JJ Merelo wrote: El jue., 4 oct. 2018 a las 20:58, ToddAndMargo (>) escribió:     Hi All,     I am trying to come up with something like +=       $ p6 'my $v = 32; $v += 2; say $v;'      

Re: bitwise or?

2018-10-04 Thread ToddAndMargo
On 10/4/18 12:00 PM, Brandon Allbery wrote: You're not doing anything with '$v +| 0b0001'. Were you looking for something like '+|='? (Which I think should work.) On Thu, Oct 4, 2018 at 2:58 PM ToddAndMargo > wrote: Hi All, I am trying to come up wit

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
Arguably it should be --> Any, since Mu vs. Any has meaning with respect to Junctions. But in this case it's just not stating a redundancy. The way you'd phrased it makes it sound like it's an explicit no-meaningful-result, as opposed to 'we don't know or care'. On Thu, Oct 4, 2018 at 3:02 PM Tre

Re: routine declaration line question

2018-10-04 Thread JJ Merelo
El jue., 4 oct. 2018 a las 21:02, Trey Harris () escribió: > Ah (replying to both Brandon and JJ since their replies crossed): > > So `--> Mu` is not a sufficient and/or correct return constraint for > things like AT-POS because why, then? > It's totally OK. The "incorrect" part might be because

Re: routine declaration line question

2018-10-04 Thread ToddAndMargo
On 10/4/18 9:37 AM, Brandon Allbery wrote: Consider a function which returns the element at a given position in a list:     method AT-POS(\position) The only thing you can say about the result type is that it's whatever the type of the element at that position is. So it doesn't bother specif

Re: routine declaration line question

2018-10-04 Thread ToddAndMargo
On 10/4/18 1:49 AM, Peter Pentchev wrote: On Wed, Oct 03, 2018 at 10:50:14PM -0700, ToddAndMargo wrote: On Wed, Oct 3, 2018 at 7:21 PM ToddAndMargo mailto:toddandma...@zoho.com>> wrote: >> On 04/10/2018 03:07, ToddAndMargo wrote: >>> Hi All, >>> >>> In another thre

Re: routine declaration line question

2018-10-04 Thread Trey Harris
Ah (replying to both Brandon and JJ since their replies crossed): So `--> Mu` is not a sufficient and/or correct return constraint for things like AT-POS because why, then? On Thu, Oct 4, 2018 at 14:56 Brandon Allbery wrote: > I think they meant more like my AT-POS example: the point is the retu

Re: bitwise or?

2018-10-04 Thread JJ Merelo
El jue., 4 oct. 2018 a las 20:58, ToddAndMargo () escribió: > Hi All, > > I am trying to come up with something like += > > $ p6 'my $v = 32; $v += 2; say $v;' > 34 > > to replace > > $ p6 'my $v = 0b0010; $v = $v +| 0b0001; say $v;' > 48 > > > But I obviously have

Re: bitwise or?

2018-10-04 Thread Brandon Allbery
You're not doing anything with '$v +| 0b0001'. Were you looking for something like '+|='? (Which I think should work.) On Thu, Oct 4, 2018 at 2:58 PM ToddAndMargo wrote: > Hi All, > > I am trying to come up with something like += > > $ p6 'my $v = 32; $v += 2; say $v;' > 34 > > t

bitwise or?

2018-10-04 Thread ToddAndMargo
Hi All, I am trying to come up with something like += $ p6 'my $v = 32; $v += 2; say $v;' 34 to replace $ p6 'my $v = 0b0010; $v = $v +| 0b0001; say $v;' 48 But I obviously have something wrong: $ p6 'my $v = 0b0010; $v +| 0b0001; say $v;' WARNI

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
I think they meant more like my AT-POS example: the point is the return value, but you can't say ahead of time what type it will have. On Thu, Oct 4, 2018 at 2:48 PM Trey Harris wrote: > > > On Thu, Oct 4, 2018 at 02:13 JJ Merelo wrote: > >> >> >> El jue., 4 oct. 2018 a las 3:36, Trey Harris ()

Re: routine declaration line question

2018-10-04 Thread JJ Merelo
Hi El jue., 4 oct. 2018 a las 20:48, Trey Harris () escribió: > > > On Thu, Oct 4, 2018 at 02:13 JJ Merelo wrote: > >> >> >> El jue., 4 oct. 2018 a las 3:36, Trey Harris () escribió: >> >>> _All_ routines in Perl 6 return _something._ A lack of a "-->" simply >>> indicates stylistically that the

Re: routine declaration line question

2018-10-04 Thread Trey Harris
On Thu, Oct 4, 2018 at 02:13 JJ Merelo wrote: > > > El jue., 4 oct. 2018 a las 3:36, Trey Harris () escribió: > >> _All_ routines in Perl 6 return _something._ A lack of a "-->" simply >> indicates stylistically that the return is not useful because it's whatever >> "falls off the end". (There's

Re: bitwise paper?

2018-10-04 Thread ToddAndMargo
On 10/4/18 10:01 AM, ToddAndMargo wrote: On 10/3/18 7:16 PM, ToddAndMargo wrote: Bitwise "IN" (Does y exist in x): $ p6 'my $x=0b1001; my $y=0b0101; my $z=$x +& $y; say so $y == $z;' False $ p6 'my $x=0b1001; my $y=0b1001; my $z=$x +& $y; say so $y == $z;' True p5 not

Re: bitwise paper?

2018-10-04 Thread ToddAndMargo
On 10/3/18 7:16 PM, ToddAndMargo wrote: Bitwise "IN" (Does y exist in x):     $ p6 'my $x=0b1001; my $y=0b0101; my $z=$x +& $y; say so $y == $z;'     False     $ p6 'my $x=0b1001; my $y=0b1001; my $z=$x +& $y; say so $y == $z;'     True     p5 not figured out yet $ p5 'my $x = 0b100

Re: routine declaration line question

2018-10-04 Thread Brandon Allbery
Consider a function which returns the element at a given position in a list: method AT-POS(\position) The only thing you can say about the result type is that it's whatever the type of the element at that position is. So it doesn't bother specifying a type at all, because the prototype can't

Re: routine declaration line question

2018-10-04 Thread Peter Pentchev
On Wed, Oct 03, 2018 at 10:50:14PM -0700, ToddAndMargo wrote: > > > > > > > > On Wed, Oct 3, 2018 at 7:21 PM ToddAndMargo > > > > > wrote: > > > > > > > > > > >> On 04/10/2018 03:07, ToddAndMargo wrote: > > > > > >>> Hi All, > > > > > >>> > > > > >