Camelia, the Perl 6 bug

IRC log for #perl6, 2013-05-30

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 pmichaud that's interesting.  :-)
00:00 pmichaud I wonder which parse is correct.
00:01 pmichaud std: say .elems given my $ = <foo bar>, <fooagain baragain>;
00:01 camelia std 0336087: OUTPUT«ok 00:00 44m␤»
00:06 diakopter gah yapc austin  http://i.imgur.com/lnG0naa.png
00:06 pmichaud diakopter: got enough space?  ;-)
00:07 diakopter main room, yes. http://www.utexas.edu/ce/tcc/fi​les/images/main_lbj_splash2.jpg
00:08 diakopter note the 'muhrkan flags
00:08 diakopter um. one of those is Texas flag, I mena.
00:08 diakopter mean
00:09 pmichaud it's nice that in Texas we display the flag of our neighbor to the north.  :)
00:09 diakopter they even stole our colors
00:22 * colomon has completely messed up the branching on his local copy of niecza.  :\
00:31 labster wow, that is a lot of people.  Are we gonna have enough BBQ?
00:32 diakopter well...
00:33 diakopter maybe
00:33 berekuk joined #perl6
00:35 labster [Coke]: that bool.t bug doesn't look fixed to me, it's just not reporting the failure: https://github.com/coke/perl6-roast-da​ta/blob/master/rakudo_summary.out#L235
00:41 labster rn:  $*CWD := "/usr/bin";
00:41 camelia rakudo 8a0859: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Cannot use bind operator with this left-hand sideâ�¤at /tmp/i3_N91lH2h:1â�¤------> [32m$*CWD := "/usr/bin"[33mâ��[31m;[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
00:41 camelia ..niecza v24-51-g009f999: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Cannot use bind operator with this LHS at /tmp/u3aUBQY7x9 line 1:â�¤------> [32m$*CWD := "/usr/bin"[33mâ��[31m;[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) â�¤  at …
00:41 labster std:  $*CWD := "/usr/bin";
00:41 camelia std 0336087: OUTPUT«ok 00:00 43m␤»
00:46 rindolf joined #perl6
00:47 labster rn: $PROCESS::CWD := "/usr/bin"; say $*CWD;
00:47 camelia niecza v24-51-g009f999: OUTPUT«/usr/bin␤»
00:47 camelia ..rakudo 8a0859: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Cannot use bind operator with this left-hand sideâ�¤at /tmp/Beq33sAjU6:1â�¤------> [32m$PROCESS::CWD := "/usr/bin"[33mâ��[31m; say $*CWD;[0mâ�¤    expecting any of:â�¤        postfixâ�¤Â»
01:04 anuby joined #perl6
01:07 TimToady pmichaud: I doubt there's a difference in the parse; looks to me more like niecza is keeping its parcels pristine, while rakudo is flattening something
01:08 TimToady nr: (1,(2,3)).elems.say
01:08 camelia niecza v24-51-g009f999: OUTPUT«2␤»
01:08 camelia ..rakudo 8a0859: OUTPUT«3␤»
01:08 TimToady like that
01:08 pmichaud rn: say .elems given (my $ = <foo bar>, <fooagain baragain>);
01:08 camelia niecza v24-51-g009f999: OUTPUT«2␤»
01:08 camelia ..rakudo 8a0859: OUTPUT«3␤»
01:09 TimToady .elems is flattening the second parcel into 2 elements
01:09 pmichaud it's supposed to, unless that's a spec change
01:10 pmichaud nr: (1,(2,3)).[2].say
01:10 camelia niecza v24-51-g009f999: OUTPUT«(Any)␤»
01:10 camelia ..rakudo 8a0859: OUTPUT«3␤»
01:11 TimToady well, that's in S07, which is...provisional... :P
01:11 pmichaud I'm actually going by what the language designer indicated approx 3 years ago.
01:11 TimToady well, but he's an idiot
01:11 pmichaud you're telling me.
01:12 * diakopter fetches the millstone
01:12 * TimToady wonders how we introspect a parcel then...
01:12 TimToady need a .args or some such
01:12 pmichaud and actually, S07 had it "wrong" for quite a long time, indicating that Parcels didn't flatten for subscripting and .elems
01:13 TimToady I don't mind the flattening, I think, as long as we provide some way of telling how many args a parcel actually has without flattening
01:13 pmichaud I think you said at one point that .lol (or one of its variations) was the way to get at the pieces of a Parcel
01:14 TimToady nr: (1,(2,3)).lol.elems.say;  #  oops
01:14 camelia rakudo 8a0859: OUTPUT«2␤»
01:14 camelia ..niecza v24-51-g009f999: OUTPUT«Unhandled exception: Unable to resolve method lol in type Parcel␤  at /tmp/3hVxKiEx6l line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4331 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4332 (module-CORE @ 582) ␤  at /home…
01:14 Teratogen what are some file extensions that perl 6 uses?
01:14 Tene .pl
01:14 Tene .pm
01:15 Tene So, just like any other perl program or module.
01:15 TimToady I think it would be good to provide a .args that didn't suffer from the overhead of .lol
01:15 Teratogen oh I thought there were some file extensions for parrot part of perl 6
01:15 Teratogen file extensions and/or mime types
01:15 Tene Parrot uses .pir and .pbc, among others.
01:16 * TimToady does not view parrot as part of Perl 6...  :P
01:16 Teratogen WHAT!
01:16 Teratogen you don't?
01:16 Tene Teratogen: Is there any particular problem you're trying to solve here, or just asking out of general curiosity?
01:16 diakopter Teratogen: is the JVM part of Perl 6?
01:16 Teratogen general curiosity... I collect file extensions and mime types
01:16 diakopter is mono/.NET?
01:17 diakopter is GHC?
01:17 dalek niecza: 99a2d57 | (Solomon Foster)++ | lib/ (3 files):
01:17 dalek niecza: Simple implementation of Int.lsb.
01:17 dalek niecza:
01:17 dalek niecza: Only works on positive numbers so far.
01:17 dalek niecza: review: https://github.com/sorear/niecza/commit/99a2d57c5e
01:17 pmichaud I don't know that I mind if we switch .elems/.[] to not flatten Parcels, but I have no idea what would break.
01:17 pmichaud perhaps not much, since that's the interpretation Niecza is using.
01:18 TimToady three years ago we were still more interesting in hiding the existence of parcels than we are now, I suspect
01:18 TimToady certainly it's more efficient to not flatten :)
01:18 TimToady the real question is whether it violates user expectations
01:19 TimToady nr: say (1,(2,3))[1].perl
01:19 camelia rakudo 8a0859: OUTPUT«2␤»
01:19 camelia ..niecza v24-51-g009f999: OUTPUT«(2, 3)␤»
01:19 pmichaud here's the version of the S08 spec that dealt with parcels, that was deemed to be incorrect: https://github.com/perl6/specs/blob/0698449411​29709f58654508bafc0d0fd9e63ba0/S08-capture.pod
01:20 rindolf joined #perl6
01:22 perigrin_ so three years ago you were USPS and now you're more FedEx?
01:22 s1n joined #perl6
01:24 perigrin joined #perl6
01:25 pmichaud PerlJam pointed out that binding and assignment look odder with the non-flatten semantics. http://irclog.perlgeek.de/​perl6/2009-09-21#i_1523936
01:26 [Coke] labster: ah. you probably just pushed it so it happens AFTER the done call. :)
01:28 pmichaud anyway, if it needs to change, we can probably make it happen.
01:28 pmichaud as far as the cost of flattening, I was thinking that a Parcel could cache its flattened counterpart
01:28 pmichaud so once flattened it doesn't have to reflatten for subsequent indexing operations
01:29 pmichaud (since Parcels are immutable, this ought to be relatively safe)
01:30 TimToady much like one could cache a Capture too; otoh, maybe the need for caching can be taken as a smell
01:30 pmichaud well, it could also be that one of the reasons for Parcels wanting to flatten was that .map/for didn't flatten by default.
01:30 pmichaud that came much later.
01:30 TimToady I think I need to review the whole argument now that we have the \foo thing
01:31 pmichaud I mean, the meaning of    for (1,(2,(3,4,5)) { .say }    depended on flattening, and <for> itself wasn't responsible for that at the time.
01:32 pmichaud but yes, it may be one of those changes that if made breaks a lot of stuff.
01:32 pmichaud in fact just within the last 24 hours I gave examples of Parcel that depended on its flattening behavior.
01:32 pmichaud in particular:
01:32 pmichaud my @a = <apple banana cherry>;  say (1, 2, @a, 4).[3];
01:33 pmichaud my @a = <apple banana cherry>;  say (1, 2, @a, 4).elems
01:33 TimToady yes, I saw that one
01:34 TimToady if we put a .args to go with .elems, we'd also need a .arg(3) to go with .[3], or some such
01:34 FROGGS_ joined #perl6
01:34 pmichaud I'm pretty sure p5 programmers would get confused by   (1, 2, @a, 4).elems  always returning 4.
01:35 pmichaud or even  +(1, 2, @a, 4)
01:35 TimToady but arg-uably parcels are 1-dimensional, so that we don't really need the full power of .[1;2;3]
01:36 TimToady so I'm still inclined to say that parcels are just missing some useful primitives that resemble .[] or .elems
01:36 pmichaud wfm.
01:37 pmichaud I don't need a decision soon; it's almost certain we won't be able to do anything like this until julyish
01:37 pmichaud at the earliest
01:37 TimToady and yes, it's the P5 programmers' expectations that would primarily be driving this, still; it's the people coming from FP-land that tend to have the opposite expectations
01:38 [Coke] pmichaud: what's your take on storing TODOs in RT?
01:39 pmichaud [Coke]: ...in RT specifically, or in an issue tracker in general?  ;-)
01:39 [Coke] anyone running mingw that can test some tickets?
01:39 [Coke] I withdaw the question, pmichaud
01:41 [Coke] RT WHY FOR YOU GIVE ME SEARCH NOT FOUND.
01:41 pmichaud TimToady: while thinking about Parcel handling, it might also be impacted by https://github.com/perl6/specs/issues/18
01:41 [Coke] click on a link to a presaved search on the home page, get a 404. lovely. reload about 50 times, eventually get it back.
01:42 pmichaud can I add this to my list of reasons I dont like RT?  ;-)
01:43 pmichaud Added.  :)
01:43 dalek specs: 9f5a968 | larry++ | S07-lists.pod:
01:43 dalek specs: add .args and .arg to Parcel
01:43 dalek specs: review: https://github.com/perl6/specs/commit/9f5a96874c
01:44 pmichaud in general I think I'm fine with storing TODOs in an issue tracker.  it hasn't worked well for me in RT.
01:44 * [Coke] files a meta-rt ticket.
01:45 pmichaud (I know you withdrew the question, but I felt compelled to answer anyway :)
01:45 [Coke] if it happens to anyone else, looks like the front page forgot to include 'rt3/' in the URL
01:47 diakopter yay. I think I asked for those arg things a few years ago
01:48 [Coke] .ask masak on https://rt.perl.org/rt3/Ti​cket/Display.html?id=76490 - you say there are tests in roast. can you mark the tests with the ticket number, pleaes?
01:48 yoleaux [Coke]: I'll pass your message to masak.
01:51 TimToady pmichaud: re issue 18, offhand it looks to me like Array.plan is really Array.plan-elems due to the slurpy, but maybe List needs both a .plan-elems and a .plan-args, or maybe List.plan is really list.plan-args and the flattening decision is deferred to whatever eventually processes the iterator (as with the old .getarg vs .getelem proposal)
01:52 pmichaud TimToady: okay.  I'll add that to the thread and think about it when I get back to it.
01:53 TimToady of course, if lol is lazy, then .plan-args(...) is more or less .plan(lol ...), but I'm not sure if that's a reasonable factoring
01:54 [Coke] r: say ~(64,32,16 ...^ Rat)
01:54 camelia rakudo 8a0859: OUTPUT«64 32 16␤»
01:54 TimToady 16/2 is a Rat :)
01:55 GlitchMr joined #perl6
01:55 [Coke] .ask moritz what the expected output on RT #78324 is. is it that sequences through 1/2 ? (please update ticket with expected results)
01:55 yoleaux [Coke]: I'll pass your message to moritz.
01:56 TimToady n: say ~(64,32,16 ...^ Rat)
01:56 camelia niecza v24-51-g009f999: OUTPUT«64 32 16␤»
01:56 [Coke] TimToady: that was the concensus, yes. Would you say that's operating as intended, or should it be smarter?
01:56 TimToady well, the question is whether a Rat should auto-coerce itself to an Int if it can
01:57 TimToady I don't know that we have any consensus on that
01:57 * pmichaud suggests spec issue ticket.
01:57 [Coke] So should we open a spec ticket for folks to kibbitz on?
01:57 TimToady arguably a FatRat should never reduce, or you lose the desire for fatness
01:57 [Coke] on it.
01:57 TimToady unless we make FatInt, which would be...silly...
01:58 TimToady but we already have Rat auto-coercing to Num sometimes
01:58 TimToady alternately, should infix:<...> use div instead of / when it can?
01:58 pmichaud where "when it can" means...?
01:59 TimToady nr: say (16/2).WHAT; say (16 div 2).WHAT;
01:59 camelia rakudo 8a0859, niecza v24-51-g009f999: OUTPUT«(Rat)␤(Int)␤»
01:59 TimToady nr: say 16/3 == 16 div 3
01:59 camelia rakudo 8a0859, niecza v24-51-g009f999: OUTPUT«False␤»
01:59 TimToady meaning that
01:59 pmichaud no, I mean how do we know when to autodetect div versus / ?
02:00 TimToady it's not clear that it's meaningful to attack it that way
02:00 pmichaud but that's how we figure out the factor to be multiplied in each case
02:00 pmichaud we aren't really dividing by two, we're multiplying by 1/2
02:00 TimToady making Rat autocoerce to Int is more general purpose and more straightforward, except maybe in a type-theoretic sense
02:01 * TimToady was just trying to think of all the options
02:01 pmichaud r: say ~(180, 90, 45 ... Rat)
02:01 camelia rakudo 8a0859: OUTPUT«180 90 45 22.5␤»
02:01 TimToady I don't think the div vs / thing will work
02:02 pmichaud r: say ~(64, 32, 16 ... *.den != 1)
02:02 camelia rakudo 8a0859: OUTPUT«No such method 'den' for invocant of type 'Int'␤  in block  at /tmp/ztwu2zSy1B:1␤␤»
02:02 pmichaud r: say ~(64, 32, 16 ... *.de != 1)
02:02 camelia rakudo 8a0859: OUTPUT«No such method 'de' for invocant of type 'Int'␤  in block  at /tmp/6_JF5Endxa:1␤␤»
02:02 TimToady otoh, arguably if you're getting into Rat-land, it might be more efficient to stay in Rat-land rather than continually convert back and forth between Rats and Ints
02:02 pmichaud r: say ~(64, 32, 16 ... 1)
02:02 camelia rakudo 8a0859: OUTPUT«64 32 16 8 4 2 1␤»
02:02 pmichaud r: say ~(64, 32, 16 ... Rat)
02:02 camelia rakudo 8a0859: OUTPUT«64 32 16 8␤»
02:03 [Coke] r: say (1+2i).reals ; say (1+2i).reims
02:03 camelia rakudo 8a0859: OUTPUT«1 2␤No such method 'reims' for invocant of type 'Complex'␤  in block  at /tmp/G84v4GhxQU:1␤␤»
02:03 [Coke] r: say (1+2i).reals ; say (1+2i).reim
02:03 camelia rakudo 8a0859: OUTPUT«1 2␤No such method 'reim' for invocant of type 'Complex'␤  in block  at /tmp/6bu35g6lnt:1␤␤»
02:03 colomon n: say ~(64, 32, 16 ... Rat)
02:03 camelia niecza v24-53-g99a2d57: OUTPUT«64 32 16 8␤»
02:03 pmichaud r: say ~(64, 32, 16 ... *.denominator != 1)
02:03 camelia rakudo 8a0859: OUTPUT«No such method 'denominator' for invocant of type 'Int'␤  in block  at /tmp/s_FkonyeJH:1␤␤»
02:03 TimToady so I'm not sure I want to say the current behavior is wrongoid
02:03 TimToady *wrongoidal
02:04 TimToady dinner &
02:04 [Coke] https://rt.perl.org/rt3/Ti​cket/Display.html?id=83720 - neither .reals nor .reim is spec'd.
02:05 dalek niecza: 269243f | (Solomon Foster)++ | lib/ (3 files):
02:05 dalek niecza: Simple implementation of Int.msb.
02:05 dalek niecza:
02:05 dalek niecza: Only works on positive numbers so far.
02:05 dalek niecza: review: https://github.com/sorear/niecza/commit/269243f620
02:12 bonsaikitten joined #perl6
02:12 colomon r: say 1.reals
02:12 camelia rakudo 8a0859: OUTPUT«No such method 'reals' for invocant of type 'Int'␤  in block  at /tmp/28cujqkleB:1␤␤»
02:12 colomon :\
02:14 [Coke] pmichaud: I am tempted to start adding [REGEX] to tickets that are about the regex engine. (mainly so I can then avoid ever looking at them again)
02:14 pmichaud [Coke]: works for me.  This is also a reason I prefer github -- adding new tags is far simpler.
02:15 pmichaud and selecting based on tags is far simpler :)
02:15 jaldhar joined #perl6
02:16 colomon rn: say 1 < 1+1i
02:16 camelia rakudo 8a0859: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤  in method Real at src/gen/CORE.setting:870␤  in sub infix:<<> at src/gen/CORE.setting:3039␤  in sub infix:<<> at src/gen/CORE.setting:3037␤  in sub infix:<<> at src/gen/CORE.setting:3039␤  in …
02:16 camelia ..niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Complex numbers are not arithmetically ordered; use cmp if you want an arbitrary order␤  at /tmp/Jq_bPJ4C0K line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.settin…
02:18 colomon rn: say (.5, 1+0i, 2).sort(+*)
02:18 camelia rakudo 8a0859: OUTPUT«0.5 1+0i 2␤»
02:18 camelia ..niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: System.InvalidOperationException: Comparison threw an exception. ---> Complex numbers are not arithmetically ordered; use cmp if you want an arbitrary order␤  at /home/p6eval/niecza/lib/CORE.setting line 3412 (infix:<<=>> @ 3) ␤  at /h…
02:19 TimToady nr: say .5 <=> 1+1i
02:19 camelia niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Complex numbers are not arithmetically ordered; use cmp if you want an arbitrary order␤  at /home/p6eval/niecza/lib/CORE.setting line 3412 (infix:<<=>> @ 3) ␤  at /tmp/flRSkTF8Zt line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE…
02:19 camelia ..rakudo 8a0859: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤  in method Real at src/gen/CORE.setting:870␤  in sub infix:<<=>> at src/gen/CORE.setting:3027␤  in sub infix:<<=>> at src/gen/CORE.setting:3026␤  in sub infix:<<=>> at src/gen/CORE.setting:3027…
02:21 TimToady r: say .5 <=> 1 + 0i
02:21 camelia rakudo 8a0859: OUTPUT«Increase␤»
02:21 colomon I'm not at all certain how that sort works in Rakudo.
02:21 TimToady it seems smart enough to ignore the 0i
02:21 colomon rn: say (.5, 1+0.00000001i, 2).sort(+*)
02:21 camelia rakudo 8a0859: OUTPUT«0.5 1+1e-08i 2␤»
02:21 camelia ..niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: System.InvalidOperationException: Comparison threw an exception. ---> Complex numbers are not arithmetically ordered; use cmp if you want an arbitrary order␤  at /home/p6eval/niecza/lib/CORE.setting line 3412 (infix:<<=>> @ 3) ␤  at /h…
02:23 btyler joined #perl6
02:27 colomon rn: say (1+1i).Real
02:27 camelia rakudo 8a0859: OUTPUT«Can not convert 1+1i to Real: imaginary part not zero␤  in method gist at src/gen/CORE.setting:10065␤  in method gist at src/gen/CORE.setting:893␤  in sub say at src/gen/CORE.setting:10951␤  in block  at /tmp/UkonlsIvKj:1␤␤»
02:27 camelia ..niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Unable to resolve method Real in type Complex␤  at /tmp/8HOJkpXRq5 line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582) ␤  at /ho…
02:27 colomon rn: say (1+0i).Real
02:28 camelia niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Unable to resolve method Real in type Complex␤  at /tmp/6D1NUwdH0S line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582) ␤  at /ho…
02:28 camelia ..rakudo 8a0859: OUTPUT«1␤»
02:28 colomon rn: say (1+0.0000001i).Real
02:28 camelia niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Unable to resolve method Real in type Complex␤  at /tmp/IozeWEUoZO line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582) ␤  at /ho…
02:28 camelia ..rakudo 8a0859: OUTPUT«Can not convert 1+1e-07i to Real: imaginary part not zero␤  in method gist at src/gen/CORE.setting:10065␤  in method gist at src/gen/CORE.setting:893␤  in sub say at src/gen/CORE.setting:10951␤  in block  at /tmp/ThUuayaKqw:1␤␤»
02:28 [Coke] r: say Date.new(-13_000_000_000, 1, 1)
02:28 camelia rakudo 8a0859: OUTPUT«-115098112-01-01␤»
02:29 lustlife joined #perl6
02:29 colomon oh!
02:30 colomon r: say (3, 11+1i, 40).sort(+*)
02:30 camelia rakudo 8a0859: OUTPUT«11+1i 3 40␤»
02:30 colomon sorting by string comparison
02:30 colomon n: say (3, 11+1i, 40).sort(+*)
02:30 camelia niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: System.InvalidOperationException: Comparison threw an exception. ---> Complex numbers are not arithmetically ordered; use cmp if you want an arbitrary order␤  at /home/p6eval/niecza/lib/CORE.setting line 3412 (infix:<<=>> @ 3) ␤  at /h…
02:31 TimToady so +* isn't forcing numeric sort for some reason
02:32 TimToady r: say (3,4,11+1i, 40).sort(+*)
02:32 camelia rakudo 8a0859: OUTPUT«11+1i 3 4 40␤»
02:32 TimToady not just looking at the first two args then
02:33 jaldhar joined #perl6
02:33 colomon TimToady: Rakudo doesn't know any way to sort Complex numbers other than by stringification
02:35 colomon so +* doesn't really have any effect on Complex numbers, for the purposes of sorting.
02:36 [Coke] r: say 1.0000001 ** (10 ** 9)
02:36 camelia rakudo 8a0859: OUTPUT«Nominal type check failed for parameter 'nu'; expected Int but got Num instead␤  in sub DIVIDE_NUMBERS at src/gen/CORE.setting:7990␤  in sub infix:<**> at src/gen/CORE.setting:8131␤  in sub infix:<**> at src/gen/CORE.setting:3020␤  in block  at /tmp/GbNF6TmPgz:1␤␤»…
02:36 colomon n: say 1.0000001 ** (10 ** 9)
02:36 camelia niecza v24-53-g99a2d57: OUTPUT«2.688103843211962E+43␤»
02:37 [Coke] rakudo: _~*.A
02:37 camelia rakudo 8a0859: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared name:â�¤    _ used at line 1â�¤â�¤Â»
02:37 [Coke] std: _~*.A
02:37 camelia std 0336087: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared name:â�¤    '_' used at line 1â�¤Check failedâ�¤FAILED 00:00 42mâ�¤Â»
02:39 colomon n: say 459430345345345.msb
02:39 camelia niecza v24-53-g99a2d57: OUTPUT«Unhandled exception: Unable to resolve method msb in type Int␤  at /tmp/k6zEK2G78A line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582) ␤  at /home/p6…
02:40 colomon n: say 459430345345345.lsb
02:40 camelia niecza v24-53-g99a2d57: OUTPUT«0␤»
02:40 colomon p6eval: rebuild niecza
02:41 [Coke] rant: how can I search for tickets that are NOT tagged testneeded?
02:41 [Coke] != doesn't work. NOT LIKE doesn't work.
02:44 [Coke] my RT dosimeter is all red. Is that bad?
02:45 TimToady p6eval: evalbot rebuild niecza
02:45 camelia TimToady: OK (started asynchronously)
02:47 [Coke] i see the rakudo test needed search has a search string you can't get using the building. "LIKE '%testneeded%'", or some such (with wildcards) - the obvious inversion of that fails to eliminate testneeded tickets.
02:48 [Coke] r: say 657 - 75 # since I can't make RT figure this out.
02:48 camelia rakudo 8a0859: OUTPUT«582␤»
02:48 [Coke] plus one for stalled.
02:49 colomon rn: say (1+11i).<re im>
02:49 camelia niecza v24-54-g269243f: OUTPUT«Unhandled exception: Cannot use hash access on an object of type Complex␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting line 352 (Any.at_key @ 9) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/luurBXaZej line 1 (mai…
02:49 camelia ..rakudo 8a0859: OUTPUT«postcircumfix:<{ }> not defined for type Complex␤  in method gist at src/gen/CORE.setting:10065␤  in method gist at src/gen/CORE.setting:893␤  in method gist at src/gen/CORE.setting:5282␤  in method gist at src/gen/CORE.setting:893␤  in sub say at src/gen/CORE.sett…
02:49 [Coke] r: say ().item.perl
02:49 camelia rakudo 8a0859: OUTPUT«$()␤»
02:52 TimToady though, oddly, that's not what $() means...
02:52 TimToady probably means that turning $() into $/.ast is a bad idea
02:54 TimToady nr: say $()
02:54 camelia niecza v24-54-g269243f: OUTPUT«Unhandled exception: Unable to resolve method ast in type Any␤  at /tmp/f7XaVZ4rb6 line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582) ␤  at /home/p6…
02:54 camelia ..rakudo 8a0859: OUTPUT«No such method 'ast' for invocant of type 'Any'␤  in block  at /tmp/g2OeCZUC0_:1␤␤»
02:55 atroxaper joined #perl6
02:56 TimToady nr: say $/()
02:56 camelia niecza v24-54-g269243f: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Any␤  at /tmp/qyn0WskBJS line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4333 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4334 (module-CORE @ 582…
02:56 camelia ..rakudo 8a0859: OUTPUT«No such method 'Any' for invocant of type 'Parcel'␤  in block  at /tmp/b1Fhw4nHYG:1␤␤»
02:56 TimToady say what?
02:56 [Coke] TimToady: the suggestion in the ticket was to make ().item.perl return $( ) instead.
02:57 TimToady at the moment I'm more inclined to steal $() back from Match
02:57 TimToady it was one of those "you think that's cute today" ideas
02:58 TimToady but if a Match turns .() into .ast, we could just have $/(), and it'd also work on $/[0]()
02:59 TimToady $() is a low-wattage feature compared to postcircumfix:<( )>
02:59 TimToady and $/() is only one character longer
03:00 TimToady but how is rakudo deciding that it needs a .Any there?
03:00 sorear what would we use $() for instead?
03:00 labster empty parcel?
03:00 TimToady an itemized (), as the .perl was thinking above
03:01 TimToady that seems least surprisey to me
03:02 TimToady n: say ().item.perl
03:02 camelia niecza v24-54-g269243f: OUTPUT«$()␤»
03:02 TimToady appears that niecza agrees with rakudo there :)
03:03 TimToady ASCII needs more brackets
03:04 Teratogen remember APL?
03:04 Teratogen =)
03:04 labster set your time machine for 1960
03:04 Teratogen that was a cool character set
03:06 TimToady set your time machine for now
03:06 TimToady .u ⍬
03:06 yoleaux U+236C APL FUNCTIONAL SYMBOL ZILDE [So] (⍬)
03:07 Teratogen TimToady did you ever get to try the Space Cadet Keyboard?
03:08 * TimToady was never a Space Cadet; we had astronauts by the time I reached my formative years
03:10 TimToady "Space Cadet" is so...Heinleiny...
03:14 Teratogen I really enjoy Heinlein
03:16 TimToady "nothing will ever replace the sliderule"
03:16 * sorear had a high school math teacher who always had a sliderule in his shirt pocket
03:16 TimToady it's still great for teaching logarithms
03:18 geekosaur HS chemistry teacher forced us all to use slide rules
03:19 sorear I suspect you're referring to something earlier than I am
03:20 TimToady well, all the golden age SF writers assumed that more powerful computers would necessarily be bigger, up to planet-sized
03:20 TimToady though arguably the Internet is a planet-sized computer :)
03:21 sorear it's embedded within a 3-300m thick layer of plaque covering a planet.  not really planet-sized :/
03:22 TimToady well, the neutrino channels through the middle are, as of yet, rather underutilized :)
03:23 * sorear does not really like the brain architecture where the cortex holds all the logic and the medulla is nothing but interconnect
03:23 TimToady for the purposes of this exercise, we will assume a frictionless, spherical computer...
03:24 Teratogen the noosphere, as Pierre Teilhard de Chardin would say
03:24 TimToady sorear: your brain doesn't really care what you like in that regard, except insofar as it does
03:42 xinming joined #perl6
03:43 preflex_ joined #perl6
04:04 TimToady START is not really a phaser, becuase it's executed inline; I'm therefore considering renaming it not to "ONCE" but to "once", to fit in with the other statement prefixes that run in-line
04:06 TimToady but FIRST is named that because it's the opposite to LAST
04:07 fgomez joined #perl6
04:23 drbean joined #perl6
04:26 Psyche^ joined #perl6
04:26 [Coke] sau once for 1..10
04:27 [Coke] er, say "ha!" once for 1..10
04:29 dalek specs: fca7f5a | larry++ | S0 (2 files):
04:29 dalek specs: START phaser --> once statement prefix
04:29 dalek specs: review: https://github.com/perl6/specs/commit/fca7f5a903
04:30 dalek specs: 75751f5 | larry++ | S0 (2 files):
04:30 dalek specs: change dates
04:30 dalek specs: review: https://github.com/perl6/specs/commit/75751f5985
04:34 sorear not a statement postfix?
04:49 thou joined #perl6
04:52 cc joined #perl6
04:52 cc left #perl6
04:54 TimToady um...no
04:55 * TimToady does not always feel the need to make Perl read like English
04:56 dalek std: 6b4371d | larry++ | STD.pm6:
04:56 dalek std: START --> once
04:56 dalek std: review: https://github.com/perl6/std/commit/6b4371ded8
04:56 lue .oO(Inform Perl 7)
04:57 TimToady the Reality® operating system used English® as its programming language
04:57 TimToady and we see how well that worked out
04:58 Teratogen Cobol was an attempt to create code that could be read by managers.
05:00 lue .oO(EANGLOCENTRIC);
05:00 sorear .o( not QFT? )
05:00 TimToady mais oui!
05:00 Teratogen when I was stationed at the pentagon I actually bumped into Grace Hopper in the Walgreens on the concourse
05:00 Teratogen I should have got an autograph
05:00 Teratogen darn
05:00 lue r: use MONKEY_TYPING; supersede class Complex { }; # me would like this to work. I recommend use CLASS_WARFARE;
05:00 camelia rakudo 8a0859: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Cannot use 'supersede' with class declarationâ�¤at /tmp/fg_1ajxjdL:1â�¤------> [32m MONKEY_TYPING; supersede class Complex [33mâ��[31m{ }; # me would like this to work. I rec[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤        ge…
05:00 Teratogen she was very gracious though, and talked with me for a few minutes about Cobol and PL/I
05:02 Teratogen I was a Multics PL/1 programmer!
05:02 Teratogen I had an honest to god VT-100 on my desk
05:02 TimToady wow, so modern, compared to my VT-05...
05:02 Teratogen also had a Tektronix 4014 terminal to play with
05:03 TimToady pretty flashy, that
05:03 Teratogen yes, when you did a clear screen, the entire screen would flash green
05:04 Teratogen things were so fubar at that time (about 1983) that a command came down from above that we were NOT to write any computer programs
05:04 Teratogen so I whiled away the time writing fractal programs in pl/1 for the Tektronix 4014
05:05 sorear what were you supposed to do instead?
05:05 Teratogen I really don't remember
05:05 Teratogen that was many decades ago
05:06 Teratogen I did get away from Multics and started working with the first 16 bit computers to arrive at the Pentagon
05:06 Teratogen Zenith Z-100 and Z-150
05:06 TimToady wow, they really bet on the right horse there...
05:07 Teratogen I also got to play around with a Xerox Star
05:07 Teratogen that thing was slow
05:07 * lue exits with the feeling that he missed out on an Awesome Time™ in the history of computing. &
05:07 TimToady that sounds more like '73 than '83
05:07 Teratogen 1973, I was writing programs in HP Timesharing Basic
05:08 Teratogen teletypes, paper tape, modems with cups
05:08 Teratogen all  that jazz
05:08 TimToady BASIC/PLUS on a PDP-11/20 for me
05:08 TimToady with 16k of memory
05:09 Teratogen our high school system had a dinky HP 2000 that ran Timesharing Basic during the day, then they would shut down Timesharing Basic at night so they could run Card Fortran
05:09 birdwindupbird joined #perl6
05:11 Teratogen I wrote a trojan horse in Basic that printed LOGIN: and just waited for somebody to sit down and enter their user id and password, which would get stored in a file then would terminate and log out
05:11 Teratogen but I got found out and had to go see the principal
05:11 Teratogen that was the beginning and the end of my "hacking" career
05:13 kaleem joined #perl6
05:13 Teratogen I also got to work with Honeywell GCOS as an explorer scout
05:13 TimToady before I was a sysadmin, I wrote a computer game that would notice if it was run as root, and change the su command :)
05:14 TimToady the weirdest OS was on a Wang computer; all menus to do anything
05:14 Teratogen sounds more like OS/400
05:15 Teratogen are you sure you are not mixing the two up?
05:15 sorear sounds lke a lot of "modern" OSen
05:15 TimToady no mouse
05:17 Teratogen the Xerox Star had a mouse, but there was significant lag between moving the mouse and movement of the mouse cursor on the screen
05:17 Teratogen and also lag when typing in text
05:18 Teratogen If I remember correctly the Star was an 8 bit system
05:18 FROGGS_ joined #perl6
05:18 sorear o/ FROGGS_
05:19 TimToady the first time my hacker friend logged into the Oxford eliza program over the, eek, Arpanet, the lag was about 15 seconds
05:19 TimToady (from Seattle)
05:19 FROGGS_ morning
05:22 Teratogen ah well, enough reminiscing
05:22 Teratogen time to take my medications and crash
05:34 Pleiades` joined #perl6
05:43 Pleiades` joined #perl6
06:03 dakkar joined #perl6
06:04 cooper joined #perl6
06:04 cooper joined #perl6
06:11 census joined #perl6
06:18 domidumont joined #perl6
06:32 dmol joined #perl6
06:39 snarkyboojum joined #perl6
06:43 danaj joined #perl6
06:51 fgomez joined #perl6
06:53 ponbiki joined #perl6
07:03 thou joined #perl6
07:13 domidumont joined #perl6
07:22 domidumont joined #perl6
07:32 sqirrel joined #perl6
07:42 chayin joined #perl6
07:48 diakopter .ask tadzik plz IM me on gtalk as soon as convenient
07:48 yoleaux diakopter: I'll pass your message to tadzik.
08:08 PacoAir joined #perl6
08:11 tadzik diakopter: done
08:11 yoleaux 07:48Z <diakopter> tadzik: plz IM me on gtalk as soon as convenient
08:15 dalek v5: a8f50bf | (Tobias Leich)++ | / (4 files):
08:15 dalek v5: enable subroutine traits and lvalue subs
08:15 dalek v5: review: https://github.com/rakudo-p5/v5/commit/a8f50bffac
08:17 FROGGS_ TimToady: if I get "expected term but found infix for 'shift || 1'" then the precedence is wrong, right? (talking about v5, 'shift() || 1' is working though)
08:25 moritz \o
08:25 yoleaux 01:55Z <[Coke]> moritz: what the expected output on RT #78324 is. is it that sequences through 1/2 ? (please update ticket with expected results)
08:26 kivutar joined #perl6
08:30 FROGGS_ o/
08:31 moritz [Coke]: comment added
08:33 diakopter anyone here play arcade games in early-mid 90's?
08:35 ggoebel joined #perl6
08:37 tadzik I don't suppose so, my first computer was a 386 PC with Wolfenstein 3D preinstalled
08:38 * diakopter barely doesn't WWII joke
08:41 FROGGS_ diakopter: I made an arcanoid-clone once, does that count?
08:43 diakopter yes
08:43 dakkar joined #perl6
08:45 tadzik oh, I wrote that too :)
08:46 FROGGS_ tadzik: hah! show off! mine -> https://github.com/FROGGS/Games-As​teroids/blob/master/screenshot.png
08:52 tadzik lemee compile that :)
08:53 FROGGS_ I'm not sure it still works
08:54 tadzik duh. When I try to take a screenshot, a ball falls down and the game closes :D
08:56 FROGGS_ hehe
08:56 tadzik http://i.imgur.com/UaLwOBk.png here it is
08:57 FROGGS_ ahh, I didnt even meant arcanoid
08:57 tadzik heh
08:57 FROGGS_ tadzik: you're using libsdl too?
08:57 FROGGS_ or is allegro such thing?
08:58 tadzik FROGGS_: I played with it recently
08:58 tadzik allegro is very simple
08:58 FROGGS_ well, libsdl is Simple Directmedia Layer, so must be simple too :P
08:58 tadzik but it has layers :D
08:59 FROGGS_ no
09:02 rindolf joined #perl6
09:05 berekuk joined #perl6
09:07 moritz iirc allegro uses SDL under the hood
09:07 moritz or can use it
09:15 tadzik oh, sufraces, not layers
09:16 bbkr pmichaud: supernovus removed hack from HTTP::Easy so now * can be released without including uncommitted patches
09:23 mrlo joined #perl6
09:25 berekuk joined #perl6
09:26 spider-mario joined #perl6
09:29 tgt joined #perl6
09:42 masak morning, #perl6
09:42 yoleaux 01:48Z <[Coke]> masak: on https://rt.perl.org/rt3/Ti​cket/Display.html?id=76490 - you say there are tests in roast. can you mark the tests with the ticket number, pleaes?
09:43 masak [Coke]: no, that would be moritz++.
09:48 masak oh, it's both of us.
09:48 * masak goes lookin'
10:05 dalek roast: e5f4341 | masak++ | S12-construction/new.t:
10:05 dalek roast: added reference to RT ticket from test file
10:05 dalek roast:
10:05 dalek roast: Suggested by [Coke]++.
10:05 dalek roast: review: https://github.com/perl6/roast/commit/e5f4341ea6
10:14 FROGGS_ .u ␤
10:14 yoleaux U+2424 SYMBOL FOR NEWLINE [So] (␤)
10:15 yves_ joined #perl6
10:18 woosley left #perl6
10:24 berekuk joined #perl6
10:40 berekuk joined #perl6
10:45 atroxaper left #perl6
10:46 atroxaper joined #perl6
10:47 atroxaper left #perl6
10:55 kivutar joined #perl6
11:07 woosley1 joined #perl6
11:07 woosley1 left #perl6
11:07 grondilu r: say "foo␤bar"  # testing this newline symbol
11:07 camelia rakudo 8a0859: OUTPUT«foo␤bar␤»
11:11 moritz r: say '␤'.ord
11:11 camelia rakudo 8a0859: OUTPUT«10␤»
11:12 moritz camelia round-trips it to \n and back
11:13 diakopter for those of you yapc-na'ers who unsubscribed from the mailing list... ;)
11:13 diakopter http://blog.yapcna.org/post/51715017317/yap​c-austin-navigation-the-lbj-auditorium-and
11:13 diakopter http://blog.yapcna.org/post/51716532535/yapc-​austin-tcc-floor-plan-and-conference-schedule
11:13 diakopter (that's it)
11:15 colomon joined #perl6
11:18 colomon n: say 1324141431.lsb, 1324141431.msb
11:18 camelia niecza v24-54-g269243f: OUTPUT«030␤»
11:18 colomon n: say 1324141431.lsb ~ " " ~ 1324141431.msb
11:18 camelia niecza v24-54-g269243f: OUTPUT«0 30␤»
11:19 FROGGS_ rn: say -1.msb
11:19 camelia rakudo 8a0859: OUTPUT«No such method 'msb' for invocant of type 'Int'␤  in block  at /tmp/gGtJ88xOl0:1␤␤»
11:19 camelia ..niecza v24-54-g269243f: OUTPUT«0␤»
11:20 sqirrel joined #perl6
11:24 ztt_ joined #perl6
11:28 moritz note that method call binds tighter than prefix -
11:29 FROGGS_ ohh
11:29 FROGGS_ rn: say (-1).msb
11:29 camelia rakudo 8a0859: OUTPUT«No such method 'msb' for invocant of type 'Int'␤  in block  at /tmp/x2hY1EkEi5:1␤␤»
11:29 camelia ..niecza v24-54-g269243f: OUTPUT«0␤»
11:33 masak I'm not proposing we change anything, just curious: what would break if prefix ops bound tighter than method calls?
11:33 FROGGS_ the meaning
11:33 masak please be more specific.
11:34 FROGGS_ class Rect { has $.x; has $.y; has $.w; has $.h; }; my $rect = Rect.new; say -$rect.x
11:34 masak (I'm pretty sure what we have currently is the right setting. just wanting to think it through what it would mean for those two precedences to be reversed.)
11:34 masak FROGGS_: right. sure. so you have to put parens in that case, otherwise it doesn't mean what you want. big deal. :)
11:35 FROGGS_ tighter +/- prefixes only make sense if the object is somewhat numeric
11:35 masak depends on your opinion on overloading, but sure.
11:35 FROGGS_ yes, sure
11:37 masak anyway, your example is just the "equal-but opposite" correspinding inconvenience to what we have now, that you have to parenthesize (-1).msb for example.
11:37 masak "equal-but-opposite"*
11:38 sqirrel joined #perl6
11:39 FROGGS_ I think I'm just used to how it is
11:39 FROGGS_ there is no real reason for or against it
11:40 moritz iirc we parsed -1 as a term for some time
11:40 moritz and it was quite confusiong
11:40 moritz because it meant that -1.sqrt and -$a.sqrt parsed differently
11:42 masak ah, yes.
11:42 masak well, I meant that *any* prefix would bind tighter. including -$a
11:42 FROGGS_ that was because the - in -1 wasnt a prefix
11:42 masak FROGGS_: in other news, how many angels can dance on the head of a pin? :)
11:43 moritz masak: the answer to that is quite easy: Mu
11:43 FROGGS_ hmm?
11:43 masak what a delightfully satisfactory answer. I feel so extremely enlightened. :P
11:43 moritz anyway, it makes sense to have mathematical operators with the same relative precedence as in mathemtics
11:44 masak oh, troo. and mathematics doesn't really have method calls, but it has indices which are similar.
11:44 masak yeah, that's a good rationale.
11:49 dalek v5: 6765445 | (Tobias Leich)++ | p5:
11:49 dalek v5: p5 let you run a code snippet in Perl 5 and v5
11:49 dalek v5: review: https://github.com/rakudo-p5/v5/commit/6765445418
11:49 dalek v5: d9394ff | (Tobias Leich)++ | Makefile:
11:49 dalek v5: warnings.pm does not depend on Perl5.nqp
11:49 dalek v5: review: https://github.com/rakudo-p5/v5/commit/d9394ff091
11:49 dalek v5: 588025a | (Tobias Leich)++ | lib/Perl5/Grammar.nqp:
11:49 dalek v5: behave better when assigning to lvalue subs
11:49 dalek v5: review: https://github.com/rakudo-p5/v5/commit/588025a83a
11:49 dalek v5: f6563ec | (Tobias Leich)++ | lib/Perl5/Terms.pm:
11:49 dalek v5: allow a more termish shift
11:49 dalek v5: review: https://github.com/rakudo-p5/v5/commit/f6563ecf35
12:02 atroxaper joined #perl6
12:03 proller joined #perl6
12:14 sqirrel joined #perl6
12:17 sergot_ hi p/
12:17 yoleaux 29 May 2013 09:32Z <sorear> sergot_: Please rewrite your crontab so that when the load average is 25 and single perl6 jobs take hours, you don't start MORE JOBS
12:17 sergot_ o/
12:18 sergot_ ok!
12:18 sergot_ I'm sorry for this
12:19 jaldhar joined #perl6
12:24 markstacey joined #perl6
12:43 colomon masak: negative lsb and msb are NYI in Niecza.
12:46 brrt joined #perl6
12:50 ztt_ joined #perl6
13:01 ajr joined #perl6
13:08 domidumont joined #perl6
13:08 konundra joined #perl6
13:11 chrisdev joined #perl6
13:13 masak colomon: I'm not caught up on backlog, so I'm still in a state of confusion as to what those methods really are.
13:13 [Coke] {least,most}sigbit.
13:16 masak and implicit in all of this is that it's a "1" bit, yes?
13:16 masak that was not at all clear from the spec, see.
13:19 diakopter ..but he clarified that
13:20 proller joined #perl6
13:24 s1n joined #perl6
13:24 masak ah, so he did. it hasn't reached my mailbox yet, is all.
13:27 domidumont1 joined #perl6
13:32 colomon masak:
13:33 colomon n: say (1,2,4 ... *).map(*.lsb)[^200]
13:33 camelia niecza v24-54-g269243f: OUTPUT«0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88…
13:33 colomon n: say (1,2,4 ... *).map((* +| 16).lsb)[^200]
13:33 camelia niecza v24-54-g269243f: OUTPUT«0 1 2 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 …
13:34 colomon n: say (1,2,4 ... *).map((* +| 16).msb)[^200]
13:34 camelia niecza v24-54-g269243f: OUTPUT«4 4 4 4 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88…
13:35 brrt left #perl6
13:38 atroxaper joined #perl6
13:44 FieldsaBB joined #perl6
13:56 bluescreen10 joined #perl6
13:58 alester joined #perl6
14:01 s1n joined #perl6
14:01 skids_ joined #perl6
14:10 PacoAir joined #perl6
14:19 pmichaud I'm a little confused .. what would be the value of  msb(-3) and msb(-4) ?
14:21 konundra joined #perl6
14:22 colomon pmichaud: Inf?
14:22 pmichaud not according to most recent spec
14:22 pmichaud Negative integers stored in an C<Int> notionally
14:22 pmichaud +have an infinite number of 1 bits on top, which is a problem.
14:22 pmichaud +Instead of returning C<+Inf>, which is relatively useless, we return
14:22 pmichaud +the position of the first of that infinite supply of sign bits.
14:22 pmichaud +So C<msb(-1)> returns 0, C<msb(-2)> returns 1, and C<msb(-32768)>
14:22 pmichaud +returns 15, just as if we'd converted it from C<int16> to C<uint16>
14:23 pmichaud +and examined that for its top bit.
14:23 pmichaud I think that msb(-1) should be 1 also.
14:24 pmichaud I suppose it could be zero.
14:24 pmichaud but the explanation falls apart values like -3 and -4
14:24 pmichaud *for values
14:27 colomon wouldn't msb(-3) and msb(-4) both by 2 by that specification?
14:27 * colomon has no idea why this would be useful, mind you....
14:27 colomon s/by/be/
14:27 pmichaud oh, because it gives you the magnitude of the bit representation needed for a negative number
14:27 pmichaud I can see the use for it.
14:27 kaare_ joined #perl6
14:29 cognominal nr:   ' 22 666' ~~  m/(?:\s+(\d+)){2}/; print "$0 $1"
14:29 camelia rakudo 8a0859: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Quantifier quantifies nothingâ�¤at /tmp/v_Age4cR2m:1â�¤------> [32m' 22 666' ~~  m/(?:[33mâ��[31m\s+(\d+)){2}/; print "$0 $1"[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        prefix or t…
14:29 camelia ..niecza v24-54-g269243f: OUTPUT«[31m===[0mSORRY![3​1m===[0mâ�¤â�¤Unsupported use of (?: ... ) for grouping; in Perl 6 please use [ ... ] at /tmp/pthiR77qDt line 1:â�¤------> [32m' 22 666' ~~  m/(?:[33mâ��[31m\s+(\d+)){2}/; print "$0 $1"[0mâ�¤â�¤Parse failedâ�¤â�¤Â»
14:29 cognominal oops
14:29 colomon is it just going to be msb(-$n) = msb($n-1) + 1?
14:29 pmichaud looking.
14:29 dalek v5: 6a1743a | (Tobias Leich)++ | / (3 files):
14:29 dalek v5: make "shift || 1" work again
14:29 dalek v5: review: https://github.com/rakudo-p5/v5/commit/6a1743a12d
14:29 cognominal niecza is more helpful than rakudo here
14:30 colomon n: say (1.msb + 1, 32767.msb + 1, 2.msb + 1, 3.msb+1)
14:30 camelia niecza v24-54-g269243f: OUTPUT«1 15 2 2␤»
14:31 pmichaud that doesn't match the description.
14:31 pmichaud which says that msb(-1) is 0 and msb(-2) is 1.
14:31 colomon pmichaud: i believe it does, except msb(-1) is a special case
14:31 FROGGS[mobile] joined #perl6
14:32 pmichaud n: say msb(2-1)+1 ;   # msb(-2)
14:32 camelia niecza v24-54-g269243f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'msb' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 36) â�¤  at /home…
14:32 pmichaud n: say (2-1).msb+1 ;   # msb(-2)
14:32 camelia niecza v24-54-g269243f: OUTPUT«1␤»
14:32 xilo joined #perl6
14:32 cognominal nr:   ' 42 666' ~~  m/[\s+(\d+)] * 2/;
14:32 camelia rakudo 8a0859, niecza v24-54-g269243f:  ( no output )
14:32 colomon n: say Nil + 12
14:32 camelia niecza v24-54-g269243f: OUTPUT«Use of Nil as a number␤  at /home/p6eval/niecza/lib/CORE.setting line 1357 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 469 (Nil.Numeric @ 4) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/YX19Iqn4tW line 1 (mainline @ 3) ␤  at /home/p6e…
14:33 cognominal nr:  say  ' 42 666' ~~  m/[\s+(\d+)] * 2/;
14:33 camelia niecza v24-54-g269243f: OUTPUT«「 42」␤ 0 => 「4」␤␤»
14:33 camelia ..rakudo 8a0859: OUTPUT«「 42」␤ 0 => 「42」␤ 0 => 「4」␤␤»
14:33 pmichaud n: for -1, -2, ... -17 { say $_, " => ", (-$_).msb + 1; }
14:33 camelia niecza v24-54-g269243f: OUTPUT«Potential difficulties:â�¤  Comma found before apparent series operator; please remove comma (or put parensâ�¤    around the ... listop, or use 'fail' instead of ...) at /tmp/Xx4EmBmn6E line 1:â�¤------> [32mfor -1, -2,[33mâ��[31m ... -17 { say $_, " => ", (-$_…
14:33 pmichaud n: for -1, -2 ... -17 { say $_, " => ", (-$_).msb + 1; }
14:33 camelia niecza v24-54-g269243f: OUTPUT«-1 => 1␤-2 => 2␤-3 => 2␤-4 => 3␤-5 => 3␤-6 => 3␤-7 => 3␤-8 => 4␤-9 => 4␤-10 => 4␤-11 => 4␤-12 => 4␤-13 => 4␤-14 => 4␤-15 => 4␤-16 => 5␤-17 => 5␤»
14:33 pmichaud n: for -1, -2 ... -17 { say $_, " => ", (-$_ - 1).msb + 1; }
14:33 camelia niecza v24-54-g269243f: OUTPUT«Use of Nil as a number␤  at /home/p6eval/niecza/lib/CORE.setting line 1357 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 469 (Nil.Numeric @ 4) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /tmp/OipaUJAgoX line 1 (mainline @ 9) ␤  at /home/p6e…
14:34 colomon n: for -2, -3 ... -17 { say $_, " => ", (-$_ - 1).msb + 1; }
14:34 camelia niecza v24-54-g269243f: OUTPUT«-2 => 1␤-3 => 2␤-4 => 2␤-5 => 3␤-6 => 3␤-7 => 3␤-8 => 3␤-9 => 4␤-10 => 4␤-11 => 4␤-12 => 4␤-13 => 4␤-14 => 4␤-15 => 4␤-16 => 4␤-17 => 5␤»
14:34 pmichaud okay
14:34 pmichaud yes, -1 must be a special case then.
14:35 colomon mind you, my understanding of this may be completely off....
14:36 pmichaud it's just a little weird; for positive numbers, there are eight values that return a .msb of 3, but for negative numbers there are only four values that return a .msb of 3.
14:37 FROGGS[mobile] joined #perl6
14:37 pmichaud of course, making it work the other way would mean that .msb would be returning the position of something other than a 1 bit for some negative numbers.
14:37 pmichaud which also has its weirdnesses :)
14:37 pmichaud anyway, thanks.
14:38 pmichaud that helped.
14:39 colomon I hope it's right!
14:39 colomon At the moment, I'm being a bit boggled at the lsb for negative numbers.
14:39 colomon oh, no, I think I've got it
14:40 colomon lsb(-$n) = lsb(msb($n) * 2 - $n)
14:41 colomon ... except wait, should lsb(-1) be Nil?
14:41 colomon I guess not, by spec: "so always have a lowest bit set somewhere, if only the sign bit."
14:43 colomon n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", mnsb(-$n); };
14:43 camelia niecza v24-54-g269243f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable $n is not predeclared at /tmp/yfZprpVsp6 line 1:â�¤------> [32m -1, -2 ... -17 { say $_, " => ", mnsb(-[33mâ��[31m$n); };[0mâ�¤â�¤Undeclared routine:â�¤      'mnsb' used at line 1â�¤â�¤Potential difficulties:â�¤  &nmsb is declared b…
14:43 colomon n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$n); };
14:43 camelia niecza v24-54-g269243f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Variable $n is not predeclared at /tmp/AxD6pAA0RU line 1:â�¤------> [32m -1, -2 ... -17 { say $_, " => ", nmsb(-[33mâ��[31m$n); };[0mâ�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 15…
14:43 colomon n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
14:43 camelia niecza v24-54-g269243f: OUTPUT«-1 => 0␤-2 => Nil␤-3 => 0␤-4 => Nil␤-5 => 0␤-6 => 1␤-7 => 0␤-8 => 1␤-9 => 0␤-10 => 2␤-11 => 0␤-12 => 1␤-13 => 0␤-14 => 3␤-15 => 0␤-16 => 3␤-17 => 0␤»
14:43 colomon that seems very bad
14:44 pmichaud n: sub nmsb($n) { (($n+1)*-2).msb };  for -1, -2 ... -17 { say $_, " => ", nmsb($_); }
14:44 camelia niecza v24-54-g269243f: OUTPUT«-1 => Nil␤-2 => 1␤-3 => 2␤-4 => 2␤-5 => 3␤-6 => 3␤-7 => 3␤-8 => 3␤-9 => 4␤-10 => 4␤-11 => 4␤-12 => 4␤-13 => 4␤-14 => 4␤-15 => 4␤-16 => 4␤-17 => 5␤»
14:44 colomon no, definition is off!
14:44 colomon n: sub nmsb($n) { ($n.msb ** 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
14:44 camelia niecza v24-54-g269243f: OUTPUT«-1 => 0␤-2 => 0␤-3 => 1␤-4 => Nil␤-5 => 0␤-6 => 1␤-7 => 0␤-8 => 0␤-9 => Nil␤-10 => 0␤-11 => 1␤-12 => 0␤-13 => 2␤-14 => 0␤-15 => 1␤-16 => Nil␤-17 => 0␤»
14:45 pmichaud my version seems correctish.
14:45 colomon n: sub nmsb($n) { (2 ** (1 + $n.msb) - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
14:45 camelia niecza v24-54-g269243f: OUTPUT«-1 => 0␤-2 => 1␤-3 => 0␤-4 => 2␤-5 => 0␤-6 => 1␤-7 => 0␤-8 => 3␤-9 => 0␤-10 => 1␤-11 => 0␤-12 => 2␤-13 => 0␤-14 => 1␤-15 => 0␤-16 => 4␤-17 => 0␤»
14:46 pmichaud I'm going with it, at any rate :)
14:46 pmichaud https://gist.github.com/pmichaud/5678418
14:47 colomon n: sub nmsb($n) { (2 ** (1 + $n.msb) - $n).lsb; }; for -126 ... -128 { say $_, " => ", nmsb(-$_); };
14:47 camelia niecza v24-54-g269243f: OUTPUT«-126 => 1␤-127 => 0␤-128 => 7␤»
14:48 colomon n: sub nmsb($n) { (($n+1)*-2).msb };for -126 ... -128 { say $_, " => ", nmsb(-$_); };
14:48 camelia niecza v24-54-g269243f: OUTPUT«-126 => 7␤-127 => 8␤-128 => 8␤»
14:48 BooK joined #perl6
14:48 colomon pmichaud: My version is more right...
14:48 colomon -126 is 1000 0010 binary, so 1 is correct for it.
14:49 pmichaud colomon: for *msb* ?
14:49 colomon oh, no, lsb!
14:49 colomon sorry, massive confusion
14:49 colomon I changed the problem I was working on without changing the function name.
14:51 colomon however, should msb(-128) be 7 rather than 8?
14:52 pmichaud it is in my version.
14:52 colomon ack, testing the wrong thing
14:54 colomon n: https://gist.github.com/colomon/5678473
14:54 camelia niecza v24-54-g269243f: OUTPUT«-126 => 7␤-127 => 7␤-128 => 7␤-129 => 8␤»
14:54 colomon okay, that agrees with my notion of what things should be.  pmichaud++
14:57 * colomon steals pmichaud's formula for niecza.  ;)
15:00 pmichaud r:  say 64, 32, 16 ... *.?denominator != 1;
15:00 camelia rakudo 8a0859: OUTPUT«use of uninitialized value of type Nil in numeric context  in block  at /tmp/gUjGMNkwp8:1␤␤64␤»
15:00 pmichaud r:  say 64, 32, 16 ... +*.?denominator != 1;
15:00 camelia rakudo 8a0859: OUTPUT«use of uninitialized value of type Nil in numeric context  in block  at /tmp/zAxiuw9obq:1␤␤64␤»
15:00 pmichaud bah.
15:00 ajr joined #perl6
15:01 pmichaud r:  say 64, 32, 16 ... (*.?denominator // 1) != 1;
15:01 camelia rakudo 8a0859: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: Mu *%_)␤  in method Numeric at src/gen/CORE.setting:865␤  in sub infix:<==> at src/gen/CORE.setting:3031␤  in sub infix:<==> at src/gen/CORE.setting:3029␤  in sub infix:<!=> at src/gen/CORE.setting:3…
15:01 colomon nr: say (Nil // 1)
15:01 pmichaud r:  say 64, 32, 16 ... 0.5;
15:01 camelia rakudo 8a0859, niecza v24-54-g269243f: OUTPUT«1␤»
15:01 camelia rakudo 8a0859: OUTPUT«64 32 16 8 4 2 1 0.5␤»
15:01 pmichaud r:  say 64, 32, 16 ... (*.denominator != 1);
15:02 camelia rakudo 8a0859: OUTPUT«No such method 'denominator' for invocant of type 'Int'␤  in block  at /tmp/TBLSHjsqtD:1␤␤»
15:02 pmichaud r: .WHAT.say for 64, 32, 16 ... 0.5;
15:02 camelia rakudo 8a0859: OUTPUT«(Int)␤(Int)␤(Int)␤(Ra​t)␤(Rat)␤(Rat)␤(Rat)␤(Rat)␤»
15:02 pmichaud r: .denominator.say for 64, 32, 16 ... 0.5;
15:02 camelia rakudo 8a0859: OUTPUT«No such method 'denominator' for invocant of type 'Int'␤  in block  at /tmp/J4Zz2A5wzr:1␤␤»
15:02 pmichaud r: .?denominator.say for 64, 32, 16 ... 0.5;
15:02 camelia rakudo 8a0859: OUTPUT«Nil␤Nil␤Nil␤1␤1␤1␤1␤2␤»
15:02 pmichaud r: (.?denominator //1).say for 64, 32, 16 ... 0.5;
15:02 camelia rakudo 8a0859: OUTPUT«1␤1␤1␤1␤1␤1␤1␤2␤»
15:03 pmichaud icky.
15:03 pmichaud the correct answer is *clearly*
15:03 pmichaud 64, 32, 16 ... 1
15:03 pmichaud :-P
15:03 fgomez joined #perl6
15:05 thou joined #perl6
15:05 colomon rn: https://gist.github.com/colomon/5678473
15:05 camelia rakudo 8a0859, niecza v24-54-g269243f: OUTPUT«-1 => 0␤-2 => 1␤-3 => 2␤-4 => 2␤-126 => 7␤-127 => 7␤-128 => 7␤-129 => 8␤»
15:06 rindolf joined #perl6
15:09 colomon much simpler for lsb: lsb(-$n) == lsb($n)
15:12 dalek rakudo/nom: ee11f77 | pmichaud++ | src/core/Int.pm:
15:12 dalek rakudo/nom: Add an implementation of Int.msb .
15:12 dalek rakudo/nom:
15:12 dalek rakudo/nom: This is mostly just a "something that works" implementation, if
15:12 dalek rakudo/nom: others feel a need to come up with more elegant/faster versions,
15:12 dalek rakudo/nom: feel free to do so.
15:12 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/ee11f77034
15:16 dalek niecza: 7942a09 | (Solomon Foster)++ | lib/CORE.setting:
15:16 dalek niecza: Handle negative numbers in .lsb and .msb.
15:16 dalek niecza: review: https://github.com/sorear/niecza/commit/7942a0959c
15:16 ggoebel joined #perl6
15:18 colomon we need to get some tests into roast for these...
15:20 * colomon starts a few
15:23 jnthn I suspect
15:23 jnthn oops
15:23 jnthn um. Good evening.
15:24 colomon \o
15:28 [Coke] jnthn: YOU ARE SUSPECT AND WILL BE REPORTED!
15:28 [Coke] <insert closing image of leonard nimoy version of body snatches>
15:30 snearch joined #perl6
15:30 dalek roast: b75779f | (Solomon Foster)++ | S32-num/int.t:
15:30 dalek roast: Some very basic tests for .lsb and .msb.
15:30 dalek roast: review: https://github.com/perl6/roast/commit/b75779f58b
15:31 [Coke] *snatchers!
15:34 [Coke] r: say 1000 / 80
15:34 camelia rakudo 8a0859: OUTPUT«12.5␤»
15:37 konundra joined #perl6
15:45 ggoebel joined #perl6
15:47 FROGGS[mobile] joined #perl6
15:49 FROGGS[mobile] joined #perl6
15:49 colomon n: say (-1).msb
15:49 camelia niecza v24-54-g269243f: OUTPUT«0␤»
15:50 colomon p6eval: evalbot rebuild niecza
15:50 camelia colomon: OK (started asynchronously)
15:51 colomon \o/
15:53 espadrine joined #perl6
15:59 prevost joined #perl6
16:00 moritz it just says it does that
16:00 moritz but since the build is now on feather1 and the bot runs on feather3, it can't actually trigger the build anymore
16:04 colomon :(
16:05 FieldsaBB joined #perl6
16:14 domidumont joined #perl6
16:15 jac50 joined #perl6
16:16 daniel-s joined #perl6
16:17 TimToady http://rosettacode.org/wiki/Find_first_a​nd_last_set_bit_of_a_long_integer#Perl_6
16:17 TimToady colomon++
16:18 colomon TimToady: are those values all correct?  ;)
16:18 * colomon has not exhaustively tested the new methods yet.
16:19 TimToady the task only calls for the postive integers, so probably correct
16:20 TimToady should do the 0th power though...
16:21 colomon TimToady: even in the positive case, I only tested some pretty straightforward cases.  powers of 2 up to 200, things like that.
16:21 domidumont1 joined #perl6
16:24 colomon I'm pretty sure I got 1 correct.  ;)
16:24 TimToady they look like they match the other languages' results
16:24 dalek rakudo/nom: cd5ca7c | pmichaud++ | src/core/Int.pm:
16:24 dalek rakudo/nom: Add Int.lsb to setting.
16:24 dalek rakudo/nom:
16:24 dalek rakudo/nom: Like Int.msb in the previous commit, this is also a
16:24 dalek rakudo/nom: "something that works" implementation.  More elegant or
16:24 dalek rakudo/nom: performant solutions are welcomed.
16:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/cd5ca7c6d0
16:25 TimToady ooh, I'll delete the 'works with' :)
16:27 pmichaud well, rakudo (on my machine at least) seems to have trouble with larger ints.
16:27 pmichaud probably has to do with the bit shift operations in Parrot.
16:27 pmichaud I wonder if I can fix it by using div instead of +>
16:27 moritz int or Int?
16:28 pmichaud Int
16:28 pmichaud I'm not (directly) using int anywhere.
16:28 moritz Int uses its own bitshift ops
16:28 moritz which are slightly problematic
16:28 moritz because libtommath doesn't use 2s complement
16:28 moritz so they have to work around that
16:28 pmichaud actually, it's probably not the .msb/.lsb that is the problem, but whatever is generating the table of numbers to test.
16:29 pmichaud r: for ^20 { say 42 ** $_; }
16:29 TimToady so ** is the problem?
16:29 camelia rakudo ee11f7: OUTPUT«1␤42␤1764␤74088␤3111696␤130691232␤54890​31744␤230539333248␤9682651996416␤4066713838494​72␤17080198121677824␤717368321110468608␤301294​69486639681536␤1265437718438866624512␤53148384​174432398229504␤2232232135326160725639168␤9375​3749683698750476845056␤3937657486715347520…
16:29 pmichaud r: for 15..20 { say 42 ** $_; }
16:29 camelia rakudo ee11f7: OUTPUT«2232232135326160725639168␤93753749683698​750476845056␤3937657486715347520027492352␤16538​1614442044595841154678784␤694602780656587302532​8496508928␤291733167875766667063796853374976␤»
16:29 pmichaud hmm
16:29 pmichaud looks like that's not the problem.
16:29 atroxaper left #perl6
16:30 TimToady well, it "works with" rakudo, it just doesn't work well :)
16:30 pmichaud oh, I bet it's the printf that can't cope.
16:30 TimToady ah, could be
16:31 pmichaud r: for 15..20 { printf "%30d\n", 42 ** $_; }
16:31 camelia rakudo ee11f7: OUTPUT«                    -797016064␤                     885063680␤                   -1482031104␤                   -2115764224␤                    1332215808␤                     118489088␤»
16:31 pmichaud yup.
16:31 pmichaud so it is computing the correct values, it just can't display the bigints properly.
16:31 TimToady r: for 15..20 { printf "%30s\n", 42 ** $_; }
16:31 camelia rakudo ee11f7: OUTPUT«     2232232135326160725639168␤    93753749683698750476845056␤  3937657486715347520027492352␤16538161444204​4595841154678784␤69460278065658730253284965​08928␤291733167875766667063796853374976␤»
16:31 TimToady there's a workaround, anyway :)
16:32 pmichaud indeed.
16:32 pmichaud ummmmm   how is it possible for the RC code to produce that output, if the for loop is ^$power ?
16:32 pmichaud wouldn't it only go 0..19 then?
16:32 pmichaud where is the "20" row coming from?
16:32 TimToady ah, sorry, you caught me cheating :)
16:32 pmichaud CHEATER!
16:33 pmichaud it also feels like cheating to add .lsb and .msb to Perl 6 and then use them for an RC solution :P
16:33 TimToady fixed
16:33 pmichaud but that's less of a cheat, because .lsb and .msb are really useful.
16:34 [Coke] pmichaud: ... for what?
16:34 colomon This RC solution!
16:34 TimToady and also, potentially optimizable with knowledge of the integer storage format
16:34 [Coke] colomon: *SMACK*
16:35 TimToady why did [Coke] just kiss colomon?
16:35 [Coke] must be a generational thing. :P
16:35 pmichaud https://gist.github.com/pmichaud/5679283 # much better
16:36 pmichaud [Coke]: I suspect I've come across a fair number of problems where it would be really handy to quickly find the .msb or .lsb
16:36 pmichaud certainly I've run across several just in writing compiler tools and the like.
16:37 [Coke] I'll believe it's useful when it's used to compile rakudo. ;)
16:37 moritz r: sub msb(Int:D $x) { $x.base(2).chars }; say 42.msb
16:37 camelia rakudo ee11f7: OUTPUT«5␤»
16:37 moritz r: sub msb(Int:D $x) { $x.base(2).chars }; say msb(42)
16:37 camelia rakudo ee11f7: OUTPUT«6␤»
16:37 moritz r: say 42.base(2)
16:37 camelia rakudo ee11f7: OUTPUT«101010␤»
16:37 TimToady yes, msb is one less than the bit length
16:37 moritz r: say 1.msb
16:38 camelia rakudo ee11f7: OUTPUT«0␤»
16:38 moritz TimToady: off by one then :-)
16:38 TimToady actually, it's off by a 0 :)
16:40 pmichaud oh, it wouldn't surprise me if .lsb/.msb could be used for some of the bit flag manipulation we do in the Parameter/Signature types
16:41 Chillance joined #perl6
16:41 TimToady lsb is useful for converting to int ** exp notation
16:42 TimToady which is kinda halfway to floating point
16:45 kaare_ joined #perl6
16:46 pmichaud r: say 42**20
16:46 camelia rakudo ee11f7: OUTPUT«291733167875766667063796853374976␤»
16:46 pmichaud r: printf("%d\n", 42**20)
16:46 camelia rakudo ee11f7: OUTPUT«118489088␤»
16:46 * pmichaud files rakudobug
16:47 moritz I'm pretty sure that's already submitted
16:48 moritz or not; I can't find it
16:50 pmichaud I couldn't find one.
16:50 pmichaud (I did look before submitting.)
16:50 pmichaud I think that's also the source of the date formatting bug in #114760.
16:51 masak fwiw, I'm writing a sprintf for nqp. I've gotten some ways into it, and it's looking good. just need to pour more tuits into it.
16:51 masak would be an excellent thing to do over an afternoon hackathon, I think.
16:52 pmichaud TimToady: on the topic of (s)printf, if you have any thoughts or comments on https://github.com/perl6/specs/issues/13 I'd love to hear them.
16:52 pmichaud (no rush, just general "is coming up with a new format syntax a good idea, or should we continue to rely on the long-established printf codes?"
16:53 pmichaud I'm sure we'll want to continue to support traditional printf, but we might also want something better structured that has a possibility of handling the newer types
16:54 pmichaud masak++ # sprintf in nqp
16:55 masak http://github.com/masak/sprintf
16:55 masak I remember it being great fun to hack on.
16:56 masak so... if anyone is up for a sprintf hackathon (sometime post-YAPC::NA), drop me a line.
16:56 pmichaud masak: on #118227 (hyper-adding hash types), does that discussion need to continue in a spec issue somewhere, maybe?
16:57 masak yes, I think so.
16:58 masak unless TimToady has an immediate ruling about how container types interact with hyperops.
16:59 FROGGS joined #perl6
17:05 FROGGS o/
17:05 jac50 joined #perl6
17:06 TimToady masak: nope
17:07 TimToady FROGGS: it's not just precedence, but also the fact that in p5 certain infixes can occur where a term is expected
17:07 TimToady p5 relies on yacc to sort those out
17:07 FROGGS yacc?
17:07 TimToady well, or byacc, or bison
17:08 TimToady the actual parse that the lexer is feeding tokens to
17:08 TimToady *parser
17:09 FROGGS okay, then I'll read p5's source when I hit a piece of code that doesnt work with my current hack
17:11 TimToady the grammar in perly.y is officially ambiguous, so we rely on yacc's default shift/reduce and reduce/reduce behavior to disambiguate such things
17:14 FROGGS I hope p5's test suite covers enough cases... but I guess it does not because it never was made for a reimplementation
17:15 pmichaud add more cases.
17:15 FROGGS pmichaud: will do some day
17:15 FROGGS currently I my goal is to be able to compile most of the test files
17:15 pmichaud audreyt++ 's approach might work also, which is to get others to add test cases if they want bugfixes/features.
17:16 TimToady you'll also have to weed out tests that are only testing implementation details that are immaterial to the actual language
17:17 FROGGS TimToady: well, if it is something that some (important) module is using, I have non choice than to support it
17:17 FROGGS pmichaud: I like that approad for rakudo also
17:17 pmichaud yeah, I've not been as diligent about it as audreyt was.  I hope to get that way again soon.
17:19 FROGGS for now I am just happy that subroutine signatures were a bit easier to do than I thought (even if it just supports a tiny bit right now)
17:26 konundra joined #perl6
17:29 kaare_ joined #perl6
17:30 FieldsaBB joined #perl6
17:31 GlitchMr rn: say 'aa'.pred
17:31 camelia niecza v24-55-g7942a09: OUTPUT«Unhandled exception: Magical string decrement underflowed␤  at <unknown> line 0 (KERNEL Str.pred @ 1) ␤  at /tmp/e5mLzpJamY line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4341 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting lin…
17:31 camelia ..rakudo cd5ca7: OUTPUT«Decrement out of range␤  in method gist at src/gen/CORE.setting:10095␤  in method gist at src/gen/CORE.setting:893␤  in sub say at src/gen/CORE.setting:10981␤  in block  at /tmp/U1glEXypIc:1␤␤»
17:31 GlitchMr Why it isn't 'z'?
17:33 geekosaur wasn't there an explicit decision made that because it's generally easier to handle overflow on increment than underflow on decrement, the latter would not be handled?
17:34 masak GlitchMr: according to S03:518, it should fail.
17:36 pmichaud GlitchMr: it's not clear that "file-000.txt" should decrement to become "file-99.txt"
17:37 GlitchMr Well, with numbers it doesn't make sense
17:37 pmichaud with letters, either.
17:37 pmichaud I wouldn't want  "file-aaa.txt" to suddenly become "file-zz.txt"
17:37 GlitchMr But, if I had "file-100.txt", then it's not sure whatever .pred should return "file-99.txt" or "file-099.txt".
17:37 bowtie joined #perl6
17:37 pmichaud oh, Perl 6 defines that already.
17:38 pmichaud It's file-099.txt.
17:38 pmichaud r:  say "file-100.txt".pred
17:38 camelia rakudo cd5ca7: OUTPUT«file-099.txt␤»
17:38 GlitchMr But I cannot think of anything other than 'z' 'aa'.pred could be.
17:38 pmichaud it can be an error.  :)
17:39 pmichaud think of it as "underflow" if you wish.
17:39 pmichaud "aa".pred underflows out of the range of 2-character strings.
17:41 GlitchMr perl6: say 'ab' ... 'y'
17:41 pmichaud that will be infinite, because you never reach 'y'
17:41 camelia rakudo cd5ca7, niecza v24-55-g7942a09: OUTPUT«(timeout)»
17:41 GlitchMr perl6: say 'y' ... 'ab'
17:41 camelia rakudo cd5ca7: OUTPUT«Decrement out of range␤  in method Str at src/gen/CORE.setting:10094␤  in method Str at src/gen/CORE.setting:876␤  in method Stringy at src/gen/CORE.setting:885␤  in sub infix:<eq> at src/gen/CORE.setting:1288␤  in sub infix:<eq> at src/gen/CORE.setting:1286␤  in m…
17:41 camelia ..niecza v24-55-g7942a09: OUTPUT«Unhandled exception: Magical string decrement underflowed␤  at <unknown> line 0 (KERNEL Str.pred @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3311 (ANON @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3345 (ANON @ 3) ␤  at /home/p6eval/niecza/…
17:41 GlitchMr Uhmmm, what?
17:42 pmichaud r:  say 'y' after 'ab'
17:42 camelia rakudo cd5ca7: OUTPUT«True␤»
17:42 TimToady r: say [gt] 'zz','zy'...'aa'
17:42 camelia rakudo cd5ca7: OUTPUT«True␤»
17:42 TimToady that invariant would not hold if we removed chars
17:42 markstacey joined #perl6
17:42 pmichaud since 'y' comes after 'aa', it's considered a decrement.
17:42 GlitchMr So
17:42 GlitchMr perl6: say 'a' ... 'ab'
17:42 camelia rakudo cd5ca7, niecza v24-55-g7942a09: OUTPUT«a b c d e f g h i j k l m n o p q r s t u v w x y z aa ab␤»
17:43 GlitchMr This is... strange.
17:43 pmichaud incrementing strings is strange, yes.
17:43 pmichaud that's why it's called "magical"
17:43 GlitchMr It works, until you replace 'a' with 'b'.
17:43 GlitchMr Feels too magical.
17:43 pmichaud perl6: say 'b', 'c', ... 'ab'
17:43 camelia rakudo cd5ca7: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Comma found before apparent series operator; please remove comma (or put parens\n    around the ... listop, or use 'fail' instead of ...)â�¤at /tmp/48Nwj_FJJO:1â�¤------> [32msay 'b', 'c',[33mâ��[31m ... 'ab'[0mâ�¤Â»
17:43 camelia ..niecza v24-55-g7942a09: OUTPUT«Potential difficulties:â�¤  Comma found before apparent series operator; please remove comma (or put parensâ�¤    around the ... listop, or use 'fail' instead of ...) at /tmp/wu3TIDWEpn line 1:â�¤------> [32msay 'b', 'c',[33mâ��[31m ... 'ab'[0mâ�¤â�¤Unhandled exce…
17:43 pmichaud perl6: say 'b', 'c' ... 'ab'
17:43 TimToady and, basically, there's almost no use case for decrement, compared to increment
17:43 camelia niecza v24-55-g7942a09: OUTPUT«Unhandled exception: Magical string decrement underflowed␤  at <unknown> line 0 (KERNEL Str.pred @ 1) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3311 (ANON @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 3345 (ANON @ 3) ␤  at /home/p6eval/niecza/…
17:43 camelia ..rakudo cd5ca7: OUTPUT«b c d e f g h i j k l m n o p q r s t u v w x y z aa ab␤»
17:43 GlitchMr The code appears to work, until you will actually do something.
17:44 GlitchMr 'a' ... 'ab' doesn't do any sort of warning, nothing.
17:44 GlitchMr But 'b' ... 'ab' fails.
17:44 pmichaud sure, because 'b' after 'ab', but 'a' before 'ab'
17:44 pmichaud r: say 'b' after 'ab'
17:44 camelia rakudo cd5ca7: OUTPUT«True␤»
17:44 pmichaud r: say 'a' before 'ab'
17:44 camelia rakudo cd5ca7: OUTPUT«True␤»
17:44 pmichaud if you don't like the magical characteristics of ..., then don't rely on the magic.
17:45 GlitchMr for 'a' .. 'zz' { #`[It works!] }
17:46 GlitchMr for 'c' .. 'bb' { #`[Uhmmm, why range is empty] }
17:46 GlitchMr That could be confusing
17:46 pmichaud yes, it can be confusing.
17:46 kaleem joined #perl6
17:46 pmichaud there's not an obvious fix.
17:46 moritz for every magic behavior you get a WAT too
17:46 pmichaud for every alternate approach we've tried, it causes even more confusing cases to appear.
17:46 GlitchMr Forbid string ranges for strings with different sizea?
17:47 GlitchMr Compare reversed strings?
17:47 GlitchMr flipped*
17:47 moritz that sounds weird as well
17:47 pmichaud we tried forbidding string ranges... but that means that '999' doesn't overflow properly into '1000'
17:48 GlitchMr Hmmm, right
17:48 pmichaud flipping the strings sounds wrong, it's much better if the Range operator *always* does increment.
17:48 pmichaud we did try having Range operators autoreverse, and that just leads to other issues.
17:48 GlitchMr Not sure about 'numeric string'.succ.
17:48 GlitchMr It appears to work in most cases.
17:48 pmichaud and clearly someone wouldn't expect  'c'..'bb' to *start* with 'bb'
17:48 GlitchMr Until you do this.
17:48 GlitchMr > '0'.pred
17:48 GlitchMr Decrement out of range
17:48 GlitchMr > 0.pred
17:48 GlitchMr -1
17:49 GlitchMr Have fun figuring out why $number-- doesn't work.
17:49 pmichaud maybe because it's not a number?  ;-)
17:49 moritz r: my $x = '0'; say --$x
17:49 camelia rakudo cd5ca7: OUTPUT«Decrement out of range␤  in method gist at src/gen/CORE.setting:10095␤  in method gist at src/gen/CORE.setting:893␤  in sub say at src/gen/CORE.setting:10981␤  in block  at /tmp/ASfgUFdFvQ:1␤␤»
17:50 GlitchMr What if I get '0' from external source. For example, Perl 5 code?
17:50 moritz n: my $x = '0'; say --$x
17:50 camelia niecza v24-55-g7942a09: OUTPUT«Unhandled exception: Magical string decrement underflowed␤  at /tmp/WUzsDvXLWA line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4341 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4342 (module-CORE @ 582) ␤  at /home/p6eval…
17:50 moritz GlitchMr: then you can use + to force it to be a number
17:50 pmichaud or you can use -= 1
17:50 pmichaud r: my $x = '0';  $x -= 1;  say $x
17:50 camelia rakudo cd5ca7: OUTPUT«-1␤»
17:51 GlitchMr DB<2> $a = '0'
17:51 GlitchMr DB<3> $a--
17:51 GlitchMr DB<4> x $a
17:51 GlitchMr 0  '-1'
17:52 GlitchMr In Perl 5 it's fine, because it "mostly" doesn't care about types.
17:52 moritz because it mostly doesn't have types.
17:52 pmichaud In Perl 6 we care very much about types.
17:52 GlitchMr The only instance I'm aware of where Perl 5 cares are bitwise operators.
17:52 GlitchMr And talking about CPAN, JSON.
17:53 pmichaud pmichaud@kiwi:~$ perl -e 'my $x = "aa";  $x--; print "$x\n"'
17:53 pmichaud -1
17:53 moritz and ++ in some cases
17:53 [Coke] (sounds like FROGGS is running into things I found when trying to port tcl to parrot)
17:53 [Coke] (in terms of test suites)
17:53 GlitchMr moritz, which cases?
17:53 pmichaud pmichaud@kiwi:~$ perl -e 'my $x = "z";  $x++; print "$x\n"; $x--; print "$x\n";'
17:53 pmichaud aa
17:53 pmichaud -1
17:54 GlitchMr In Perl 5, what looks like number is considered a number, and what looks like string is considered a string.
17:54 pmichaud even in Perl 5 increment and decrement don't "round trip"
17:54 moritz GlitchMr: search 'perldoc perlop' for magic
17:54 GlitchMr Well, in Perl 5 autodecrement wasn't magical.
17:54 moritz and ++ cares whether stuff is numeric
17:55 GlitchMr Sounds like optimization.
17:55 GlitchMr print ++($foo = "99");# prints "100"
17:55 GlitchMr ++ of number would be also 100.
17:56 pmichaud print ++($foo = "00099");  # prints "00100"
17:56 moritz well, perl 5 does "fun" like this:
17:56 moritz $ perl -wE 'my $x = "a"; say 0+$x; say ++$x'
17:56 moritz Argument "a" isn't numeric in addition (+) at -e line 1.
17:56 moritz 0
17:56 moritz 1
17:57 moritz the mere fact that $x was used as a number once means it doesn't magically auto-increment to 'b' anymore
17:57 GlitchMr glitchmr@pineapple ~> perl -E 'my $c = "ab"; $c + 2; say ++$c'
17:57 GlitchMr 1
17:57 GlitchMr glitchmr@pineapple ~> perl -E 'my $c = "ab"; say ++$c'
17:57 GlitchMr ac
17:57 GlitchMr Ok...
17:57 GlitchMr That is strange...
17:57 GlitchMr Why doing noop would do this in any language?
17:59 masak "doctor, it hurts when I do this"
17:59 pmichaud adding two values together is not technically a "noop".  :)   (I know, you meant that $c should be treated as immutable in this case... but it's not a no-op :)
17:59 GlitchMr I would understand just checking internal type of variable (then it would be just optimization), but checking the last operation done on variable?
18:00 pmichaud I think the + operation mutates the variable if it a string representing a number, or something like that.
18:00 pmichaud I doubt it's "checking the last operation performed"
18:00 pmichaud but that's completely a guess on my part, not being terribly familiar with p5 internals
18:00 moritz GlitchMr: well, chekcking type of a variable is exactly what happens here
18:00 PerlJam GlitchMr: there's a bit (maybe two) that indicate whether a scalar should be treated as a string or a number.  Performing addition with the scalar flips that bit.
18:00 GlitchMr Optimization, because you cannot have number with value of "ABC". Unless you use something like http://thedailywtf.com/Articles/OMGWTF​-Finalist-08-Universal-Calculator.aspx that allows you to declare new digits.
18:01 moritz GlitchMr: and using a scalar as anumber marks its type
18:02 dmol joined #perl6
18:02 colomon BTW: perl -E 'my $c = "ab"; say ++$c; say $c'
18:02 colomon ac
18:02 pmichaud anyway, I suspect the language design team would consider proposals for changes to the meaning of Str.pred... just know that we've gone through a lot of the more obvious ideas already.
18:02 colomon that's 5.14
18:03 GlitchMr <colomon> BTW: perl -E 'my $c = "ab"; say ++$c; say $c'
18:03 GlitchMr This does exactly what I would expect.
18:04 GlitchMr I know that ++ mutates variable.
18:04 colomon oh, I copied the wrong one.
18:05 espadrine joined #perl6
18:05 colomon here's the behavior that's extra awesome:
18:05 colomon perl -E 'my $c = "ab"; $c + 2; say $c++; say $c'
18:05 colomon ab
18:05 colomon 1
18:05 jac50 joined #perl6
18:05 GlitchMr Yeah, doing math on string is strange behavior I didn't see in other programming languages.
18:06 GlitchMr I would rather expect that internal type would depend on doing math and storing result.
18:06 GlitchMr And not just doing math.
18:07 GlitchMr If I would do $abc += 2, it would be perfectly fine for me to expect that $abc is number.
18:07 GlitchMr But if I do $abc + 2, the type of $abc shouldn't change.
18:08 moritz GlitchMr: we know that. We know that Perl 5 is imperfect in many way. Which is why we work on Perl 6
18:08 masak and Perl 6 is imperfect in many ways, too. but at least it's mostly new ways.
18:08 huf i dont think type is the thing that changes :)
18:08 GlitchMr I'm not sure anymore what changes.
18:08 GlitchMr And I know nothing about Perl internals.
18:09 huf i think in order to do addition, the scalar is numified (to 0) and that value is stored in the ... mumble slot
18:09 huf and then i guess ++ does heuristics :D
18:09 masak GlitchMr: you've stumbled onto a piece of the Perl 5 internals that people don't normally stumble on. you should feel proud.
18:09 masak GlitchMr: and Perl 5 does a great number of useful things for people despite these interesting flaws.
18:09 huf this is similar to the +0 trick wrt bitwise ops
18:10 GlitchMr I already know about ISO-8859-1/UTF-8 flag. But this surprised me more.
18:10 masak partly, I guess, because no-one would write '$c + 2;' like that in a real program.
18:10 PerlJam masak: that reads like "you've been eaten by a grue, you should feel proud"  ;)
18:10 huf and also Scalar::Util::dualvar() might be relevant-ish
18:10 GlitchMr ISO-8859-1/UTF-8 makes some sort of sense.
18:10 masak GlitchMr: use it to your advantage. learn a bit about the Perl 5 internals. turn your confusion and anger into knowledge ;)
18:10 masak PerlJam: yep. that about sums it up.
18:11 GlitchMr Also, I know about '0 but true'. I guess it counts as internal.
18:11 masak GlitchMr: note that dualvars are not in Perl 6. so, what moritz said.
18:11 pmichaud masak, but someone could do this:
18:11 masak the closest thing we have is Cool, I guess.
18:11 pmichaud pmichaud@kiwi:~$ perl -E 'my $c = 'ab'; my $d = $c + 2; say ++$c;'
18:11 pmichaud 1
18:11 moritz r: say 'foo' but 42
18:11 camelia rakudo cd5ca7: OUTPUT«foo␤»
18:12 moritz r: say 1 + ('foo' but 42)
18:12 camelia rakudo cd5ca7: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏foo' (indicated by ⏏)␤  in method Numeric at src/gen/CORE.setting:10093␤  in sub infix:<+> at src/gen/CORE.setting:2983␤  in sub infix:<+> at src/gen/CORE.setting:2981␤  in sub…
18:12 PerlJam GlitchMr: forget all that Perl 5 internals knowledge; Perl 5 is a dead end!  (Stevan told me so)  Learn about Perl 6 internals or moe internals.
18:12 masak pmichaud: troo.
18:14 GlitchMr Even PHP hasn't surprised me so much (it also doesn't have any sort of specification) as $a + 2 changing variable type.
18:14 GlitchMr Yes, it does have lots of quirks (see __lambda_func()), but make sense.
18:14 pmichaud oh, I can think of many languages that don't have quirks.  I tend to not use them because they aren't powerful enough to do the things I want to do :)
18:15 PerlJam GlitchMr: you haven't played with PHP's array data type much I'll wager.
18:15 huf i still dont think it's the type that changes :)
18:15 huf it's ... something. but i wouldnt call it type.
18:15 GlitchMr array in PHP is hax, but outside of internals, it is consistent.
18:15 huf not really.
18:16 kaleem joined #perl6
18:16 huf the so-called array-cast operator breaks it hard
18:16 GlitchMr (array) for objects, right?
18:16 huf and the internals leak through
18:16 huf yeah
18:16 huf cause both are zend_hash-es internally
18:16 huf and (array) is broken as hell
18:17 huf .... and why do i know this fuck me
18:17 flussence php would be a lot less horrific if the SPL stuff was fully integrated into the core
18:17 PerlJam huf: keep your friends close, but your enemies closer?
18:17 GlitchMr Yeah, (array) for objects with private properties is broken
18:17 flussence some of it's actually pretty nice...
18:17 GlitchMr glitchmr@pineapple ~> php -r 'class b { private $cakE; } var_dump((array) new b);'
18:17 GlitchMr array(1) {
18:17 GlitchMr '\0b\0cakE' =>
18:17 GlitchMr NULL
18:17 GlitchMr }
18:17 huf PerlJam: gotta have some excuse to drink...
18:18 GlitchMr But hey, it's a way for accessing private properties.
18:18 pmichaud ...we're supposed to have an excuse?
18:18 huf GlitchMr: $x = new stdclass; $x->{"0"} = 1; $x = (array)$x; have fun now
18:18 GlitchMr But yeah, it looks like internals.
18:18 huf pmichaud: not really, but it's something to put on the shelf
18:18 huf in this age of ebooks, there's not much else you can put there
18:19 GlitchMr Oh, numeric properties
18:19 GlitchMr Yeah, broken
18:19 GlitchMr array() converts '0' to number, but object contains stringy '0'.
18:19 * masak sees PHP code and gets depressed :(
18:20 pmichaud depressed?  why?
18:20 FROGGS PHP code is ugly by default
18:20 PerlJam masak: just remember ... PHP is a slang of Perl 6   ;)
18:20 huf you can break the comparison operator *that* badly?
18:20 FROGGS PerlJam: not yet :o)
18:20 huf that's ... impressivef
18:21 pmichaud ugly, perhaps, but that's just more motivation to continue working on p6 :)
18:21 FROGGS pmichaud: that is why I am here
18:21 GlitchMr == is broken in PHP. But it has nothing with internals.
18:21 FROGGS to have a sweet language for $future
18:21 pmichaud where we can see beautiful things like masak++'s knapsack solver :)
18:22 pmichaud not to mention all of the other beautiful code that comes out of Sweden these days
18:22 FROGGS (old europe)++ *g*
18:23 GlitchMr IMO, PHP shouldn't have (object) operator. And only (string) should work with objects (when object has __toString() property).
18:24 masak GlitchMr: srsly. I'm about to have dinner here.
18:24 konundra joined #perl6
18:25 FROGGS hehe
18:25 GlitchMr Still surprised that PHP at least has working type model, even if it is broken (but not as broken as invisible type model in Perl where doing "nothing" can affect types).
18:26 GlitchMr If you would consider == to be numeric equals operator, things make more sense.
18:26 huf what are these types you keep mentioning?
18:27 GlitchMr null, bool, integer, float, and string in PHP
18:28 dalek perl6-roast-data: 297f7d1 | coke++ | / (4 files):
18:28 dalek perl6-roast-data: today (automated commit)
18:28 dalek perl6-roast-data: review: https://github.com/coke/perl6​-roast-data/commit/297f7d1a68
18:28 [Coke] niecza has been dirty for 317 days. pugs has been dirty for 1 day. rakudo has been dirty for 1 day.
18:28 huf GlitchMr: yes, perl5 has no such concept
18:29 GlitchMr Also, sorry for moving the discussion from Perl 5 to PHP.
18:29 [Coke] rakudo failure is the GC issue again.
18:29 pmurias joined #perl6
18:29 [Coke] pugs is the new lsb/msb functions - can someone fudge those for pugs please?
18:29 dmol1 joined #perl6
18:29 [Coke] (or, implementing them would also be fine. ;)
18:30 dalek nqp: 0255fc8 | (Pawel Murias)++ | src/QAST/VM.nqp:
18:30 dalek nqp: Dump the contents of QAST::VM nodes when dumping the ast.
18:30 dalek nqp: review: https://github.com/perl6/nqp/commit/0255fc83f3
18:30 GlitchMr Heh, also coke has interesting way of keeping GitHub streak.
18:30 PerlJam Does anyone implement stuff for pugs anymore?
18:30 FROGGS [Coke]: rakudo was clean yesterday?
18:31 FROGGS hmmm, I was early in bed an at that day rakudo passes... is that a sign?
18:31 GlitchMr PerlJam, [Coke] appears to make small changes to Pugs. https://github.com/perl6/Pugs.hs/commits/master
18:31 GlitchMr But that doesn't change that Pugs.hs is mostly dead
18:31 pmurias [Coke]: lsb/msb?
18:32 GlitchMr Like Pugs.hs stringifies Int as (Int) instead of Int().
18:33 GlitchMr Nothing major happens in Pugs, just such small changes that are easy to implement.
18:33 GlitchMr p: say Int
18:33 camelia pugs: OUTPUT«Int()␤»
18:33 GlitchMr This has old Pugs version (not that anyone cares)
18:35 pmichaud some of us do.
18:35 zakalwe joined #perl6
18:37 dalek Pugs.hs: 2a05b7f | (Konrad Borowski)++ | Pugs/ (2 files):
18:37 dalek Pugs.hs: Copyright 2005-2013, The Pugs Contributors
18:37 dalek Pugs.hs: review: https://github.com/perl6/Pugs.hs/commit/2a05b7f363
18:39 FROGGS p: say Any
18:39 camelia pugs: OUTPUT«Any()␤»
18:39 GlitchMr Should be (Any)
18:39 GlitchMr r: say Any
18:39 camelia rakudo cd5ca7: OUTPUT«(Any)␤»
18:39 moritz getting pugs to build has usually been an adventure
18:39 GlitchMr https://github.com/perl6/Pugs.hs/commit/​5933753509fefd880deccc14e43d6e7d6e32e806
18:40 FROGGS moritz: but [Coke]++ does it, no?
18:40 GlitchMr It isn't really maintained. It still has changes, but they are very small.
18:40 raiph joined #perl6
18:41 PerlJam moritz: I think I stopped paying attention to pugs the last time I tried to build it, but didn't have the latest and greatest ghc or something so it failed.
18:41 census joined #perl6
18:43 GlitchMr left #perl6
18:43 GlitchMr joined #perl6
18:43 GlitchMr oops, accidental part
18:44 timotimo i'm confused about backtracking control with :
18:45 pmichaud timotimo: example?
18:45 timotimo if i have <ident>: \:: <.ws>: <digit>+, backtracking into "Hello: Foobar: 1"
18:46 timotimo it will try Hello:, then ello:, then llo: then lo: then o: and then Foobar: 1
18:46 timotimo i thought the : would make it not backtrack into the ident?
18:46 timotimo i suppose i'd have to put a <ww> before the <ident> and it'll be fine?
18:46 pmichaud are you sure it's backtracking into ident?
18:46 pmichaud if so, that's a bug.
18:47 timotimo it seems that way, from trying it with grammar:debugger
18:47 pmichaud oh, that's not backtracking into <ident>
18:47 pmichaud that's moving the start position forward one
18:47 timotimo oh
18:47 timotimo duh :)
18:47 zby_home_ joined #perl6
18:47 timotimo so a <ww> would help?
18:47 timotimo oh, ww is wrong
18:47 pmichaud more likely a <<
18:47 pmichaud «
18:48 timotimo yes, that or wb
18:48 pmichaud « is probably more efficient
18:49 [Coke] pugs is just on life support, yes.
18:50 pmichaud nothing wrong with life support.  I highly recommend it.
18:51 timotimo mhm, ok
18:53 masak Pugs is estivating :)
18:55 timotimo pmichaud: it seems i don't have to put any : any more. cool. is that because ident is defined as a token?
18:55 timotimo is there a way to introspect these types?
18:56 pmichaud yes, ident is defined as a token, so it won't backtrack.
18:59 timotimo .comb(... , :match) makes me happy
18:59 pmichaud "Perl 6... making people happy."
18:59 moritz that's the same as .match(:g, ...), no?
19:00 timotimo yes
19:01 timotimo but it is a sensible progression from "comb" to "comb and please give me match objects"
19:05 jac50 joined #perl6
19:05 stevan_ joined #perl6
19:11 colomon is it the same?
19:11 colomon r: say "hello".match(/\w/, :g).WHAT
19:11 camelia rakudo cd5ca7: OUTPUT«(List)␤»
19:11 colomon okay, guess it is.  :)
19:11 colomon r: say "hello".match(/\w/).WHAT
19:11 camelia rakudo cd5ca7: OUTPUT«(Match)␤»
19:14 timotimo why does :g turn into False instead of a list of match objects when i just change m to m:g? also, there was a match before and now it's False, huh?
19:15 pmichaud might be a bug... would need to see an example
19:15 flussence doesn't m:g keep the .pos state between matches?
19:16 pmichaud it starts a new match from the end of the previous one, yes.
19:23 timotimo test test
19:25 timotimo r: https://gist.github.com/timo/0a8f7182dc0968f8e73c
19:25 camelia rakudo cd5ca7: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/mDsOlLecdp:1â�¤------> [32mhttps[33mâ��[31m://gist.githu​b.com/timo/0a8f7182dc0968f8[0mâ�¤    expecting any of:â�¤        argument listâ�¤        postfixâ�¤        infix stopperâ�¤        infix or meta-infixâ�¤        st…
19:26 timotimo oopsie?
19:26 timotimo oh, oops
19:26 timotimo it still doesn't do secret gists?
19:27 timotimo didn't want to put it public
19:28 timotimo r: say "Heute: Gulasch: 3,50 Euro UNGLAUBLICHES SCHNÄPPCHEN" ~~ m/ <produkt=.ident> \: <.ws> $<pre>=[<.digit>+] \, $<post>=[<.digit> ** 2] <.ws> "Euro"/;
19:28 camelia rakudo cd5ca7: OUTPUT«「Gulasch: 3,50 Euro」␤ produkt => 「Gulasch」␤ pre => 「3」␤ post => 「50」␤␤»
19:28 timotimo r: say "Heute: Gulasch: 3,50 Euro UNGLAUBLICHES SCHNÄPPCHEN" ~~ m:g/ <produkt=.ident> \: <.ws> $<pre>=[<.digit>+] \, $<post>=[<.digit> ** 2] <.ws> "Euro"/;
19:28 camelia rakudo cd5ca7: OUTPUT«False␤»
19:28 timotimo afk
19:34 domidumont joined #perl6
19:35 eternaleye joined #perl6
19:35 masak TimToady: s/Determinate/Determinant/ in http://rosettacode.org/wik​i/Matrix_arithmetic#Perl_6
19:37 TimToady not my entry
19:38 TimToady and it's a wiki
19:38 masak oops; sorry for the noise.
19:38 * masak edits it
19:49 berekuk joined #perl6
19:53 eternaleye joined #perl6
19:57 s1n joined #perl6
20:02 stevan_ joined #perl6
20:04 monstar joined #perl6
20:09 monstar joined #perl6
20:14 timotimo well, the regex match definitely goes through and then it continues through the regex and ends up with "false"
20:16 splitcells joined #perl6
20:17 pmichaud it might be a buglet introduced by switching negative matches to be Nil
20:18 timotimo that could be, yes
20:18 timotimo there are no tests that catch this? that' s kinda bad :(
20:19 colomon timotimo: You appear to be qualified to write one...
20:19 timotimo :)
20:19 timotimo yeah, i think ishould
20:19 FROGGS timotimo: if you have a test we could bisect this to be sure
20:20 timotimo say "foo. bar. baz." ~~ m:g/(...)\./; - i don't have time, internet or battery power enough to bisect this, sorry
20:20 FROGGS timotimo: I can do that
20:20 timotimo i'm having a hard time even typing on thi slaggy ssh connection
20:21 timotimo thank you
20:21 FROGGS nqp: nqp::say("foo. bar. baz." ~~ m:g/(...)\./)
20:21 camelia nqp: OUTPUT«Confused at line 2, near "nqp::say(\""␤current instr.: 'panic' pc 14721 (src/stage2/gen/NQPHLL.pir:5232) (src/stage2/gen/NQPHLL.nqp:279)␤»
20:21 pmichaud r: say 18446744073709551616 * 18446744073709551616
20:21 camelia rakudo cd5ca7: OUTPUT«340282366920938463463374607431768211456␤»
20:22 * masak feels a little bad for recognizing 2**64 at sight
20:22 sftp joined #perl6
20:24 masak I used to be fascinated (around 10 or so) that 2**(2**$n) % 10 == 6 for $n >= 2.
20:25 splitcells joined #perl6
20:25 masak or more generally that the square of any integer ending in 6 also ended in a 6.
20:25 splitcells test
20:25 timotimo r: say "Heute: Gulasch: 3,50 Euro UNGLAUBLICHES SCHNÄPPCHEN" ~~ rx:P5/ (?<produkt>[a-zA-Z])\: +(?<pre>[0-9]+), +(?<post>[0-9]{2}) Euro/;
20:25 camelia rakudo cd5ca7: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤quantifier quantifies nothingâ�¤at /tmp/REX8OuXBob:1â�¤------> [32m UNGLAUBLICHES SCHNÄPPCHEN" ~~ rx:P5/ (?[33mâ��[31m<produkt>[a-zA-Z])\: +(?<pre>[0-9]+), +([0mâ�¤    expecting any of:â�¤        colon pair (restricted)â�¤Â»
20:25 timotimo not yet implemented?
20:25 timotimo seems like a crass oversight, or i probably did it wrong
20:26 FROGGS (? ) NYI afaik
20:26 pmichaud oh, the :P5 implementation is fairly minimal.
20:26 pmichaud for one, I'd like to wait for its specification to settle down a bit before adding that.  :-P
20:34 eternaleye joined #perl6
20:36 raiph joined #perl6
20:38 dalek rakudo-star-daily: 29a8855 | coke++ | log/ (5 files):
20:38 dalek rakudo-star-daily: today (automated commit)
20:38 dalek rakudo-star-daily: review: https://github.com/coke/rakudo​-star-daily/commit/29a885506c
20:39 [Coke] R* green
20:39 FROGGS \o/
20:40 cooper joined #perl6
20:49 eternaleye joined #perl6
20:54 FROGGS timotimo / pmichaud: say "foo. bar. baz." ~~ m:g/(...)\./; already returned False for 2013.03 and 2013.02
20:56 pmichaud looks like a possible problem with the :g syntax.
20:56 pmichaud r: say "foo. bar. baz.".match( /(...)\./, :global)
20:56 camelia rakudo cd5ca7: OUTPUT«foo. bar. baz.␤»
20:57 pmichaud r: say "foo. bar. baz." ~~ m:global/(...)\./;
20:57 camelia rakudo cd5ca7: OUTPUT«False␤»
20:58 FROGGS r: say "foo. bar. baz." ~~ m:global/(...)\./; say $/
20:58 camelia rakudo cd5ca7: OUTPUT«False␤「baz.」␤ 0 => 「baz」␤␤»
20:59 FROGGS maybe the smartmatch/ACCEPTS does something wrong?
20:59 timotimo FROGGS: thank you for looking into it
20:59 pmichaud r: $_ = "foo. bar. baz.";  say m:g/(...)\./;
20:59 camelia rakudo cd5ca7: OUTPUT«foo. bar. baz.␤»
20:59 pmichaud r: $_ = "foo. bar. baz.";  say m:g/(...)\./.WHAT;
20:59 camelia rakudo cd5ca7: OUTPUT«(List)␤»
21:00 pmichaud ah, yes, since m:g/.../   returns a List, the smart match against the List returns False.
21:01 ajr joined #perl6
21:01 FROGGS needs to be fixed in make_smartmatch in Actions.nqp?
21:01 timotimo FROGGS: :P5 support falls into your domain, right? :)
21:01 FROGGS timotimo: yes and no
21:02 pmichaud FROGGS: that doesn't sound quite right, no.
21:02 timotimo FROGGS: as in "if you feel like improving (? support in p5regex, go ahead"? ;)
21:02 FROGGS ahh, right, I remember something about setting $/ there...
21:03 pmichaud it may be that we do need to fix :global to return a Match object, per S05
21:04 FROGGS timotimo: I'm going (at least hope to) support Perl 5 regex from the v5 side (including $1 for the first capture), and maybe some things will go into m:P5 too
21:04 pmichaud oh, I'd be totally fine with improvements being made directly to P5Regex in NQP
21:07 timotimo can't there be cross-pollination?
21:08 FROGGS timotimo: v5 is using P5Regex too, so patches can be easily applied to both (or to nqp only in many cases)
21:18 autumn joined #perl6
21:19 arlinius joined #perl6
21:36 pecastro_ joined #perl6
21:49 snearch joined #perl6
21:50 gdey joined #perl6
21:55 pmichaud I'll do an R* release tonight.
21:55 pmichaud thanks to everyone who helped resolve the outstanding issues for it.
21:57 sorear \o/
21:58 masak \o/
22:23 xilo joined #perl6
22:25 xilo joined #perl6
22:28 japhb_ joined #perl6
22:30 felher r: my @array = { a => 1, b => 2}; say @array>>.<a>;
22:30 camelia rakudo cd5ca7: OUTPUT«postcircumfix:<{ }> not defined for type Int␤  in method sink at src/gen/CORE.setting:10103␤  in method STORE at src/gen/CORE.setting:6962␤  in sub hash at src/gen/CORE.setting:7115␤  in sub hyper at src/gen/CORE.setting:14147␤  in sub hyper at src/gen/CORE.setting…
22:30 felher Has this changed as of late?
22:31 * felher thought that worked some time ago.
22:34 shachaf joined #perl6
22:34 TimToady nobody implements S03:4147 yet
22:34 TimToady and array subscripting is "nodal", so it shouldn't try to go deep
22:35 TimToady hash subscripting, even
22:35 xilo joined #perl6
22:36 TimToady so for now just use a .map: *.<a>
22:36 TimToady r: my @array = { a => 1, b => 2}; say @array.map: *.<a>;
22:36 camelia rakudo cd5ca7: OUTPUT«1␤»
22:38 felher TimToady: interesting @ S03:4147 . thanks :)
22:39 geekosaur joined #perl6
22:44 geekosaur joined #perl6
22:44 genehack joined #perl6
22:46 skids joined #perl6
22:47 TimToady yes, the smartmatch case is precisely why S05 specs that a Match object is to be returned, since that is one of the few types that can indicate success/failure from .ACCEPTS
22:49 TimToady I believe the specced Match return is consistent with turning m:g/foo/ into m/ .*? <( (foo)+ % [.*?] )> / or some such
22:56 konundra joined #perl6
23:01 berekuk joined #perl6
23:20 kivutar joined #perl6
23:26 mattp_ joined #perl6
23:38 grondilu r: my @a = <foo bar>; say $@a
23:38 camelia rakudo cd5ca7: OUTPUT«foo bar␤»
23:39 grondilu r: my @a = <foo bar>; say $@a.elems
23:39 camelia rakudo cd5ca7: OUTPUT«2␤»
23:39 grondilu r: my @a = <foo bar>; say ($@a).elems
23:39 camelia rakudo cd5ca7: OUTPUT«2␤»
23:39 grondilu r: my @a = <foo bar>; say ($@a, 1).elems
23:39 camelia rakudo cd5ca7: OUTPUT«2␤»
23:40 grondilu well, that's nice
23:40 grondilu r: my @a = <foo bar>; say (@a, 1).elems
23:40 camelia rakudo cd5ca7: OUTPUT«3␤»
23:40 espadrine joined #perl6
23:42 grondilu what's Int.msb?
23:43 grondilu r: say (^10)».msb
23:43 camelia rakudo cd5ca7: OUTPUT«Nil 0 1 1 2 2 2 2 3 3␤»
23:43 grondilu r: say (^100)».msb
23:43 camelia rakudo cd5ca7: OUTPUT«Nil 0 1 1 2 2 2 2 3 3 3 3 3 3 3 3 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6␤»
23:43 grondilu r: say (^100)».msb.bag
23:43 camelia rakudo cd5ca7: OUTPUT«bag("0" => 1, "1" => 2, "2" => 4, "3" => 8, "4" => 16, "5" => 32, "6" => 36)␤»
23:44 * grondilu confesses he has no idea what this is
23:45 diakopter heh.
23:47 grondilu r: say (^100)».lsb.bag
23:47 camelia rakudo cd5ca7: OUTPUT«bag("0" => 50, "1" => 25, "2" => 12, "3" => 6, "4" => 3, "5" => 2, "6" => 1)␤»
23:49 grondilu r: say (^100).map(* %% 2).bag
23:49 camelia rakudo cd5ca7: OUTPUT«bag("True" => 50, "False" => 50)␤»

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs