»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
TimToady I'm pretty settled these days 00:00
maybe I should write that part of the new book first :)
japhb :-) 00:01
00:01 larion joined
TimToady my rules are perhaps a bit more finessed these days, given the various additional degrees of freedom, which all have their purpose 00:01
japhb Nodnod
TimToady these days it's more like "Know which of these principles you're emphasizing, to the detriment of other principles." 00:02
rjbs files perl6.vim bug: github.com/vim-perl/vim-perl/issues/188 00:04
TimToady m: say < a \# b > 00:05
camelia rakudo-moar 68c432: OUTPUT«a \# b␤»
TimToady hmm
m: say << a \# b >>
camelia rakudo-moar 68c432: OUTPUT«a#b␤»
TimToady m: say << a \# b >>.elems
camelia rakudo-moar 68c432: OUTPUT«3␤»
00:05 gfldex left
TimToady m: say << a \# b >>.WHAT 00:06
camelia rakudo-moar 68c432: OUTPUT«(Parcel)␤»
TimToady m: say < a \# b >.WHAT
camelia rakudo-moar 68c432: OUTPUT«(Parcel)␤»
TimToady why one has spaces and the other not, dunno..
m: say << a \# b >><> 00:07
camelia rakudo-moar 68c432: OUTPUT«a # b␤»
TimToady apparently <<>> is itemizing itself
m: say < a \# b >.perl 00:08
camelia rakudo-moar 68c432: OUTPUT«("a", "\\#", "b")␤»
rjbs has not yet attempted to understand itemization, but knows he'll need to.
TimToady m: say << a \# b >>.perl
camelia rakudo-moar 68c432: OUTPUT«("a", "#", "b")␤»
japhb m: say < a \# b >.DUMP
camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤ "a",␤ "\\#",␤ "b"␤)))␤»
japhb m: say << a \# b >>.DUMP
camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤ "a",␤ "#",␤ "b"␤)))␤»
TimToady beats me 00:09
japhb Huh
TimToady well, hopefully that one smooths out after GLR
japhb m: say < a \# b >.elems
camelia rakudo-moar 68c432: OUTPUT«3␤»
00:09 f3ew left
japhb That is just mystifying. 00:09
TimToady $!flattens maybe 00:10
japhb m: my \a := < a \# b >; say a.DUMP;
camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤ "a",␤ "\\#",␤ "b"␤)))␤»
japhb m: my \a := << a \# b >>; say a.DUMP;
camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤ "a",␤ "#",␤ "b"␤)))␤»
TimToady except a parcel doesn't have $!flattens
00:10 f3ew joined
japhb Oh wait, perhaps they aren't compiling to the same tree. 00:11
TimToady quite possible
japhb Does camelia have a way to dump QAST?
TimToady m: say quasi { 1 + 1 }.WHAT 00:12
camelia rakudo-moar 68c432: OUTPUT«(AST)␤»
TimToady m: say quasi { 1 + 1 }.dump
camelia rakudo-moar 68c432: OUTPUT«Method 'dump' not found for invocant of class 'AST'␤ in block <unit> at /tmp/ZeHLHrwRV9:1␤␤»
TimToady aw
m: say quasi { 1 + 1 }.QAST.dump
camelia rakudo-moar 68c432: OUTPUT«Method 'QAST' not found for invocant of class 'AST'␤ in block <unit> at /tmp/G9U_xcAWo1:1␤␤»
japhb m: say quasi { 1 + 1 }.^methods>>.name;
camelia rakudo-moar 68c432: OUTPUT«BUILD incarnate evaluate_unquotes is_quasi_ast Str␤»
japhb m: say quasi { 1 + 1 }.Str 00:13
camelia rakudo-moar 68c432: OUTPUT«quasi { 1 + 1 }␤»
japhb m: say quasi { say < a \# b > }.Str
camelia rakudo-moar 68c432: OUTPUT«quasi { say < a \# b > }␤»
TimToady m: say quasi { 1 + 1 }.incarnate.WHAT
camelia rakudo-moar 68c432: OUTPUT«Too few positionals passed; expected 3 arguments but got 1␤ in block <unit> at /tmp/DXltPBB0Mu:1␤␤»
japhb m: say quasi { say << a \# b >> }.Str
camelia rakudo-moar 68c432: OUTPUT«quasi { say << a \# b >> }␤»
TimToady probably cheating
japhb Ah, it's probably just saving the code
yeah
TimToady well, one could probably monkey patch some action method and capture control inside an EVAL somehow 00:14
or dynamically lookup a $/ from inside a BEGIN (evil) 00:15
00:15 laouji joined
TimToady m: BEGIN say callframe(1) 00:16
camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 3, annotations => {:file("src/Perl6/World.nqp"), :line("1704")}<>, my => EnumMap.new())␤»
TimToady m: BEGIN say callframe(2)
camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 4, annotations => {:file("src/Perl6/World.nqp"), :line("3494")}<>, my => EnumMap.new("\$ex" => Mu, :RETURN(Mu)))␤»
TimToady m: BEGIN say callframe(3)
camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 5, annotations => {:file("src/Perl6/World.nqp"), :line("2531")}<>, my => EnumMap.new(:RETURN(Mu)))␤»
TimToady m: BEGIN say callframe(4) 00:17
camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 6, annotations => {:file("src/gen/m-Perl6-Actions.nqp"), :line("1459")}<>, my => EnumMap.new())␤»
TimToady heh
00:17 larion left
TimToady m: BEGIN say CALLER::CALLER::<$/> 00:18
camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
japhb Yeah, they do compile differently. I used:
diff -u <(perl6 --target=ast -e 'say < a \# b >') <(perl6 --target=ast -e 'say << a \# b >>') |less
TimToady m: BEGIN say CALLER::CALLER::CALLER::<$/>
camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::<$/>
camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
japhb And you can see (non-trivial) differences.
TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::CALLER::<$/>
camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::CALLER::CALLER::<$/>
camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
TimToady aww
00:19 larion joined
japhb In short, the < > form inserts a call to &infix:<,>, and the << >> form does not 00:20
00:20 laouji left 00:22 raiph left
TimToady m: say < 42 >.WHAT 00:22
camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
TimToady m: say << 42 >>.WHAT
camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
TimToady but it's not in order to force a Parcel of 1 element 00:23
japhb m: say (<< 42 >>).WHAT # Just in case
camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
japhb phew
m: say (< 42 >).WHAT # Just in case
camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
TimToady could be a superstitious comma, I suppose
japhb Sorta like that one? :-)
TimToady I paused there in my internal speec 00:24
*ch
japhb In any case, superstitious tokens are not supposed to be affect semantics .... 00:25
s/to be/to/
TimToady kinda like a block can have multiple statements without a Stmts node... 00:27
but this is a parcel without a comma node
japhb Would you expect there to always be one, or always not be one? 00:28
00:29 skids joined
TimToady well, comma just makes a list of things, so a list of things doesn't much care, I expect 00:30
a bit surprising it doesn't turn into 1 elem though
perhaps there's compensating code somewhere that strips the outer comma 00:31
japhb But only for the << >> case. :-/
rjbs Stringification of Buf seems a bit off for non-octet bufs. 00:33
m: Buf.new(100,200,300).say
camelia rakudo-moar 68c432: OUTPUT«Buf:0x<64 c8 2c>␤»
rjbs That 2C is probably a cropped 12C. 00:34
TimToady yeah, would be nice to prettify the ASCII subset at least, if not Latin-1
oh, that, it's just overflow
C semantics on small ints
rjbs Sure.
Oh, gosh, it's truncated in the buf, silently... 00:35
The docs only say: A Buf is a mutable sequence of (usually unsigned) integers.
TimToady it's a "feature" :)
rjbs I reckon I'll use an array.
The code I'm porting is my ZSCII codec, which maps between four states of text for working with Z-Machine: 00:36
japhb m: buf16.new(100,200,300).say
camelia rakudo-moar 68c432: OUTPUT«Buf[uint16]:0x<64 c8 12c>␤»
japhb rjbs: ^^
rjbs japhb++ !!
That'll do.
japhb It's because the default type specialization for Buf when it puns is uint8 00:37
TimToady Buf is really a role that instantiates for an integer type
rjbs (a) unicode strings (b) zscii strings [codepoints between 0 and 0x3FF] (c) zchars (d) packed zchars
In p5, it's easy: they're all strings. :)
which is also awful, of course
japhb rjbs: See src/core/Buf.pm for the gory details, and all the default specializations.
TimToady m: say Buf[Int].new(1, 2, 4 ... 10000000000000000)
camelia rakudo-moar 68c432: OUTPUT«MVMArray: bindpos expected object register␤ in any at src/gen/m-Metamodel.nqp:1640␤ in block <unit> at /tmp/y36TPyihca:1␤␤»
TimToady hmm 00:38
rjbs I find it hard to type "buf" and not "bug" :)
Okay, great. From now on, I type "buf8"
TimToady m: say buf64.new(1, 2, 4 ... 10000000000000000)
camelia rakudo-moar 68c432: OUTPUT«Buf[uint64]:0x<01 02 04 08 10 20 40 80 100 200 400 800 1000 2000 4000 8000 10000 20000 40000 80000 100000 200000 400000 800000 1000000 2000000 4000000 8000000 10000000 20000000 40000000 80000000 100000000 200000000 400000000 800000000 1000000000 2000000000…» 00:39
TimToady m: say Buf[int64].new(1, 2, 4 ... 10000000000000000)
camelia rakudo-moar 68c432: OUTPUT«Buf[int64]:0x<01 02 04 08 10 20 40 80 100 200 400 800 1000 2000 4000 8000 10000 20000 40000 80000 100000 200000 400000 800000 1000000 2000000 4000000 8000000 10000000 20000000 40000000 80000000 100000000 200000000 400000000 800000000 1000000000 2000000000 …»
TimToady I guess Buf is biased towards native types
japhb TimToady: Makes sense to me ...
TimToady m: say Buf[num].new(1, 2, 4 ... 10000000000000000) 00:40
camelia rakudo-moar 68c432: OUTPUT«MVMArray: bindpos expected num register␤ in any at src/gen/m-Metamodel.nqp:1640␤ in block <unit> at /tmp/KGT3y5fEUG:1␤␤»
japhb Though the error for Buf[Int] is definitely LTA
m: say Buf[num].new(1e0, 2e0, 4e0 ... 10000000000000000e0)
camelia rakudo-moar 68c432: OUTPUT«This type cannot unbox to a native integer␤ in any at src/gen/m-Metamodel.nqp:1640␤ in block <unit> at /tmp/PmtxCa80jI:1␤␤»
japhb Heh.
TimToady o_O
japhb o/~ somebody cheated ... o/~ 00:41
TimToady and got cot
00:42 zacts left
TimToady either that, or made an ass out of u and me 00:43
japhb Speak for yourself, donkey man. ;-) 00:44
TimToady hee haw!
00:44 larion left 00:45 larion joined
BenGoldberg m: say Buf[num].new( 1.0, 2.0, 4.0 ) 00:46
camelia rakudo-moar 68c432: OUTPUT«This type cannot unbox to a native integer␤ in any at src/gen/m-Metamodel.nqp:1640␤ in block <unit> at /tmp/X1MSq10t4a:1␤␤»
00:53 laouji joined 00:56 thou joined
raydiak is starting to think CAPTCHAs on comment boxes are written to check the length and offer something sarcastic if you write too much...this time it gave me "evermore" 01:03
BenGoldberg . o O (Quoth the aven, evermore?) 01:06
01:10 kurahaupo1 left, Akagi201 joined
raydiak searched for it and ironically the first thing I saw was "Quoth the aven radiant ...", make the machines stop talking to me! :) 01:12
not even google-personalized results 01:14
rjbs So is "buf16" an implementation-specific type? 01:24
TimToady no
it's a standard Perl 6 type
rjbs Great, thanks.
(I thought there was some convention about Int vs. int, but that memory is well aged.) 01:25
TimToady lower-case types tend to native, but that's not the same as implementation-specific 01:26
rjbs Aha, I see!
TimToady int itself is a bit ambiguous, compared to int32 or int64
it's not likely to be the same as int in C 01:27
p6 defines int as the largest integer that runs at "full speed"
rjbs I know how to use \c[...] to go from name to char, but how do I go from char to name? (in p5, via charnames::viacode)
TimToady so the native call interface tends to be more specific about C types as viewed in p6
m: say uniname("💩") 01:28
camelia rakudo-moar 68c432: OUTPUT«PILE OF POO␤»
rjbs Super.
TimToady: but that was a really crappy example!
(haw haw haw)
TimToady uniname also works with integer codepoints 01:30
m: say uniname(0x2424) 01:31
camelia rakudo-moar 68c432: OUTPUT«SYMBOL FOR NEWLINE␤»
rjbs This whole exercise is worth it just for the joy of replacing low lines with hyphen minuses in variable names.
TimToady o-O
01:31 colomon left 01:32 aborazmeh joined, aborazmeh left, aborazmeh joined 01:33 colomon joined
TimToady m: say uniname(0x1F35F) 01:38
camelia rakudo-moar 68c432: OUTPUT«FRENCH FRIES␤»
01:38 dayangkun joined
TimToady m: say uninames(0x1F350..0x1F35F) 01:38
camelia rakudo-moar 68c432: OUTPUT«Cannot call uninames(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int); none of these signatures match:␤ (Str $str)␤ in block <unit> at /tmp/XK4NzAbW2k:1␤␤»
TimToady m: say (0x1F350..0x1F35F)».uniname 01:39
camelia rakudo-moar 68c432: OUTPUT«PEAR PEACH CHERRIES STRAWBERRY HAMBURGER SLICE OF PIZZA MEAT ON BONE POULTRY LEG RICE CRACKER RICE BALL COOKED RICE CURRY AND RICE STEAMING BOWL SPAGHETTI BREAD FRENCH FRIES␤»
TimToady is getting hungry
raydiak m: say uniname(0x20), <the>, uniname(0x3c2).comb(/\S+/)[*-2], <frontier>
camelia rakudo-moar 68c432: OUTPUT«SPACEtheFINALfrontier␤»
raydiak
.oO( in your stomach :) )
01:40
TimToady m: say uniname('ꗴ') 01:41
camelia rakudo-moar 68c432: OUTPUT«VAI SYLLABLE THE␤»
BenGoldberg m: say char(0x1F366);
camelia rakudo-moar 68c432: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iTmHxvT41y␤Undeclared routine:␤ char used at line 1. Did you mean 'chars', 'chr'?␤␤»
BenGoldberg m: say chr(0x1F366);
camelia rakudo-moar 68c432: OUTPUT«🍦␤»
BenGoldberg m: say uniname(chr(0x1F366));
camelia rakudo-moar 68c432: OUTPUT«SOFT ICE CREAM␤»
BenGoldberg m: say uniname(0x1F366); 01:42
camelia rakudo-moar 68c432: OUTPUT«SOFT ICE CREAM␤»
raydiak was having a phone conversation today, started talking about manna and got hungry... 01:45
01:46 ilbot3 joined
TimToady m: say '𐌼'.uniname 01:48
camelia rakudo-moar 68c432: OUTPUT«GOTHIC LETTER MANNA␤»
raydiak okay, that's it, I'm grabbing the pretzels... 01:49
rjbs Does Unicode 8 give us flavor selectors for ice cream yet?
raydiak m: say (0x1f34e, 0x1f34f)».uniname # may I offer you a healthier alternative? :) 01:54
camelia rakudo-moar 68c432: OUTPUT«RED APPLE GREEN APPLE␤»
TimToady Eve, to Adam: Here, you wanna finish this for me? 01:59
raydiak ha ha :) 02:01
02:03 Akagi201 left 02:04 laouji_ joined
rjbs I had p5 code that did: while (my $str = substr $x, 0, 2, '') { ... } 02:05
In p6, $x is a buf. Is there an analogous behavior, or shall I use a $i?
TimToady m: my $b = buf8.new(1..10); .say for $b.rotor(2) 02:07
camelia rakudo-moar 68c432: OUTPUT«1 2␤3 4␤5 6␤7 8␤9 10␤»
rjbs So, that's not sufficient, because inside the loop, I might need to consume more.
TimToady m: my $b = buf8.new(1..10); for @$b -> $a, $b { say "$a $b" } 02:08
camelia rakudo-moar 68c432: OUTPUT«1 2␤3 4␤5 6␤7 8␤9 10␤»
02:08 noganex joined
TimToady well, there's always subbuf 02:08
02:09 laouji_ left
TimToady also, regexes have an optional starting pos 02:09
rjbs Can you use a regex on a buf?
Looks like no. 02:10
02:11 noganex_ left
raydiak you could also turn it into a compact array like my int8 @b = "foobar".encode.list, and then you get shift or splice or whatever, though I'm sure it's one of the less-efficient approaches 02:11
TimToady goes to buffer some dinner &
rjbs Don't overflow! 02:12
02:12 telex left
raydiak (but avoid the underruns too) 02:14
rjbs any form of runs
02:14 telex joined
raydiak yes, of course...doubly so if you're only in your underwear 02:16
jercos m: "taxes and stuff" ~~ /taxes?/ 02:17
camelia ( no output )
jercos m: say "taxes and stuff" ~~ /taxes?/
camelia rakudo-moar 68c432: OUTPUT«「taxes」␤»
jercos m: say "taxes and stuff" X~~ (/taxes?/, /taxes??/)
camelia rakudo-moar 68c432: OUTPUT«True True␤»
02:27 rmgk_ joined, rmgk left, rmgk_ is now known as rmgk 02:46 cognominal left 02:47 aborazmeh left 02:49 aborazmeh joined, aborazmeh left, aborazmeh joined 02:54 agentzh_ joined
rjbs What best way to append an element to a buf? 03:01
$b[ $b.elems ] = 0xA0; # seems wordy 03:02
dalek ast/date-time-slices-tz: dd9ef10 | (Chris Jepeway)++ | S32-temporal/DateTime.t:
Added tests to check that DateTime.{utc,local} preserve timezone types.

type itself beyond merely the current "be an Int()" expectation.
03:03
raydiak you can use +* instead of $b.elems
rjbs $b[+*] = 1 # <-- like that?
raydiak++ tanks 03:04
thanks, also
raydiak yep :) and you're totally welcome
* in numeric context in a subscript evaluates to .elems
03:05 laouji_ joined
raydiak not as useful in this case but if the other thing were a buf already, you can concat too (~) as if they were strings 03:05
rjbs Hm, might be useful, I'll have to revisit the code later. 03:06
It's late now. I should take out the trash and go to bed.
:)
raydiak sleep well :)
rjbs A whole hour of p6 hacking time lost to planning a *vacation* on which I won't write any code at all. What's wrong with the world?!
Thanks :) Ta ta!
raydiak haha, darned vacations :)
03:10 laouji_ left 03:12 skids left 03:23 BenGoldberg left 03:36 mr_ron joined
mr_ron m: %h{'a';'b'}=3 03:37
camelia rakudo-moar 68c432: OUTPUT«5===SORRY!5=== Error while compiling /tmp/yQhTRcPrFg␤Variable '%h' is not declared␤at /tmp/yQhTRcPrFg:1␤------> 3<BOL>7⏏5%h{'a';'b'}=3␤»
mr_ron sorry - different result on my system
m: no strict; %h{'a';'b'}=3 03:42
camelia rakudo-moar 68c432: OUTPUT«Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.…»
mr_ron thar it blows
03:42 laouji left 03:47 mr_ron left 03:48 Sqirrel left
labster m: my %h; %h{'a';'b'}=3 03:49
camelia ( no output )
labster no strict bug?
raydiak m: my %h; %h{'a';'b'}=3; say %h.perl 03:51
camelia rakudo-moar 68c432: OUTPUT«{:a({:b(3)})}<>␤»
raydiak m: no strict; $a = 1 03:52
camelia ( no output )
raydiak gr so much lag 03:53
raydiak goes to play with it in a local terminal
and then find myself waiting on rakudobrew instead of flaky wifi :) 03:56
m: no strict; %h{'a'}=3 03:57
camelia ( no output )
raydiak m: no strict; %h{'a'}{'b'}=3 03:58
camelia rakudo-moar 68c432: OUTPUT«Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.…»
03:59 molaf left
raydiak wow stage parse is up over 100s for me 04:02
TimToady about the same for me; sure you're not looking at the jvm compile? 04:05
I mean, no worse here
a browser in the background chewing cpu maybe? 04:06
raydiak yeah don't really do jvm any more...it's been about 90 for me
only a single window with a single tab open a site I know to be well-behaved
TimToady cron job? 04:07
raydiak my desktop is a newer revised arrangement of data.cyberuniverses.com/pub/screenshot.png 04:08
mainly, I got a bunch of meters watching everything
I know right away when anything goes awry in the background
TimToady turn on debugging or profiling?
raydiak I did "rakudobrew build moar"
haven't made any changes I know of lately 04:09
to my system I mean, or env vars
or even notable updates
TimToady just builds from git
raydiak I like how it migrates all the panda modules
and, well, ... laziness is a virtue, no? 04:10
TimToady maybe it does a parallel make?
just guessin'
it'd interleave other messages though if that were the case 04:11
raydiak really with dynamic underclock and overclocking, I guess I wouldn't read too much into it unless it's repeatable
it is getting warmer here than it has been
TimToady could just be that
blocking the vent can have that effect too
raydiak just on a tabletop atm 04:12
cleaned it out within the last few months
TimToady recently lose any feet off of it?
raydiak looks
TimToady that can cut the air gap underneath
raydiak clever, didn't consider that one, but nope
TimToady out of ideas for the moment... 04:13
raydiak though, I'd probably notice that too, that rocking diagonally thing drives me nuts when it happens
yeah me too
good game though :) 04:14
TimToady :)
raydiak unless we fall back to cosmic rays and other improbable unprovable hypotheticals
maybe God just decided it'd be fun if we had this conversation *shrug* 04:15
TimToady lessee, your system clock had a large time adjustment come in from ntp or so
04:15 agentzh_ left
raydiak wish I knew what time to look for in the system logs 04:15
TimToady one of your devices started interrupting continually 04:16
dalek kudo-star-daily: d00a5fd | coke++ | log/ (2 files):
today (automated commit)
raydiak maybe, but only if somehting's failing, nothing even plugged in besides power
TimToady your disk is filling your logs with I'm about to go bad messages
raydiak still 183 gig free 04:17
wait myh logs arent on that one
TimToady free space doesn't matter if it's working up toward a head crash
TimToady is full of good news... :) 04:18
raydiak :)
raydiak wonders if his system meters do something dumb like ignore nice time or something 04:19
TimToady just uses top to see what's really chewing time
raydiak ah! I got a plausable one! if a process acted up *after* I started the build, I wouldn't be able to tell on the meters because of all the noise 04:20
TimToady could well have been a cron job running at the top of the hour then, if you'd just finished at 2 after
raydiak I'll bet that's exactly what happened. 04:21
raydiak will build again later, but has gotten hisself way out in left field from his originally intended direction, and still intends to head that way :) 04:22
TimToady well, hope you get to first base then 04:23
assuming that's the opposite of left field
raydiak heh thanks, here's hoping that my childhood baseball experiences aren't indicative of my probability of success 04:25
04:26 yeahnoob joined 04:28 laouji joined
raydiak off to worry about food and things 04:30
TimToady o/ 04:31
04:46 quester joined
raydiak \o back from the store 04:49
car's still broken until tomorrow, so had to run to the gas station when we noticed we were out of bread
04:51 agentzh_ joined
moritz raydiak: no instant food delivery by drones? :-) 05:05
raydiak at least found the ~Nil warning at github.com/rakudo/rakudo/blob/0fe9....nqp#L2250 if anyone wants to take it from there, my nqp-fu is weak, and sadly now is not the time to train it
moritz: no...(thankfully?) 05:06
though even if there were such a thing around... if we could afford it the car wouldn't be broken :)
just takes me longer sometimes b/c I usually accomplish it for nearly no money, which in and of itself is kinda cool in a way 05:08
05:12 labster_ joined 05:14 jercos_ joined
raydiak copy & paste of part of something I wrote earlier today about whether automated cars need windows, which summarizes my thoughts on delivery dromes as well: 05:14
Anyway, once we're all tightly sealed up in our automated capsules to shoot us from one building to another, you don't really have to interact with most of the outside world any more, and you don't need cops so much.
You also take some heavy losses in the form of creativity, freedom, fresh air, human spirit, the diversity of natural things like weather and plants, and so much more...but nobody seems worried about those kinds of qualitative factors any more. :P
05:15 labster_ is now known as labster
raydiak was kinda flabbergasted that someone would even pose the question "do vehicles need windows if the computer can see?" 05:15
05:15 jdv79_ joined, vike1 joined
raydiak meant to mention motion sickness too but forgot 05:16
05:16 b2gills1 joined, mls_ joined
[Coke] m: my @a = <a b c>; my @b = <q r s>; for @a Z @b -> $q, $t { say "$q, $t" } 05:17
camelia rakudo-moar 68c432: OUTPUT«a q, b r␤Too few positionals passed; expected 2 arguments but got 1␤ in block <unit> at /tmp/pkhK8N1lu5:1␤␤»
[Coke] ^^ root cause of explosion in t/spec/integration/advent2009-day17.t 05:18
TimToady m: my @a = <a b c>; my @b = <q r s>; for @a Z @b -> ($q, $t) { say "$q, $t" }
camelia rakudo-moar 68c432: OUTPUT«a, q␤b, r␤c, s␤»
TimToady m: my @a = <a b c>; my @b = <q r s>; for flat @a Z @b -> $q, $t { say "$q, $t" }
camelia rakudo-moar 68c432: OUTPUT«a, q␤b, r␤c, s␤»
[Coke] excellent, thanks.
TimToady it's the 'for no flattens' thing
*no longer
05:19 tony-o_ joined, jnthn_ joined, _thou joined, spider-mario left 05:20 b2gills left, b2gills1 is now known as b2gills
dalek ast: f73c005 | coke++ | integration/advent2009-day17.t:
fix fallout from "for no longer flattens"

  TimToady++
05:20
05:21 El_Che_ joined, laouji_ joined 05:22 vytas` joined
dalek kudo/nom: 2805390 | coke++ | t/spectest.data:
Not actually very stressful
05:22
05:23 kaare__ joined
[Coke] m: say cat(); 05:24
camelia rakudo-moar 68c432: OUTPUT«5===SORRY!5=== Error while compiling /tmp/uqPAloD1uV␤Undeclared routine:␤ cat used at line 1. Did you mean 'cas'?␤␤»
dalek kudo/nom: a6f5638 | coke++ | t/spectest.data:
run fudged test
ast: 0e6aac0 | coke++ | S32-container/cat.t:
fudge test for rakudo
05:25
05:26 ir2ivps4 joined, bayprogrammer_ joined, laouji_ left, thou left, El_Che left, vytas left, tony-o left 05:28 quester left, quester joined
[Coke] m: $str = "abracadabra"; $str ~~ m:exhaustive/ a (.*?) a / && say "@()"; 05:30
camelia rakudo-moar 68c432: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FJYkyYmJyx␤Variable '$str' is not declared. Did you mean 'str'?␤at /tmp/FJYkyYmJyx:1␤------> 3<BOL>7⏏5$str = "abracadabra"; $str ~~ m:exhausti␤»
[Coke] m: my $str = "abracadabra"; $str ~~ m:exhaustive/ a (.*?) a / && say "@()";
camelia rakudo-moar 68c432: OUTPUT«@()␤»
[Coke] m: my $str = "abracadabra"; $str ~~ m:exhaustive/ a (.*?) a / && say $/.perl;
camelia rakudo-moar 68c432: OUTPUT«$(Match.new(ast => Any, list => (Match.new(ast => Any, list => (), hash => EnumMap.new(), orig => "abracadabra", to => 3, from => 1),), hash => EnumMap.new(), orig => "abracadabra", to => 4, from => 0), Match.new(ast => Any, list => (Match.new(ast => Any, …»
05:30 mtj_ joined
[Coke] oh, wow, that actually works, I think. 05:31
05:35 quester left
[Coke] Someone more awake than I am can probably fudge t/spec/S05-modifier/exhaustive.t, then. 05:35
05:39 aborazmeh left 05:41 Sqirrel joined
FROGGS[mobile]2 I attempted to fix it last weekend 05:46
05:49 FROGGS joined 05:56 quester joined, diana_olhovik joined 05:57 domidumont joined 06:00 espadrine joined 06:01 Sysaxed` left 06:02 domidumont left 06:03 domidumont joined 06:06 _mg_ joined 06:11 agentzh_ left 06:20 quester left, meisl left, Foxcool joined
TimToady .tell jnthn skipping onlystars on CALLER is probably adequate 06:26
yoleaux TimToady: I'll pass your message to jnthn.
masak morningz, #perl6 06:32
moritz masax, morning 06:34
06:43 _thou left
masak m: my $name = "masak"; say my $alien-name = $name.subst(/k$/, "x") 06:44
camelia rakudo-moar a6f563: OUTPUT«masax␤»
06:44 larion left, koo6 joined 06:48 [Tux] left 06:49 [Tux] joined
masak m: sub call($) { "hey I just met you" and "this is crazy" but "here's my number" }; so call my $maybe 06:50
camelia ( no output )
masak :D
FROGGS hehe
06:51 jnthn_ is now known as jnthn
masak jnthn: morning. 06:51
jnthn :P 06:53
yoleaux 12 May 2015 20:55Z <FROGGS> jnthn: if there is no veto I'd like to merge the cunion branches of moar and rakudo this week
06:26Z <TimToady> jnthn: skipping onlystars on CALLER is probably adequate
jnthn well, I get one code review and one no-op in the messages this morning. Not Bad. :)
FROGGS morning 06:54
dalek kudo/cunion: 7d46567 | FROGGS++ | t/04-nativecall/13-union. (2 files):
test inlined CStructs in CUnions
06:55
nwc10 jnthn: have you considered going on holiday, to see how much we'd really miss you? :-) 06:56
FROGGS zostay: you need to update your moarvm and rakudo, and tell me how structs in union work with these branches
masak nwc10: shhhh!
:P 06:57
don't give him ideas!
06:58 larion joined
jnthn ooooh! :D 06:59
masak dang.
nwc10: now you've done it... :)
masak .oO( unfortunately, jnthn went on vacation. the Year of Perl 6 has been bumped to 2016 ) 07:00
nwc10 well, if it's only 2 weeks, we just declare that Christmas is Orthodox
masak how unorthodox 07:01
07:03 RabidGravy joined
masak oh, I liked the message of this short post: boz.com/articles/be-kind.html 07:12
"being kind" isn't "being nice"
07:12 Ven joined 07:18 larion left 07:33 FROGGS left 07:35 PZt joined 07:36 Ven left
RabidGravy marning 07:36
sergot morning o/ 07:38
07:45 zakharyas joined 07:52 espadrine left 07:55 berekuk joined 07:57 virtualsue joined 08:06 abraxxa joined 08:07 rindolf joined
masak myrnong, RabidGravy, sergocie. 08:08
08:08 [Sno] left, [Sno] joined 08:09 Ven joined
RabidGravy :) 08:09
masak m: sub vow { <a e i o u y å ä ö>.roll }; say "m{vow}rn{vow}ng" 08:10
camelia rakudo-moar a6f563: OUTPUT«märneng␤»
08:10 laouji_ joined 08:12 brrt joined
moritz you're on a roll here, right? :-) 08:12
brrt \o
m: say <a b c>.roll(3)
camelia rakudo-moar a6f563: OUTPUT«b a c␤»
abraxxa just realized that there was no rakudo 2015.04 release 08:13
Ven \o, #perl6
brrt \o Ven
moritz abraxxa: oh yes, there was one, just no R* release 08:15
masak abraxxa: what are you saying? I released the april compiler release.
08:15 laouji_ left
masak abraxxa: you probably have R and R* mixed up... 08:15
abraxxa i looked yesterday evening after upgrading my synology nas to dsm 5.2 which supports docker and found the official rakudo container
which is 2015.03 08:16
i found moarvm 2015.04
and this site also only lists 2015.03: rakudo.org/how-to-get-rakudo/
08:16 darutoko joined
masak that's R*, I believe. 08:17
abraxxa where do I find the rakudo releases (besides git tags which I didn't look for)
masak rakudo.org/downloads/rakudo/
abraxxa that just one click from perl6.org 'Download Rakudo Perl6' link away
08:19 cygx joined
cygx o/ 08:20
so, how do I open a file in update mode (fopen "r+", perl5 open "+<")?
08:21 poul joined
masak not 100% sure that's implemented yet 08:21
but open("file", :a) should do it 08:23
08:23 fhelmberger joined
masak yep, it works. just tried it locally. 08:23
$ perl6 -e 'my $h = open("foofile", :a); $h.say: "OH HAI"; $h.close' 08:24
$ cat foofile
OH HAI
cygx ok, can confirm that seems to do it 08:26
it violates convention, though
masak sounds like you would prefer it to work some other way...?
could you elaborate?
cygx my confirmation was to soon: while I can seek, I can'T read from the file... 08:29
masak: well, I would have expected :a to work as in POSIX
masak I'm out of my depth here. I don't know how :a works in POSIX. 08:30
but to the extent I understand what you're saying, I agree -- we probably shouldn't be violating POSIX convention. 08:31
we're usually quite keen to keep to POSIX convention, in fact.
08:33 larion joined
cygx fopen support 6 modes: read-only, write-only(clobber), write-only(append), rw(update), rw(clobber), rW(append) 08:37
(ie r w a r+ w+ a+) 08:38
it's actually MoarVM that only supports 3 modes, not just Rakudo :( 08:45
masak I think I understand all of them except "rw(update)". how does this one differ from, say, "rW(append)"? 08:48
brrt i think write-only doesn't clobber but truncates first
cygx brrt: yes, 'clobber' should be read as 'truncate first' 08:49
brrt ah ok 08:50
08:51 virtualsue left
cygx masak: append forces writes to the end of file, ignoring the position within it 08:52
jnthn MoarVM has been built to do things Rakudo needs, so if Rakudo didn't need something yet it's often gone undone. :)
08:53 ssqq joined 08:54 donaldh joined
masak cygx: I guess I'm used to thinking of it in bash terms. '<' (read), '>' (write/clobber), and '>>' (write/append). I'm not aware that the other modes have symbols in the shell syntax. 08:54
ssqq We could export sub from module, How to export token from grammar? 08:56
masak ssqq: should be the same.
ssqq: but maybe it's enough to declare it `our`?
m: grammar G { our token foo { foo } }; say &G::foo 08:57
camelia rakudo-moar a6f563: OUTPUT«foo␤»
masak m: grammar G { our token foo { foo } }; say &G::foo.^name
camelia rakudo-moar a6f563: OUTPUT«Regex␤»
ssqq thanks, masak
masak m: grammar G { our token foo is export { foo } }; import G; say &foo.^name
camelia rakudo-moar a6f563: OUTPUT«Regex␤»
cygx masak: perl introduced +< and +> for that
masak cygx: oh!
cygx: can you see a simple tweak to what Rakudo already has that would not violate convention? 08:58
ssqq m: grammar G { our token foo { foo } }; say 'foo' ~~ /^ <G::foo> $/; 08:59
camelia rakudo-moar a6f563: OUTPUT«Method 'foo' not found for invocant of class 'G'␤ in block <unit> at /tmp/xO_08coGUM:1␤␤»
cygx masak: I'd probably add a :mode parameter or somesuch that takes a string of the same format as fopen, then add more user-friendly boolean named parameters on top
ssqq m: grammar G { our token foo { foo } }; say 'foo' ~~ /^ <::G::foo> $/;
camelia rakudo-moar a6f563: OUTPUT«Method 'foo' not found for invocant of class 'G'␤ in block <unit> at /tmp/B5D25gcjfc:1␤␤»
09:01 espadrine joined
cygx masak: I guess :a right now actually does what it's supposed to do 09:02
masak: it was you who suggested that it does what I actually need to do (r+) 09:03
;)
donaldh cygx masak: as jnthn said, MoarVM and nqp/JVM only really implement what rakudo needs.
ssqq masak: How to resue a exported token in sub-rule like '/ <Grammar::token> /'
cygx donaldh: and Rakudo should implement what the user needs
donaldh e.g. there is no way to open a file read/write/no-truncate as would be needed to mmap a file.
timotimo ohai donaldh :)
nwc10 good *, donaldh 09:04
donaldh o/
masak cygx: well, you said "violates convention", so I assumed something needed fixing... :)
donaldh "what rakudo needs" really means "what rakudo needed in terms of file I/O to get itself working" 09:05
masak cygx: let's put it like this (and maybe we can file a rakudobug) -- what's missing that you need? preferably expressed as a call to open()
cygx masak: it would have violated convention if your suggestion that I could have... oh, just forget about it ;)
masak :P
cygx: ENOTENOUGHCOFFEE
09:05 FROGGS joined
cygx I need to do an fopen("file", "r+") 09:05
preferably witout going through nativecall ;) 09:06
masak submits rakudobug 09:07
ssqq m: our token doo { doo }; say 'doo' ~~ &doo 09:09
camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
ssqq m: grammar G { our token doo { doo }; }; say 'doo' ~~ &G::doo
camelia rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'G' but got 'Cursor'␤ in regex doo at /tmp/6wnVpK9Krj:1␤ in block <unit> at /tmp/6wnVpK9Krj:1␤␤»
masak cygx: backlogging, I now see the misunderstanding too. d'oh :)
ssqq m: our token doo { doo }; say 'doo' ~~ / <doo> / 09:10
camelia rakudo-moar a6f563: OUTPUT«「doo」␤ doo => 「doo」␤»
ssqq m: grammar G { our token doo is export { doo }; }; say 'doo' ~~ / <&G::doo> / 09:11
camelia rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'G' but got 'Cursor'␤ in regex doo at /tmp/VXkzbHnAbP:1␤ in block <unit> at /tmp/VXkzbHnAbP:1␤␤»
masak cygx: rt.perl.org/Ticket/Display.html?id=125168 09:12
arnsholt masak: Fun Python fact of the day: Occurence of a call to a function named "super" in Python will cause the compiler to insert an extra variable (called __class__)
I'm growing increasingly suspicious if this whole "explicit is better than implicit" thing
masak arnsholt: wow
timotimo or does it just mean "python's compiler can usually remove the __class__ variable"? 09:13
moritz arnsholt: is that py2 or py3?
arnsholt I'm reading the Python 3 docs, but Python 2 allows the same behvaiour, so probably Python 2 too
masak "explicit is better than implicit [except when we are deliberately trying to pull the wool over your eyes for your own good]"
nwc10 does Guido have a Rule 2?
masak (the latter part is written in invisible ink and only visible if you have a Level 5 black belt in Python) 09:14
arnsholt s/5/implementor/ I think =)
masak nwc10: no. Guido is always right by fiat, and when he changes his mind, it's because you misunderstood what he was saying before :P
s/changes/appears to change/ 09:15
arnsholt That's how rule 2 works, isn't it? =)
masak there's a semantic difference, but I'm not sure it matters.
arnsholt Oh, looks like I was a bit wrong 09:17
__class__ is always there
Aha. __class__ is magically created if it's referred to in a method or super() is called 09:20
timotimo so basically like a $?foo variable in perl6 09:21
09:22 ben_m joined 09:23 Ven left
arnsholt Yeah, except it can be implicitly created too 09:23
timotimo fair enough
so, will snake get this, too? ;)
arnsholt Not straight away, I think =) 09:25
ssqq when we export token from grammar, How to use it? 09:26
m: grammar D { our token doo { doo }; }; say 'doo' ~~ &D::doo
arnsholt Not immediately clear to me where it's implemented in PyPy either
camelia rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor'␤ in regex doo at /tmp/8wglQQkyMB:1␤ in block <unit> at /tmp/8wglQQkyMB:1␤␤»
arnsholt Oh well. Time to do actual $dayjob things, I suppose =) 09:27
FROGGS m: grammar D { token doo is export { doo }; }; import D; say 'doo' ~~ &doo 09:29
camelia rakudo-moar a6f563: OUTPUT«Type check failed in binding <anon>; expected 'D' but got 'Cursor'␤ in regex doo at /tmp/anZydiSimC:1␤ in block <unit> at /tmp/anZydiSimC:1␤␤»
FROGGS m: grammar D { our token doo(Mu:) { doo }; }; say 'doo' ~~ &D::doo 09:30
camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
FROGGS ssqq: that's not nice, but a workaround
ssqq m: grammar D { our token doo(Mu::) { doo }; }; say 'doo' ~~ / <&D::doo> / 09:31
camelia rakudo-moar a6f563: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤ in regex doo at /tmp/0yOKpRIsYi:1␤ in block <unit> at /tmp/0yOKpRIsYi:1␤␤»
FROGGS m: grammar D { our token doo(Mu:) { doo }; }; say 'doo' ~~ / <&D::doo> / 09:32
ssqq FROGGS: how to use export token in sub-rule '<sub-rule>'
camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
FROGGS with only one colon in that signature
ssqq FROGGS: I see, thanks
09:33 FROGGS[mobile]2 left
masak FROGGS: (a) I'm not sure one should be allowed to type the invocant in that way. feels very weird. (b) this is a bug, right? that it doesn't just work in the first place, without that workaround? 09:34
FROGGS masak: yes, we fixed the lexical 'my token foo' a while ago, but obviously not that one here 09:36
masak oh, aha.
FROGGS "yes, it is a bug"
masak FROGGS: feel free to bugmit a rakudosub.
if you won't, then I will.
FROGGS I'll do
masak ++FROGGS 09:38
cygx hm... if I read the code correctly, open(:rw) doesn't actually do what it promises - it gets adjusted to :w
masak cygx: can you confirm that with a one-liner? 09:39
cygx I can confirm it with the source ;) 09:40
github.com/rakudo/rakudo/blob/nom/...dle.pm#L68
FROGGS m: grammar D { token doo(Mu:) is export { doo }; }; import D; say 'doo' ~~ &doo
camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
09:41 yeahnoob left
timotimo ran cachegrind on the core setting compilation over night, and is now running the same with that one moarvm patch 09:41
FROGGS files RT #125169
filed*
timotimo it'll also allow me to figure out how big the variance is on all the measurements with cachegrind
masak FROGGS++ 09:43
cygx masak: my $f = open("test.txt", :rw); $f.write("hello".encode); $f.seek(0, 0); say $f.read(5).decode 09:44
=> Reading from filehandle failed: operation not permitted
masak submits rakudobug 09:45
cygx: rt.perl.org/Ticket/Display.html?id=125170 09:47
timotimo who is hosting synbot6? is that running on a machine that belongs to tadzik? 09:55
in order to get data out of rt, we'd need to give an account a "cli password", because there's apparently no REST access for public data 09:56
so ... maybe i'll actually put HTML parsing into synbot6 to get the ticket title of an RT bug :\ 09:57
10:00 laouji_ joined
masak timotimo: what's the goal? reacting to RT updates? 10:01
timotimo: can't you set up an email address and listen to emails that come in?
timotimo that's not the goal; i was looking to give the title of a bug as well as the URL each time a ticket number gets mentioned 10:02
10:04 laouji_ left
timotimo and perhaps it'd also be helpful to give the title of a bug if only the URL is posted? 10:05
but that could end up spammy, maybe?
masak hm. 10:06
my immediate reaction is "yes, probably spammy". returning the URL for the interested feels like the right response.
but I like your initiative, and I can see how getting the title could be helpful as well. 10:07
and if it leads to us dogfooding another bot function in Perl 6, who am I to argue? :)
timotimo hmm
FROGGS m: sub bar (*&block) { }; bar() # bug 10:13
camelia rakudo-moar a6f563: OUTPUT«Use of Nil in string context at src/gen/m-Perl6-Optimizer.nqp line 1650 in any optimize_call at src/gen/m-Perl6-Optimizer.nqp:1319␤␤5===SORRY!5=== Error while compiling /tmp/hPZXvIYZLr␤Calling bar() will never work with declared signature (&bloc…»
FROGGS note that it spits out "Calling bar() will never work with declared signature (&block)"
though I think a slurpy scalar or callable does not make much sense... 10:15
so it would be nice if TimToady could judge on S06-signature/slurpy-blocks.t
10:15 PZt left
masak slurpy scalars we have. 10:15
see S06.
FROGGS we have?
implemented? 10:16
masak I meant spec.
dunno about implemented.
FROGGS you meant syn
masak wouldn't surprise me.
I mean specification 06.
er, synopsis 6.
FROGGS :P
masak sorry, I'm old-skool. my brain still thinks "spec".
trying to modernize.
FROGGS is there a difference between *$foo and $foo? 10:17
/?/? ?/
masak see S06 :)
&
FROGGS "Slurpy scalars still impose list context on their arguments." 10:19
I still dont get it 10:20
10:20 koo6 left 10:22 dayangkun left
FROGGS m: my @a = 1, 2, 3, 4, 5; for @a -> $b?, $c? { say $b, $c } 10:22
camelia rakudo-moar a6f563: OUTPUT«12␤34␤5(Mu)␤»
FROGGS m: my @a = 1, 2, 3, 4, 5; for @a -> *$b, *$c { say $b, $c }
camelia rakudo-moar a6f563: OUTPUT«12␤34␤Too few positionals passed; expected 2 arguments but got 1␤ in block <unit> at /tmp/MmFtICPkk7:1␤␤»
FROGGS I don't understand the difference between slurpy and optional scalars 10:23
tadzik timotimo: no, I have no idea who runs it :D
it's a mystery
10:24 d4l3k_ joined
FROGGS O.o 10:25
10:25 ribasushi left
moritz FROGGS: I think slurpy scalars are meant to extract elements from a list 10:25
tadzik maybe it's just self aware
moritz my @a = 1, 2; (-> *$a, *@b { say $a })(@a) # should say 1, and leave @b = (2,) 10:26
10:26 coffee` left, abraxxa left
moritz my @a = 1, 2; (-> $a?, *@b { say $a })(@a) # should say 1 2, and leave @b empty 10:26
10:26 go|dfish left 10:27 poul left
FROGGS m: sub bar (*$foo, *@bar) { say $foo }; my @a = 1, 2, 3, 4; bar(@a) # then this should print 1 10:27
camelia rakudo-moar a6f563: OUTPUT«1 2 3 4␤»
10:27 Alina-malina left, d4l3k_ is now known as dalek, ChanServ sets mode: +v dalek, Alina-malina joined, ruoso joined 10:28 zostay joined, ribasushi joined, diegok left, larion left
FROGGS m: sub quicksort ([$pivot, *@data], $reverse?, $inplace?) { } 10:29
camelia ( no output )
10:29 ilbot3 left 10:30 maddingue left, abraxxa joined, maddingue joined 10:31 pierrot_ joined, nebuchad` joined, [Tux] left, diegok joined 10:33 geekosaur joined, dalek left 10:34 dalek joined, ChanServ sets mode: +v dalek, go|dfish joined 10:35 rvchangue left 10:36 ilbot3 joined, [Tux] joined 10:37 rvchangue joined, poul joined, coffee` joined
cygx I've started on supporting different modes for open(): gist.github.com/cygx/9b64a69fb9dc60d05bd8 10:38
10:38 Ven joined
cygx this would support all C11 modes as well as the Perl5 ones 10:39
got to go o/
10:39 cygx left 10:43 _mg_ left 10:45 mephinet joined 10:47 ssqq left 10:53 andreoss joined, bjz joined 10:58 Ven left 10:59 bjz left
ben_m What makes it so that I can call <1 2 3>.map: *.uc? Talking about the colon after map, trying to google that kind of syntax but not sure what to google. 11:00
11:06 abc_ joined
literal ben_m: this might help: perl6advent.wordpress.com/2009/12/...-whatever/ 11:07
masak g'ah -- I have zero time, but I would like to write a p6u post that puts this whole "test your private properties" discussion into perspective. 11:08
tadzik ben_m: it's equivalent to <1 2 3>.map(*.uc)
masak ben_m: the colon is like an opening '(' without a need for a closing ')'. it's for when you know you'll put in the closing ')' at the end of the expression.
(or would have done that, rather) 11:09
ben_m: in Perl 5, there's the somewhat special `print STDOUT "hi";` syntax that's similar. Perl 6 is more precise, and lets you write this either as `$*OUT.print("hi")` or `$*OUT.print: "hi"` or even `print $*OUT: "hi"`
11:10 Ven joined 11:14 donaldh left, pauluu joined 11:23 bjz joined 11:24 ibo2perl6 joined 11:26 bjz left
ibo2perl6 m: my $a = 13; say $$a++; say $$$a++; say $a # is this intentional? it confuses me 11:26
camelia rakudo-moar a6f563: OUTPUT«13␤14␤15␤»
11:26 bjz joined
itz_ I quite like this behaviour from debian unstable 11:28
moritz ibo2perl6: if you get over the idea that $ means dereferencing, it's not confusing 11:29
itz_ ====== How can you help? (doc: wiki.debian.org/how-can-i-help ) ======
New bugs suitable for new contributors (tagged 'newcomer'): - lightdm - bugs.debian.org/636108 - lightdm: does not source ~/.profile
maybe rakudobrew could print out suggestions based on RT or something?
masak ibo2perl6: it confuses you that you're able to add more `$` signs at the beginning and nothing happens? 11:30
m: my @x = 1, 2, 3; say @x; say @(@x); say @(@(@x))
camelia rakudo-moar a6f563: OUTPUT«1 2 3␤1 2 3␤1 2 3␤»
masak m: my @x = 1, 2, 3; say @x; say @@x; say @@@x 11:31
camelia rakudo-moar a6f563: OUTPUT«1 2 3␤1 2 3␤1 2 3␤»
moritz $ or $(...) is just an itemization
itemizing an item is a no-op
and why-oh-why do I always want to misspell 'item' as 'time' or 'itme'?
masak moritz: because of timing issues between the left and right hands when you type. 11:32
'itme' is right-left-right-left
much easier to type.
'time' is left-right-right-left and 'item' is right-left-left-right. both somewhat harder to type. 11:33
11:35 _mg_ joined 11:36 telex left 11:38 telex joined
RabidGravy what is "write string requires an object with REPR MVMOSHandle" trying to tell me? 11:43
jnthn RabidGravy: Maybe that you pulled a very busted Rakudo a couple of days ago that failed that way on everything 11:45
It did so because we modified PROCESS:: during the BEGIN time of a module's pre-comp, which will screw up the standard handles.
(We can't really fix that in general, it's just going to have to be one of those pre-comp rules.) 11:46
Guess it's possible you have a different issue though.
RabidGravy Hmm, I'll test that, but it's weird because if I run the code in question with "perl6 -Ilib <path>" then it's fine 11:47
moritz otherwise it's that something tried an IO operation on something that's not an IO handle
RabidGravy if I put it in the path and just run it then it does that
11:48 rurban joined
RabidGravy the line in question is "say $entry" where $entry is an object with a .gist 11:48
testing with the most recent rakudo 11:54
jepeway m: Int.new(0).say # does/should this work? 12:06
camelia rakudo-moar a6f563: OUTPUT«Default constructor for 'Int' only takes named arguments␤ in block <unit> at /tmp/NF8GBRu6qb:1␤␤»
12:07 poul left
RabidGravy Hmm, nope updating rakudo don't fix it 12:14
12:15 abc_ left
RabidGravy infact 'say "foo";' gives rise to the same error under the same circumstances 12:19
then doing "use lib 'lib';" in the file fixes it 12:20
oh wait, no it doesn't 12:22
rjbs jnthn: Did you see my kvetch about Linenoise on OS X last night? Are you the right person to re-kvetch at? 12:27
RabidGravy so, yep something is b0rked because 12:28
#!/usr/bin/env perl6
use v6;
use Sys::Lastlog;
say "foo";
rjbs jnthn: If I "panda install Linenoise", it installs liblinenoise.dylib, but `perl6` dies when it can't fine liblinenoise.so
RabidGravy gives me the "write string requires an object with REPR MVMOSHandle"
12:33 ab5tract_ joined
arnsholt rjbs: It's a Linenoise.pm bug 12:33
(I just looked at the code)
It's hardcoded to look for 'liblinenoise.so' 12:34
rjbs arnsholt: Is there anything I can do to help correct it? I'm dyin' here without history. ;)
Okay. So maybe I will install and edit in place, then file a GH ticket..? :)
arnsholt Try installing a hacked version that chops off the .so part
rjbs Thanks, trying that now.
12:34 laouji_ joined
arnsholt Looking further at the code, there are some hard-coded constant values that may very well be Linux specific 12:35
rjbs :'(
arnsholt If you run out of patience with Linenoise.pm, there's always rlwrap
hoelzro oh, my mistake 12:36
I didn't realize I'd hardcoded that
will just saying is native('liblinenoise') fix that? 12:37
arnsholt Should, yeah
Ven m: sub head(*$head, *@tail) { return $head }; head(1, 2, 3, 4);
camelia ( no output )
Ven m: sub head(*$head, *@tail) { say $head }; head(1, 2, 3, 4);
rjbs Hm. I did an s/liblinenoise.so/liblinenoise/ on the installed Linenoise.pm, but did not help, I get the same error, which seems odd.
camelia rakudo-moar a6f563: OUTPUT«1␤»
Ven m: sub head($head, *@tail) { say $head }; head(1, 2, 3, 4);
camelia rakudo-moar a6f563: OUTPUT«1␤»
Ven I'm not sure I get what `*$` does as specified in s06
arnsholt From memory, it first tries to load the thing as-is, and if that fails it tries to load with shared library extension
rjbs Should I hack it before installing?
(I don't see a .pmc file or anything, should such things exist.) 12:38
arnsholt Which file did you edit?
The .pm installed by panda, or something else?
rjbs ~/perl6/share/perl6/site/lib/Linenoise.pm
which is the path emitted as install destination by panda install
12:38 laouji_ left
arnsholt Right, right 12:38
In that case, there's probably a precompiled version lying around 12:39
Linenoise.moarvm
hoelzro rjbs: I thought you were also having trouble with panda installing a .so instead of a .dylib?
jnthn rjbs: I'm entirely the wrong person to kvetch at if you want a useful answer; I didn't do any of the Linenoise module work, don't know much about OSX (apart from its debug malloc library :P), and didn't really hack on Panda either :)
rjbs jnthn: Thanks anyway. Someone had wondered whether perhaps moar was doing dylib loading incorrectly, but it looks like that is not the case, now t hanks to arnsholt++ 12:40
Ven arnsholt: do you have the source doc for the `__class__` python behavior?
rjbs hoelzro: No, it installed .dylib
Ven or maybe you were looking at source code
rjbs There is a .moarvm file, yes.
arnsholt Ven: docs.python.org/3/reference/datamo...s-creation "__class__ is an implicit closure reference created by the compiler if any methods in a class body refer to either __class__ or super. "
hoelzro rjbs: ok, good. what if you repalce all of the liblinenoise.so with liblinenoise in Linenoise.pm in a clone of the linenoise repo, and panda install that?
Ven arnsholt: thanks 12:41
rjbs The plot worsens...
So, I removed the .moarvm, I edited the .pm, and now I get:
Cannot locate native library 'liblinenoise.dylib'
hoelzro: I will try that. How do I panda install "the repo whose working tree I'm in"?
hoelzro rjbs: panda install .
arnsholt Ven: Also, PEP3135 (which is referenced just below the bit I quoted)
hoelzro or any directory, for that matter
rjbs Great, thanks. 12:42
Ven arnsholt: all that sounds pretty bad :/. I'll read up
hoelzro rjbs: you probably need to tweak the OS X equivalent of LD_LIBRARY_PATH
DYLD_something_or_other, I think
rjbs I had wondered whether I'd need to do that, thanks.
andreoss how do i espace * inside list? 12:43
rjbs Where's the github repo?
12:43 laouji_ joined
andreoss i need * to be a block inside a list 12:43
jepeway DYLD_LIBRARY_PATH, I think
rjbs Yes, it's DYLD_LIBRARY_PATH
hoelzro rjbs: github.com/hoelzro/p6-linenoise
geekosaur please don't. 12:44
DYLD_FALLBACK_LIBRARY_PATH if you must, but better is to fix the problem
hoelzro geekosaur: I was planning on hacking MoarVM to add the share directory to the rpath
I don't know if that'll fix the problem on OS X
DrForr While I'm thinking of it, should I ask someone to add github.com/drforr/perl6-readline ?
rjbs hoelzro: I'll give you a report in 10-15m. Time to walk the kid to school! 12:45
(It worked! I tested while she got her shoes tied.)
nwc10 you're fast, or she's not?
rjbs A little from column A... 12:46
hoelzro: github.com/hoelzro/p6-linenoise/pull/2
rjbs & for a bit
geekosaur just for the record, DYLD_LIBRARY_PATH doesn't work like LD_LIBRARY_PATH does on Linux and can break things in bizarre ways. DYLD_FALLBACK_LIBRARY_PATH is closer to Linux behavior (but may only work on 10.7+) 12:47
andreoss m: my %h = not => not **; %h<not>(True).say;
camelia rakudo-moar a6f563: OUTPUT«False␤»
12:47 xinming left
andreoss m: my %h = not => not *; %h<not>(True).say; 12:47
camelia rakudo-moar a6f563: OUTPUT«False␤»
andreoss m: my %h = not => not *, so => so *; %h<not>(True).say; 12:48
camelia rakudo-moar a6f563: OUTPUT«False␤»
12:48 laouji_ left, xinming joined
arnsholt geekosaur: What is the correct solution, incidentally? 12:49
That's one of the annoying things with shared libraries; convincing the linker to find the damned things 12:50
hoelzro rjbs: glad to hear it =)
geekosaur OS X encodes the runtime path to the dylib within the dylib itself. generally you use install_name_tool if you need to adjust that 12:51
this may require linking the dylib with -headerpad_max_install_names to leave sufficient room for large paths 12:52
but in short, if you copy a dylib somewhere other than where you built it, use install_name_tool to fix its internal path 12:53
hoelzro jnthn: if you have some time today, could you look at RT #125154? I was able to fix it by reverting a commit you made a year ago (319509a), but I would like to keep the gains that resulted from that commit
12:56 xinming left
masak Ven: I've never used *$param in real code. 12:56
12:56 xinming joined
jepeway why not DYLD_LIBRARY_PATH? that gets searched first (from reading man page) then the default dirs which can be overridden with DYLD_FALLBACK_LIBRARY_PATH 12:56
masak Ven: if you believe something is off there with respect to the spec^Wsyn, then we should try to come up with a oneliner that exhibits that off-ness.
Ven masak: I don't even get what's the purpose :-) 12:57
seems to me `:($, *@)` already works
12:58 mls_ is now known as mls
jepeway well, gone, again. still interested in why Int.new(0) is a bust. would love DateTime.utc to be able to use $.timezone.new(0) so it won't slice off timezone types. 12:58
masak goes and reads S06
geekosaur because DYLD_LIBRARY_PATH overrides the hardcoded paths completely. so if you have something using the libiconv.dylib Apple ships, and you include the library directory for macports or homebrew or anything shipping a newer gnu iconv in DYLD_LIBRARY_PATH, that thing thta expects Apple's will crash hard 12:59
12:59 skids joined
geekosaur DYLD_FALLBACK_LIBRARY_PATH will try the specified one first and only then search the fallback path, so all the system programs will still work even if you have an alternative version of an Apple-provided library somewhere on it 13:00
13:00 firefish5000 joined, koo6 joined
masak "Slurpy scalars still impose list context on their arguments." -- that, and the "treated lazily" thing seem to be the two differences. 13:01
m: sub tail(*$head, *@tail) { return @tail }; say tail(1..Inf)
camelia rakudo-moar a6f563: OUTPUT«␤»
masak heh :)
moritz I think it simply ignores the slurpiness 13:02
masak m: sub tail(*$head, *@tail) { return @tail }; my @fromtwo = tail(1..Inf); say @fromtwo.elems
camelia rakudo-moar a6f563: OUTPUT«0␤»
moritz and binds the argument range to $head
jepeway shown (I hope) in this commit github.com/perl6/roast/commit/dd9e...0f197a6893
masak TimToady: this example is straight from S06, and it doesn't work. something is wrong somewhere.
geekosaur in short, as apple ships a bunch of downrev things that both free and commercial software developers ship newer versions of as a matter of course, DYLIB_LIBRARY_PATH can make those things "just work" at the price of breaking all Apple provided programs completely
Ven m: sub f(*$a, *@) { say $a }; f((((0, 1), 2), 3), 4)
camelia rakudo-moar a6f563: OUTPUT«0 1 2 3␤»
moritz slurpy scalars are NYI, that's wrong, no?
Ven masak: ^ 13:03
I think the behavior that should happen is that it should be flattened and give out 0, right?
rjbs tries to understand how to use install_name_tool for this. 13:08
geekosaur -id to change the dylib's own path 13:09
13:10 aborazmeh joined, aborazmeh left, aborazmeh joined
masak Ven: I dunno. calls don't tend to do much flattening, in my experience. 13:11
rjbs geekosaur: Thanks, I kept trying to use -change. Now otool -L shows the right path in that file, but running perl6 still fails to load it. Do I need to rebuild a registry or something?
Ven masak: well, I expected that's what "list context" meant there
masak "list context" is a very weird thing to apply to Perl 6. 13:12
it's Perl 5 thinking.
we do have list assignment.
13:12 ab5tract_ left
moritz and flattening 13:12
geekosaur -change would be if the perl6 executable has a linked-in path to it that needs to be replaced: install_name_tool -change /path/to/old/liblinenoise.dylin /path/to/new/location perl6
rjbs geekosaur: Right. It'd be nice if there was an error on my misuse, I think, but whatever. :) 13:13
13:13 Ven left
geekosaur it might be necessary to use install_name_tool -add_rpath on perl6 to point to the directory where libLinenoise.dylib is for dynamic loading 13:14
since it can't use the embedded path to find it if it wasn't actually linked against it 13:15
(as with dynload)
13:15 ibo2perl6 left
rjbs input file: /Users/rjbs/perl6/bin/perl6 is not a Mach-O file 13:16
geekosaur right, you need to find the actual executable. that will be a wrapper shell script 13:17
rjbs Gosh, so it is. 13:18
silly me
install_name_tool -add_rpath $PWD /Users/rjbs/perl6/bin/moar
The trick is done. 13:19
geekosaur++ # medicine man
geekosaur the powerpc abi went this way for security reasons and apple kept it on porting to intel
rjbs I will write this experience up.
Is there a clear suggested course of action for tadzik/panda? 13:20
geekosaur it's more difficult to relocate things but, unlike ELF, there's not a long list of "disable these envars and functions in any security-sensitive context or else!"
rjbs Does panda install from releases or git? Real question: does there need to be a new release of Linenoise before that fix is live for installers? 13:23
FROGGS rjbs: panda installs from git (HEAD) 13:25
rjbs Thanks.
tadzik rjbs: (currently) :)
there should be a plan to convince our module writers to tag releases and stuff 13:26
[Coke] we should probably fix that eventually to get "latest" tagged good version since not everyone keeps master/HEAD in working order.
tadzik++
tadzik [Coke]: yeah, that's a good plan 13:27
it will confuse everyone for a while, but it's inevitable
rjbs hoelzro: Going "left" in the repl requires ^B when I'd hoped <Left> would work. Is this known, or do I need to futz with something more?
hoelzro rjbs: that's...interesting 13:29
hoelzro tries
[Coke] "linenoise kind of sucks when you're used to readline" 13:30
hoelzro yes, it kind of does =(
DrForr is working on a readline binding, fortunately
DrForr++
rjbs I can cope with ^B for now, but yeah. It's kind of blecherous. 13:31
1000% better than "delete and start over" though ;)
DrForr Feel free to add the github repo github.com/drforr/perl6-readline - I'll document it tonight, and I'm sure I'll get a flood of "Please...". 13:32
hoelzro I thought left arrow did work, though 13:33
13:34 aborazmeh left
hoelzro rjbs: left arrow works for me 13:39
I haven't tried linenoise on OS X, though
rjbs hoelzro: It does not work here under iTerm. I tried changing the terminal type I report to no avail.
It works under tmux, but not not under tmux. :-/ 13:40
hoelzro rjbs: would you mind trying a standalone program using linenoise, to see if it's linenoise-related?
geekosaur hm. iterm2 and tmux should be sending (and expecting) the same thing 13:41
rjbs hoelzro: If you give me instructions, happy to.
hoelzro ok, hang on 13:42
rjbs Also works under Terminal.
hoelzro so just not iTerm? 13:43
rjbs This is odd...
hoelzro indeed
rjbs If I hit ^V<Left>, I see \eOD - but under tmux, \e[D
geekosaur wonders if that is actually the original iTerm... which was rather buggy 13:44
hoelzro are you using iTerm 1 or 2?
rjbs It's 2.
hoelzro ok, good =)
geekosaur also it sounds like you're in application keypad mode
tadzik hmm, anyone using rakudobrew on windows?
orelse, rakudo in general on cygwin?
geekosaur printf '\033>' 13:45
hoelzro rjbs: compile and run this, please: gist.github.com/hoelzro/b84b155f7e7c863aca1c 13:46
geekosaur ^ should switch off application keypad mode
rjbs I've loaded a different keyboard profile. Now it works.
hoelzro type exit to exit
nwc10 tadzik: libuv doesn't support cygwin, so current rakudo on cygwin could only be via Java, if cygwin has Java
RabidGravy so, any ideas where to start looking for the reason that simply loading a compiled module might be shagging up $*OUT?
rjbs hoelzro: It's fine now, but I think it's because of the changed keyboard profile 13:47
hoelzro ok, that's good
geekosaur yes. something turned on application keypad mode, resetting the keyboard profile turned it back off
rjbs geekosaur++ # fascinating, had no idea.
geekosaur most unix stuff doesn;t use application keypad mode, it's mostly a vms thing 13:48
rjbs geekosaur: I think it's worse than that. This was the default on new terminals, afaict.
At any rate, it's fixed, and I have two ways to fix it should it happen again. 13:49
I'm gonna repl the hell out of perl6 now.
geekosaur preferences > profiles > advanced
rjbs hoelzro++ thanks!
hoelzro no problem!
geekosaur check your default profile
rjbs geekosaur: I did, and that's where I fixed it.
hoelzro rjbs: btw, you now have tab completion for Perl 6 builtins
and whatever you import, for that matter
rjbs I look forward to being delighted! 13:50
hoelzro I hope the delight makes up for the pain =)
rjbs The pain is already made up for.
13:50 muraiki joined
rjbs Just knowing that I can edit my repl lines easily is huge peace of mind. That's been a major drag. 13:51
hoelzro: Tab completion is nice, but a bit odd. "Int.<tab>" for example is not what I'd expect. Anyway, I've never been much of a tab completer. :) 13:54
hoelzro rjbs: yeah, it's *really* rudimentary at this point
rjbs Okay! 13:55
13:56 Ven_ joined
tadzik nwc10: ah :( 13:57
rjbs Posted: rjbs.manxome.org/rubric/entry/2081
tadzik nwc10: do you know what's the alternative that works fine?
nwc10 native Windows? 13:58
RabidGravy Okay, it's something to do with "use System::Passwd"
tadzik with strawberry perl?
nwc10 or, more carefully, "native alternative to what?"
tadzik well, to cygwin
I want to be able to use moarvm-rakudo on windows 13:59
hoelzro rjbs: if you come up with other improvements to tab completion, please let me know!
tadzik I thought cygwin is the way to go
nwc10 tadzik: er, OK. jnthn builds natively on Windows
RabidGravy require System::Passwd is fine, use System::Passwd and $*OUT is shagged
rjbs hoelzro: For now, expect complaints more than fixes, but we'll see how it goes. :-)
nwc10 and I believe that (at least) FROGGS has also done it, of the active folks ehre
hoelzro that's fine =)
rjbs Time to switch back to p5 for workday, though!
hoelzro could someone on OS X try the new Moar to see if my rpath change helps at all? 14:02
14:02 g4 left
hoelzro I'm guessing we'll have to use install_name_tool -id on the module .dylibs as well 14:02
btyler hoelzro: just finished building
hoelzro: worked without any mucking, just a fresh moar + panda install Linenoise 14:03
hoelzro awesome!
could you try installing Linenoise and seeing if that works with just the install_name_tool -id $PWD/liblinenoise.dylib liblinenoise.dylib fix rjbs posted? 14:04
14:04 _thou joined
masak rjbs++ # puttering with perl6 14:05
rjbs masak: My hope is that I can politely complain about stuff so that come v6.0 other people are less likely to impolitely complain. >:-) 14:06
btyler hoelzro: my repl seems to be happy to give me history and left arrow without anything beyond building moar and installing linenoise -- I can wipe out an install and start fresh if you want me to see if rjbs' install_name_tool thing is still needed
Ven_ starts working on some mop hackery...
hoelzro btyler: that would be awesome
FROGGS nwc10: done what? 14:07
btyler awesome how fast it is to rebuild r-m from nothing these days 14:10
tadzik src\strings\unicode.c(45034): fatal error C1026: parser stack overflow, program 14:13
too complex
thanks, microsoft :(
FROGGS O.o
tadzik: you've got HEAD?
tadzik FROGGS: yep
FROGGS because there was a fix for that lately
tadzik fresh from rakudobrew
FROGGS what's your cl version?
tadzik or perhaps it's actually using MOAR_REVISION which wasn't bumped? 14:14
it mite be
FROGGS yeah, possible
dalek p: 59601a2 | FROGGS++ | tools/build/MOAR_REVISION:
bump moar rev, possible win32 build fix
14:16
tadzik yay
dalek kudo/nom: 0f3f80c | FROGGS++ | tools/build/NQP_REVISION:
bump nqp/moar rev, possible win32 build fix
Ven_ m: sub trait_mod:<is>(Mu:U \type, :$serializable!) { my @attribute = type.^attributes.grep(*.has-accessor); say @attribute.perl }; class A is serializable { has $.a; } 14:17
camelia rakudo-moar a6f563: OUTPUT«[]<>␤»
tadzik FROGGS: same thing, it seems 14:18
Ven_ not sure why this is empty? are attributes not yet there?
FROGGS lemme test it
Ven_: that trait probably runs too early for attrs to show up
Ven_ FROGGS: alright. what should I do instead? 14:19
FROGGS Ven_: write a sub that receives an object and serializes it?
Ven_ FROGGS: I'd like to generate such a sub at compile-time if possible 14:20
FROGGS Ven_: hmmm, isnt there a COMPOSE phaser or something like that, that runs at the right time?
btyler hoelzro: wiped out everything and started from scratch, no install_name_tool required, REPL history/arrow keys worked after panda install Linenoise 14:21
Ven_ FROGGS: my learnxiny say it's NYI :P
14:21 itz joined
FROGGS :o( 14:21
tadzik: I'm building now HEAD...
tadzik: I've got ActivePerl 64bit and cl 17.0 btw 14:22
tadzik cl? 14:23
I
I'm on strawberry, not sure if that matters
14:23 itz_ left
FROGGS tadzik: that probably matters 14:23
tadzik huh
FROGGS cl is the c compiler from Visual Studio (Express) 14:24
ugexe ive built on windows with strawberry perl + msvc
tadzik hmm, I'm running 2015 RC 14:25
FROGGS ohh, wow
such new
tadzik version 19.00.22816
I guess it's worse :P
14:26 Ven_ left
FROGGS well, if it is an RC it might not be bug free .o) 14:26
:o)
but I have no experience how good cl RC's are
ugexe fwiw ive had problem installs due to strawberry perl having generated some settings during install that later changed (like swapping in a new hard disk, even if its cloned). for whatever reason perl5 continued to work fine but rakudo would fail to compile 14:28
FROGGS tadzik: "Rakudo has been built and installed." 14:29
14:29 laouji left 14:30 FROGGS[mobile] joined 14:31 FROGGS left 14:32 brrt left
colomon hey, who’s planning on going to the Swiss Perl Workshop in August? 14:32
besides TimToady++
FROGGS[mobile] colomon: I am 14:33
colomon cool
masak I'm thinking of going. 14:35
colomon also cool.
masak (it's in my work schedule, valiantly defending itself against intruders)
FROGGS[mobile] I'll most likely fly
masak I've always wanted to ride there across the alps. 14:36
on a giant squirrel.
rjbs tadzik: So all the dylib futzing is now oboslete with an upgraded rakudobrew and fresh brewed moar?
masak decommute &
btyler rjbs: that was my experience just now with OSX 10.10
colomon If my Swiss clients come up with a good reason to fly me out there in late August…
rjbs masak: youtu.be/Czy0pXRRZcs?t=334
14:37 firefish5000 left
colomon afk # but will check back in 14:37
tadzik rjbs: so I've heard :)
rjbs updates his blog post.
tadzik rjbs: no rakudobrew update should be necessary though
rjbs Oh?
tadzik rakudobrew always fetches the lastest rakudo
rjbs Is it rakudo that got the fix, then? 14:38
tadzik so if it's fixed in there, it's fixed automagically if you update your rakudo using rakudobrew
MoarVM, actually
I hope MOAR_REVISION covers that patch
FROGGS just bumped it, so it should :)
rjbs Okay!
tadzik can't test it myself, since my visual studio is too bleeding edge :);
rjbs: where's that blog post of yours? I don't see it on bpo or ironman 14:39
rjbs rjbs.manxome.org/rubric/entry/2081 14:40
tadzik ceers
rjbs It's only half an hour old, probably ironman hasn't updated.
tadzik nice :) rjbs++ for spreading good propaganda 14:41
RabidGravy jnthn, it appears the "write string requires an object with REPR MVMOSHandle" is caused by System::Passwd doing IO in the "module scope" when it is loaded
I've sent a patch to the author, but I suspect that the problem is deeper than that 14:42
andreoss m: try { die ; CATCH { say "ok" }}; say "..."; 14:44
camelia rakudo-moar a6f563: OUTPUT«ok␤Died␤ in block <unit> at /tmp/DL0zH5a7LJ:1␤␤»
14:44 laouji joined
andreoss should it die even inside try/catch ? 14:45
m: try { fail ; CATCH { say "ok" }}; say "...";
camelia rakudo-moar a6f563: OUTPUT«ok␤Died␤ in block <unit> at /tmp/QRQKrF6e_S:1␤␤»
ugexe you need a default block 14:46
m: try { die ; CATCH { default {say "ok"} }}; say "...";
camelia rakudo-moar a6f563: OUTPUT«ok␤...␤»
ugexe if you dont plan to properly catch/handle or do anything with the error you just do try { die ; } or say "..."; 14:47
andreoss design.perl6.org/Differences.html 14:48
probably deprecated syntax for CATCH here, since no pattern matching inside CATCH
14:48 ash__ joined
ugexe well warn is not say 14:49
14:49 laouji left
ugexe m: try { die ; CATCH { warn "ok" }}; say "..."; 14:49
camelia rakudo-moar a6f563: OUTPUT«ok at /tmp/vcga3V_KPb line 1 in block <unit> at /tmp/vcga3V_KPb:1␤␤Died␤ in block <unit> at /tmp/vcga3V_KPb:1␤␤»
hoelzro btyler: interesting...thanks for trying that out
ooooh
I think I know why
ugexe andreoss: but yeah its probably old 14:50
hoelzro dylibs contain their location so that when you link against them, the resulting executable knows where to find them
but if you dlopen (or whatever it is on OS X), it doesn't need that path 14:51
14:57 Ven_ joined, rurban left, pierrot_ is now known as pierrot
Ven_ FROGGS[mobile]: ended up with a sub indeed. 14:59
Should I release those 3 lines in something like "Serialize::Tiny"? 15:01
15:03 fhelmberger left 15:04 grondilu left, fhelmberger joined
Ven_
.oO( how tiny is Tiny )
15:05
ben_m masak thanks for explanation earlier. So foo: just parses like foo( and the closing ) would be at the end of the expression. Neat.
15:06 cygx joined
cygx o/ 15:06
hoelzro o/ cygx
15:06 rindolf left
FROGGS[mobile] Ven_: I still hope to release my serialization code soon 15:08
Ven_ FROGGS[mobile]: do you mind me taking an option on Serialization::Tiny, then?
FROGGS[mobile] I should probably bug jnthn++ tomorrow
15:08 fhelmberger left
FROGGS[mobile] Ven_: go ahead 15:09
Ven_ alright. I can just remove it if needed later anyhoo
FROGGS[mobile] my code relies on the currently used compiler anyway
15:15 gfldex joined
dalek osystem: 58d8c4f | (Jonathan Stowe)++ | META.list:
Added Sys::Lastlog
15:16
15:20 FROGGS joined, diana_olhovik left 15:21 grondilu joined
cygx I opened some pull requests that need discussion (changed to the API) as well as testing 15:22
github.com/MoarVM/MoarVM/pull/215 github.com/rakudo/rakudo/pull/425
* changes
15:23 pat_js joined 15:25 xinming left
FROGGS jnthn: would it be possible to tackle the serialization problem tomorrow? 15:28
15:31 rindolf joined 15:34 _mg_ left
Ven_ FROGGS: do we have some META.info docs? 15:35
(i.e. is `depends` needed)
jnthn FROGGS: Which one? The "detach from SC" one? 15:41
cygx I just realized that with my changes, p5 `open(my $fh, '<', 'input.txt')` would read in p6 `my $fh = open('input.txt', '<')`
15:42 Celelibi left
jnthn Surely that wants doing with a named arg, as :r/:w are 15:42
hoelzro cygx: have you considered changing that second param to a named parameter, like :mode?
cygx I actually had it as a named argument first 15:43
then, I thought: let's make it optional instead and save some typing ;)
15:44 domidumont left, Celelibi joined
Ven_ FROGGS: github.com/vendethiel/Serialize-Tiny.pm6 15:44
[Coke] colomon: I might be able to make it, depending on travel support (which I might be able to get) 15:46
cygx some bikeshedding: should the mode argument be optional or default to 'r'? should it :$mode or :$m?
*should it be
15:49 zakharyas left
dalek osystem: 5a02edd | ven++ | META.list:
Add Serialize-Tiny
15:51
FROGGS jnthn: yes, exactly
jnthn FROGGS: Sure, we can.
FROGGS Ven_: look at others in the modules list
Ven_ FROGGS: sorry?
FROGGS Ven_: to see how a good META.info looks like 15:52
Ven_ FROGGS: yes yes, that's what I ended up doing :) github.com/perl6/ecosystem/commit/...a07cba1e0b
FROGGS S22 talks about it, but we are not there yet
dalek pan style="color: #395be5">perl6-examples: ebdddb0 | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
minor refactoring, added booleans
15:53
pan style="color: #395be5">perl6-examples: 35d4a0c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
[interpreters] handle booleans, added tests
pan style="color: #395be5">perl6-examples: da5775c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
[interpreters] fix floats
15:54 FROGGS[mobile] left 15:59 domidumont joined 16:00 eli-se joined 16:01 Ven_ left
abraxxa rakudobrew build-panda fails on 2015.04 16:01
Probable version skew in pre-compiled '/home/ahartmai/.rakudobrew/moar-2015.04/panda/ext/File__Find/lib/File/Find.pm' (cause: no object at index 390)
build stage failed for panda: Failed building lib/Panda/Ecosystem.pm
No such method 'clone' for invocant of type 'NQPArray' 16:07
16:08 domidumont left 16:11 eternaleye left, eternaleye joined
abraxxa works on nom 16:17
PerlJam just did
rakudobrew build moar
and is sitting here waiting on the results of "==> Reinstalling Linenoise" 16:18
dalek : 3e351e0 | (Andrei Osipov)++ | docs/Perl6/Perl5/Differences.pod:
Fix depricated syntax in CATCH block
PerlJam which seems to be taking a really long time
andreoss ugexe: i've fixed it
16:21 Sqirrel left, Sqirrel joined 16:29 _mg_ joined
andreoss m: my @x = gather take $_ andthen last if $_ > 5 for 1...10; say @x; 16:31
camelia rakudo-moar 0f3f80: OUTPUT«6 7 8 9 10␤»
16:31 _mg_ left
jnthn Most obfuscated way to write my @x = 6..10 ever :P 16:34
Well, roundabout way, anyway :)
16:35 kaare_ joined
TimToady suspects there's a bug there somewhere 16:35
or a NYI
jnthn Does take evaluate the the value you take, or just Nil? 16:36
That'd explain it nicely if the latter...
TimToady take is supposed to return the same value it took
jnthn hm, and looking at control.pm it does
I don't understand the semantics of andthen, so... :) 16:37
TimToady it's 'and' with topicalization of the lhs result, more or less
jnthn m: my @x = gather take $_ and last if $_ > 5 for 1...10; say @x;
camelia rakudo-moar 0f3f80: OUTPUT«6␤»
jnthn ah
so pointlessly used here 16:38
16:38 _mg_ joined, kaare__ left
jnthn (as in, "and" does just fine too) 16:38
TimToady right
and 'andthen' is still a WIP
jnthn m: say 1 andthen 2
camelia rakudo-moar 0f3f80: OUTPUT«1␤»
jnthn m: say 1 andthen (say 'omg')
camelia rakudo-moar 0f3f80: OUTPUT«1␤omg␤»
jnthn hm :)
andreoss m: say (1 andthen 2)
camelia rakudo-moar 0f3f80: OUTPUT«2␤»
jnthn h
*oh
m: my @x = gather (take $_ andthen last) if $_ > 5 for 1...10; say @x; 16:39
camelia rakudo-moar 0f3f80: OUTPUT«6 7 8 9 10␤»
jnthn hm, not prec :)
hm, is andthen a way to chain method calls? :P 16:40
.foo andthen .bar andthen .baz :)
TimToady kinda, but mostly intended for logic programming someday
jnthn ok
TimToady using lazy lists like STD does
where I wished I had 'andthen' :)
andreoss my @x = gather take $_ andthen (say "last" if $_ > 5) for 1...10; say @x; 16:42
m: my @x = gather take $_ andthen (say "last" if $_ > 5) for 1...10; say @x;
camelia rakudo-moar 0f3f80: OUTPUT«last␤last␤last␤last␤last␤1 2 3 4 5 6 7 8 9 10␤»
andreoss m: my @x = gather take $_ andthen (last if $_ > 5) for 1...10; say @x;
camelia rakudo-moar 0f3f80: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
TimToady jnthn: in fact, if you look at STD.pm5, you see it's full of things like: if $C->_STARr(sub { my $C=shift; if (my ($C) = ($C->_BRACKETr(sub {...} 16:44
where $C is the current cursor, but we're continually having to retopicalize (if $C is the topic here) 16:45
16:46 pat_js left
TimToady and orelse is the flip side, except it topicalizes to $! instead, iirc 16:47
I also wanted to differentiage 'orelse' from p5's 'dor', which I view as a bit of a mistake 16:48
16:48 _mg_ left
jnthn
.oO( d'or )
16:51
16:51 kaare_ left 16:52 raiph joined 16:53 abraxxa left, espadrine left
TimToady m: no strict; %h{"a"}{"b"} # doesn't even need the assignment to fail 16:55
camelia rakudo-moar 0f3f80: OUTPUT«Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.…»
TimToady did that one ever get RT'd? 16:56
jnthn Never seen it before
It only shows uup under "no strict"? 16:57
TimToady yeah, the first arg to .{} ends up Mu
jnthn hm
TimToady and works with $ instead
so % isn't auto-creating somehow
jnthn Yeah
BTW, is "no strict" in the REPL intentional? 16:58
TimToady I did not participate in that discussion :)
jnthn OK. I don't like it being :P
Means typo = annoying, instead of helpful error. 16:59
Which sucks if you're doing live demos. :)
TimToady I agree
Ulti +1 for strict in REPL I'd want the REPL environment to be near enough the same as a script executing
TimToady esp if you can just arrow up and add the 'my'
jnthn OK, I'll prolly make it so tomorrow.
Right. :)
I can up arrow fine on Windows :D
It's you backwards *nix folks who need the silly libraries to enable it :P 17:00
Ulti the main use case of a REPL for me outside of P6 is debugging a script where I copy paste lines
ben_m While we're at the topic of the REPL, is there a way to load sub/variable definitions from a file and use them in the REPL? Would be useful for a kind of interactive workflow 17:01
Ulti -M ?
jnthn ben_m: "require 'file'" I think
TimToady um....'use'?
jnthn Or use :)
require I guess doens't import them :)
TimToady not by default 17:02
ben_m I assumed stuff has to be a proper package or something for use ... haven't done much Perl6 yet.
jnthn But yeah, module works out fine.
> use Test;
> plan 1
1..1
Ulti I was hoping the REPL would *justwork* with my Slang so that I could do perl6 -MBioInfo to have an augmented REPL
ben_m Could've just tried that I suppose, thanks.
jnthn Ulti: I think it should already?
Ulti well it created a multi line quote with `` and the multi line enhanced REPL really didnt like it last time I tried 17:03
was a while ago though
cygx I think I'll get rid of an explicit mode argument to open and just add more named parameters 17:04
17:04 eli-se left
cygx the list of flags: gist.github.com/cygx/89984bc8b82c4609d280 17:05
jnthn cygx: Looks sensible at first glance. 17:07
TimToady sics the masakbot on the 'no strict' bug 17:08
jnthn suspects the masakbot is at the same dinner that he's on the train to... :) 17:09
TimToady we had some interesting threading bugs the night before too 17:10
zostay FROGGS: i'll take a look when i get a chance; try for later today, thanks!
jnthn I've more than enough of those already to look at. :) 17:11
I suspect a lot of them boil down to a smaller number of root causes. At least, the things I already fixed could manifest in various ways. 17:12
TimToady: There's an RT complaining about .assuming not working on Block 17:13
TimToady: In S06 it suggests it lives on the Callable role...
But there's not much precedent for putting anything else on there... :)
hoelzro jnthn: do you have any thoughts on how I could add takedispatcher code to make PRE blocks work with callsame? I tried to make a change in add_phaser, but no dice
17:14 dnmfarrell joined
jnthn Callable is just of/returns 17:14
hoelzro: No idea without looking into it a bunch more, sorry.
hoelzro no worries
guess I'll have to go with my do { PRE { ... } } workaround =/
jnthn TimToady: I could imagine putting assuming in Block, or maybe in Code (the latter is the type of thunks) 17:15
Any preference?
17:16 domidumont joined
dnmfarrell hey #perl6 I'm trying to define a grammar that recognizes "include" tokens for other files to parse. I can get the grammar to parse the referenced file, but how can I include the resulting match object in the parent match object? e.g. "token include { ^^\=include \h+ <text> \n { $/ = self.parsefile($/<text>.Str) } }" 17:17
TimToady jnthn: nope
dnmfarrell: either with 'make' to store into the .made slot, or return $/.CURSOR directly might possibly work 17:18
jnthn Or stash it in a dyncar if you want to reach it from the actions
dnmfarrell TimToady: jnthn thanks! let me try those 17:19
jnthn uh, dynvar :)
TimToady still thinks some of our internal dynvar usage is a bit smelly
17:19 diana_olhovik_ joined
TimToady $*ACTIONS is probably slowing down the parser, both directly and through opportunity cost to the optimizer 17:20
jnthn TimToady: Indeed, also by making a polymorphic callsite 17:22
TimToady and language braids probably should be coming in through cursors, not %*LANG
jnthn TimToady: Whereas if we could grab the actions from, say, ParseShared, then we could do the grab and invoke in the code we compile, not down in !cursor_pass, maybe
TimToady but that's more about correctness than speed, I'll warrant 17:23
jnthn TimToady: So it becomes monomorphic and so inlinable/specializable
So yeah, it is sub-optimial in 2 ways to do actions as $*ACTIONS
TimToady one would eventually like the action code to just be a kind of wrapper for an inlined parse rule, maybe
or automatically added to the end of a parse rule so there's no invoke at all 17:24
jnthn Well, adding the call at code-gen time is what I was thinking of.
And spehs can decide if inlining is worth it. 17:25
*spesh
TimToady nod, so probably equivalentish
jnthn Aye
It'd also fix that RT about spurious calls when .parse is not passed a :actions
TimToady maybe also there's some generalizing to the forest/frogs kind of deriving multiple classes in parallel we want to think about 17:27
which I talked about in one of the apos but never got much traction
I suppose people would call that the expression problem nowadays
kinda touche on AOP too 17:28
*es
jnthn I'm kinda touché on AOP also :P 17:29
TimToady AOP is one of those half-paradigms :)
I'd put DBC in the same category
or maybe they're only a third of a new paradigm...hard to quantify that... 17:30
17:31 andreoss left 17:34 eli-se joined
eli-se hi 17:34
17:40 jercos_ is now known as jercos
nwc10 sorry if this is a daft question - was there some type of Perl 6 time counter which is seconds since Jan 1st 2000? 17:44
TimToady Instants are TAI based, so just a difference
or did you wish to ignore leap seconds? 17:45
nwc10 no, right now I'm blissfully able to ignore time (as SEP - I'm getting to deal with URLs and legacy code) 17:46
but I had this vague (and it seems wrong) memory that something in Perl 6 was calibrated relative to 2000, instead of (say) 1970, or some other arbitrary epoch
actually, to be very fair, nearly everything is now SEP until Friday, as tomorrow is a public holiday 17:48
TimToady that was my original proposal in 2000, but since then they've continued to use leap seconds, and we've settled on a more epoch-less view of time
17:48 jdv79_ is now known as jdv79
nwc10 and Friday is a bit SEP too, as I managed to finish the thing at work today, which is only "wanted" by Monday 17:48
rjbs What holiday is tomorrow?
nwc10 aha, thanks.
I think that it's Ascention 17:49
I cant spell
TimToady m: say DateTime.new(now) - DateTime.new("2000-01-01T00:00:00Z") # something like this 17:50
camelia rakudo-moar 0f3f80: OUTPUT«Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2223␤Cannot call Numeric(DateTime: ); none of these signatures match:␤ (Mu:U \v: *%_)␤ in block <unit> at /tmp/mbf07e8OV1:1␤␤»
TimToady m: say now - DateTime.new("2000-01-01T00:00:00Z".Instant) 17:52
camelia rakudo-moar 0f3f80: OUTPUT«Method 'Instant' not found for invocant of class 'Str'␤ in block <unit> at /tmp/allXxMean2:1␤␤»
TimToady m: say now - DateTime.new("2000-01-01T00:00:00Z").Instant
camelia rakudo-moar 0f3f80: OUTPUT«484854764.793363␤»
TimToady that's in atomic time, including leap seconds
nwc10 m: say now - DateTime.new("2000-01-01T00:00:00Z").Instant 17:53
camelia rakudo-moar 0f3f80: OUTPUT«484854783.420377␤»
jnthn detrain; bbl &
TimToady m: say time - DateTime.new("2000-01-01T00:00:00Z").posix 17:54
camelia rakudo-moar 0f3f80: OUTPUT«484854892␤»
TimToady there's the civil answer :) 17:55
nwc10 sorry, side effect of "got it done today" is that I'm now shattered, and only really half awake.
m: say time - DateTime.new("2000-01-01T00:00:00Z").posix; say now - DateTime.new("2000-01-01T00:00:00Z".Instant) 17:56
camelia rakudo-moar 0f3f80: OUTPUT«484854961␤Method 'Instant' not found for invocant of class 'Str'␤ in block <unit> at /tmp/T27J8X3j30:1␤␤»
nwc10 bother. what did I mess up...
TimToady copied my syntax error
move the ) inside .Instant
nwc10 m: say time - DateTime.new("2000-01-01T00:00:00Z").posix; say now - DateTime.new("2000-01-01T00:00:00Z").Instant 17:57
camelia rakudo-moar 0f3f80: OUTPUT«484855036␤484855039.600707␤»
nwc10 and now I go check to see if there were 3 leap seconds...
oh yes. and I should repeat this in about 6 weeks. :-) 17:58
TimToady yes, drat it
(Lords a Leaping)-- 17:59
m: my @a = ^100; my @p = map { start { [ @a ] } }, ^10; say @p».result».elems 18:07
camelia rakudo-moar 0f3f80: OUTPUT«100 100 100 100 100 100 100 100 100 100␤»
TimToady I think the fact that this one always goes wrong at the second element (if it does go wrong) indicates that [@a] is probably assuming an invariant that is not true on the nursury to gen2 copy 18:08
RabidGravy AH HA! Narrowed down the weird "write string requires an object with REPR MVMOSHandle" thing I saw earlier
TimToady I think the fact that this one always goes wrong at the second element (if it does go wrong) indicates that [@a] is probably assuming an invariant that is not true on the nursury to gen2 copy
oops 18:09
m: my @a = ^100; my @p = map { start { [ @a ] } }, ^10; say @p».result».elems
camelia rakudo-moar 0f3f80: OUTPUT«100 100 100 100 100 100 100 100 100 100␤»
TimToady m: my @a = ^100; my @p = map { start { [ @a ] } }, ^10; say @p».result».elems
camelia rakudo-moar 0f3f80: OUTPUT«100 100 100 100 100 100 100 100 100 100␤»
TimToady well, I won't spam that more
18:10 berekuk left
RabidGravy If one has a A.pm "module A { my $foo = $*DISTRO.Str; }" and a B.pm that can be just "use A; class B { }" and they are compiled and installed, then doing "use B;" in a script will cause $*OUT to get shagged up like that 18:10
I think that is somewhat broken 18:11
dalek rl6-roast-data: 4a92e9b | coke++ | / (9 files):
today (automated commit)
18:12
RabidGravy It does *not* happen if non-compiled versions of the files are loaded 18:13
TimToady weird
18:14 dolmen joined
RabidGravy I'll rakudobug it, but just wondered if anyone had a theory as to what is going on with that 18:14
TimToady does it also fail if you write directly to $PROCESS::OUT? 18:15
cygx RabidGravy: known
I already submitted that
(I think - let me check)
rt.perl.org/Public/Bug/Display.html?id=125090
TimToady would be nice to know if the problem is in the dynvars or in PROCESS
on the [@a] thing, it's specifcally the [] that is not GC-safe, since neither $(@a) nor $(@a.flat) fail that way 18:20
RabidGravy TimToady, it's weirder than that :
Two terms in a row
at ./tt:5
------> $PROCESS::OUT.say⏏"foo");
TimToady needs a : 18:21
m: $PROCESS::OUT.say: "foo"
camelia rakudo-moar 0f3f80: OUTPUT«foo␤»
timotimo rjbs: your blog post could be read to say "perl6 never had readline until now", whereas previously linenoise came with moarvm and our parrot backend had a line editor built-in, too (i think it was built into parrot itself?), but we decided the vm is the wrong place for a readline like library if we want to give it more enhanced features
18:21 laouji joined
RabidGravy ah yes, okay it's not weirder than that 18:22
the result is however the same
rjbs timotimo: I'm not sure if you're suggesting I made an edit, what that edit would be, or why I'd make it.
timotimo dunno
just musing, really 18:23
rjbs Okay!
TimToady okay, so not really a dynvar problem, but a PROCESS setup issue, likely
timotimo afk for a bit again
18:23 telex left 18:24 telex joined 18:25 molaf joined 18:26 laouji left 18:27 fhelmberger joined
grondilu Range div Int dies uglily. 18:28
m: say ^10 div 3
camelia rakudo-moar 0f3f80: OUTPUT«Cannot call infix:<div>(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int); none of these signatures match:␤ (Int:D \a, Int:D \b)␤ (int $a, int $b --> int)␤ in block <unit> at /tmp/zKx_f3Ob1H:1␤␤»
grondilu hum, wait.
I had "Unimplemented spesh ops hit" locally. 18:29
it may be because I'm currently compiling Moar, though.
in any case, why does ^10 div 3 look for infix:<div> with ten Int as parameters? 18:31
m: say (^10) div 3
camelia rakudo-moar 0f3f80: OUTPUT«Cannot call infix:<div>(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int); none of these signatures match:␤ (Int:D \a, Int:D \b)␤ (int $a, int $b --> int)␤ in block <unit> at /tmp/qvOS4Zm1sK:1␤␤»
grondilu that's just weird 18:32
colomon grondilu: because it numifies the range, which has 10 numbers in it
18:32 dolmen left
colomon oh! 18:32
guess it’s not, that’s a bug, I think
m: say ^10 + 1 18:33
camelia rakudo-moar 0f3f80: OUTPUT«11␤»
colomon m: say ^10 div 1
camelia rakudo-moar 0f3f80: OUTPUT«Cannot call infix:<div>(Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int); none of these signatures match:␤ (Int:D \a, Int:D \b)␤ (int $a, int $b --> int)␤ in block <unit> at /tmp/XuOvudFsOb:1␤␤»
grondilu I was wondering if infix:<div>(Range $r, Int $n) could be made to mean $r.min, * + ($r.max - $r.min)/($n - 1) ... $r.max
like "cutting a range in $n parts" 18:34
18:34 _mg_ joined
grondilu basically like the "cut" sub I wrote for rosettacode.org/wiki/Mandelbrot_set#Perl_6 18:34
moritz infix:<div> is specifically for meant for two operands of the same type 18:35
grondilu ok 18:36
infix:</> then?
moritz m: sub cat(Int() $parts, *@e) { @e.rotor((@e / $parts).ceiling) }; say cut 3, ^10
grondilu m: say ^10 / 3
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_mhDGwXXc7␤Undeclared routine:␤ cut used at line 1. Did you mean 'cat'?␤␤»
rakudo-moar 0f3f80: OUTPUT«3.333333␤»
moritz m: sub cut(Int() $parts, *@e) { @e.rotor((@e / $parts).ceiling) }; say cut(3, ^10).perl
camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2, 3), (4, 5, 6, 7))␤»
moritz m: sub cut(Int() $parts, *@e) { @e.rotor((@e / $parts).floor) }; say cut(3, ^10).perl
18:36 _mg_ left
camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤» 18:37
moritz better
grondilu that's not quite what I had in mind though.
I was thinking of cutting a Range in $n intervals of equal length. 18:38
moritz oh
18:39 ponbiki left
TimToady maybe Range.rotor should be returning ranges 18:39
grondilu m: sub cut(Range $r, Int $n) { $r.min, * + ($r.max - $r.min)/($n - 1) ... $r.max }; say cut(0..1, 10) 18:41
camelia rakudo-moar 0f3f80: OUTPUT«0 0.111111 0.222222 0.333333 0.444444 0.555556 0.666667 0.777778 0.888889 1␤»
PerlJam
.oO( Range.rover? )
TimToady m: say (^10).rotor(3)».minmax 18:42
camelia rakudo-moar 0f3f80: OUTPUT«0..0 1..1 2..2 3..3 4..4 5..5 6..6 7..7 8..8␤»
TimToady hmm
hyper seems to be losing the ()s
grondilu m: sub cut(Range $r, Int $n) { $r.min, * + ($r.max - $r.min)/($n - 1) ... $r.max }; say cut(0..pi, 10) # I suspect this will fail
camelia rakudo-moar 0f3f80: OUTPUT«0 0.349065850398866 0.698131700797732 1.0471975511966 1.39626340159546 1.74532925199433 2.0943951023932 2.44346095279206 2.79252680319093 3.14159265358979␤»
18:42 kaare_ joined
grondilu (Rat FTW) 18:43
18:43 diana_olhovik_ left
TimToady m: say (^10).rotor(3).map: *.minmax 18:44
camelia rakudo-moar 0f3f80: OUTPUT«0 1 2 3 4 5 6 7 8␤»
TimToady m: say (^10).rotor(3).map(*.minmax).perl
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8)␤»
TimToady hmm
m: say (^10).rotor(3).perl 18:45
camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤»
TimToady who's losing the ()s?
m: say (^10).rotor(3).map({$_}).perl
camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤»
TimToady m: say (^10).rotor(3).map((*.minmax)).perl 18:46
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8)␤»
TimToady m: say (^10).rotor(3).map((*.minmax,)).perl
camelia rakudo-moar 0f3f80: OUTPUT«Method 'count' not found for invocant of class 'Parcel'␤ in block <unit> at /tmp/_wS9dpZFPk:1␤␤»
TimToady m: say (^10).rotor(3).map(({.minmax)}).perl
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/MQMbExo2UF␤Missing block␤at /tmp/MQMbExo2UF:1␤------> 3say (^10).rotor(3).map(({.minmax7⏏5)}).perl␤ expecting any of:␤ statement end␤ statement modifier␤ statement mo…»
TimToady m: say (^10).rotor(3).map({.minmax)}).perl
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/e6kZYAqViV␤Missing block␤at /tmp/e6kZYAqViV:1␤------> 3say (^10).rotor(3).map({.minmax7⏏5)}).perl␤ expecting any of:␤ statement end␤ statement modifier␤ statement mod…»
TimToady m: say (^10).rotor(3).map({.minmax}).perl
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8)␤» 18:47
TimToady weird
m: say (^10).rotor(3).map({.minmax.WHAT}).perl
camelia rakudo-moar 0f3f80: OUTPUT«(Range, Range, Range)␤»
TimToady who's flattening the ranges? 18:48
m: say (0..2, 3..5, 6..8).perl 18:49
camelia rakudo-moar 0f3f80: OUTPUT«(0..2, 3..5, 6..8)␤»
timotimo m: say (^10).rotor(3).map({.WHAT}).perl
camelia rakudo-moar 0f3f80: OUTPUT«(Parcel, Parcel, Parcel)␤»
timotimo m: say (^10).rotor(3).map({.perl}).perl
camelia rakudo-moar 0f3f80: OUTPUT«("(0, 1, 2)", "(3, 4, 5)", "(6, 7, 8)")␤»
timotimo so the result of the ranges of minmax gets flattened again?
m: say (^10).rotor(3).map({^5}).perl 18:50
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4)␤»
timotimo m: say (^3).map({^5}).perl
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4)␤»
timotimo m: say (^3).map({(1, 2, 3)}).perl
camelia rakudo-moar 0f3f80: OUTPUT«((1, 2, 3), (1, 2, 3), (1, 2, 3))␤»
TimToady tres weird
m: say (^3).map({(^5)}).perl 18:52
camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4)␤»
TimToady m: say (^3).map({(^5).item}).perl
camelia rakudo-moar 0f3f80: OUTPUT«(0..^5, 0..^5, 0..^5)␤»
TimToady something is flattening there that shouldn't oughta
m: say {^5}().perl 18:54
camelia rakudo-moar 0f3f80: OUTPUT«0..^5␤»
TimToady must be the map, I guess
[Coke] TimToady: It is both disconcerting and the opposite that you are trying to guess why this listy thing is working the way it does. 18:59
TimToady well, we're still mid-GLR here 19:00
m: say (1..5,42).list.perl 19:01
camelia rakudo-moar 0f3f80: OUTPUT«(1, 2, 3, 4, 5, 42)␤»
TimToady .list is flattening ranges
I wonder what depends on that behavior...
nwc10 awaits dalek with the "let's find out" commit... 19:03
TimToady hafta figger out where it's doing it, first...it's down in the nqp/vm level somewhere, I think 19:04
timotimo so, p6list or something? 19:05
TimToady which means nqp might be depending on it
timotimo as in, nqp::p6list?
do we even have ranges in nqp?
FROGGS that's extops, no?
TimToady dunno, offhand
brane is runnin low on nutriments 19:06
FROGGS there are no ranges in nqp
TimToady well, I still suspect that .list is badly overloaded to mean more than one thing here
arnsholt Wow. I'm so looking forward to using Perl 6 for all my Perl needs 19:09
arnsholt just fixed an absolutely ridiculous bug, due to having "my $id = @_" instead of "my ($id) = @_"
19:09 pauluu left
arnsholt Bug didn't trigger for my test user locally, since that user had id=1... 19:10
FROGGS eww
hobbs that's why all test users should have id=42
arnsholt Good point, good point 19:11
Lesson learned, I guess =)
19:11 berekuk joined
TimToady you might also use that module someone came up with that makes undef return random values so that it's *really* undefined 19:11
timotimo that's why Bool::True should numify to 42? :)
TimToady as long as 42 also numifies to 1, there's no problem :) 19:12
19:13 berekuk left 19:15 berekuk joined 19:17 berekuk left
DrForr Of course it does... in the correct base. 19:19
TimToady all those bases am not belong to us
mst all those base amn't belong to us # scans better 19:20
19:25 eli-se left 19:27 domidumont left 19:28 Foxcool left 19:33 ash__ left 19:42 mohij joined
cygx more modes for opening files, v2: github.com/rakudo/rakudo/pull/426 19:49
19:53 rurban joined 19:54 dnmfarrell left
PerlJam cygx++ 20:08
20:09 grondilu left 20:11 laouji joined
PerlJam cygx: What's the distinction between $mode and $llmode? Why have both? 20:14
20:15 laouji left
cygx PerlJam: in my branch, the argument to nqp::open corresponds to POSIX O_* flags, so translation from user-visible flags is necessary 20:17
PerlJam: I let the multi-dispatcher handle that instead of putting a given or a hash inside the method
PerlJam: that's why that open is a private method as its signature is an implementation detal 20:18
*detail
PerlJam cygx: sure, but why do you need to pass both to !open() ? It really only uses $llmode. (what it uses $mode for looks like it could glean from $llmode)
20:18 colomon left
cygx PerlJam: if I omit either of the mode arguments, there's no way around implementing another lookup mechanism 20:20
20:20 rurban left
PerlJam cygx: in your modified version of !open, $mode is *only* used if $path eq '-' from what I can tell. It seems like you can get the same information from $llmode for that purpose and do away with $mode entirely. 20:24
20:28 darutoko left
cygx PerlJam: it's also part of the error message of the `$!path eq '-'` branch in guise of $_ 20:28
so you either have to live with a worse error message, or implement a new lookup mechanism just for that single case 20:29
PerlJam or make nqp::open() use Perl6y modes natively :) 20:30
cygx PerlJam: but what, if for whatever reason, I wanted to open a file in mode -cax 20:31
20:34 colomon joined
FROGGS m: if 0 -> $a { } else -> $b { say $b } 20:38
camelia rakudo-moar 0f3f80: OUTPUT«0␤»
PerlJam cygx: I guess you've struck a good balance then.
20:39 koo6 left
FROGGS m: my $i = 0; if $i -> $a { } elsif $i++ -> $b { } else -> $c { say $c } 20:39
camelia rakudo-moar 0f3f80: OUTPUT«0␤»
FROGGS m: my $i = 0; if $i -> $a { } elsif Str -> $b { } else -> $c { say $c } 20:40
camelia rakudo-moar 0f3f80: OUTPUT«(Str)␤»
FROGGS nice
20:41 lizmat joined
lizmat waves from Echt 20:42
[Coke] hio, lizmat 20:43
FROGGS m: my x; repeat while $x < 10 { say $x++ }
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/AiP3__bMHg␤Malformed my (did you mean to declare a sigilless \x or $x?)␤at /tmp/AiP3__bMHg:1␤------> 3my x7⏏5; repeat while $x < 10 { say $x++ }␤»
FROGGS m: my $#x; repeat while $x < 10 { say $x++ }
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WSSIYzXJuB␤Unsupported use of $#variable; in Perl 6 please use @variable.end␤at /tmp/WSSIYzXJuB:1␤------> 3my $#7⏏5x; repeat while $x < 10 { say $x++ }␤»
FROGGS m: my $x; repeat while $x < 10 { say $x++ }
camelia rakudo-moar 0f3f80: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
FROGGS hi lizmat
cygx PerlJam: well, the argument boils down to whether nqp::open should follow Perl6 (which in turn loosely follows C11 under my implementation), or POSIX (which is how its implemented in MoarVM and curiously enough the JVM as well)
DrForr m: sub foo ( Int ) returns Int returns Int { 1 }
camelia rakudo-moar 0f3f80: OUTPUT«Code object coerced to string (please use .gist or .perl to do that) at src/Perl6/World.nqp line 2438 in any ex-handle at src/Perl6/World.nqp:3481␤␤Unhandled exception: No exception handler located for warn␤ at <unknown>:1 (/home/camelia/rakudo-i…»
lizmat FROGGS [Coke] o/ 20:44
20:44 eli-se joined
TimToady m: repeat while my $x < 10 { say $x++ } 20:45
camelia rakudo-moar 0f3f80: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
TimToady FROGGS: I'd write it ^^
that's one of the main reasons we allow the conditional at the front, despite testing it at the end
PerlJam isn't sure why ... 20:46
m: my $i = 0; if $i -> $a { } elsif Str -> $b { } else -> $c { say $c } 20:47
camelia rakudo-moar 0f3f80: OUTPUT«(Str)␤»
PerlJam says (Str)
FROGGS TimToady: yes yes... I'm just testing things :o) 20:48
TimToady nod
FROGGS I need an inspiration to do something today
though, not much time left
20:51 yqt joined
dalek kudo/nom: 8e8936b | coke++ | t/spectest.data:
run fudged test
20:52
zengargoyle else has the thing that failed the previous if test. 20:54
PerlJam zengargoyle: yeah, re-reading S04 now 20:55
zengargoyle i think i remember reading it somewhere and it making sense.. :)
PerlJam It's a nuance I hadn't had a care to ever use or think about.
21:02 cygx_ joined 21:03 cognominal joined, Gruber joined 21:04 rivarun joined 21:05 sjn__ joined, moritz_ joined, Pauekn_ joined, pmichaud_ joined, betterworld joined, krunen_ joined 21:07 petercom1and joined 21:08 Hor|zon_ joined 21:09 cygx left, Hor|zon left, betterwo1ld left, muraiki left, RabidGravy left, |Tux| left
tony-o_ m: my $p = start { sleep 1; say $*SET; }; my $*SET = 5; await $p; 21:09
camelia rakudo-moar 0f3f80: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
tony-o_ m: my $p = start { sleep 1; say $*SET; }; our $*SET = 5; await $p;
camelia rakudo-moar 0f3f80: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
21:09 cygx_ is now known as cygx 21:10 RabidGravy joined, |Tux| joined, tictac joined 21:11 muraiki joined 21:12 kaare_ left
tony-o_ anyone have an example of something similar to doing the perl6 equivalent to js' closures with a start block? i'm having trouble getting multiple start blocks to have the correct context with some variables .. 21:14
21:15 colomon left 21:19 raiph left
tony-o_ m: my $p = start { sleep 1; say $SET; }; our $SET = 5; await $p; 21:20
camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/IVilJhORo2␤Variable '$SET' is not declared␤at /tmp/IVilJhORo2:1␤------> 3my $p = start { sleep 1; say 7⏏5$SET; }; our $SET = 5; await $p;␤»
21:23 skids left
RabidGravy tony-o, I may be missing the point entirely bit isn't it just move the definition of the $SET before the start? 21:26
21:26 Peter_R joined
dalek pan style="color: #395be5">perl6-examples: 013b0fc | paultcochrane++ | categories/cookbook/09directories/09-0 (5 files):
[cookbook] Correct minor whitespace issues
21:27
pan style="color: #395be5">perl6-examples: e290958 | paultcochrane++ | categories/cookbook/10subroutines/10-01arguments.pl:
[cookbook] loop over sorted hash keys for output consistency
pan style="color: #395be5">perl6-examples: df763c1 | paultcochrane++ | categories/cookbook/10subroutines/10-01arguments.pl:
[cookbook] replace tabbed output with spaces
pan style="color: #395be5">perl6-examples: 15e77c3 | paultcochrane++ | t/categories/cookbook/10subroutines.t:
[cookbook] add test for 10subroutine subcategory
pan style="color: #395be5">perl6-examples: 01c837a | paultcochrane++ | categories/ (2 files):
Merge branch 'master' of github.com:perl6/perl6-examples
21:27 PZt joined
tony-o_ m: my $p = start { sleep 1; say $OUTER::SET; }; our $SET = 5; await $p; 21:28
camelia rakudo-moar 8e8936: OUTPUT«5␤»
tony-o_ i could do that too, the problem is i don't know exactly what's going to be happeningi n the start block
hoelzro tony-o_: you want multiple start blocks to share a single closed over variable? 21:31
tony-o_ it sounds that way, i'll show you my actual code: github.com/tony-o/perl6-green/blob...en.pm6#L84 21:32
hoelzro tony-o_: what about multiple threads messing with shared state, though? 21:33
tony-o_ here is the test file for that - github.com/tony-o/perl6-green/blob...-sets.t#L8
hoelzro that sounds iffy
TimToady it ought to find the $*SET in the lexpad anyway 21:34
tony-o_ with the dyn vars i get 'Any' for $*SET after the first call
so it finds it but it's always undefined on subsequent calls 21:35
21:35 colomon joined
TimToady maybe cached it too early 21:35
tony-o_ what does that mean? 21:37
TimToady the thread keeps an old dynamic scope around that looked up the dynvar too early, so has cached a value of Any 21:38
tony-o_ m: my $*SET = 5; start { sleep .25; say $*SET; }; sleep 1;
camelia ( no output )
TimToady m: my $*SET = 5; await start { sleep .25; say $*SET; }; 21:40
camelia rakudo-moar 8e8936: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
TimToady hmm, that doesn't fit my theory :)
m: my $*SET = 5; { await start { sleep .25; say $*SET; }; } 21:41
camelia rakudo-moar 8e8936: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
TimToady maybe it's breaking the chain of callers somehow 21:42
21:42 colomon left
tony-o_ the caller is definitely different with the start block than without 21:42
21:42 dolmen joined
tony-o_ m: my $x = 5; await start { sleep .1; say $OUTER::x; }; 21:43
camelia rakudo-moar 8e8936: OUTPUT«5␤»
tony-o_ m: my $x = 5; { await start { sleep .1; say $OUTER::x; }; };
camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
tony-o_ hm
TimToady use OUTERS there
tony-o_ m: my $x = 5; await start { sleep .1; say $OUTERS::x; };
camelia rakudo-moar 8e8936: OUTPUT«5␤»
TimToady m: my $*SET = 5; await start { sleep .25; say CALLERS::<$*SET>; }; 21:44
camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
TimToady "there it was, gone completely"
tony-o_ m: sub t { say CALLERS::.hash; }; await start { sleep .25; t; }; t; 21:45
camelia rakudo-moar 8e8936: OUTPUT«PseudoStash.new("\$*DISPATCHER" => Mu, "\$_" => Mu)␤PseudoStash.new("!UNIT_MARKER" => Mu, "\$!" => Mu, "\$/" => Mu, "\$=pod" => Mu, "\$?PACKAGE" => Mu, "\$_" => Mu, "\&t" => Mu, "::?PACKAGE" => Mu, "\@?INC" => Mu, :EXPORT(Mu), :GLOBALish(Mu))␤»
tony-o_ m: sub t { say OUTERS::.hash; }; await start { sleep .25; t; }; t;
camelia rakudo-moar 8e8936: OUTPUT«PseudoStash.new("!UNIT_MARKER" => Mu, "\$!" => Mu, "\$/" => Mu, "\$=pod" => Mu, "\$?PACKAGE" => Mu, "\$_" => Mu, "\&t" => Mu, "::?PACKAGE" => Mu, "\@?INC" => Mu, :EXPORT(Mu), :GLOBALish(Mu))␤PseudoStash.new("!UNIT_MARKER" => Mu, "\$!" => Mu, "\$/" => Mu,…»
TimToady m: my $*SET = 5; await start { sleep .25; say OUTER::<$*SET>; };
camelia rakudo-moar 8e8936: OUTPUT«5␤»
tony-o_ m: my $*SET = 5; sub t { say OUTER::<$*SET>; }; await start { sleep .25; t; }; t; 21:46
camelia rakudo-moar 8e8936: OUTPUT«5␤5␤»
tony-o_ m: my $*SET = 5; sub t { say OUTERS::<$*SET>; }; await start { sleep .25; t; }; t;
camelia rakudo-moar 8e8936: OUTPUT«5␤5␤» 21:47
TimToady yeah, something broke in the call chain, seems
or something is marked is_thunk that maybe shouldn't be
m: sub foo () { my $*SET = 5; await start { sleep .25; say $*SET; }; }; foo 21:48
camelia rakudo-moar 8e8936: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
tony-o_ glad i'm not crazy, i could've sworn i had it working that way like 6 months ago
TimToady seems like it oughta work to me 21:49
but then, I'm about to narcoleptic...
*to go
nap & # obviously overdue...
hoelzro @tim-today.nap({ ... }) 21:51
grr
$tim-toady
messed up my own joke!
tony-o_ haha
hoelzro: i don't mind if the variable gets changed by whatever the sub does, if that's what you were getting at above 21:52
hoelzro tony-o_: yes
RabidGravy I was playing with somthing like: 21:57
m: my $e = sub f($SET) { sleep 1; say $SET }; my $p = start $e.assuming(5); await $p;
camelia rakudo-moar 8e8936: OUTPUT«5␤»
RabidGravy which is a way of avoiding the closure altogether 21:59
21:59 laouji joined 22:02 sjn__ is now known as sjn, airdisa joined
literal /W 4 22:03
tony-o_ well, 'f' in that case would still be calling a sub that may or may not 'start' and i'd be in the same situation i think 22:04
22:04 laouji left 22:10 RabidGravy left 22:20 ben_m left 22:21 andreoss joined 22:25 airdisa left
dalek pan style="color: #395be5">perl6-examples: 8d42c4c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
a typo
22:27
pan style="color: #395be5">perl6-examples: 0100381 | (Andrei Osipov)++ | / (7 files):
Merge branch 'master' of github.com/perl6/perl6-examples
22:39 aborazmeh joined, aborazmeh left, aborazmeh joined 22:42 aborazmeh left 22:43 cygx left 22:44 aborazmeh joined, aborazmeh left, aborazmeh joined 22:45 egrep joined
japhb .tell jnthn I got test failures attempting to panda install OO::Monitors, as of a fresh build Wednesday morning US/Pacific time. Known breakage? 22:51
yoleaux japhb: I'll pass your message to jnthn.
jdv79 m: my $a; -> $a is rw = $OUTER::a {}(); # why not? 22:52
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/slmdD2N_hB␤Cannot use 'is rw' on an optional parameter␤at /tmp/slmdD2N_hB:1␤»
22:53 andreoss left
tony-o_ m: my $a = 5; (-> $a is rw = $OUTER::a { say $a; })(); 22:55
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/cJzVUtGI1S␤Cannot use 'is rw' on an optional parameter␤at /tmp/cJzVUtGI1S:1␤»
tony-o_ m: my $a = 5; (sub ($a is rw = $OUTER::a) { say $a; })();
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YmcYMIYbpR␤Cannot use 'is rw' on an optional parameter␤at /tmp/YmcYMIYbpR:1␤»
tony-o_ m: my $a = 5; (sub ($a = $OUTER::a) { say $a; })(); 22:56
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding $a; expected 'Any' but got 'Mu'␤ in sub at /tmp/NgppsUq090:1␤ in block <unit> at /tmp/NgppsUq090:1␤␤»
tony-o_ m: my $a = 5; { (sub ($a = $OUTER::a) { say $a; })(); };
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding $a; expected 'Any' but got 'Mu'␤ in sub at /tmp/qCSPcd8309:1␤ in block <unit> at /tmp/qCSPcd8309:1␤␤»
rjbs Huh. I thought the repl used to kvetch if I tried to refer to an undeclared variable. 22:57
22:57 skids joined, yqt left
jdv79 does turning on strict help? 22:58
tony-o_: was looking at rt.perl.org/Ticket/Display.html?id=78280 but it seems to be outdated maybe
rjbs jdv79: on a line by line basiss
I just wasted a bunch of time because of this. Is there a way to get the whole repl strict? 22:59
perl6 -M strict
m: my $
camelia ( no output )
rjbs Why doesn't that error?
jdv79 nice
23:02 rindolf left
rjbs More idiomatic way to say: $a[ $a.elems .. 2 ] = 1 xx 3 - $a.elems 23:03
23:04 aborazmeh left 23:06 kurahaupo1 joined
TimToady $ is a valid anonymous variable, and I don't understand what you're trying to do with the range there 23:07
rjbs I will read up on anonymous variables!
I want to say: pad this list to size 3 with 1's.
TimToady ah
I think $a[ *+0 .. 2 ] = 1 xx * should work 23:09
m: my @a = 0; @a[ *+0 .. 2 ] = 1 xx *; say @a 23:10
camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
rjbs Man, that * shows up everywhere! :) 23:12
TimToady when we get shaped arrays, my @a[3] is default(1) might do it
if you don't actually care how big it is, but just want it to default that high
m: my @a is default(1) = 0; say @a[^3]
camelia rakudo-moar 8e8936: OUTPUT«0␤»
TimToady hmm 23:13
m: my @a is default(1) = 0; say @a[0,1,2]
camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
TimToady I guess ranges autotruncate there
rjbs m: my @a is default(1) = 0; say @a[0..2]
camelia rakudo-moar 8e8936: OUTPUT«0␤»
dalek ast: 6c87a83 | (Justin DeVuyst)++ | S32-io/io-handle.t:
Annotate test for RT #78454.
23:14
rjbs Okay.
TimToady m: my @a is default(1) = 0; say @a[0 ...^ 3]
camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
rjbs Woah, what's that?
TimToady sequence operator
m: say 1,2,4 ...^ 256
camelia rakudo-moar 8e8936: OUTPUT«1 2 4 8 16 32 64 128␤» 23:15
rjbs I look forward to some kind of grammar actions that let me say "diagram this program for me." ;-)
TimToady well, that's kinda what ast output does...
rjbs Can I get that with --target or something? 23:16
trying!
Hm. I'm not ready to read this yet. :) 23:17
TimToady perl6-m --target=ast -e 'say 1,2,4 ...^ 256'
but yeah, it would be nice to be able to wave your mouse over an expression and say "explain this" 23:18
rjbs Yeah, I did that with a larger program. Looks useful, but it's all in terms I don't yet have much use for.
Right. Instead, I'm using #perl6 for that, and am very thankful for everyone's extreme forbearance. 23:19
TimToady the point is that the data is available to do this, so it's just a smop
rjbs Right!
23:19 kurahaupo1 left
TimToady unlike in p5 where it lies to itself continually 23:19
and the obfuscates it all
*then
I can say that since it's largely my fault :)
jdv79 maybe a gnuplot renderer or something off the ast would be neat 23:20
TimToady masak++ would like an AST level higher than QAST for macros and such
rjbs Hm. I can't do this?
jdv79 er, i mean graphviz i think
rjbs m: for (1,2,3,4,5).rotor(2, :partial) -> @a is default(0) { } 23:21
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VHTC2F19iQ␤Can't use unknown trait 'is default' in a parameter declaration.␤at /tmp/VHTC2F19iQ:1␤ expecting any of:␤ rw␤ readonly␤ copy␤ required␤ parcel␤…»
TimToady yeah, formal parameters aren't real arrays
so at best it could be used to constraint the actual binding to an array that had that set for a default already 23:22
defaults aren't that abstract 23:23
23:24 dolmen left
TimToady and binding is much more destructive than assignment (which is why it's faster) 23:25
rjbs inches toward a solution. 23:26
TimToady m: for (1,2,3,4,5).rotor(2, :partial) -> @a { my @array is default(0) = @a; say @array[0,1] }
camelia rakudo-moar 8e8936: OUTPUT«1 2␤3 4␤5 0␤»
rjbs I need to port my test suite over, tout suite.
TimToady: That's just what I did!
Ha! Was baffled by this code failing. Then I realized that I was using |= instead of +|= 23:27
TimToady m: for (1,2,3,4,5).rotor(2, :partial) -> $a, $b = 0 { say "$a $b" }
camelia rakudo-moar 8e8936: OUTPUT«1 2 3 4␤5 0␤»
TimToady yes, bitops are demoted so we can have junctions
m: for (1,2,3,4,5).rotor(2, :partial) -> ($a, $b = 0) { say "$a $b" } 23:28
camelia rakudo-moar 8e8936: OUTPUT«1 2␤3 4␤5 0␤»
rjbs TimToady: Yeah, I just missed it. I fixed most of them and missed that one.
gist.github.com/rjbs/8bdf1a710beec0f88e95
TimToady that's better
rjbs ^-- that's the ported code, "all done."
jdv79 m: class A; multi infix:<=>(A $, Str $) { 42 }; say A = "" # should this print 42?
camelia rakudo-moar 8e8936: OUTPUT«Cannot modify an immutable A␤ in block <unit> at /tmp/mYH68jtxUb:1␤␤»
TimToady m: my buf8 $b; $b.push: 63..65; say $b 23:30
camelia rakudo-moar 8e8936: OUTPUT«Cannot modify an immutable Buf[uint8]␤ in any at src/gen/m-Metamodel.nqp:1640␤ in block <unit> at /tmp/fDHiYFEMdi:1␤␤»
TimToady hmm, bufs are supposed to be mutable
rjbs Yeah, I complained about that yesterday.
23:30 mohij left
rjbs I think the answer I got was "bufs aren't arrays, use [+*]" 23:30
TimToady but they're supposed to be like arrays, and we have blobs to be immutable bufs 23:31
23:31 bayprogrammer_ is now known as bayprogrammer
TimToady if if it's immutable, why does the lvalue form work? 23:32
probably just missing a method push somewhere
rjbs I am exaggerating the answer I got, apparently: irclog.perlgeek.de/perl6/2015-05-13#i_10594007
I can rakudobug it. 23:33
TimToady m: say buf8.can('push')
camelia rakudo-moar 8e8936: OUTPUT«Method+{<anon>}.new␤»
TimToady m: say buf8.can('push')».WHY
camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
TimToady m: say buf8.can('push')».WHAT 23:34
camelia rakudo-moar 8e8936: OUTPUT«(Parcel)␤»
rjbs odd, you got a different error than I did, because I did this:
TimToady well, obviously inheriting Any.push, which is non-cooperative...
rjbs m: Buf.new(1,2,3).push(4)
camelia rakudo-moar 8e8936: OUTPUT«Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Use of Nil in string context at src/gen/m-BOOTSTRAP.nqp line 2235␤Cannot call push(Buf: Int); none of these signatures match:␤ (Any:U \SELF: *@values, *%_)␤ in block <unit> at /t…»
TimToady so just NYI
rjbs Is that because 4 isn't a listy thing, and it ought to be?
Or is that just another head of the NYIdra?
23:36 kurahaupo joined
rjbs Oh, it's because yours was not defined... 23:36
I think.
23:37 molaf left
rjbs rakudobugged, moving on. 23:37
Can I declare type synonyms? 23:41
TimToady constant MyInt = Int; my MyInt $x = 35.5; 23:43
m: constant MyInt = Int; my MyInt $x = 35.5;
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in assignment to '$x'; expected 'Int' but got 'Rat'␤ in block <unit> at /tmp/cNScw8YjoV:1␤␤»
TimToady or...
m: subset MyInt of Int; my MyInt $x = 35.5;
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in assignment to '$x'; expected 'MyInt' but got 'Rat'␤ in block <unit> at /tmp/G64bVMJibt:1␤␤»
TimToady in this case it's just not a proper subset :)
rjbs Interesting. Thanks!
23:44 raiph joined
rjbs I keep forgetting which thingy is meant to be buf8 and which buf16. Hooray for type synonyms! 23:44
and constants are default lexically scoped?
I can test tha tmyself, nm.
TimToady constants and enums are our by default 23:47
rjbs Okay.
TimToady but you can say my constant
rjbs I may just do that!
We established the other day that in Buf[X], X has to be a native type. Is that "just now" or "forever"? 23:48
TimToady I suspect it's temporary, but jnthn would know more
rjbs Okay, not important atm anyway! 23:49
TimToady we do try to guarantee continguous memory, and that's sort of antithetical to pointer indirection
Str can be implemented as ropes, but Bufs aren't allowed to do that, on the theory that you want to pass them to/from external APIs 23:50
rjbs moarvm does ropes, doesn't it? I seem to recall nwc10 talking about working on ropes for it at some point. I was surprised. 23:51
What you say makes sense, for sure.
TimToady it does use ropes for some things currently, but isn't terriby smart about it yet
rjbs It's fun: the more I work on porting this code, the more it is clear how Perl 6 is very distinct from Perl 5. I already knew this, but I am getting to better bellyfeel it.
TimToady lots of places it gives up and flattens the ropes
well, we tried to fix everything, which is why it took so long :) 23:52
(and takes so long, sigh)
rjbs I, for one, have never resented the delay!
(I like to think I'm not the /only/ for one.) 23:53
TimToady :)
rjbs Can I parameterize the Hash type to declare a hash that must map from uint8 to Str? Better yet, Str.chars==1 ?
TimToady m: my Str %hash[uint8] = ^256 Z=> "\0" ... "\xff"; say %hash[65] 23:56
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ahbr4F_Ewd␤Shaped variable declarations not yet implemented. Sorry. ␤at /tmp/ahbr4F_Ewd:1␤------> 3my Str %hash[uint8]7⏏5 = ^256 Z=> "\0" ... "\xff"; say %hash[6␤»
TimToady m: my Str %hash{uint8} = ^256 Z=> "\0" ... "\xff"; say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/FPJYVZ_0XE␤Operators 'Z=>' and '...' are non-associative and require parentheses␤at /tmp/FPJYVZ_0XE:1␤------> 3my Str %hash{uint8} = ^256 Z=> "\0"7⏏5 ... "\xff"; say %hash[65]␤ expecting any of…»
TimToady m: my Str %hash{uint8} = ^256 Z=> ("\0" ... "\xff"_; say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/mCsefICUuf␤Two terms in a row␤at /tmp/mCsefICUuf:1␤------> 3%hash{uint8} = ^256 Z=> ("\0" ... "\xff"7⏏5_; say %hash[65]␤ expecting any of:␤ infix␤ infix stopper␤ stat…»
TimToady m: my Str %hash{uint8} = ^256 Z=> ("\0" ... "\xff"); say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8' but got 'Int'␤ in block <unit> at /tmp/YFhCoo2Yqp:1␤␤»
TimToady aww
rjbs It's nice to see that you're still learning Perl 6 as well. ;-)
geekosaur heh
TimToady m: my Str %hash{uint8()} = ^256 Z=> ("\0" ... "\xff"); say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8(Any)' but got 'Int'␤ in block <unit> at /tmp/RFvcOXZD7p:1␤␤»
geekosaur and I htink you want to subset Str to get your chars==1
rjbs Cool. But the idea is that you say: my VALUETYPE %hash{KEYTYPE} more or less? Cool. 23:57
TimToady m: my Str %hash{uint8}; %hash{^256} = "\0" ... "\xff"; say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8' but got 'Int'␤ in block <unit> at /tmp/D4MtGaErj2:1␤␤»
TimToady whaaa 23:58
m: my Str %hash{Int where * < 256}; %hash{^256} = "\0" ... "\xff"; say %hash[65]
camelia rakudo-moar 8e8936: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1xqOfELe8C␤Two terms in a row␤at /tmp/1xqOfELe8C:1␤------> 3my Str %hash{Int7⏏5 where * < 256}; %hash{^256} = "\0" ... ␤ expecting any of:␤ infix␤ infix stopper␤ stat…»
geekosaur smells something vaguely NYI (or at least LTA)
TimToady m: subset Int8 of Int where * < 256; my Str %hash{Int8}; %hash{^256} = "\0" ... "\xff"; say %hash[65] 23:59
camelia rakudo-moar 8e8936: OUTPUT«Index out of range. Is: 65, should be in 0..0␤ in block <unit> at /tmp/8qVLgsBHBA:1␤␤»
TimToady m: subset Int8 of Int where * < 256; my Str %hash{Int8}; %hash{^256} = "\0" ... "\xff"; say %hash{65}
camelia rakudo-moar 8e8936: OUTPUT«A␤»
TimToady well, it's still a WIP
rjbs :)