»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by moritz on 3 May 2013.
pmichaud that's interesting. :-) 00:00
I wonder which parse is correct.
std: say .elems given my $ = <foo bar>, <fooagain baragain>; 00:01
camelia std 0336087: OUTPUT«ok 00:00 44m␤»
diakopter gah yapc austin i.imgur.com/lnG0naa.png 00:06
00:06 risou is now known as risou_awy, risou_awy is now known as risou
pmichaud diakopter: got enough space? ;-) 00:06
diakopter main room, yes. www.utexas.edu/ce/tcc/files/images/...plash2.jpg 00:07
note the 'muhrkan flags 00:08
um. one of those is Texas flag, I mena.
mean
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:14 daniel-s left 00:19 btyler left
colomon has completely messed up the branching on his local copy of niecza. :\ 00:22
00:22 berekuk left 00:25 risou is now known as risou_awy, tgt left
labster wow, that is a lot of people. Are we gonna have enough BBQ? 00:31
diakopter well... 00:32
maybe 00:33
00:33 berekuk joined 00:34 berekuk left
labster [Coke]: that bool.t bug doesn't look fixed to me, it's just not reporting the failure: github.com/coke/perl6-roast-data/b...y.out#L235 00:35
rn: $*CWD := "/usr/bin"; 00:41
camelia rakudo 8a0859: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/i3_N91lH2h:1␤------> $*CWD := "/usr/bin"⏏;␤ expecting any of:␤ postfix␤»
..niecza v24-51-g009f999: OUTPUT«===SORRY!===␤␤Cannot use bind operator with this LHS at /tmp/u3aUBQY7x9 line 1:␤------> $*CWD := "/usr/bin"⏏;␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1502 (die @ 5) ␤ at …
labster std: $*CWD := "/usr/bin";
camelia std 0336087: OUTPUT«ok 00:00 43m␤»
00:46 rindolf joined
labster rn: $PROCESS::CWD := "/usr/bin"; say $*CWD; 00:47
camelia niecza v24-51-g009f999: OUTPUT«/usr/bin␤»
..rakudo 8a0859: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/Beq33sAjU6:1␤------> $PROCESS::CWD := "/usr/bin"⏏; say $*CWD;␤ expecting any of:␤ postfix␤»
00:47 PacoAir left 00:57 rindolf left 01:04 anuby joined 01:06 japhb_ left
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:07
01:08 s1n left
TimToady nr: (1,(2,3)).elems.say 01:08
camelia niecza v24-51-g009f999: OUTPUT«2␤»
..rakudo 8a0859: OUTPUT«3␤»
TimToady like that
pmichaud rn: say .elems given (my $ = <foo bar>, <fooagain baragain>);
camelia niecza v24-51-g009f999: OUTPUT«2␤»
..rakudo 8a0859: OUTPUT«3␤»
TimToady .elems is flattening the second parcel into 2 elements 01:09
pmichaud it's supposed to, unless that's a spec change
nr: (1,(2,3)).[2].say 01:10
camelia niecza v24-51-g009f999: OUTPUT«(Any)␤»
..rakudo 8a0859: OUTPUT«3␤»
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.
TimToady well, but he's an idiot
pmichaud you're telling me.
diakopter fetches the millstone 01:12
TimToady wonders how we introspect a parcel then...
need a .args or some such
pmichaud and actually, S07 had it "wrong" for quite a long time, indicating that Parcels didn't flatten for subscripting and .elems
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
TimToady nr: (1,(2,3)).lol.elems.say; # oops 01:14
camelia rakudo 8a0859: OUTPUT«2␤»
..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…
Teratogen what are some file extensions that perl 6 uses?
Tene .pl
.pm
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
Teratogen oh I thought there were some file extensions for parrot part of perl 6
file extensions and/or mime types
Tene Parrot uses .pir and .pbc, among others.
TimToady does not view parrot as part of Perl 6... :P 01:16
Teratogen WHAT!
you don't?
Tene Teratogen: Is there any particular problem you're trying to solve here, or just asking out of general curiosity?
diakopter Teratogen: is the JVM part of Perl 6?
Teratogen general curiosity... I collect file extensions and mime types
diakopter is mono/.NET?
is GHC? 01:17
dalek ecza: 99a2d57 | (Solomon Foster)++ | lib/ (3 files):
Simple implementation of Int.lsb.

Only works on positive numbers so far.
pmichaud I don't know that I mind if we switch .elems/.[] to not flatten Parcels, but I have no idea what would break.
perhaps not much, since that's the interpretation Niecza is using.
TimToady three years ago we were still more interesting in hiding the existence of parcels than we are now, I suspect 01:18
certainly it's more efficient to not flatten :)
the real question is whether it violates user expectations
nr: say (1,(2,3))[1].perl 01:19
camelia rakudo 8a0859: OUTPUT«2␤»
..niecza v24-51-g009f999: OUTPUT«(2, 3)␤»
pmichaud here's the version of the S08 spec that dealt with parcels, that was deemed to be incorrect: github.com/perl6/specs/blob/069844...apture.pod
01:20 rindolf joined
perigrin_ so three years ago you were USPS and now you're more FedEx? 01:22
01:22 s1n joined 01:24 perigrin joined
pmichaud PerlJam pointed out that binding and assignment look odder with the non-flatten semantics. irclog.perlgeek.de/perl6/2009-09-21#i_1523936 01:25
[Coke] labster: ah. you probably just pushed it so it happens AFTER the done call. :) 01:26
pmichaud anyway, if it needs to change, we can probably make it happen. 01:28
as far as the cost of flattening, I was thinking that a Parcel could cache its flattened counterpart
so once flattened it doesn't have to reflatten for subsequent indexing operations
(since Parcels are immutable, this ought to be relatively safe) 01:29
01:30 FieldsaBB left
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.
that came much later.
TimToady I think I need to review the whole argument now that we have the \foo thing
01:30 chrisdev left
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:31
but yes, it may be one of those changes that if made breaks a lot of stuff. 01:32
in fact just within the last 24 hours I gave examples of Parcel that depended on its flattening behavior.
in particular:
my @a = <apple banana cherry>; say (1, 2, @a, 4).[3];
my @a = <apple banana cherry>; say (1, 2, @a, 4).elems 01:33
TimToady yes, I saw that one
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
01:34 FROGGS_ joined
pmichaud I'm pretty sure p5 programmers would get confused by (1, 2, @a, 4).elems always returning 4. 01:34
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]
so I'm still inclined to say that parcels are just missing some useful primitives that resemble .[] or .elems 01:36
pmichaud wfm.
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
at the earliest
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
[Coke] pmichaud: what's your take on storing TODOs in RT? 01:38
01:38 FROGGS left
pmichaud [Coke]: ...in RT specifically, or in an issue tracker in general? ;-) 01:39
[Coke] anyone running mingw that can test some tickets?
I withdaw the question, pmichaud
RT WHY FOR YOU GIVE ME SEARCH NOT FOUND. 01:41
pmichaud TimToady: while thinking about Parcel handling, it might also be impacted by github.com/perl6/specs/issues/18
[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.
pmichaud can I add this to my list of reasons I dont like RT? ;-) 01:42
Added. :) 01:43
dalek ecs: 9f5a968 | larry++ | S07-lists.pod:
add .args and .arg to Parcel
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.
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
diakopter yay. I think I asked for those arg things a few years ago 01:47
[Coke] .ask masak on rt.perl.org/rt3/Ticket/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:50 rindolf left
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:51
pmichaud TimToady: okay. I'll add that to the thread and think about it when I get back to it. 01:52
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:53
[Coke] r: say ~(64,32,16 ...^ Rat) 01:54
camelia rakudo 8a0859: OUTPUT«64 32 16␤»
TimToady 16/2 is a Rat :)
01:55 GlitchMr joined
[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.
TimToady n: say ~(64,32,16 ...^ Rat) 01:56
camelia niecza v24-51-g009f999: OUTPUT«64 32 16␤»
[Coke] TimToady: that was the concensus, yes. Would you say that's operating as intended, or should it be smarter?
TimToady well, the question is whether a Rat should auto-coerce itself to an Int if it can
I don't know that we have any consensus on that 01:57
pmichaud suggests spec issue ticket.
[Coke] So should we open a spec ticket for folks to kibbitz on?
TimToady arguably a FatRat should never reduce, or you lose the desire for fatness
[Coke] on it.
TimToady unless we make FatInt, which would be...silly...
but we already have Rat auto-coercing to Num sometimes 01:58
alternately, should infix:<...> use div instead of / when it can?
pmichaud where "when it can" means...?
TimToady nr: say (16/2).WHAT; say (16 div 2).WHAT; 01:59
camelia rakudo 8a0859, niecza v24-51-g009f999: OUTPUT«(Rat)␤(Int)␤»
TimToady nr: say 16/3 == 16 div 3
camelia rakudo 8a0859, niecza v24-51-g009f999: OUTPUT«False␤»
TimToady meaning that
pmichaud no, I mean how do we know when to autodetect div versus / ?
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
we aren't really dividing by two, we're multiplying by 1/2
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
pmichaud r: say ~(180, 90, 45 ... Rat)
camelia rakudo 8a0859: OUTPUT«180 90 45 22.5␤»
TimToady I don't think the div vs / thing will work
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␤␤»
pmichaud r: say ~(64, 32, 16 ... *.de != 1)
camelia rakudo 8a0859: OUTPUT«No such method 'de' for invocant of type 'Int'␤ in block at /tmp/6_JF5Endxa:1␤␤»
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
pmichaud r: say ~(64, 32, 16 ... 1)
camelia rakudo 8a0859: OUTPUT«64 32 16 8 4 2 1␤»
pmichaud r: say ~(64, 32, 16 ... Rat)
camelia rakudo 8a0859: OUTPUT«64 32 16 8␤»
[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␤␤»
[Coke] r: say (1+2i).reals ; say (1+2i).reim
camelia rakudo 8a0859: OUTPUT«1 2␤No such method 'reim' for invocant of type 'Complex'␤ in block at /tmp/6bu35g6lnt:1␤␤»
colomon n: say ~(64, 32, 16 ... Rat)
camelia niecza v24-53-g99a2d57: OUTPUT«64 32 16 8␤»
pmichaud r: say ~(64, 32, 16 ... *.denominator != 1)
camelia rakudo 8a0859: OUTPUT«No such method 'denominator' for invocant of type 'Int'␤ in block at /tmp/s_FkonyeJH:1␤␤»
TimToady so I'm not sure I want to say the current behavior is wrongoid
*wrongoidal
dinner & 02:04
[Coke] rt.perl.org/rt3/Ticket/Display.html?id=83720 - neither .reals nor .reim is spec'd.
dalek ecza: 269243f | (Solomon Foster)++ | lib/ (3 files):
Simple implementation of Int.msb.

Only works on positive numbers so far.
02:05
02:12 bonsaikitten joined
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␤␤»
colomon :\
[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.
and selecting based on tags is far simpler :) 02:15
02:15 jaldhar joined
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 …
..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…
colomon rn: say (.5, 1+0i, 2).sort(+*) 02:18
camelia rakudo 8a0859: OUTPUT«0.5 1+0i 2␤»
..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…
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…
..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…
TimToady r: say .5 <=> 1 + 0i 02:21
camelia rakudo 8a0859: OUTPUT«Increase␤»
colomon I'm not at all certain how that sort works in Rakudo.
TimToady it seems smart enough to ignore the 0i
colomon rn: say (.5, 1+0.00000001i, 2).sort(+*)
camelia rakudo 8a0859: OUTPUT«0.5 1+1e-08i 2␤»
..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
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␤␤»
..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…
colomon rn: say (1+0i).Real
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
..rakudo 8a0859: OUTPUT«1␤»
colomon rn: say (1+0.0000001i).Real
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…
..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␤␤»
[Coke] r: say Date.new(-13_000_000_000, 1, 1)
camelia rakudo 8a0859: OUTPUT«-115098112-01-01␤»
02:29 lustlife joined, jaldhar left
colomon oh! 02:29
r: say (3, 11+1i, 40).sort(+*) 02:30
camelia rakudo 8a0859: OUTPUT«11+1i 3 40␤»
colomon sorting by string comparison
n: say (3, 11+1i, 40).sort(+*)
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…
TimToady so +* isn't forcing numeric sort for some reason 02:31
r: say (3,4,11+1i, 40).sort(+*) 02:32
camelia rakudo 8a0859: OUTPUT«11+1i 3 4 40␤»
TimToady not just looking at the first two args then
02:33 jaldhar joined
colomon TimToady: Rakudo doesn't know any way to sort Complex numbers other than by stringification 02:33
so +* doesn't really have any effect on Complex numbers, for the purposes of sorting. 02:35
[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␤␤»…
colomon n: say 1.0000001 ** (10 ** 9)
camelia niecza v24-53-g99a2d57: OUTPUT«2.688103843211962E+43␤»
02:36 adu left
[Coke] rakudo: _~*.A 02:37
camelia rakudo 8a0859: OUTPUT«===SORRY!===␤Undeclared name:␤ _ used at line 1␤␤»
[Coke] std: _~*.A
camelia std 0336087: OUTPUT«===SORRY!===␤Undeclared name:␤ '_' used at line 1␤Check failed␤FAILED 00:00 42m␤»
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…
colomon n: say 459430345345345.lsb 02:40
camelia niecza v24-53-g99a2d57: OUTPUT«0␤»
colomon p6eval: rebuild niecza
[Coke] rant: how can I search for tickets that are NOT tagged testneeded? 02:41
!= doesn't work. NOT LIKE doesn't work.
my RT dosimeter is all red. Is that bad? 02:44
TimToady p6eval: evalbot rebuild niecza 02:45
camelia TimToady: OK (started asynchronously)
[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:47
r: say 657 - 75 # since I can't make RT figure this out. 02:48
camelia rakudo 8a0859: OUTPUT«582␤»
[Coke] plus one for stalled.
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…
..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…
[Coke] r: say ().item.perl
camelia rakudo 8a0859: OUTPUT«$()␤»
TimToady though, oddly, that's not what $() means... 02:52
probably means that turning $() into $/.ast is a bad idea
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…
..rakudo 8a0859: OUTPUT«No such method 'ast' for invocant of type 'Any'␤ in block at /tmp/g2OeCZUC0_:1␤␤»
02:55 atroxaper joined
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…
..rakudo 8a0859: OUTPUT«No such method 'Any' for invocant of type 'Parcel'␤ in block at /tmp/b1Fhw4nHYG:1␤␤»
TimToady say what?
[Coke] TimToady: the suggestion in the ticket was to make ().item.perl return $( ) instead.
TimToady at the moment I'm more inclined to steal $() back from Match 02:57
it was one of those "you think that's cute today" ideas
but if a Match turns .() into .ast, we could just have $/(), and it'd also work on $/[0]() 02:58
$() is a low-wattage feature compared to postcircumfix:<( )> 02:59
and $/() is only one character longer
but how is rakudo deciding that it needs a .Any there? 03:00
sorear what would we use $() for instead?
labster empty parcel?
TimToady an itemized (), as the .perl was thinking above
that seems least surprisey to me 03:01
n: say ().item.perl 03:02
camelia niecza v24-54-g269243f: OUTPUT«$()␤»
TimToady appears that niecza agrees with rakudo there :)
ASCII needs more brackets 03:03
Teratogen remember APL? 03:04
=)
labster set your time machine for 1960
Teratogen that was a cool character set
TimToady set your time machine for now 03:06
.u ⍬
yoleaux U+236C APL FUNCTIONAL SYMBOL ZILDE [So] (⍬)
Teratogen TimToady did you ever get to try the Space Cadet Keyboard? 03:07
TimToady was never a Space Cadet; we had astronauts by the time I reached my formative years 03:08
"Space Cadet" is so...Heinleiny... 03:10
03:12 lizmat left
Teratogen I really enjoy Heinlein 03:14
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
TimToady it's still great for teaching logarithms
geekosaur HS chemistry teacher forced us all to use slide rules 03:18
sorear I suspect you're referring to something earlier than I am 03:19
TimToady well, all the golden age SF writers assumed that more powerful computers would necessarily be bigger, up to planet-sized 03:20
though arguably the Internet is a planet-sized computer :)
sorear it's embedded within a 3-300m thick layer of plaque covering a planet. not really planet-sized :/ 03:21
TimToady well, the neutrino channels through the middle are, as of yet, rather underutilized :) 03:22
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...
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:40 fgomez left 03:42 xinming joined 03:43 preflex_ joined 03:44 preflex left, preflex_ is now known as preflex 03:46 btyler left
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:04
but FIRST is named that because it's the opposite to LAST 04:07
04:07 kst` left, fgomez joined 04:16 colomon left 04:19 drbean left 04:20 thou left 04:23 drbean joined 04:26 Psyche^ joined
[Coke] sau once for 1..10 04:26
er, say "ha!" once for 1..10 04:27
04:27 Patterner left, Psyche^ is now known as Patterner
dalek ecs: fca7f5a | larry++ | S0 (2 files):
START phaser --> once statement prefix
04:30
ecs: 75751f5 | larry++ | S0 (2 files):
change dates
sorear not a statement postfix? 04:34
04:46 BooK left 04:49 thou joined 04:52 cc joined, cc left
TimToady um...no 04:54
TimToady does not always feel the need to make Perl read like English 04:55
dalek d: 6b4371d | larry++ | STD.pm6:
START --> once
04:56
lue
.oO(Inform Perl 7)
TimToady the Reality® operating system used English® as its programming language 04:57
and we see how well that worked out
Teratogen Cobol was an attempt to create code that could be read by managers. 04:58
lue
.oO(EANGLOCENTRIC);
05:00
sorear .o( not QFT? )
TimToady mais oui!
Teratogen when I was stationed at the pentagon I actually bumped into Grace Hopper in the Walgreens on the concourse
I should have got an autograph
darn
lue r: use MONKEY_TYPING; supersede class Complex { }; # me would like this to work. I recommend use CLASS_WARFARE;
camelia rakudo 8a0859: OUTPUT«===SORRY!===␤Cannot use 'supersede' with class declaration␤at /tmp/fg_1ajxjdL:1␤------> MONKEY_TYPING; supersede class Complex ⏏{ }; # me would like this to work. I rec␤ expecting any of:␤ scoped declarator␤ ge…
Teratogen she was very gracious though, and talked with me for a few minutes about Cobol and PL/I
I was a Multics PL/1 programmer! 05:02
I had an honest to god VT-100 on my desk
TimToady wow, so modern, compared to my VT-05...
Teratogen also had a Tektronix 4014 terminal to play with
TimToady pretty flashy, that 05:03
Teratogen yes, when you did a clear screen, the entire screen would flash green
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
so I whiled away the time writing fractal programs in pl/1 for the Tektronix 4014
sorear what were you supposed to do instead? 05:05
Teratogen I really don't remember
05:05 FROGGS_ left
Teratogen that was many decades ago 05:05
I did get away from Multics and started working with the first 16 bit computers to arrive at the Pentagon 05:06
Zenith Z-100 and Z-150
TimToady wow, they really bet on the right horse there...
Teratogen I also got to play around with a Xerox Star 05:07
that thing was slow
lue exits with the feeling that he missed out on an Awesome Time™ in the history of computing. &
TimToady that sounds more like '73 than '83
Teratogen 1973, I was writing programs in HP Timesharing Basic
teletypes, paper tape, modems with cups 05:08
all that jazz
TimToady BASIC/PLUS on a PDP-11/20 for me
with 16k of memory
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
05:09 birdwindupbird joined
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
but I got found out and had to go see the principal
that was the beginning and the end of my "hacking" career
05:13 kaleem joined
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 :)
the weirdest OS was on a Wang computer; all menus to do anything 05:14
Teratogen sounds more like OS/400
are you sure you are not mixing the two up? 05:15
sorear sounds lke a lot of "modern" OSen
TimToady no mouse
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
05:17 ponbiki left
Teratogen and also lag when typing in text 05:17
If I remember correctly the Star was an 8 bit system 05:18
05:18 FROGGS_ joined
sorear o/ FROGGS_ 05:18
05:18 ChanServ sets mode: +v yoleaux
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
(from Seattle)
05:19 ChanServ sets mode: +v preflex
FROGGS_ morning 05:19
05:20 ChanServ sets mode: +v dalek
Teratogen ah well, enough reminiscing 05:22
time to take my medications and crash
05:34 Pleiades` left, Pleiades` joined 05:40 Pleiades` left 05:43 Pleiades` joined 06:02 cooper left 06:03 dakkar joined 06:04 cooper joined, cooper left, cooper joined 06:11 census joined 06:18 domidumont joined 06:26 domidumont left, jaldhar left 06:30 census left 06:33 dmol joined 06:36 fgomez left 06:39 snarkyboojum_ left, snarkyboojum joined 06:43 danaj joined 06:51 fgomez joined 06:53 ponbiki joined, ponbiki is now known as Guest97771 06:58 dmol left 07:00 thou left 07:03 thou joined 07:13 domidumont joined 07:17 thou left 07:22 domidumont left, domidumont joined 07:32 sqirrel joined 07:42 chayin joined
diakopter .ask tadzik plz IM me on gtalk as soon as convenient 07:48
yoleaux diakopter: I'll pass your message to tadzik.
08:02 Guest97771 is now known as ponbiki 08:08 PacoAir joined
tadzik diakopter: done 08:11
yoleaux 07:48Z <diakopter> tadzik: plz IM me on gtalk as soon as convenient
dalek : a8f50bf | (Tobias Leich)++ | / (4 files):
enable subroutine traits and lvalue subs
08:15
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:17
08:19 ggoebel left
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
FROGGS_ o/ 08:30
08:31 mrlo left
moritz [Coke]: comment added 08:31
diakopter anyone here play arcade games in early-mid 90's? 08:34
08:35 ggoebel joined
tadzik I don't suppose so, my first computer was a 386 PC with Wolfenstein 3D preinstalled 08:37
diakopter barely doesn't WWII joke 08:38
FROGGS_ diakopter: I made an arcanoid-clone once, does that count? 08:41
08:42 dakkar left
diakopter yes 08:43
08:43 dakkar joined
tadzik oh, I wrote that too :) 08:45
FROGGS_ tadzik: hah! show off! mine -> github.com/FROGGS/Games-Asteroids/...enshot.png 08:46
08:48 sqirrel left
tadzik lemee compile that :) 08:52
FROGGS_ I'm not sure it still works 08:53
tadzik duh. When I try to take a screenshot, a ball falls down and the game closes :D 08:54
08:56 domidumont left
FROGGS_ hehe 08:56
tadzik i.imgur.com/UaLwOBk.png here it is
FROGGS_ ahh, I didnt even meant arcanoid 08:57
tadzik heh
FROGGS_ tadzik: you're using libsdl too?
or is allegro such thing? 08:58
tadzik FROGGS_: I played with it recently
allegro is very simple
FROGGS_ well, libsdl is Simple Directmedia Layer, so must be simple too :P
tadzik but it has layers :D
FROGGS_ no 08:59
09:02 rindolf joined 09:05 berekuk joined
moritz iirc allegro uses SDL under the hood 09:07
or can use it
09:07 berekuk left
tadzik oh, sufraces, not layers 09:15
bbkr pmichaud: supernovus removed hack from HTTP::Easy so now * can be released without including uncommitted patches 09:16
09:23 mrlo joined 09:25 berekuk joined 09:26 spider-mario joined 09:29 tgt joined
masak morning, #perl6 09:42
yoleaux 01:48Z <[Coke]> masak: on rt.perl.org/rt3/Ticket/Display.html?id=76490 - you say there are tests in roast. can you mark the tests with the ticket number, pleaes?
masak [Coke]: no, that would be moritz++. 09:43
oh, it's both of us. 09:48
masak goes lookin'
10:01 yves_ left
dalek ast: e5f4341 | masak++ | S12-construction/new.t:
added reference to RT ticket from test file

Suggested by [Coke]++.
10:05
10:09 anuby left
FROGGS_ .u ␤ 10:14
yoleaux U+2424 SYMBOL FOR NEWLINE [So] (␤)
10:15 yves_ joined 10:18 woosley left 10:22 berekuk left 10:24 berekuk joined 10:31 berekuk left 10:35 kivutar left 10:40 berekuk joined 10:45 atroxaper left 10:46 atroxaper joined 10:47 atroxaper left 10:55 kivutar joined 11:00 berekuk left 11:07 woosley1 joined, woosley1 left
grondilu r: say "foo␤bar" # testing this newline symbol 11:07
camelia rakudo 8a0859: OUTPUT«foo␤bar␤»
moritz r: say '␤'.ord 11:11
camelia rakudo 8a0859: OUTPUT«10␤»
moritz camelia round-trips it to \n and back 11:12
diakopter for those of you yapc-na'ers who unsubscribed from the mailing list... ;) 11:13
blog.yapcna.org/post/51715017317/ya...torium-and
blog.yapcna.org/post/51716532535/ya...e-schedule
(that's it)
11:15 colomon joined
colomon n: say 1324141431.lsb, 1324141431.msb 11:18
camelia niecza v24-54-g269243f: OUTPUT«030␤»
colomon n: say 1324141431.lsb ~ " " ~ 1324141431.msb
camelia niecza v24-54-g269243f: OUTPUT«0 30␤»
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␤␤»
..niecza v24-54-g269243f: OUTPUT«0␤»
11:20 sqirrel joined 11:24 ztt_ joined 11:25 pmurias left
moritz note that method call binds tighter than prefix - 11:28
FROGGS_ ohh 11:29
rn: say (-1).msb
camelia rakudo 8a0859: OUTPUT«No such method 'msb' for invocant of type 'Int'␤ in block at /tmp/x2hY1EkEi5:1␤␤»
..niecza v24-54-g269243f: OUTPUT«0␤»
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
masak please be more specific.
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.)
FROGGS_: right. sure. so you have to put parens in that case, otherwise it doesn't mean what you want. big deal. :)
FROGGS_ tighter +/- prefixes only make sense if the object is somewhat numeric 11:35
masak depends on your opinion on overloading, but sure.
FROGGS_ yes, sure
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
"equal-but-opposite"*
11:37 sqirrel left 11:38 sqirrel joined
FROGGS_ I think I'm just used to how it is 11:39
there is no real reason for or against it
moritz iirc we parsed -1 as a term for some time 11:40
and it was quite confusiong
because it meant that -1.sqrt and -$a.sqrt parsed differently
masak ah, yes. 11:42
well, I meant that *any* prefix would bind tighter. including -$a
FROGGS_ that was because the - in -1 wasnt a prefix
masak FROGGS_: in other news, how many angels can dance on the head of a pin? :)
moritz masak: the answer to that is quite easy: Mu 11:43
FROGGS_ hmm?
masak what a delightfully satisfactory answer. I feel so extremely enlightened. :P
moritz anyway, it makes sense to have mathematical operators with the same relative precedence as in mathemtics
masak oh, troo. and mathematics doesn't really have method calls, but it has indices which are similar. 11:44
yeah, that's a good rationale.
dalek : 6765445 | (Tobias Leich)++ | p5:
p5 let you run a code snippet in Perl 5 and v5
11:49
: d9394ff | (Tobias Leich)++ | Makefile:
warnings.pm does not depend on Perl5.nqp
: 588025a | (Tobias Leich)++ | lib/Perl5/Grammar.nqp:
behave better when assigning to lvalue subs
: f6563ec | (Tobias Leich)++ | lib/Perl5/Terms.pm:
allow a more termish shift
12:02 atroxaper joined 12:03 proller joined 12:13 sqirrel left 12:14 sqirrel joined
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
sergot_ o/
ok! 12:18
I'm sorry for this
12:19 jaldhar joined 12:24 markstacey joined, markstacey is now known as gudahtt 12:26 skids_ left, proller left
colomon masak: negative lsb and msb are NYI in Niecza. 12:43
12:46 brrt joined 12:48 ztt_ left 12:50 ztt_ joined 12:52 risou_awy is now known as risou 12:56 s1n left 13:01 ajr joined, ajr is now known as Guest35167 13:02 Guest35167 is now known as ajr_ 13:08 domidumont joined, konundra joined 13:11 chrisdev joined, chrisdev left
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:15 atroxaper left
masak and implicit in all of this is that it's a "1" bit, yes? 13:16
that was not at all clear from the spec, see.
diakopter ..but he clarified that 13:19
13:20 proller joined 13:24 s1n joined
masak ah, so he did. it hasn't reached my mailbox yet, is all. 13:24
13:27 domidumont1 joined 13:30 domidumont left
colomon masak: 13:32
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…
colomon n: say (1,2,4 ... *).map((* +| 16).lsb)[^200]
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 …
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 13:38 atroxaper joined 13:41 s1n left 13:44 FieldsaBB joined 13:52 alester left 13:56 bluescreen10 joined 13:57 xinming left 13:58 alester joined 14:01 s1n joined, skids_ joined 14:02 PacoAir left 14:10 PacoAir joined 14:13 xilo left 14:19 konundra left
pmichaud I'm a little confused .. what would be the value of msb(-3) and msb(-4) ? 14:19
14:21 konundra joined
colomon pmichaud: Inf? 14:22
pmichaud not according to most recent spec
Negative integers stored in an C<Int> notionally
+have an infinite number of 1 bits on top, which is a problem.
+Instead of returning C<+Inf>, which is relatively useless, we return
+the position of the first of that infinite supply of sign bits.
+So C<msb(-1)> returns 0, C<msb(-2)> returns 1, and C<msb(-32768)>
+returns 15, just as if we'd converted it from C<int16> to C<uint16>
+and examined that for its top bit. 14:23
I think that msb(-1) should be 1 also.
I suppose it could be zero. 14:24
but the explanation falls apart values like -3 and -4
*for values
14:26 rindolf left
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....
s/by/be/
pmichaud oh, because it gives you the magnitude of the bit representation needed for a negative number
I can see the use for it.
14:27 kaare_ joined
cognominal nr: ' 22 666' ~~ m/(?:\s+(\d+)){2}/; print "$0 $1" 14:29
camelia rakudo 8a0859: OUTPUT«===SORRY!===␤Quantifier quantifies nothing␤at /tmp/v_Age4cR2m:1␤------> ' 22 666' ~~ m/(?:⏏\s+(\d+)){2}/; print "$0 $1"␤ expecting any of:␤ postfix␤ infix stopper␤ infix or meta-infix␤ prefix or t…
..niecza v24-54-g269243f: OUTPUT«===SORRY!===␤␤Unsupported use of (?: ... ) for grouping; in Perl 6 please use [ ... ] at /tmp/pthiR77qDt line 1:␤------> ' 22 666' ~~ m/(?:⏏\s+(\d+)){2}/; print "$0 $1"␤␤Parse failed␤␤»
cognominal oops
colomon is it just going to be msb(-$n) = msb($n-1) + 1?
pmichaud looking.
dalek : 6a1743a | (Tobias Leich)++ | / (3 files):
make "shift || 1" work again
cognominal niecza is more helpful than rakudo here
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␤»
pmichaud that doesn't match the description. 14:31
which says that msb(-1) is 0 and msb(-2) is 1.
colomon pmichaud: i believe it does, except msb(-1) is a special case
14:31 FROGGS_ left, FROGGS[mobile] joined
pmichaud n: say msb(2-1)+1 ; # msb(-2) 14:32
camelia niecza v24-54-g269243f: OUTPUT«===SORRY!===␤␤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…
pmichaud n: say (2-1).msb+1 ; # msb(-2)
camelia niecza v24-54-g269243f: OUTPUT«1␤»
14:32 xilo joined
cognominal nr: ' 42 666' ~~ m/[\s+(\d+)] * 2/; 14:32
camelia rakudo 8a0859, niecza v24-54-g269243f: ( no output )
colomon n: say Nil + 12
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…
cognominal nr: say ' 42 666' ~~ m/[\s+(\d+)] * 2/; 14:33
camelia niecza v24-54-g269243f: OUTPUT«「 42」␤ 0 => 「4」␤␤»
..rakudo 8a0859: OUTPUT«「 42」␤ 0 => 「42」␤ 0 => 「4」␤␤»
pmichaud n: for -1, -2, ... -17 { say $_, " => ", (-$_).msb + 1; }
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:␤------> for -1, -2,⏏ ... -17 { say $_, " => ", (-$_…
pmichaud n: for -1, -2 ... -17 { say $_, " => ", (-$_).msb + 1; }
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␤»
pmichaud n: for -1, -2 ... -17 { say $_, " => ", (-$_ - 1).msb + 1; }
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; }
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␤»
pmichaud okay
yes, -1 must be a special case then.
colomon mind you, my understanding of this may be completely off.... 14:35
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:36
14:37 FROGGS[mobile] left, FROGGS[mobile] joined
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
which also has its weirdnesses :)
anyway, thanks.
that helped. 14:38
colomon I hope it's right! 14:39
At the moment, I'm being a bit boggled at the lsb for negative numbers.
oh, no, I think I've got it
lsb(-$n) = lsb(msb($n) * 2 - $n) 14:40
... except wait, should lsb(-1) be Nil? 14:41
I guess not, by spec: "so always have a lowest bit set somewhere, if only the sign bit."
n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", mnsb(-$n); }; 14:43
camelia niecza v24-54-g269243f: OUTPUT«===SORRY!===␤␤Variable $n is not predeclared at /tmp/yfZprpVsp6 line 1:␤------> -1, -2 ... -17 { say $_, " => ", mnsb(-⏏$n); };␤␤Undeclared routine:␤ 'mnsb' used at line 1␤␤Potential difficulties:␤ &nmsb is declared b…
colomon n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$n); };
camelia niecza v24-54-g269243f: OUTPUT«===SORRY!===␤␤Variable $n is not predeclared at /tmp/AxD6pAA0RU line 1:␤------> -1, -2 ... -17 { say $_, " => ", nmsb(-⏏$n); };␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 15…
colomon n: sub nmsb($n) { ($n.msb * 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
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␤»
colomon that seems very bad 14:44
pmichaud n: sub nmsb($n) { (($n+1)*-2).msb }; for -1, -2 ... -17 { say $_, " => ", nmsb($_); }
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␤»
colomon no, definition is off!
n: sub nmsb($n) { ($n.msb ** 2 - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
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␤»
pmichaud my version seems correctish. 14:45
colomon n: sub nmsb($n) { (2 ** (1 + $n.msb) - $n).lsb; }; for -1, -2 ... -17 { say $_, " => ", nmsb(-$_); };
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␤»
pmichaud I'm going with it, at any rate :) 14:46
gist.github.com/pmichaud/5678418
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␤»
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
colomon pmichaud: My version is more right... 14:48
-126 is 1000 0010 binary, so 1 is correct for it.
pmichaud colomon: for *msb* ? 14:49
colomon oh, no, lsb!
sorry, massive confusion
I changed the problem I was working on without changing the function name.
however, should msb(-128) be 7 rather than 8? 14:51
pmichaud it is in my version. 14:52
colomon ack, testing the wrong thing
14:53 dakkar left
colomon n: gist.github.com/colomon/5678473 14:54
camelia niecza v24-54-g269243f: OUTPUT«-126 => 7␤-127 => 7␤-128 => 7␤-129 => 8␤»
colomon okay, that agrees with my notion of what things should be. pmichaud++
14:55 kaare_ left, fgomez left
colomon steals pmichaud's formula for niecza. ;) 14:57
14:59 espadrine left
pmichaud r: say 64, 32, 16 ... *.?denominator != 1; 15:00
15:00 ajr_ left
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;
camelia rakudo 8a0859: OUTPUT«use of uninitialized value of type Nil in numeric context in block at /tmp/zAxiuw9obq:1␤␤64␤»
pmichaud bah. 15:01
15:01 ajr joined
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 ajr is now known as Guest80880, Guest80880 is now known as ajr_
colomon nr: say (Nil // 1) 15:01
pmichaud r: say 64, 32, 16 ... 0.5;
camelia rakudo 8a0859, niecza v24-54-g269243f: OUTPUT«1␤»
rakudo 8a0859: OUTPUT«64 32 16 8 4 2 1 0.5␤»
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␤␤»
pmichaud r: .WHAT.say for 64, 32, 16 ... 0.5;
camelia rakudo 8a0859: OUTPUT«(Int)␤(Int)␤(Int)␤(Rat)␤(Rat)␤(Rat)␤(Rat)␤(Rat)␤»
pmichaud r: .denominator.say for 64, 32, 16 ... 0.5;
camelia rakudo 8a0859: OUTPUT«No such method 'denominator' for invocant of type 'Int'␤ in block at /tmp/J4Zz2A5wzr:1␤␤»
pmichaud r: .?denominator.say for 64, 32, 16 ... 0.5;
camelia rakudo 8a0859: OUTPUT«Nil␤Nil␤Nil␤1␤1␤1␤1␤2␤»
pmichaud r: (.?denominator //1).say for 64, 32, 16 ... 0.5;
camelia rakudo 8a0859: OUTPUT«1␤1␤1␤1␤1␤1␤1␤2␤» 15:03
pmichaud icky.
the correct answer is *clearly*
64, 32, 16 ... 1
:-P
15:03 fgomez joined
colomon rn: gist.github.com/colomon/5678473 15:05
15:05 thou joined
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:05
15:06 ggoebel left, rindolf joined
colomon much simpler for lsb: lsb(-$n) == lsb($n) 15:09
dalek kudo/nom: ee11f77 | pmichaud++ | src/core/Int.pm:
Add an implementation of Int.msb .

This is mostly just a "something that works" implementation, if others feel a need to come up with more elegant/faster versions, feel free to do so.
15:12
ecza: 7942a09 | (Solomon Foster)++ | lib/CORE.setting:
Handle negative numbers in .lsb and .msb.
15:16
15:16 ggoebel joined
colomon we need to get some tests into roast for these... 15:18
colomon starts a few 15:20
jnthn I suspect 15:23
oops
um. Good evening. 15:24
colomon \o
15:27 FieldsaBB left
[Coke] jnthn: YOU ARE SUSPECT AND WILL BE REPORTED! 15:29
<insert closing image of leonard nimoy version of body snatches>
15:30 snearch joined
dalek ast: b75779f | (Solomon Foster)++ | S32-num/int.t:
Some very basic tests for .lsb and .msb.
15:30
15:31 ggoebel left
[Coke] *snatchers! 15:31
r: say 1000 / 80 15:34
camelia rakudo 8a0859: OUTPUT«12.5␤»
15:37 konundra left, konundra joined, FROGGS[mobile] left 15:45 ggoebel joined 15:47 FROGGS[mobile] joined 15:49 FROGGS[mobile] left, FROGGS[mobile] joined
colomon n: say (-1).msb 15:49
camelia niecza v24-54-g269243f: OUTPUT«0␤»
colomon p6eval: evalbot rebuild niecza 15:50
camelia colomon: OK (started asynchronously)
colomon \o/ 15:51
15:53 espadrine joined 15:56 konundra left 15:59 prevost joined
moritz it just says it does that 16:00
but since the build is now on feather1 and the bot runs on feather3, it can't actually trigger the build anymore
colomon :( 16:04
16:05 FieldsaBB joined 16:08 ajr_ left 16:14 domidumont joined 16:15 jac50 joined 16:16 daniel-s joined
TimToady rosettacode.org/wiki/Find_first_and...ger#Perl_6 16:17
colomon++
16:18 domidumont1 left
colomon TimToady: are those values all correct? ;) 16:18
colomon has not exhaustively tested the new methods yet.
TimToady the task only calls for the postive integers, so probably correct 16:19
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 16:23 domidumont left
colomon I'm pretty sure I got 1 correct. ;) 16:24
TimToady they look like they match the other languages' results
dalek kudo/nom: cd5ca7c | pmichaud++ | src/core/Int.pm:
Add Int.lsb to setting.

Like Int.msb in the previous commit, this is also a
  "something that works" implementation. More elegant or
performant solutions are welcomed.
TimToady ooh, I'll delete the 'works with' :) 16:25
pmichaud well, rakudo (on my machine at least) seems to have trouble with larger ints. 16:27
probably has to do with the bit shift operations in Parrot.
I wonder if I can fix it by using div instead of +> 16:28
moritz int or Int?
pmichaud Int
I'm not (directly) using int anywhere. 16:29
moritz Int uses its own bitshift ops
which are slightly problematic
because libtommath doesn't use 2s complement
so they have to work around that
pmichaud actually, it's probably not the .msb/.lsb that is the problem, but whatever is generating the table of numbers to test.
r: for ^20 { say 42 ** $_; }
TimToady so ** is the problem?
camelia rakudo ee11f7: OUTPUT«1␤42␤1764␤74088␤3111696␤130691232␤5489031744␤230539333248␤9682651996416␤406671383849472␤17080198121677824␤717368321110468608␤30129469486639681536␤1265437718438866624512␤53148384174432398229504␤2232232135326160725639168␤93753749683698750476845056␤3937657486715347520…
pmichaud r: for 15..20 { say 42 ** $_; }
camelia rakudo ee11f7: OUTPUT«2232232135326160725639168␤93753749683698750476845056␤3937657486715347520027492352␤165381614442044595841154678784␤6946027806565873025328496508928␤291733167875766667063796853374976␤»
pmichaud hmm
looks like that's not the problem.
16:29 atroxaper left
TimToady well, it "works with" rakudo, it just doesn't work well :) 16:31
pmichaud oh, I bet it's the printf that can't cope.
TimToady ah, could be
pmichaud r: for 15..20 { printf "%30d\n", 42 ** $_; }
camelia rakudo ee11f7: OUTPUT« -797016064␤ 885063680␤ -1482031104␤ -2115764224␤ 1332215808␤ 118489088␤»
pmichaud yup.
so it is computing the correct values, it just can't display the bigints properly.
TimToady r: for 15..20 { printf "%30s\n", 42 ** $_; }
camelia rakudo ee11f7: OUTPUT« 2232232135326160725639168␤ 93753749683698750476845056␤ 3937657486715347520027492352␤165381614442044595841154678784␤6946027806565873025328496508928␤291733167875766667063796853374976␤»
TimToady there's a workaround, anyway :)
pmichaud indeed. 16:32
ummmmm how is it possible for the RC code to produce that output, if the for loop is ^$power ?
16:32 domidumont1 left
pmichaud wouldn't it only go 0..19 then? 16:32
where is the "20" row coming from?
16:32 kaleem left
TimToady ah, sorry, you caught me cheating :) 16:32
pmichaud CHEATER! 16:33
it also feels like cheating to add .lsb and .msb to Perl 6 and then use them for an RC solution :P
TimToady fixed
pmichaud but that's less of a cheat, because .lsb and .msb are really useful.
[Coke] pmichaud: ... for what? 16:34
colomon This RC solution!
TimToady and also, potentially optimizable with knowledge of the integer storage format
[Coke] colomon: *SMACK*
TimToady why did [Coke] just kiss colomon? 16:35
[Coke] must be a generational thing. :P 16:36
pmichaud gist.github.com/pmichaud/5679283 # much better 16:37
[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
certainly I've run across several just in writing compiler tools and the like.
[Coke] I'll believe it's useful when it's used to compile rakudo. ;) 16:38
moritz r: sub msb(Int:D $x) { $x.base(2).chars }; say 42.msb
camelia rakudo ee11f7: OUTPUT«5␤»
moritz r: sub msb(Int:D $x) { $x.base(2).chars }; say msb(42)
camelia rakudo ee11f7: OUTPUT«6␤»
moritz r: say 42.base(2)
camelia rakudo ee11f7: OUTPUT«101010␤»
TimToady yes, msb is one less than the bit length
moritz r: say 1.msb
camelia rakudo ee11f7: OUTPUT«0␤»
moritz TimToady: off by one then :-)
TimToady actually, it's off by a 0 :)
16:40 kivutar left
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
16:41 Chillance joined
TimToady lsb is useful for converting to int ** exp notation 16:41
which is kinda halfway to floating point 16:42
16:45 kaare_ joined
pmichaud r: say 42**20 16:46
camelia rakudo ee11f7: OUTPUT«291733167875766667063796853374976␤»
pmichaud r: printf("%d\n", 42**20)
camelia rakudo ee11f7: OUTPUT«118489088␤»
pmichaud files rakudobug
moritz I'm pretty sure that's already submitted 16:47
or not; I can't find it 16:48
16:49 espadrine left
pmichaud I couldn't find one. 16:50
(I did look before submitting.)
I think that's also the source of the date formatting bug in #114760.
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
would be an excellent thing to do over an afternoon hackathon, I think.
pmichaud TimToady: on the topic of (s)printf, if you have any thoughts or comments on github.com/perl6/specs/issues/13 I'd love to hear them. 16:52
(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?"
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:53
masak++ # sprintf in nqp 16:54
masak github.com/masak/sprintf 16:55
I remember it being great fun to hack on. 16:56
so... if anyone is up for a sprintf hackathon (sometime post-YAPC::NA), drop me a line.
pmichaud masak: on #118227 (hyper-adding hash types), does that discussion need to continue in a spec issue somewhere, maybe?
masak yes, I think so. 16:57
16:57 alester left 16:58 FROGGS[mobile] left
masak unless TimToady has an immediate ruling about how container types interact with hyperops. 16:58
16:59 FROGGS joined 17:04 jac50 left
FROGGS o/ 17:05
17:05 jac50 joined
TimToady masak: nope 17:06
FROGGS: it's not just precedence, but also the fact that in p5 certain infixes can occur where a term is expected 17:07
p5 relies on yacc to sort those out
FROGGS yacc?
TimToady well, or byacc, or bison
the actual parse that the lexer is feeding tokens to 17:08
*parser
17:08 birdwindupbird left
FROGGS okay, then I'll read p5's source when I hit a piece of code that doesnt work with my current hack 17:09
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:11
17:13 FieldsaBB left
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:14
pmichaud add more cases. 17:15
FROGGS pmichaud: will do some day
currently I my goal is to be able to compile most of the test files
pmichaud audreyt++ 's approach might work also, which is to get others to add test cases if they want bugfixes/features.
TimToady you'll also have to weed out tests that are only testing implementation details that are immaterial to the actual language 17:16
FROGGS TimToady: well, if it is something that some (important) module is using, I have non choice than to support it 17:17
pmichaud: I like that approad for rakudo also
pmichaud yeah, I've not been as diligent about it as audreyt was. I hope to get that way again soon.
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:19
17:21 risou is now known as risou_awy, risou_awy is now known as risou 17:26 konundra joined 17:28 kaare_ left 17:29 kaare_ joined 17:30 FieldsaBB joined
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…
..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␤␤»
GlitchMr Why it isn't 'z'?
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:33
masak GlitchMr: according to S03:518, it should fail. 17:34
pmichaud GlitchMr: it's not clear that "file-000.txt" should decrement to become "file-99.txt" 17:36
GlitchMr Well, with numbers it doesn't make sense 17:37
pmichaud with letters, either.
I wouldn't want "file-aaa.txt" to suddenly become "file-zz.txt"
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
pmichaud oh, Perl 6 defines that already. 17:37
It's file-099.txt. 17:38
r: say "file-100.txt".pred
camelia rakudo cd5ca7: OUTPUT«file-099.txt␤»
17:38 sqirrel left
GlitchMr But I cannot think of anything other than 'z' 'aa'.pred could be. 17:38
pmichaud it can be an error. :)
think of it as "underflow" if you wish. 17:39
"aa".pred underflows out of the range of 2-character strings.
GlitchMr perl6: say 'ab' ... 'y' 17:41
pmichaud that will be infinite, because you never reach 'y'
camelia rakudo cd5ca7, niecza v24-55-g7942a09: OUTPUT«(timeout)»
GlitchMr perl6: say 'y' ... 'ab'
17:41 risou is now known as risou_awy
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
..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/…
GlitchMr Uhmmm, what?
pmichaud r: say 'y' after 'ab' 17:42
camelia rakudo cd5ca7: OUTPUT«True␤»
TimToady r: say [gt] 'zz','zy'...'aa'
camelia rakudo cd5ca7: OUTPUT«True␤»
TimToady that invariant would not hold if we removed chars
17:42 markstacey joined
pmichaud since 'y' comes after 'aa', it's considered a decrement. 17:42
17:42 gudahtt left
GlitchMr So 17:42
perl6: say 'a' ... 'ab'
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␤»
GlitchMr This is... strange. 17:43
pmichaud incrementing strings is strange, yes.
that's why it's called "magical"
GlitchMr It works, until you replace 'a' with 'b'.
Feels too magical.
pmichaud perl6: say 'b', 'c', ... 'ab'
camelia rakudo cd5ca7: OUTPUT«===SORRY!===␤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␤------> say 'b', 'c',⏏ ... 'ab'␤»
..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:␤------> say 'b', 'c',⏏ ... 'ab'␤␤Unhandled exce…
pmichaud perl6: say 'b', 'c' ... 'ab'
TimToady and, basically, there's almost no use case for decrement, compared to increment
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/…
..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␤»
GlitchMr The code appears to work, until you will actually do something.
'a' ... 'ab' doesn't do any sort of warning, nothing. 17:44
But 'b' ... 'ab' fails.
pmichaud sure, because 'b' after 'ab', but 'a' before 'ab'
r: say 'b' after 'ab'
camelia rakudo cd5ca7: OUTPUT«True␤»
pmichaud r: say 'a' before 'ab'
camelia rakudo cd5ca7: OUTPUT«True␤»
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 ztt_ left
GlitchMr for 'c' .. 'bb' { #`[Uhmmm, why range is empty] } 17:46
That could be confusing
pmichaud yes, it can be confusing.
17:46 kaleem joined
pmichaud there's not an obvious fix. 17:46
moritz for every magic behavior you get a WAT too
pmichaud for every alternate approach we've tried, it causes even more confusing cases to appear.
GlitchMr Forbid string ranges for strings with different sizea?
Compare reversed strings? 17:47
flipped*
moritz that sounds weird as well
pmichaud we tried forbidding string ranges... but that means that '999' doesn't overflow properly into '1000'
GlitchMr Hmmm, right 17:48
pmichaud flipping the strings sounds wrong, it's much better if the Range operator *always* does increment.
we did try having Range operators autoreverse, and that just leads to other issues.
GlitchMr Not sure about 'numeric string'.succ.
It appears to work in most cases.
pmichaud and clearly someone wouldn't expect 'c'..'bb' to *start* with 'bb'
GlitchMr Until you do this.
> '0'.pred
Decrement out of range
> 0.pred
-1
Have fun figuring out why $number-- doesn't work. 17:49
pmichaud maybe because it's not a number? ;-)
moritz r: my $x = '0'; say --$x
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?
moritz n: my $x = '0'; say --$x
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…
moritz GlitchMr: then you can use + to force it to be a number
pmichaud or you can use -= 1
r: my $x = '0'; $x -= 1; say $x
camelia rakudo cd5ca7: OUTPUT«-1␤»
17:51 markstacey is now known as gudahtt
GlitchMr DB<2> $a = '0' 17:51
DB<3> $a--
DB<4> x $a
0 '-1'
In Perl 5 it's fine, because it "mostly" doesn't care about types. 17:52
moritz because it mostly doesn't have types.
pmichaud In Perl 6 we care very much about types.
GlitchMr The only instance I'm aware of where Perl 5 cares are bitwise operators.
And talking about CPAN, JSON. 17:53
pmichaud pmichaud@kiwi:~$ perl -e 'my $x = "aa"; $x--; print "$x\n"'
-1
moritz and ++ in some cases
[Coke] (sounds like FROGGS is running into things I found when trying to port tcl to parrot)
(in terms of test suites)
GlitchMr moritz, which cases?
pmichaud pmichaud@kiwi:~$ perl -e 'my $x = "z"; $x++; print "$x\n"; $x--; print "$x\n";'
aa
-1
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"
moritz GlitchMr: search 'perldoc perlop' for magic
GlitchMr Well, in Perl 5 autodecrement wasn't magical.
moritz and ++ cares whether stuff is numeric
GlitchMr Sounds like optimization. 17:55
print ++($foo = "99");# prints "100"
++ of number would be also 100.
pmichaud print ++($foo = "00099"); # prints "00100" 17:56
moritz well, perl 5 does "fun" like this:
$ perl -wE 'my $x = "a"; say 0+$x; say ++$x'
Argument "a" isn't numeric in addition (+) at -e line 1.
0
1
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'
1
glitchmr@pineapple ~> perl -E 'my $c = "ab"; say ++$c'
ac
Ok...
That is strange...
Why doing noop would do this in any language? 17:58
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 :)
GlitchMr I would understand just checking internal type of variable (then it would be just optimization), but checking the last operation done on variable?
pmichaud I think the + operation mutates the variable if it a string representing a number, or something like that. 18:00
I doubt it's "checking the last operation performed"
but that's completely a guess on my part, not being terribly familiar with p5 internals
moritz GlitchMr: well, chekcking type of a variable is exactly what happens here
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.
GlitchMr Optimization, because you cannot have number with value of "ABC". Unless you use something like thedailywtf.com/Articles/OMGWTF-Fin...lator.aspx that allows you to declare new digits.
moritz GlitchMr: and using a scalar as anumber marks its type 18:01
18:02 dmol joined
colomon BTW: perl -E 'my $c = "ab"; say ++$c; say $c' 18:02
ac
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.
colomon that's 5.14 18:03
GlitchMr <colomon> BTW: perl -E 'my $c = "ab"; say ++$c; say $c'
This does exactly what I would expect.
I know that ++ mutates variable. 18:04
colomon oh, I copied the wrong one.
18:04 jac50 left 18:05 espadrine joined
colomon here's the behavior that's extra awesome: 18:05
perl -E 'my $c = "ab"; $c + 2; say $c++; say $c'
ab
1
18:05 jac50 joined
GlitchMr Yeah, doing math on string is strange behavior I didn't see in other programming languages. 18:05
I would rather expect that internal type would depend on doing math and storing result. 18:06
And not just doing math.
If I would do $abc += 2, it would be perfectly fine for me to expect that $abc is number. 18:07
But if I do $abc + 2, the type of $abc shouldn't change.
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.
huf i dont think type is the thing that changes :)
GlitchMr I'm not sure anymore what changes.
And I know nothing about Perl internals.
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
and then i guess ++ does heuristics :D
masak GlitchMr: you've stumbled onto a piece of the Perl 5 internals that people don't normally stumble on. you should feel proud.
GlitchMr: and Perl 5 does a great number of useful things for people despite these interesting flaws.
huf this is similar to the +0 trick wrt bitwise ops
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.
PerlJam masak: that reads like "you've been eaten by a grue, you should feel proud" ;)
huf and also Scalar::Util::dualvar() might be relevant-ish
GlitchMr ISO-8859-1/UTF-8 makes some sort of sense.
masak GlitchMr: use it to your advantage. learn a bit about the Perl 5 internals. turn your confusion and anger into knowledge ;)
PerlJam: yep. that about sums it up.
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.
pmichaud masak, but someone could do this:
masak the closest thing we have is Cool, I guess.
pmichaud pmichaud@kiwi:~$ perl -E 'my $c = 'ab'; my $d = $c + 2; say ++$c;'
1
moritz r: say 'foo' but 42
camelia rakudo cd5ca7: OUTPUT«foo␤»
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…
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.
masak pmichaud: troo.
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
Yes, it does have lots of quirks (see __lambda_func()), but make sense.
18:14 kaleem left
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.
huf i still dont think it's the type that changes :)
it's ... something. but i wouldnt call it type.
GlitchMr array in PHP is hax, but outside of internals, it is consistent.
huf not really.
18:16 kaleem joined
huf the so-called array-cast operator breaks it hard 18:16
18:16 kaleem left
GlitchMr (array) for objects, right? 18:16
huf and the internals leak through
yeah
cause both are zend_hash-es internally
and (array) is broken as hell
.... 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
PerlJam huf: keep your friends close, but your enemies closer?
GlitchMr Yeah, (array) for objects with private properties is broken
flussence some of it's actually pretty nice...
GlitchMr glitchmr@pineapple ~> php -r 'class b { private $cakE; } var_dump((array) new b);'
array(1) {
'\0b\0cakE' =>
NULL
}
huf PerlJam: gotta have some excuse to drink...
18:18 konundra left
GlitchMr But hey, it's a way for accessing private properties. 18:18
pmichaud ...we're supposed to have an excuse?
huf GlitchMr: $x = new stdclass; $x->{"0"} = 1; $x = (array)$x; have fun now
GlitchMr But yeah, it looks like internals.
huf pmichaud: not really, but it's something to put on the shelf
in this age of ebooks, there's not much else you can put there
GlitchMr Oh, numeric properties 18:19
Yeah, broken
array() converts '0' to number, but object contains stringy '0'.
masak sees PHP code and gets depressed :(
pmichaud depressed? why? 18:20
FROGGS PHP code is ugly by default
PerlJam masak: just remember ... PHP is a slang of Perl 6 ;)
huf you can break the comparison operator *that* badly?
FROGGS PerlJam: not yet :o)
huf that's ... impressivef
pmichaud ugly, perhaps, but that's just more motivation to continue working on p6 :) 18:21
FROGGS pmichaud: that is why I am here
GlitchMr == is broken in PHP. But it has nothing with internals.
FROGGS to have a sweet language for $future
pmichaud where we can see beautiful things like masak++'s knapsack solver :)
not to mention all of the other beautiful code that comes out of Sweden these days 18:22
FROGGS (old europe)++ *g*
GlitchMr IMO, PHP shouldn't have (object) operator. And only (string) should work with objects (when object has __toString() property). 18:23
masak GlitchMr: srsly. I'm about to have dinner here. 18:24
18:24 konundra joined, snearch left
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).
If you would consider == to be numeric equals operator, things make more sense. 18:26
huf what are these types you keep mentioning?
GlitchMr null, bool, integer, float, and string in PHP 18:27
dalek rl6-roast-data: 297f7d1 | coke++ | / (4 files):
today (automated commit)
18:28
[Coke] niecza has been dirty for 317 days. pugs has been dirty for 1 day. rakudo has been dirty for 1 day.
huf GlitchMr: yes, perl5 has no such concept
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
[Coke] pugs is the new lsb/msb functions - can someone fudge those for pugs please? 18:29
18:29 dmol left, dmol1 joined
[Coke] (or, implementing them would also be fine. ;) 18:29
dalek p: 0255fc8 | (Pawel Murias)++ | src/QAST/VM.nqp:
Dump the contents of QAST::VM nodes when dumping the ast.
18:30
GlitchMr Heh, also coke has interesting way of keeping GitHub streak.
PerlJam Does anyone implement stuff for pugs anymore?
FROGGS [Coke]: rakudo was clean yesterday?
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. github.com/perl6/Pugs.hs/commits/master
But that doesn't change that Pugs.hs is mostly dead
pmurias [Coke]: lsb/msb? 18:32
GlitchMr Like Pugs.hs stringifies Int as (Int) instead of Int().
Nothing major happens in Pugs, just such small changes that are easy to implement. 18:33
p: say Int
camelia pugs: OUTPUT«Int()␤»
GlitchMr This has old Pugs version (not that anyone cares)
pmichaud some of us do. 18:35
18:35 zakalwe joined
dalek gs.hs: 2a05b7f | (Konrad Borowski)++ | Pugs/ (2 files):
Copyright 2005-2013, The Pugs Contributors
18:37
FROGGS p: say Any 18:39
camelia pugs: OUTPUT«Any()␤»
GlitchMr Should be (Any)
r: say Any
camelia rakudo cd5ca7: OUTPUT«(Any)␤»
moritz getting pugs to build has usually been an adventure
GlitchMr github.com/perl6/Pugs.hs/commit/59...7d6e32e806
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
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
18:41 census joined, stevan_ left 18:43 GlitchMr left, GlitchMr joined
GlitchMr oops, accidental part 18:43
timotimo i'm confused about backtracking control with : 18:44
pmichaud timotimo: example? 18:45
timotimo if i have <ident>: \:: <.ws>: <digit>+, backtracking into "Hello: Foobar: 1"
it will try Hello:, then ello:, then llo: then lo: then o: and then Foobar: 1 18:46
i thought the : would make it not backtrack into the ident?
i suppose i'd have to put a <ww> before the <ident> and it'll be fine?
pmichaud are you sure it's backtracking into ident?
if so, that's a bug.
timotimo it seems that way, from trying it with grammar:debugger 18:47
pmichaud oh, that's not backtracking into <ident>
that's moving the start position forward one
timotimo oh
duh :)
18:47 zby_home_ joined
timotimo so a <ww> would help? 18:47
oh, ww is wrong
pmichaud more likely a <<
«
18:48 FieldsaBB left
timotimo yes, that or wb 18:48
pmichaud « is probably more efficient
[Coke] pugs is just on life support, yes. 18:49
pmichaud nothing wrong with life support. I highly recommend it. 18:50
timotimo mhm, ok 18:51
masak Pugs is estivating :) 18:53
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
is there a way to introspect these types?
pmichaud yes, ident is defined as a token, so it won't backtrack. 18:56
timotimo .comb(... ^H, :match) makes me happy 18:59
pmichaud "Perl 6... making people happy."
moritz that's the same as .match(:g, ...), no?
timotimo yes 19:00
but it is a sensible progression from "comb" to "comb and please give me match objects" 19:01
19:04 jac50 left 19:05 jac50 joined, stevan_ joined
colomon is it the same? 19:11
r: say "hello".match(/\w/, :g).WHAT
camelia rakudo cd5ca7: OUTPUT«(List)␤»
colomon okay, guess it is. :)
r: say "hello".match(/\w/).WHAT
camelia rakudo cd5ca7: OUTPUT«(Match)␤»
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:14
pmichaud might be a bug... would need to see an example 19:15
flussence doesn't m:g keep the .pos state between matches?
pmichaud it starts a new match from the end of the previous one, yes. 19:16
timotimo test test 19:23
r: gist.github.com/timo/0a8f7182dc0968f8e73c 19:25
camelia rakudo cd5ca7: OUTPUT«===SORRY!===␤Two terms in a row␤at /tmp/mDsOlLecdp:1␤------> https⏏://gist.github.com/timo/0a8f7182dc0968f8␤ expecting any of:␤ argument list␤ postfix␤ infix stopper␤ infix or meta-infix␤ st…
timotimo oopsie? 19:26
oh, oops
it still doesn't do secret gists?
didn't want to put it public 19:27
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」␤␤»
timotimo r: say "Heute: Gulasch: 3,50 Euro UNGLAUBLICHES SCHNÄPPCHEN" ~~ m:g/ <produkt=.ident> \: <.ws> $<pre>=[<.digit>+] \, $<post>=[<.digit> ** 2] <.ws> "Euro"/;
camelia rakudo cd5ca7: OUTPUT«False␤»
timotimo afk 19:29
19:31 prevost left 19:34 eternaleye left, domidumont joined, census left 19:35 eternaleye joined
masak TimToady: s/Determinate/Determinant/ in rosettacode.org/wiki/Matrix_arithmetic#Perl_6 19:35
TimToady not my entry 19:37
and it's a wiki 19:38
masak oops; sorry for the noise.
masak edits it
19:42 s1n left 19:47 gudahtt left 19:48 eternaleye left, stevan_ left 19:49 berekuk joined 19:50 jac50 left 19:51 bowtie left 19:52 proller left 19:53 eternaleye joined 19:57 s1n joined 20:02 stevan_ joined 20:04 monstar joined 20:05 kaare_ left 20:07 monstar left 20:09 sftp left, monstar joined
timotimo well, the regex match definitely goes through and then it continues through the regex and ends up with "false" 20:14
20:16 splitcells joined
pmichaud it might be a buglet introduced by switching negative matches to be Nil 20:17
timotimo that could be, yes 20:18
there are no tests that catch this? that' ^Hs kinda bad :(
colomon timotimo: You appear to be qualified to write one... 20:19
timotimo :)
yeah, i think ishould
FROGGS timotimo: if you have a test we could bisect this to be sure
timotimo say "foo. bar. baz." ~~ m:g/(...)\./; - i don't have time, internet or battery power enough to bisect this, sorry 20:20
20:20 domidumont left
FROGGS timotimo: I can do that 20:20
timotimo i'm having a hard time even typing on thi slaggy ssh connection
thank you 20:21
FROGGS nqp: nqp::say("foo. bar. baz." ~~ m:g/(...)\./)
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)␤»
pmichaud r: say 18446744073709551616 * 18446744073709551616
camelia rakudo cd5ca7: OUTPUT«340282366920938463463374607431768211456␤»
masak feels a little bad for recognizing 2**64 at sight 20:22
20:22 splitcells left, sftp joined
masak I used to be fascinated (around 10 or so) that 2**(2**$n) % 10 == 6 for $n >= 2. 20:24
20:25 splitcells joined
masak or more generally that the square of any integer ending in 6 also ended in a 6. 20:25
splitcells test
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/;
camelia rakudo cd5ca7: OUTPUT«===SORRY!===␤quantifier quantifies nothing␤at /tmp/REX8OuXBob:1␤------> UNGLAUBLICHES SCHNÄPPCHEN" ~~ rx:P5/ (?⏏<produkt>[a-zA-Z])\: +(?<pre>[0-9]+), +(␤ expecting any of:␤ colon pair (restricted)␤»
timotimo not yet implemented?
seems like a crass oversight, or i probably did it wrong
FROGGS (? ) NYI afaik 20:26
pmichaud oh, the :P5 implementation is fairly minimal.
for one, I'd like to wait for its specification to settle down a bit before adding that. :-P
20:27 cooper left 20:29 raiph left, eternaleye left 20:34 eternaleye joined 20:36 raiph joined, zby_home_ left
dalek kudo-star-daily: 29a8855 | coke++ | log/ (5 files):
today (automated commit)
20:38
[Coke] R* green 20:39
FROGGS \o/
20:40 cooper joined, konundra left 20:42 splitcells left 20:43 eternaleye left 20:49 eternaleye joined, arlinius left 20:51 PacoAir left
FROGGS timotimo / pmichaud: say "foo. bar. baz." ~~ m:g/(...)\./; already returned False for 2013.03 and 2013.02 20:54
pmichaud looks like a possible problem with the :g syntax. 20:56
r: say "foo. bar. baz.".match( /(...)\./, :global)
camelia rakudo cd5ca7: OUTPUT«foo. bar. baz.␤»
pmichaud r: say "foo. bar. baz." ~~ m:global/(...)\./; 20:57
camelia rakudo cd5ca7: OUTPUT«False␤»
FROGGS r: say "foo. bar. baz." ~~ m:global/(...)\./; say $/ 20:58
camelia rakudo cd5ca7: OUTPUT«False␤「baz.」␤ 0 => 「baz」␤␤»
FROGGS maybe the smartmatch/ACCEPTS does something wrong? 20:59
timotimo FROGGS: thank you for looking into it
pmichaud r: $_ = "foo. bar. baz."; say m:g/(...)\./;
camelia rakudo cd5ca7: OUTPUT«foo. bar. baz.␤»
pmichaud r: $_ = "foo. bar. baz."; say m:g/(...)\./.WHAT;
camelia rakudo cd5ca7: OUTPUT«(List)␤»
pmichaud ah, yes, since m:g/.../ returns a List, the smart match against the List returns False. 21:00
21:01 ajr joined, ajr is now known as Guest66179
FROGGS needs to be fixed in make_smartmatch in Actions.nqp? 21:01
21:01 Guest66179 is now known as ajr_
timotimo FROGGS: :P5 support falls into your domain, right? :) 21:01
FROGGS timotimo: yes and no
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"? ;)
FROGGS ahh, right, I remember something about setting $/ there...
pmichaud it may be that we do need to fix :global to return a Match object, per S05 21:03
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
timotimo can't there be cross-pollination? 21:07
21:07 raiph left
FROGGS timotimo: v5 is using P5Regex too, so patches can be easily applied to both (or to nqp only in many cases) 21:08
21:12 pmurias left 21:16 skids_ left, bbkr left 21:17 autumn left 21:18 autumn joined 21:19 arlinius joined 21:31 spider-mario left 21:33 xilo left 21:36 pecastro_ joined 21:37 pecastro left 21:39 espadrine left 21:49 snearch joined 21:50 gdey joined
pmichaud I'll do an R* release tonight. 21:55
thanks to everyone who helped resolve the outstanding issues for it.
sorear \o/ 21:57
masak \o/ 21:58
22:03 lustlife left 22:19 bluescreen10 left 22:23 xilo joined 22:24 xilo left 22:25 xilo joined 22:28 japhb_ joined
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…
felher Has this changed as of late?
felher thought that worked some time ago. 22:31
22:32 dukeleto left 22:34 shachaf joined
TimToady nobody implements S03:4147 yet 22:34
and array subscripting is "nodal", so it shouldn't try to go deep
hash subscripting, even 22:35
22:35 xilo left, xilo joined
TimToady so for now just use a .map: *.<a> 22:36
r: my @array = { a => 1, b => 2}; say @array.map: *.<a>;
camelia rakudo cd5ca7: OUTPUT«1␤»
felher TimToady: interesting @ S03:4147 . thanks :) 22:38
22:39 geekosaur joined 22:41 geekosaur left 22:43 genehack_ left 22:44 geekosaur joined, genehack joined 22:46 skids joined
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:47
I believe the specced Match return is consistent with turning m:g/foo/ into m/ .*? <( (foo)+ % [.*?] )> / or some such 22:49
22:56 konundra joined 22:59 berekuk left 23:01 berekuk joined 23:20 kivutar joined 23:25 mattp_ left 23:26 mattp_ joined 23:29 tgt left 23:30 monstar left 23:34 rindolf left 23:36 kivutar left
grondilu r: my @a = <foo bar>; say $@a 23:38
camelia rakudo cd5ca7: OUTPUT«foo bar␤»
grondilu r: my @a = <foo bar>; say $@a.elems 23:39
camelia rakudo cd5ca7: OUTPUT«2␤»
grondilu r: my @a = <foo bar>; say ($@a).elems
camelia rakudo cd5ca7: OUTPUT«2␤»
grondilu r: my @a = <foo bar>; say ($@a, 1).elems
camelia rakudo cd5ca7: OUTPUT«2␤»
grondilu well, that's nice 23:40
r: my @a = <foo bar>; say (@a, 1).elems
23:40 berekuk left
camelia rakudo cd5ca7: OUTPUT«3␤» 23:40
23:40 espadrine joined
grondilu what's Int.msb? 23:42
r: say (^10)».msb 23:43
camelia rakudo cd5ca7: OUTPUT«Nil 0 1 1 2 2 2 2 3 3␤»
grondilu r: say (^100)».msb
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␤»
grondilu r: say (^100)».msb.bag
camelia rakudo cd5ca7: OUTPUT«bag("0" => 1, "1" => 2, "2" => 4, "3" => 8, "4" => 16, "5" => 32, "6" => 36)␤»
grondilu confesses he has no idea what this is 23:44
diakopter heh. 23:45
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)␤»
grondilu r: say (^100).map(* %% 2).bag 23:49
camelia rakudo cd5ca7: OUTPUT«bag("True" => 50, "False" => 50)␤»
23:50 mattp_ left 23:53 konundra left 23:54 snearch left