Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2015-05-13

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 TimToady I'm pretty settled these days
00:00 TimToady maybe I should write that part of the new book first :)
00:01 japhb :-)
00:01 larion joined #perl6
00:01 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
00:02 TimToady these days it's more like "Know which of these principles you're emphasizing, to the detriment of other principles."
00:04 * rjbs files perl6.vim bug: https://github.com/vim-perl/vim-perl/issues/188
00:05 TimToady m: say < a \# b >
00:05 camelia rakudo-moar 68c432: OUTPUT«a \# b␤»
00:05 TimToady hmm
00:05 TimToady m: say << a \# b >>
00:05 camelia rakudo-moar 68c432: OUTPUT«a#b␤»
00:05 TimToady m: say << a \# b >>.elems
00:05 camelia rakudo-moar 68c432: OUTPUT«3␤»
00:06 TimToady m: say << a \# b >>.WHAT
00:06 camelia rakudo-moar 68c432: OUTPUT«(Parcel)␤»
00:06 TimToady m: say < a \# b >.WHAT
00:06 camelia rakudo-moar 68c432: OUTPUT«(Parcel)␤»
00:06 TimToady why one has spaces and the other not, dunno..
00:07 TimToady m: say << a \# b >><>
00:07 camelia rakudo-moar 68c432: OUTPUT«a # b␤»
00:07 TimToady apparently <<>> is itemizing itself
00:08 TimToady m: say < a \# b >.perl
00:08 camelia rakudo-moar 68c432: OUTPUT«("a", "\\#", "b")␤»
00:08 * rjbs has not yet attempted to understand itemization, but knows he'll need to.
00:08 TimToady m: say << a \# b >>.perl
00:08 camelia rakudo-moar 68c432: OUTPUT«("a", "#", "b")␤»
00:08 japhb m: say < a \# b >.DUMP
00:08 camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤    "a",␤    "\\#",␤    "b"␤)))␤»
00:08 japhb m: say << a \# b >>.DUMP
00:08 camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤    "a",␤    "#",␤    "b"␤)))␤»
00:09 TimToady beats me
00:09 japhb Huh
00:09 TimToady well, hopefully that one smooths out after GLR
00:09 japhb m: say < a \# b >.elems
00:09 camelia rakudo-moar 68c432: OUTPUT«3␤»
00:09 japhb That is just mystifying.
00:10 TimToady $!flattens maybe
00:10 japhb m: my \a := < a \# b >; say a.DUMP;
00:10 camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤    "a",␤    "\\#",␤    "b"␤)))␤»
00:10 japhb m: my \a := << a \# b >>; say a.DUMP;
00:10 camelia rakudo-moar 68c432: OUTPUT«Parcel<1>(:$!storage(BOOTArray<2>(␤    "a",␤    "#",␤    "b"␤)))␤»
00:10 TimToady except a parcel doesn't have $!flattens
00:10 f3ew joined #perl6
00:11 japhb Oh wait, perhaps they aren't compiling to the same tree.
00:11 TimToady quite possible
00:11 japhb Does camelia have a way to dump QAST?
00:12 TimToady m: say quasi { 1 + 1 }.WHAT
00:12 camelia rakudo-moar 68c432: OUTPUT«(AST)␤»
00:12 TimToady m: say quasi { 1 + 1 }.dump
00:12 camelia rakudo-moar 68c432: OUTPUT«Method 'dump' not found for invocant of class 'AST'␤  in block <unit> at /tmp/ZeHLHrwRV9:1␤␤»
00:12 TimToady aw
00:12 TimToady m: say quasi { 1 + 1 }.QAST.dump
00:12 camelia rakudo-moar 68c432: OUTPUT«Method 'QAST' not found for invocant of class 'AST'␤  in block <unit> at /tmp/G9U_xcAWo1:1␤␤»
00:12 japhb m: say quasi { 1 + 1 }.^methods>>.name;
00:12 camelia rakudo-moar 68c432: OUTPUT«BUILD incarnate evaluate_unquotes is_quasi_ast Str␤»
00:13 japhb m: say quasi { 1 + 1 }.Str
00:13 camelia rakudo-moar 68c432: OUTPUT«quasi { 1 + 1 }␤»
00:13 japhb m: say quasi { say < a \# b > }.Str
00:13 camelia rakudo-moar 68c432: OUTPUT«quasi { say < a \# b > }␤»
00:13 TimToady m: say quasi { 1 + 1 }.incarnate.WHAT
00:13 camelia rakudo-moar 68c432: OUTPUT«Too few positionals passed; expected 3 arguments but got 1␤  in block <unit> at /tmp/DXltPBB0Mu:1␤␤»
00:13 japhb m: say quasi { say << a \# b >> }.Str
00:13 camelia rakudo-moar 68c432: OUTPUT«quasi { say << a \# b >> }␤»
00:13 TimToady probably cheating
00:13 japhb Ah, it's probably just saving the code
00:13 japhb yeah
00:14 TimToady well, one could probably monkey patch some action method and capture control inside an EVAL somehow
00:15 TimToady or dynamically lookup a $/ from inside a BEGIN (evil)
00:15 laouji joined #perl6
00:16 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())␤»
00:16 TimToady m: BEGIN say callframe(2)
00:16 camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 4, annotations => {:file("src/Perl6/World.nqp"), :line("3494")}<>, my => EnumMap.new("\$ex" => Mu, :RETURN(Mu)))␤»
00:16 TimToady m: BEGIN say callframe(3)
00:16 camelia rakudo-moar 68c432: OUTPUT«CallFrame.new(level => 5, annotations => {:file("src/Perl6/World.nqp"), :line("2531")}<>, my => EnumMap.new(:RETURN(Mu)))␤»
00:17 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())␤»
00:17 TimToady heh
00:18 TimToady m: BEGIN say CALLER::CALLER::<$/>
00:18 camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
00:18 japhb Yeah, they do compile differently.  I used:
00:18 japhb diff -u <(perl6 --target=ast -e 'say < a \# b >') <(perl6 --target=ast -e 'say << a \# b >>') |less
00:18 TimToady m: BEGIN say CALLER::CALLER::CALLER::<$/>
00:18 camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
00:18 TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::<$/>
00:18 camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
00:18 japhb And you can see (non-trivial) differences.
00:18 TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::CALLER::<$/>
00:18 camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
00:18 TimToady m: BEGIN say CALLER::CALLER::CALLER::CALLER::CALLER::CALLER::<$/>
00:18 camelia rakudo-moar 68c432: OUTPUT«(Any)␤»
00:18 TimToady aww
00:19 larion joined #perl6
00:20 japhb In short, the < > form inserts a call to &infix:<,>, and the << >> form does not
00:22 TimToady m: say < 42 >.WHAT
00:22 camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
00:22 TimToady m: say << 42 >>.WHAT
00:22 camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
00:23 TimToady but it's not in order to force a Parcel of 1 element
00:23 japhb m: say (<< 42 >>).WHAT  # Just in case
00:23 camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
00:23 japhb phew
00:23 japhb m: say (< 42 >).WHAT  # Just in case
00:23 camelia rakudo-moar 68c432: OUTPUT«(Str)␤»
00:23 TimToady could be a superstitious comma, I suppose
00:23 japhb Sorta like that one?  :-)
00:24 TimToady I paused there in my internal speec
00:24 TimToady *ch
00:25 japhb In any case, superstitious tokens are not supposed to be affect semantics ....
00:25 japhb s/to be/to/
00:27 TimToady kinda like a block can have multiple statements without a Stmts node...
00:27 TimToady but this is a parcel without a comma node
00:28 japhb Would you expect there to always be one, or always not be one?
00:29 skids joined #perl6
00:30 TimToady well, comma just makes a list of things, so a list of things doesn't much care, I expect
00:30 TimToady a bit surprising it doesn't turn into 1 elem though
00:31 TimToady perhaps there's compensating code somewhere that strips the outer comma
00:31 japhb But only for the << >> case.  :-/
00:33 rjbs Stringification of Buf seems a bit off for non-octet bufs.
00:33 rjbs m: Buf.new(100,200,300).say
00:33 camelia rakudo-moar 68c432: OUTPUT«Buf:0x<64 c8 2c>␤»
00:34 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
00:34 TimToady oh, that, it's just overflow
00:34 TimToady C semantics on small ints
00:34 rjbs Sure.
00:35 rjbs Oh, gosh, it's truncated in the buf, silently...
00:35 rjbs The docs only say: A Buf is a mutable sequence of (usually unsigned) integers.
00:35 TimToady it's a "feature" :)
00:35 rjbs I reckon I'll use an array.
00:36 rjbs 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
00:36 camelia rakudo-moar 68c432: OUTPUT«Buf[uint16]:0x<64 c8 12c>␤»
00:36 japhb rjbs: ^^
00:36 rjbs japhb++ !!
00:36 rjbs That'll do.
00:37 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
00:37 rjbs (a) unicode strings (b) zscii strings [codepoints between 0 and 0x3FF] (c) zchars (d) packed zchars
00:37 rjbs In p5, it's easy: they're all strings. :)
00:37 rjbs which is also awful, of course
00:37 japhb rjbs: See src/core/Buf.pm for the gory details, and all the default specializations.
00:37 TimToady m: say Buf[Int].new(1, 2, 4 ... 10000000000000000)
00:37 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␤␤»
00:38 TimToady hmm
00:38 rjbs I find it hard to type "buf" and not "bug" :)
00:38 rjbs Okay, great.  From now on, I type "buf8"
00:38 TimToady m: say buf64.new(1, 2, 4 ... 10000000000000000)
00:38 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)
00:39 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 …»
00:39 TimToady I guess Buf is biased towards native types
00:39 japhb TimToady: Makes sense to me ...
00:40 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␤␤»
00:40 japhb Though the error for Buf[Int] is definitely LTA
00:40 japhb m: say Buf[num].new(1e0, 2e0, 4e0 ... 10000000000000000e0)
00:40 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␤␤»
00:40 japhb Heh.
00:40 TimToady o_O
00:41 japhb o/~ somebody cheated ... o/~
00:41 TimToady and got cot
00:43 TimToady either that, or made an ass out of u and me
00:44 japhb Speak for yourself, donkey man.  ;-)
00:44 TimToady hee haw!
00:45 larion joined #perl6
00:46 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 #perl6
00:56 thou joined #perl6
01:03 * 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:06 BenGoldberg . o O (Quoth the aven, evermore?)
01:10 Akagi201 joined #perl6
01:12 raydiak searched for it and ironically the first thing I saw was "Quoth the aven radiant ...", make the machines stop talking to me! :)
01:14 raydiak not even google-personalized results
01:23 rjbs So is "buf16" an implementation-specific type?
01:24 TimToady no
01:24 TimToady it's a standard Perl 6 type
01:24 rjbs Great, thanks.
01:25 rjbs (I thought there was some convention about Int vs. int, but that memory is well aged.)
01:26 TimToady lower-case types tend to native, but that's not the same as implementation-specific
01:26 rjbs Aha, I see!
01:26 TimToady int itself is a bit ambiguous, compared to int32 or int64
01:27 TimToady it's not likely to be the same as int in C
01:27 TimToady p6 defines int as the largest integer that runs at "full speed"
01:27 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)
01:27 TimToady so the native call interface tends to be more specific about C types as viewed in p6
01:28 TimToady m: say uniname("????")
01:28 camelia rakudo-moar 68c432: OUTPUT«PILE OF POO␤»
01:28 rjbs Super.
01:28 rjbs TimToady: but that was a really crappy example!
01:28 rjbs (haw haw haw)
01:30 TimToady uniname also works with integer codepoints
01:31 TimToady m: say uniname(0x2424)
01:31 camelia rakudo-moar 68c432: OUTPUT«SYMBOL FOR NEWLINE␤»
01:31 rjbs This whole exercise is worth it just for the joy of replacing low lines with hyphen minuses in variable names.
01:31 TimToady o-O
01:32 aborazmeh joined #perl6
01:32 aborazmeh joined #perl6
01:33 colomon joined #perl6
01:38 TimToady m: say uniname(0x1F35F)
01:38 camelia rakudo-moar 68c432: OUTPUT«FRENCH FRIES␤»
01:38 dayangkun joined #perl6
01:38 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␤␤»
01:39 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␤»
01:39 * TimToady is getting hungry
01:39 raydiak m: say uniname(0x20), <the>, uniname(0x3c2).comb(/\S+/)[*-2], <frontier>
01:39 camelia rakudo-moar 68c432: OUTPUT«SPACEtheFINALfrontier␤»
01:40 raydiak .oO( in your stomach :) )
01:41 TimToady m: say uniname('ꗴ')
01:41 camelia rakudo-moar 68c432: OUTPUT«VAI SYLLABLE THE␤»
01:41 BenGoldberg m: say char(0x1F366);
01:41 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'?␤␤»
01:41 BenGoldberg m: say chr(0x1F366);
01:41 camelia rakudo-moar 68c432: OUTPUT«????␤»
01:41 BenGoldberg m: say uniname(chr(0x1F366));
01:41 camelia rakudo-moar 68c432: OUTPUT«SOFT ICE CREAM␤»
01:42 BenGoldberg m: say uniname(0x1F366);
01:45 camelia rakudo-moar 68c432: OUTPUT«SOFT ICE CREAM␤»
01:46 ilbot3 joined #perl6
01:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
01:48 TimToady m: say '????'.uniname
01:48 camelia rakudo-moar 68c432: OUTPUT«GOTHIC LETTER MANNA␤»
01:49 raydiak okay, that's it, I'm grabbing the pretzels...
01:49 rjbs Does Unicode 8 give us flavor selectors for ice cream yet?
01:54 raydiak m: say (0x1f34e, 0x1f34f)».uniname   # may I offer you a healthier alternative? :)
01:54 camelia rakudo-moar 68c432: OUTPUT«RED APPLE GREEN APPLE␤»
01:59 TimToady Eve, to Adam: Here, you wanna finish this for me?
02:01 raydiak ha ha :)
02:04 laouji_ joined #perl6
02:05 rjbs I had p5 code that did:  while (my $str = substr $x, 0, 2, '') { ... }
02:05 rjbs In p6, $x is a buf.  Is there an analogous behavior, or shall I use a $i?
02:07 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␤»
02:07 rjbs So, that's not sufficient, because inside the loop, I might need to consume more.
02:08 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 #perl6
02:08 TimToady well, there's always subbuf
02:09 TimToady also, regexes have an optional starting pos
02:09 rjbs Can you use a regex on a buf?
02:10 rjbs Looks like no.
02:11 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 &
02:12 rjbs Don't overflow!
02:14 raydiak (but avoid the underruns too)
02:14 rjbs any form of runs
02:14 telex joined #perl6
02:16 raydiak yes, of course...doubly so if you're only in your underwear
02:17 jercos m: "taxes and stuff" ~~ /taxes?/
02:17 camelia rakudo-moar 68c432: ( no output )
02:17 jercos m: say "taxes and stuff" ~~ /taxes?/
02:17 camelia rakudo-moar 68c432: OUTPUT«「taxes」␤»
02:17 jercos m: say "taxes and stuff" X~~ (/taxes?/, /taxes??/)
02:17 camelia rakudo-moar 68c432: OUTPUT«True True␤»
02:27 rmgk_ joined #perl6
02:49 aborazmeh joined #perl6
02:49 aborazmeh joined #perl6
02:54 agentzh_ joined #perl6
03:01 rjbs What best way to append an element to a buf?
03:02 rjbs $b[ $b.elems ] = 0xA0; # seems wordy
03:03 dalek roast/date-time-slices-tz: dd9ef10 | (Chris Jepeway)++ | S32-temporal/DateTime.t:
03:03 dalek roast/date-time-slices-tz: Added tests to check that DateTime.{utc,local} preserve timezone types.
03:03 dalek roast/date-time-slices-tz: These are fudged, for now, as they require help from the timezone
03:03 dalek roast/date-time-slices-tz: type itself beyond merely the current "be an Int()" expectation.
03:03 dalek roast/date-time-slices-tz: review: https://github.com/perl6/roast/commit/dd9ef107ba
03:03 raydiak you can use +* instead of $b.elems
03:03 rjbs $b[+*] = 1 # <-- like that?
03:04 rjbs raydiak++ tanks
03:04 rjbs thanks, also
03:04 raydiak yep :)  and you're totally welcome
03:04 raydiak * in numeric context in a subscript evaluates to .elems
03:05 laouji_ joined #perl6
03:05 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:06 rjbs Hm, might be useful, I'll have to revisit the code later.
03:06 rjbs It's late now. I should take out the trash and go to bed.
03:06 rjbs :)
03:06 raydiak sleep well :)
03:06 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?!
03:06 rjbs Thanks :)  Ta ta!
03:06 raydiak haha, darned vacations :)
03:36 mr_ron joined #perl6
03:37 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␤»
03:37 mr_ron sorry - different result on my system
03:42 mr_ron 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.…»
03:42 mr_ron thar it blows
03:47 mr_ron left #perl6
03:49 labster m: my %h; %h{'a';'b'}=3
03:49 camelia rakudo-moar 68c432: ( no output )
03:49 labster no strict bug?
03:51 raydiak m: my %h; %h{'a';'b'}=3; say %h.perl
03:51 camelia rakudo-moar 68c432: OUTPUT«{:a({:b(3)})}<>␤»
03:52 raydiak m: no strict; $a = 1
03:52 camelia rakudo-moar 68c432: ( no output )
03:53 raydiak gr so much lag
03:53 * raydiak goes to play with it in a local terminal
03:56 raydiak and then find myself waiting on rakudobrew instead of flaky wifi :)
03:57 raydiak m: no strict; %h{'a'}=3
03:57 camelia rakudo-moar 68c432: ( no output )
03:58 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.…»
04:02 raydiak wow stage parse is up over 100s for me
04:05 TimToady about the same for me; sure you're not looking at the jvm compile?
04:05 TimToady I mean, no worse here
04:06 TimToady 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
04:06 raydiak only a single window with a single tab open a site I know to be well-behaved
04:07 TimToady cron job?
04:08 raydiak my desktop is a newer revised arrangement of http://data.cyberuniverses.com/pub/screenshot.png
04:08 raydiak mainly, I got a bunch of meters watching everything
04:08 raydiak I know right away when anything goes awry in the background
04:08 TimToady turn on debugging or profiling?
04:08 raydiak I did "rakudobrew build moar"
04:09 raydiak haven't made any changes I know of lately
04:09 raydiak to my system I mean, or env vars
04:09 raydiak or even notable updates
04:09 * TimToady just builds from git
04:09 raydiak I like how it migrates all the panda modules
04:10 raydiak and, well, ... laziness is a virtue, no?
04:10 TimToady maybe it does a parallel make?
04:10 TimToady just guessin'
04:11 TimToady 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
04:11 raydiak it is getting warmer here than it has been
04:11 TimToady could just be that
04:11 TimToady blocking the vent can have that effect too
04:12 raydiak just on a tabletop atm
04:12 raydiak cleaned it out within the last few months
04:12 TimToady recently lose any feet off of it?
04:12 * raydiak looks
04:12 TimToady that can cut the air gap underneath
04:12 raydiak clever, didn't consider that one, but nope
04:13 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
04:13 raydiak yeah me too
04:14 raydiak good game though :)
04:14 TimToady :)
04:14 raydiak unless we fall back to cosmic rays and other improbable unprovable hypotheticals
04:15 raydiak 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 raydiak wish I knew what time to look for in the system logs
04:16 TimToady one of your devices started interrupting continually
04:16 dalek rakudo-star-daily: d00a5fd | coke++ | log/ (2 files):
04:16 dalek rakudo-star-daily: today (automated commit)
04:16 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/d00a5fdf04
04:16 raydiak maybe, but only if somehting's failing, nothing even plugged in besides power
04:16 TimToady your disk is filling your logs with I'm about to go bad messages
04:17 raydiak still 183 gig free
04:17 raydiak wait myh logs arent on that one
04:17 TimToady free space doesn't matter if it's working up toward a head crash
04:18 * TimToady is full of good news... :)
04:18 raydiak :)
04:19 * 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
04:20 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
04:21 raydiak I'll bet that's exactly what happened.
04:22 * 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:23 TimToady well, hope you get to first base then
04:23 TimToady assuming that's the opposite of left field
04:25 raydiak heh thanks, here's hoping that my childhood baseball experiences aren't indicative of my probability of success
04:26 yeahnoob joined #perl6
04:28 laouji joined #perl6
04:30 raydiak off to worry about food and things
04:30 TimToady o/
04:46 quester joined #perl6
04:48 raydiak \o back from the store
04:49 raydiak 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 #perl6
05:05 moritz raydiak: no instant food delivery by drones? :-)
05:05 * raydiak at least found the ~Nil warning at https://github.com/rakudo/rakudo/blob/0fe941622fc374ed4c9c2c0f272968ed270d8478/src/Perl6/Metamodel/BOOTSTRAP.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
05:06 raydiak moritz: no...(thankfully?)
05:06 raydiak though even if there were such a thing around... if we could afford it the car wouldn't be broken :)
05:08 raydiak 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:12 labster_ joined #perl6
05:14 jercos_ joined #perl6
05:14 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 raydiak 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.
05:14 raydiak 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 raydiak was kinda flabbergasted that someone would even pose the question "do vehicles need windows if the computer can see?"
05:15 jdv79_ joined #perl6
05:15 vike1 joined #perl6
05:16 raydiak meant to mention motion sickness too but forgot
05:16 b2gills1 joined #perl6
05:16 mls_ joined #perl6
05:17 [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␤␤»
05:18 [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" }
05:18 camelia rakudo-moar 68c432: OUTPUT«a, q␤b, r␤c, s␤»
05:18 TimToady m: my @a = <a b c>; my @b = <q r s>; for flat @a Z @b -> $q, $t { say "$q, $t" }
05:18 camelia rakudo-moar 68c432: OUTPUT«a, q␤b, r␤c, s␤»
05:18 [Coke] excellent, thanks.
05:18 TimToady it's the 'for no flattens' thing
05:18 TimToady *no longer
05:19 tony-o_ joined #perl6
05:19 jnthn_ joined #perl6
05:19 _thou joined #perl6
05:20 dalek roast: f73c005 | coke++ | integration/advent2009-day17.t:
05:20 dalek roast: fix fallout from "for no longer flattens"
05:20 dalek roast:
05:20 dalek roast: TimToady++
05:20 dalek roast: review: https://github.com/perl6/roast/commit/f73c005382
05:21 El_Che_ joined #perl6
05:21 laouji_ joined #perl6
05:22 vytas` joined #perl6
05:22 dalek rakudo/nom: 2805390 | coke++ | t/spectest.data:
05:22 dalek rakudo/nom: Not actually very stressful
05:22 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/2805390fae
05:23 kaare__ joined #perl6
05:24 [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'?␤␤»
05:24 dalek rakudo/nom: a6f5638 | coke++ | t/spectest.data:
05:24 dalek rakudo/nom: run fudged test
05:24 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/a6f5638ebf
05:25 dalek roast: 0e6aac0 | coke++ | S32-container/cat.t:
05:25 dalek roast: fudge test for rakudo
05:25 dalek roast: review: https://github.com/perl6/roast/commit/0e6aac0adf
05:26 ir2ivps4 joined #perl6
05:26 bayprogrammer_ joined #perl6
05:28 quester joined #perl6
05:30 [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␤»
05:30 [Coke] m: my $str = "abracadabra"; $str ~~ m:exhaustive/ a (.*?) a / && say "@()";
05:30 camelia rakudo-moar 68c432: OUTPUT«@()␤»
05:30 [Coke] m: my $str = "abracadabra"; $str ~~ m:exhaustive/ a (.*?) a / && say $/.perl;
05:30 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 #perl6
05:31 [Coke] oh, wow, that actually works, I think.
05:35 quester left #perl6
05:35 [Coke] Someone more awake than I am can probably fudge t/spec/S05-modifier/exhaustive.t, then.
05:41 Sqirrel joined #perl6
05:46 FROGGS[mobile]2 I attempted to fix it last weekend
05:49 FROGGS joined #perl6
05:56 quester joined #perl6
05:56 diana_olhovik joined #perl6
05:57 domidumont joined #perl6
06:00 espadrine joined #perl6
06:03 domidumont joined #perl6
06:06 _mg_ joined #perl6
06:20 Foxcool joined #perl6
06:26 TimToady .tell jnthn skipping onlystars on CALLER is probably adequate
06:26 yoleaux TimToady: I'll pass your message to jnthn.
06:32 masak morningz, #perl6
06:34 moritz masax, morning
06:44 masak m: my $name = "masak"; say my $alien-name = $name.subst(/k$/, "x")
06:44 camelia rakudo-moar a6f563: OUTPUT«masax␤»
06:44 koo6 joined #perl6
06:49 [Tux] joined #perl6
06:50 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 rakudo-moar a6f563: ( no output )
06:50 masak :D
06:50 FROGGS hehe
06:51 masak jnthn: morning.
06:53 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:53 yoleaux 06:26Z <TimToady> jnthn: skipping onlystars on CALLER is probably adequate
06:53 jnthn well, I get one code review and one no-op in the messages this morning. Not Bad. :)
06:54 FROGGS morning
06:55 dalek rakudo/cunion: 7d46567 | FROGGS++ | t/04-nativecall/13-union. (2 files):
06:55 dalek rakudo/cunion: test inlined CStructs in CUnions
06:55 dalek rakudo/cunion: review: https://github.com/rakudo/rakudo/commit/7d46567f29
06:56 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
06:56 masak nwc10: shhhh!
06:57 masak :P
06:57 masak don't give him ideas!
06:58 larion joined #perl6
06:59 jnthn ooooh! :D
06:59 masak dang.
06:59 masak nwc10: now you've done it... :)
07:00 * 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
07:01 masak how unorthodox
07:03 RabidGravy joined #perl6
07:12 masak oh, I liked the message of this short post: http://boz.com/articles/be-kind.html
07:12 masak "being kind" isn't "being nice"
07:12 Ven joined #perl6
07:35 PZt joined #perl6
07:36 RabidGravy marning
07:38 sergot morning o/
07:45 zakharyas joined #perl6
07:55 berekuk joined #perl6
07:56 virtualsue joined #perl6
08:06 abraxxa joined #perl6
08:07 rindolf joined #perl6
08:08 masak myrnong, RabidGravy, sergocie.
08:08 [Sno] joined #perl6
08:09 Ven joined #perl6
08:09 RabidGravy :)
08:10 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 #perl6
08:12 brrt joined #perl6
08:12 moritz you're on a roll here, right? :-)
08:12 brrt \o
08:12 brrt m: say <a b c>.roll(3)
08:12 camelia rakudo-moar a6f563: OUTPUT«b a c␤»
08:13 * abraxxa just realized that there was no rakudo 2015.04 release
08:13 Ven \o, #perl6
08:13 brrt \o Ven
08:15 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 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
08:16 abraxxa which is 2015.03
08:16 abraxxa i found moarvm 2015.04
08:16 abraxxa and this site also only lists 2015.03: http://rakudo.org/how-to-get-rakudo/
08:16 darutoko joined #perl6
08:17 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)
08:17 masak http://rakudo.org/downloads/rakudo/
08:17 abraxxa that just one click from perl6.org 'Download Rakudo Perl6' link away
08:19 cygx joined #perl6
08:20 cygx o/
08:20 cygx so, how do I open a file in update mode (fopen "r+", perl5 open "+<")?
08:21 poul joined #perl6
08:21 masak not 100% sure that's implemented yet
08:23 masak but open("file", :a) should do it
08:23 fhelmberger joined #perl6
08:23 masak yep, it works. just tried it locally.
08:24 masak $ perl6 -e 'my $h = open("foofile", :a); $h.say: "OH HAI"; $h.close'
08:24 masak $ perl6 -e 'my $h = open("foofile", :a); $h.say: "OH HAI"; $h.close'
08:24 masak $ cat foofile
08:24 masak OH HAI
08:24 masak OH HAI
08:26 cygx ok, can confirm that seems to do it
08:26 cygx it violates convention, though
08:26 masak sounds like you would prefer it to work some other way...?
08:26 masak could you elaborate?
08:29 cygx my confirmation was to soon: while I can seek, I can'T read from the file...
08:29 cygx masak: well, I would have expected :a to work as in POSIX
08:30 masak I'm out of my depth here. I don't know how :a works in POSIX.
08:31 masak but to the extent I understand what you're saying, I agree -- we probably shouldn't be violating POSIX convention.
08:31 masak we're usually quite keen to keep to POSIX convention, in fact.
08:33 larion joined #perl6
08:37 cygx fopen support 6 modes: read-only, write-only(clobber), write-only(append), rw(update), rw(clobber), rW(append)
08:38 cygx (ie r w a r+ w+ a+)
08:45 cygx it's actually MoarVM that only supports 3 modes, not just Rakudo :(
08:48 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
08:49 cygx brrt: yes, 'clobber' should be read as 'truncate first'
08:50 brrt ah ok
08:52 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 #perl6
08:54 donaldh joined #perl6
08:54 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:56 ssqq We could export sub from module, How to export token from grammar?
08:56 masak ssqq: should be the same.
08:56 masak ssqq: but maybe it's enough to declare it `our`?
08:57 masak m: grammar G { our token foo { foo } }; say &G::foo
08:57 camelia rakudo-moar a6f563: OUTPUT«foo␤»
08:57 masak m: grammar G { our token foo { foo } }; say &G::foo.^name
08:57 camelia rakudo-moar a6f563: OUTPUT«Regex␤»
08:57 ssqq thanks, masak
08:57 masak m: grammar G { our token foo is export { foo } }; import G; say &foo.^name
08:57 camelia rakudo-moar a6f563: OUTPUT«Regex␤»
08:57 cygx masak: perl introduced +< and +> for that
08:57 masak cygx: oh!
08:58 masak cygx: can you see a simple tweak to what Rakudo already has that would not violate convention?
08:59 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␤␤»
08:59 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
08:59 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/B5D25gcjfc:1␤␤»
09:01 espadrine joined #perl6
09:02 cygx masak: I guess :a right now actually does what it's supposed to do
09:03 cygx masak: it was you who suggested that it does what I actually need to do (r+)
09:03 cygx ;)
09:03 donaldh cygx masak: as jnthn said, MoarVM and nqp/JVM only really implement what rakudo needs.
09:03 ssqq masak: How to resue a exported token in sub-rule like '/ <Grammar::token> /'
09:03 cygx donaldh: and Rakudo should implement what the user needs
09:03 donaldh e.g. there is no way to open a file read/write/no-truncate as would be needed to mmap  a file.
09:03 timotimo ohai donaldh :)
09:04 nwc10 good *, donaldh
09:04 donaldh o/
09:04 masak cygx: well, you said "violates convention", so I assumed something needed fixing... :)
09:04 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()
09:05 cygx masak: it would have violated convention if your suggestion that I could have... oh, just forget about it ;)
09:05 masak :P
09:05 masak cygx: ENOTENOUGHCOFFEE
09:05 FROGGS joined #perl6
09:05 cygx I need to do an fopen("file", "r+")
09:06 cygx preferably witout going through nativecall ;)
09:07 * masak submits rakudobug
09:09 ssqq m: our token doo { doo }; say 'doo' ~~ &doo
09:09 camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
09:09 ssqq m: grammar G { our token doo { doo }; }; say 'doo' ~~ &G::doo
09:09 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␤␤»
09:09 masak cygx: backlogging, I now see the misunderstanding too. d'oh :)
09:10 ssqq m: our token doo { doo }; say 'doo' ~~ / <doo> /
09:10 camelia rakudo-moar a6f563: OUTPUT«「doo」␤ doo => 「doo」␤»
09:11 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␤␤»
09:12 masak cygx: https://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__)
09:12 arnsholt I'm growing increasingly suspicious if this whole "explicit is better than implicit" thing
09:12 masak arnsholt: wow
09:13 timotimo or does it just mean "python's compiler can usually remove the __class__ variable"?
09:13 moritz arnsholt: is that py2 or py3?
09:13 arnsholt I'm reading the Python 3 docs, but Python 2 allows the same behvaiour, so probably Python 2 too
09:13 masak "explicit is better than implicit [except when we are deliberately trying to pull the wool over your eyes for your own good]"
09:13 nwc10 does Guido have a Rule 2?
09:14 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 =)
09:14 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
09:15 masak s/changes/appears to change/
09:15 arnsholt That's how rule 2 works, isn't it? =)
09:15 masak there's a semantic difference, but I'm not sure it matters.
09:17 arnsholt Oh, looks like I was a bit wrong
09:17 arnsholt __class__ is always there
09:20 arnsholt Aha. __class__ is magically created if it's referred to in a method or super() is called
09:21 timotimo so basically like a $?foo variable in perl6
09:22 ben_m joined #perl6
09:23 arnsholt Yeah, except it can be implicitly created too
09:23 timotimo fair enough
09:23 timotimo so, will snake get this, too? ;)
09:25 arnsholt Not straight away, I think =)
09:26 ssqq when we export token from grammar, How to use it?
09:26 ssqq m: grammar D { our token doo { doo }; }; say 'doo' ~~ &D::doo
09:26 arnsholt Not immediately clear to me where it's implemented in PyPy either
09:26 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␤␤»
09:27 arnsholt Oh well. Time to do actual $dayjob things, I suppose =)
09:29 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␤␤»
09:30 FROGGS m: grammar D { our token doo(Mu:) { doo }; }; say 'doo' ~~ &D::doo
09:30 camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
09:30 FROGGS ssqq: that's not nice, but a workaround
09:31 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␤␤»
09:32 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>'
09:32 camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
09:32 FROGGS with only one colon in that signature
09:32 ssqq FROGGS: I see, thanks
09:34 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:36 FROGGS masak: yes, we fixed the lexical 'my token foo' a while ago, but obviously not that one here
09:36 masak oh, aha.
09:36 FROGGS "yes, it is a bug"
09:36 masak FROGGS: feel free to bugmit a rakudosub.
09:36 masak if you won't, then I will.
09:36 FROGGS I'll do
09:38 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
09:39 masak cygx: can you confirm that with a one-liner?
09:40 cygx I can confirm it with the source ;)
09:40 cygx https://github.com/rakudo/rakudo/blob/nom/src/core/IO/Handle.pm#L68
09:40 FROGGS m: grammar D { token doo(Mu:) is export { doo }; }; import D; say 'doo' ~~ &doo
09:40 camelia rakudo-moar a6f563: OUTPUT«「doo」␤»
09:41 * 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
09:41 FROGGS filed*
09:41 timotimo it'll also allow me to figure out how big the variance is on all the measurements with cachegrind
09:43 masak FROGGS++
09:44 cygx masak: my $f = open("test.txt", :rw); $f.write("hello".encode); $f.seek(0, 0); say $f.read(5).decode
09:44 cygx => Reading from filehandle failed: operation not permitted
09:45 * masak submits rakudobug
09:47 masak cygx: https://rt.perl.org/Ticket/Display.html?id=125170
09:55 timotimo who is hosting synbot6? is that running on a machine that belongs to tadzik?
09:56 timotimo 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:57 timotimo so ... maybe i'll actually put HTML parsing into synbot6 to get the ticket title of an RT bug :\
10:00 laouji_ joined #perl6
10:01 masak timotimo: what's the goal? reacting to RT updates?
10:01 masak timotimo: can't you set up an email address and listen to emails that come in?
10:02 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:05 timotimo and perhaps it'd also be helpful to give the title of a bug if only the URL is posted?
10:05 timotimo but that could end up spammy, maybe?
10:06 masak hm.
10:06 masak my immediate reaction is "yes, probably spammy". returning the URL for the interested feels like the right response.
10:07 masak but I like your initiative, and I can see how getting the title could be helpful as well.
10:07 masak and if it leads to us dogfooding another bot function in Perl 6, who am I to argue? :)
10:07 timotimo hmm
10:13 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…»
10:13 FROGGS note that it spits out "Calling bar() will never work with declared signature (&block)"
10:15 FROGGS though I think a slurpy scalar or callable does not make much sense...
10:15 FROGGS so it would be nice if TimToady could judge on S06-signature/slurpy-blocks.t
10:15 masak slurpy scalars we have.
10:15 masak see S06.
10:15 FROGGS we have?
10:16 FROGGS implemented?
10:16 masak I meant spec.
10:16 masak dunno about implemented.
10:16 FROGGS you meant syn
10:16 masak wouldn't surprise me.
10:16 masak I mean specification 06.
10:16 masak er, synopsis 6.
10:16 FROGGS :P
10:16 masak sorry, I'm old-skool. my brain still thinks "spec".
10:16 masak trying to modernize.
10:17 FROGGS is there a difference between *$foo and $foo?
10:17 FROGGS /?/? ?/
10:17 masak see S06 :)
10:17 masak &
10:19 FROGGS "Slurpy scalars still impose list context on their arguments."
10:20 FROGGS I still dont get it
10:22 FROGGS m: my @a = 1, 2, 3, 4, 5; for @a -> $b?, $c? { say $b, $c }
10:24 camelia rakudo-moar a6f563: OUTPUT«12␤34␤5(Mu)␤»
10:24 FROGGS m: my @a = 1, 2, 3, 4, 5; for @a -> *$b, *$c { say $b, $c }
10:24 camelia rakudo-moar a6f563: OUTPUT«12␤34␤Too few positionals passed; expected 2 arguments but got 1␤  in block <unit> at /tmp/MmFtICPkk7:1␤␤»
10:24 FROGGS I don't understand the difference between slurpy and optional scalars
10:24 tadzik timotimo: no, I have no idea who runs it :D
10:24 tadzik it's a mystery
10:24 d4l3k_ joined #perl6
10:25 FROGGS O.o
10:25 moritz FROGGS: I think slurpy scalars are meant to extract elements from a list
10:25 tadzik maybe it's just self aware
10:36 ilbot3 joined #perl6
10:36 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
10:36 [Tux] joined #perl6
10:37 rvchangue joined #perl6
10:37 poul joined #perl6
10:37 coffee` joined #perl6
10:38 cygx I've started on supporting different modes for open(): https://gist.github.com/cygx/9b64a69fb9dc60d05bd8
10:38 Ven joined #perl6
10:39 cygx this would support all C11 modes as well as the Perl5 ones
10:39 cygx got to go o/
10:39 cygx left #perl6
10:45 mephinet joined #perl6
10:53 andreoss joined #perl6
10:53 bjz joined #perl6
11:00 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:06 abc_ joined #perl6
11:07 literal ben_m: this might help: https://perl6advent.wordpress.com/2009/12/19/day-19-whatever/
11:08 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)
11:08 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.
11:09 masak (or would have done that, rather)
11:09 masak 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 #perl6
11:14 pauluu joined #perl6
11:23 bjz joined #perl6
11:24 ibo2perl6 joined #perl6
11:26 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 #perl6
11:28 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: https://wiki.debian.org/how-can-i-help ) ======
11:29 itz_ New bugs suitable for new contributors (tagged 'newcomer'): - lightdm - https://bugs.debian.org/636108 - lightdm: does not source ~/.profile
11:29 itz_ maybe rakudobrew could print out suggestions based on RT or something?
11:30 masak ibo2perl6: it confuses you that you're able to add more `$` signs at the beginning and nothing happens?
11:30 masak m: my @x = 1, 2, 3; say @x; say @(@x); say @(@(@x))
11:30 camelia rakudo-moar a6f563: OUTPUT«1 2 3␤1 2 3␤1 2 3␤»
11:30 masak m: my @x = 1, 2, 3; say @x; say @@x; say @@@x
11:30 camelia rakudo-moar a6f563: OUTPUT«1 2 3␤1 2 3␤1 2 3␤»
11:31 moritz $ or $(...) is just an itemization
11:31 moritz itemizing an item is a no-op
11:31 moritz and why-oh-why do I always want to misspell 'item' as 'time' or 'itme'?
11:32 masak moritz: because of timing issues between the left and right hands when you type.
11:32 masak 'itme' is right-left-right-left
11:32 masak much easier to type.
11:33 masak 'time' is left-right-right-left and 'item' is right-left-left-right. both somewhat harder to type.
11:35 _mg_ joined #perl6
11:38 telex joined #perl6
11:43 RabidGravy what is "write string requires an object with REPR MVMOSHandle" trying to tell me?
11:45 jnthn RabidGravy: Maybe that you pulled a very busted Rakudo a couple of days ago that failed that way on everything
11:45 jnthn It did so because we modified PROCESS:: during the BEGIN time of a module's pre-comp, which will screw up the standard handles.
11:46 jnthn (We can't really fix that in general, it's just going to have to be one of those pre-comp rules.)
11:46 jnthn Guess it's possible you have a different issue though.
11:47 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
11:47 RabidGravy if I put it in the path and just run it then it does that
11:48 rurban joined #perl6
11:48 RabidGravy the line in question is "say $entry" where $entry is an object with a .gist
11:54 RabidGravy testing with the most recent rakudo
12:06 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:14 RabidGravy Hmm, nope updating rakudo don't fix it
12:18 RabidGravy infact 'say "foo";' gives rise to the same error under the same circumstances
12:20 RabidGravy then doing "use lib 'lib';" in the file fixes it
12:22 RabidGravy oh wait, no it doesn't
12:27 rjbs jnthn: Did you see my kvetch about Linenoise on OS X last night?  Are you the right person to re-kvetch at?
12:28 RabidGravy so, yep something is b0rked because
12:28 RabidGravy #!/usr/bin/env perl6
12:28 RabidGravy use v6;
12:28 RabidGravy use Sys::Lastlog;
12:28 RabidGravy say "foo";
12:28 rjbs jnthn: If I "panda install Linenoise", it installs liblinenoise.dylib, but `perl6` dies when it can't fine liblinenoise.so
12:28 RabidGravy gives me the "write string requires an object with REPR MVMOSHandle"
12:33 ab5tract_ joined #perl6
12:33 arnsholt rjbs: It's a Linenoise.pm bug
12:33 arnsholt (I just looked at the code)
12:34 arnsholt 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. ;)
12:34 rjbs Okay.  So maybe I will install and edit in place, then file a GH ticket..? :)
12:34 arnsholt Try installing a hacked version that chops off the .so part
12:34 rjbs Thanks, trying that now.
12:34 laouji_ joined #perl6
12:35 arnsholt Looking further at the code, there are some hard-coded constant values that may very well be Linux specific
12:35 rjbs :'(
12:35 arnsholt If you run out of patience with Linenoise.pm, there's always rlwrap
12:36 hoelzro oh, my mistake
12:36 hoelzro I didn't realize I'd hardcoded that
12:37 hoelzro will just saying is native('liblinenoise') fix that?
12:37 arnsholt Should, yeah
12:37 Ven m:     sub head(*$head, *@tail)         { return $head }; head(1, 2, 3, 4);
12:37 camelia rakudo-moar a6f563: ( no output )
12:37 Ven m:     sub head(*$head, *@tail)         { say $head }; head(1, 2, 3, 4);
12:37 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.
12:37 camelia rakudo-moar a6f563: OUTPUT«1␤»
12:37 Ven m:     sub head($head, *@tail)         { say $head }; head(1, 2, 3, 4);
12:37 camelia rakudo-moar a6f563: OUTPUT«1␤»
12:37 Ven I'm not sure I get what `*$` does as specified in s06
12:37 arnsholt From memory, it first tries to load the thing as-is, and if that fails it tries to load with shared library extension
12:37 rjbs Should I hack it before installing?
12:38 rjbs (I don't see a .pmc file or anything, should such things exist.)
12:38 arnsholt Which file did you edit?
12:38 arnsholt The .pm installed by panda, or something else?
12:38 rjbs ~/perl6/share/perl6/site/lib/Linenoise.pm
12:38 rjbs which is the path emitted as install destination by panda install
12:38 arnsholt Right, right
12:39 arnsholt In that case, there's probably a precompiled version lying around
12:39 arnsholt Linenoise.moarvm
12:39 hoelzro rjbs: I thought you were also having trouble with panda installing a .so instead of a .dylib?
12:39 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 :)
12:40 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?
12:40 rjbs hoelzro: No, it installed .dylib
12:40 Ven or maybe you were looking at source code
12:40 rjbs There is a .moarvm file, yes.
12:40 arnsholt Ven: https://docs.python.org/3/reference/datamodel.html#customizing-class-creation "__class__ is an implicit closure reference created by the compiler if any methods in a class body refer to either __class__ or super. "
12:40 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?
12:41 Ven arnsholt: thanks
12:41 rjbs The plot worsens...
12:41 rjbs So, I removed the .moarvm, I edited the .pm, and now I get:
12:41 rjbs Cannot locate native library 'liblinenoise.dylib'
12:41 rjbs hoelzro: I will try that.  How do I panda install "the repo whose working tree I'm in"?
12:41 hoelzro rjbs: panda install .
12:41 arnsholt Ven: Also, PEP3135 (which is referenced just below the bit I quoted)
12:41 hoelzro or any directory, for that matter
12:42 rjbs Great, thanks.
12:42 Ven arnsholt: all that sounds pretty bad :/. I'll read up
12:42 hoelzro rjbs: you probably need to tweak the OS X equivalent of LD_LIBRARY_PATH
12:42 hoelzro DYLD_something_or_other, I think
12:42 rjbs I had wondered whether I'd need to do that, thanks.
12:43 andreoss how do i espace * inside list?
12:43 rjbs Where's the github repo?
12:43 laouji_ joined #perl6
12:43 andreoss i need * to be a block inside a list
12:43 jepeway DYLD_LIBRARY_PATH, I think
12:43 rjbs Yes, it's DYLD_LIBRARY_PATH
12:43 hoelzro rjbs: https://github.com/hoelzro/p6-linenoise
12:44 geekosaur please don't.
12:44 geekosaur DYLD_FALLBACK_LIBRARY_PATH if you must, but better is to fix the problem
12:44 hoelzro geekosaur: I was planning on hacking MoarVM to add the share directory to the rpath
12:44 hoelzro I don't know if that'll fix the problem on OS X
12:44 DrForr While I'm thinking of it, should I ask someone to add https://github.com/drforr/perl6-readline ?
12:44 rjbs hoelzro: I'll give you a report in 10-15m.  Time to walk the kid to school!
12:45 rjbs (It worked!  I tested while she got her shoes tied.)
12:45 nwc10 you're fast, or she's not?
12:46 rjbs A little from column A...
12:46 rjbs hoelzro: https://github.com/hoelzro/p6-linenoise/pull/2
12:46 * rjbs & for a bit
12:47 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;
12:47 camelia rakudo-moar a6f563: OUTPUT«False␤»
12:47 andreoss m: my %h = not => not *; %h<not>(True).say;
12:47 camelia rakudo-moar a6f563: OUTPUT«False␤»
12:48 andreoss m: my %h = not => not *, so => so *; %h<not>(True).say;
12:48 camelia rakudo-moar a6f563: OUTPUT«False␤»
12:48 xinming joined #perl6
12:49 arnsholt geekosaur: What is the correct solution, incidentally?
12:50 arnsholt 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 =)
12:51 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:52 geekosaur this may require linking the dylib with -headerpad_max_install_names to leave sufficient room for large paths
12:53 geekosaur 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 masak Ven: I've never used *$param in real code.
12:56 xinming joined #perl6
12:56 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.
12:57 Ven masak: I don't even get what's the purpose :-)
12:57 Ven seems to me `:($, *@)` already works
12:58 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
12:59 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 skids joined #perl6
13:00 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 firefish5000 joined #perl6
13:00 koo6 joined #perl6
13:01 masak "Slurpy scalars still impose list context on their arguments." -- that, and the "treated lazily" thing seem to be the two differences.
13:01 masak m: sub tail(*$head, *@tail) { return @tail }; say tail(1..Inf)
13:01 camelia rakudo-moar a6f563: OUTPUT«␤»
13:01 masak heh :)
13:02 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
13:02 camelia rakudo-moar a6f563: OUTPUT«0␤»
13:02 moritz and binds the argument range to $head
13:02 jepeway shown (I hope) in this commit https://github.com/perl6/roast/commit/dd9ef107ba0151caf61c41d830ea0e0f197a6893
13:02 masak TimToady: this example is straight from S06, and it doesn't work. something is wrong somewhere.
13:02 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
13:02 Ven m: sub f(*$a, *@) { say $a }; f((((0, 1), 2), 3), 4)
13:02 camelia rakudo-moar a6f563: OUTPUT«0 1 2 3␤»
13:02 moritz slurpy scalars are NYI, that's wrong, no?
13:03 Ven masak: ^
13:03 Ven I think the behavior that should happen is that it should be flattened and give out 0, right?
13:08 * rjbs tries to understand how to use install_name_tool for this.
13:09 geekosaur -id to change the dylib's own path
13:10 aborazmeh joined #perl6
13:10 aborazmeh joined #perl6
13:11 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?
13:11 Ven masak: well, I expected that's what "list context" meant there
13:11 masak "list context" is a very weird thing to apply to Perl 6.
13:12 masak it's Perl 5 thinking.
13:12 masak we do have list assignment.
13:12 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
13:13 rjbs geekosaur: Right.  It'd be nice if there was an error on my misuse, I think, but whatever. :)
13:14 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:15 geekosaur since it can't use the embedded path to find it if it wasn't actually linked against it
13:15 geekosaur (as with dynload)
13:16 rjbs input file: /Users/rjbs/perl6/bin/perl6 is not a Mach-O file
13:17 geekosaur right, you need to find the actual executable. that will be a wrapper shell script
13:18 rjbs Gosh, so it is.
13:18 rjbs silly me
13:18 rjbs install_name_tool -add_rpath $PWD  /Users/rjbs/perl6/bin/moar
13:19 rjbs The trick is done.
13:19 rjbs geekosaur++ # medicine man
13:19 geekosaur the powerpc abi went this way for security reasons and apple kept it on porting to intel
13:19 rjbs I will write this experience up.
13:20 rjbs 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!"
13:23 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:25 FROGGS rjbs: panda installs from git (HEAD)
13:25 rjbs Thanks.
13:25 tadzik rjbs: (currently) :)
13:26 tadzik 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.
13:26 [Coke] tadzik++
13:26 tadzik [Coke]: yeah, that's a good plan
13:27 tadzik it will confuse everyone for a while, but it's inevitable
13:27 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?
13:29 hoelzro rjbs: that's...interesting
13:29 * hoelzro tries
13:30 [Coke] "linenoise kind of sucks when you're used to readline"
13:30 hoelzro yes, it kind of does =(
13:30 hoelzro DrForr is working on a readline binding, fortunately
13:30 hoelzro DrForr++
13:31 rjbs I can cope with ^B for now, but yeah.  It's kind of blecherous.
13:31 rjbs 1000% better than "delete and start over" though ;)
13:32 DrForr Feel free to add the github repo https://github.com/drforr/perl6-readline - I'll document it tonight, and I'm sure I'll get a flood of "Please...".
13:33 hoelzro I thought left arrow did work, though
13:39 hoelzro rjbs: left arrow works for me
13:39 hoelzro I haven't tried linenoise on OS X, though
13:39 rjbs hoelzro: It does not work here under iTerm.  I tried changing the terminal type I report to no avail.
13:40 rjbs 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?
13:41 geekosaur hm. iterm2 and tmux should be sending (and expecting) the same thing
13:41 rjbs hoelzro: If you give me instructions, happy to.
13:42 hoelzro ok, hang on
13:42 rjbs Also works under Terminal.
13:43 hoelzro so just not iTerm?
13:43 rjbs This is odd...
13:43 hoelzro indeed
13:43 rjbs If I hit ^V<Left>, I see \eOD - but under tmux, \e[D
13:43 * geekosaur wonders if that is actually the original iTerm... which was rather buggy
13:44 hoelzro are you using iTerm 1 or 2?
13:44 rjbs It's 2.
13:44 hoelzro ok, good =)
13:44 geekosaur also it sounds like you're in application keypad mode
13:44 tadzik hmm, anyone using rakudobrew on windows?
13:44 tadzik orelse, rakudo in general on cygwin?
13:45 geekosaur printf '\033>'
13:46 hoelzro rjbs: compile and run this, please: https://gist.github.com/hoelzro/b84b155f7e7c863aca1c
13:46 geekosaur ^ should switch off application keypad mode
13:46 rjbs I've loaded a different keyboard profile.  Now it works.
13:46 hoelzro type exit to exit
13:46 nwc10 tadzik: libuv doesn't support cygwin, so current rakudo on cygwin could only be via Java, if cygwin has Java
13:46 RabidGravy so, any ideas where to start looking for the reason that simply loading a compiled module might be shagging up $*OUT?
13:47 rjbs hoelzro: It's fine now, but I think it's because of the changed keyboard profile
13:47 hoelzro ok, that's good
13:47 geekosaur yes. something turned on application keypad mode, resetting the keyboard profile turned it back off
13:47 rjbs geekosaur++ # fascinating, had no idea.
13:48 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.
13:49 rjbs At any rate, it's fixed, and I have two ways to fix it should it happen again.
13:49 rjbs I'm gonna repl the hell out of perl6 now.
13:49 geekosaur preferences > profiles > advanced
13:49 rjbs hoelzro++ thanks!
13:49 hoelzro no problem!
13:49 geekosaur check your default profile
13:49 rjbs geekosaur: I did, and that's where I fixed it.
13:49 hoelzro rjbs: btw, you now have tab completion for Perl 6 builtins
13:49 hoelzro and whatever you import, for that matter
13:50 rjbs I look forward to being delighted!
13:50 hoelzro I hope the delight makes up for the pain =)
13:50 rjbs The pain is already made up for.
13:50 muraiki joined #perl6
13:51 rjbs Just knowing that I can edit my repl lines easily is huge peace of mind.  That's been a major drag.
13:54 rjbs 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
13:55 rjbs Okay!
13:56 Ven_ joined #perl6
13:57 tadzik nwc10: ah :(
13:57 rjbs Posted: http://rjbs.manxome.org/rubric/entry/2081
13:57 tadzik nwc10: do you know what's the alternative that works fine?
13:58 nwc10 native Windows?
13:58 RabidGravy Okay, it's something to do with "use System::Passwd"
13:58 tadzik with strawberry perl?
13:58 nwc10 or, more carefully, "native alternative to what?"
13:58 tadzik well, to cygwin
13:59 tadzik 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!
13:59 tadzik I thought cygwin is the way to go
13:59 nwc10 tadzik: er, OK. jnthn builds natively on Windows
13:59 RabidGravy require System::Passwd is fine, use System::Passwd and $*OUT is shagged
13:59 rjbs hoelzro: For now, expect complaints more than fixes, but we'll see how it goes. :-)
13:59 nwc10 and I believe that (at least) FROGGS has also done it, of the active folks ehre
13:59 hoelzro that's fine =)
13:59 rjbs Time to switch back to p5 for workday, though!
14:02 hoelzro could someone on OS X try the new Moar to see if my rpath change helps at all?
14:02 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
14:03 btyler hoelzro: worked without any mucking, just a fresh moar + panda install Linenoise
14:03 hoelzro awesome!
14:04 hoelzro 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 _thou joined #perl6
14:05 masak rjbs++ # puttering with perl6
14:06 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
14:06 * Ven_ starts working on some mop hackery...
14:06 hoelzro btyler: that would be awesome
14:07 FROGGS nwc10: done what?
14:10 btyler awesome how fast it is to rebuild r-m from nothing these days
14:12 tadzik src\strings\unicode.c(45034): fatal error C1026: parser stack overflow, program
14:13 tadzik too complex
14:13 tadzik thanks, microsoft :(
14:13 FROGGS O.o
14:13 FROGGS tadzik: you've got HEAD?
14:13 tadzik FROGGS: yep
14:13 FROGGS because there was a fix for that lately
14:13 tadzik fresh from rakudobrew
14:13 FROGGS what's your cl version?
14:14 tadzik or perhaps it's actually using MOAR_REVISION which wasn't bumped?
14:14 tadzik it mite be
14:14 FROGGS yeah, possible
14:16 dalek nqp: 59601a2 | FROGGS++ | tools/build/MOAR_REVISION:
14:16 dalek nqp: bump moar rev, possible win32 build fix
14:16 dalek nqp: review: https://github.com/perl6/nqp/commit/59601a26b9
14:16 tadzik yay
14:16 dalek rakudo/nom: 0f3f80c | FROGGS++ | tools/build/NQP_REVISION:
14:16 dalek rakudo/nom: bump nqp/moar rev, possible win32 build fix
14:16 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0f3f80c3f6
14:17 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«[]<>␤»
14:18 tadzik FROGGS: same thing, it seems
14:18 Ven_ not sure why this is empty? are attributes not yet there?
14:18 FROGGS lemme test it
14:18 FROGGS Ven_: that trait probably runs too early for attrs to show up
14:19 Ven_ FROGGS: alright. what should I do instead?
14:19 FROGGS Ven_: write a sub that receives an object and serializes it?
14:20 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?
14:21 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 #perl6
14:21 FROGGS :o(
14:21 FROGGS tadzik: I'm building now HEAD...
14:22 FROGGS tadzik: I've got ActivePerl 64bit and cl 17.0 btw
14:23 tadzik cl?
14:23 tadzik I
14:23 tadzik I'm on strawberry, not sure if that matters
14:23 FROGGS tadzik: that probably matters
14:23 tadzik huh
14:24 FROGGS cl is the c compiler from Visual Studio (Express)
14:24 ugexe ive built on windows with strawberry perl + msvc
14:25 tadzik hmm, I'm running 2015 RC
14:25 FROGGS ohh, wow
14:25 FROGGS such new
14:25 tadzik version 19.00.22816
14:25 tadzik I guess it's worse :P
14:26 FROGGS well, if it is an RC it might not be bug free .o)
14:26 FROGGS :o)
14:26 FROGGS but I have no experience how good cl RC's are
14:28 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:29 FROGGS tadzik: "Rakudo has been built and installed."
14:30 FROGGS[mobile] joined #perl6
14:32 brrt left #perl6
14:32 colomon hey, who’s planning on going to the Swiss Perl Workshop in August?
14:32 colomon besides TimToady++
14:33 FROGGS[mobile] colomon: I am
14:33 colomon cool
14:35 masak I'm thinking of going.
14:35 colomon also cool.
14:35 masak (it's in my work schedule, valiantly defending itself against intruders)
14:35 FROGGS[mobile] I'll most likely fly
14:36 masak I've always wanted to ride there across the alps.
14:36 masak on a giant squirrel.
14:36 rjbs tadzik: So all the dylib futzing is now oboslete with an upgraded rakudobrew and fresh brewed moar?
14:36 masak decommute &
14:36 btyler rjbs: that was my experience just now with OSX 10.10
14:36 colomon If my Swiss clients come up with a good reason to fly me out there in late August…
14:36 rjbs masak: https://youtu.be/Czy0pXRRZcs?t=334
14:37 colomon afk # but will check back in
14:37 tadzik rjbs: so I've heard :)
14:37 * rjbs updates his blog post.
14:37 tadzik rjbs: no rakudobrew update should be necessary though
14:37 rjbs Oh?
14:37 tadzik rakudobrew always fetches the lastest rakudo
14:38 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
14:38 tadzik MoarVM, actually
14:38 tadzik I hope MOAR_REVISION covers that patch
14:38 tadzik FROGGS just bumped it, so it should :)
14:38 rjbs Okay!
14:38 tadzik can't test it myself, since my visual studio is too bleeding edge :);
14:39 tadzik rjbs: where's that blog post of yours? I don't see it on bpo or ironman
14:40 rjbs http://rjbs.manxome.org/rubric/entry/2081
14:40 tadzik ceers
14:40 rjbs It's only half an hour old, probably ironman hasn't updated.
14:41 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
14:42 RabidGravy I've sent a patch to the author, but I suspect that the problem is deeper than that
14:44 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 #perl6
14:45 andreoss should it die even inside try/catch ?
14:45 andreoss m: try { fail ; CATCH { say "ok" }}; say "...";
14:45 camelia rakudo-moar a6f563: OUTPUT«ok␤Died␤  in block <unit> at /tmp/QRQKrF6e_S:1␤␤»
14:46 ugexe you need a default block
14:46 ugexe m: try { die ; CATCH { default {say "ok"} }}; say "...";
14:46 camelia rakudo-moar a6f563: OUTPUT«ok␤...␤»
14:47 ugexe if you dont plan to properly catch/handle or do anything with the error you just do try { die ; } or  say "...";
14:48 andreoss http://design.perl6.org/Differences.html
14:48 andreoss probably deprecated syntax for CATCH here, since no pattern matching inside CATCH
14:48 ash__ joined #perl6
14:49 ugexe well warn is not say
14:49 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␤␤»
14:49 hoelzro btyler: interesting...thanks for trying that out
14:49 hoelzro ooooh
14:49 hoelzro I think I know why
14:50 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
14:51 hoelzro but if you dlopen (or whatever it is on OS X), it doesn't need that path
14:57 Ven_ joined #perl6
14:59 Ven_ FROGGS[mobile]: ended up with a sub indeed.
15:01 Ven_ Should I release those 3 lines in something like "Serialize::Tiny"?
15:04 fhelmberger joined #perl6
15:05 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 #perl6
15:06 cygx o/
15:06 hoelzro o/ cygx
15:08 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?
15:08 FROGGS[mobile] I should probably bug jnthn++ tomorrow
15:09 FROGGS[mobile] Ven_: go ahead
15:09 Ven_ alright. I can just remove it if needed later anyhoo
15:09 FROGGS[mobile] my code relies on the currently used compiler anyway
15:15 gfldex joined #perl6
15:16 dalek ecosystem: 58d8c4f | (Jonathan Stowe)++ | META.list:
15:16 dalek ecosystem: Added Sys::Lastlog
15:16 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/58d8c4fdf8
15:20 FROGGS joined #perl6
15:21 grondilu joined #perl6
15:22 cygx I opened some pull requests that need discussion (changed to the API) as well as testing
15:22 cygx https://github.com/MoarVM/MoarVM/pull/215 https://github.com/rakudo/rakudo/pull/425
15:22 cygx * changes
15:23 pat_js joined #perl6
15:28 FROGGS jnthn: would it be possible to tackle the serialization problem tomorrow?
15:31 rindolf joined #perl6
15:35 Ven_ FROGGS: do we have some META.info docs?
15:35 Ven_ (i.e. is `depends` needed)
15:41 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 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?
15:43 cygx I actually had it as a named argument first
15:43 cygx then, I thought: let's make it optional instead and save some typing ;)
15:44 Celelibi joined #perl6
15:44 Ven_ FROGGS: https://github.com/vendethiel/Serialize-Tiny.pm6
15:46 [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?
15:46 cygx *should it be
15:51 dalek ecosystem: 5a02edd | ven++ | META.list:
15:51 dalek ecosystem: Add Serialize-Tiny
15:51 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/5a02edd1a4
15:51 FROGGS jnthn: yes, exactly
15:51 jnthn FROGGS: Sure, we can.
15:51 FROGGS Ven_: look at others in the modules list
15:51 Ven_ FROGGS: sorry?
15:52 FROGGS Ven_: to see how a good META.info looks like
15:52 Ven_ FROGGS: yes yes, that's what I ended up doing :) https://github.com/perl6/ecosystem/commit/5a02edd1a42434a95339ba9ae8294fa07cba1e0b
15:52 FROGGS S22 talks about it, but we are not there yet
15:53 dalek perl6-examples: ebdddb0 | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
15:53 dalek perl6-examples: minor refactoring, added booleans
15:53 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/ebdddb0ea8
15:53 dalek perl6-examples: 35d4a0c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
15:53 dalek perl6-examples: [interpreters] handle booleans, added tests
15:53 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/35d4a0c0e6
15:53 dalek perl6-examples: da5775c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
15:53 dalek perl6-examples: [interpreters] fix floats
15:53 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/da5775cd8b
15:59 domidumont joined #perl6
16:00 eli-se joined #perl6
16:01 abraxxa rakudobrew build-panda fails on 2015.04
16:01 abraxxa 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)
16:01 abraxxa build stage failed for panda: Failed building lib/Panda/Ecosystem.pm
16:07 abraxxa No such method 'clone' for invocant of type 'NQPArray'
16:11 eternaleye joined #perl6
16:17 abraxxa works on nom
16:17 * PerlJam just did
16:17 PerlJam rakudobrew build moar
16:18 PerlJam and is sitting here waiting on the results of "==> Reinstalling Linenoise"
16:18 dalek mu: 3e351e0 | (Andrei Osipov)++ | docs/Perl6/Perl5/Differences.pod:
16:18 dalek mu: Fix depricated syntax in CATCH block
16:18 dalek mu: review: https://github.com/perl6/mu/commit/3e351e0276
16:18 PerlJam which seems to be taking a really long time
16:18 andreoss ugexe: i've fixed it
16:21 Sqirrel joined #perl6
16:28 _mg_ joined #perl6
16:31 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:34 jnthn Most obfuscated way to write my @x = 6..10 ever :P
16:34 jnthn Well, roundabout way, anyway :)
16:35 kaare_ joined #perl6
16:35 * TimToady suspects there's a bug there somewhere
16:35 TimToady or a NYI
16:36 jnthn Does take evaluate the the value you take, or just Nil?
16:36 jnthn That'd explain it nicely if the latter...
16:36 TimToady take is supposed to return the same value it took
16:36 jnthn hm, and looking at control.pm it does
16:37 jnthn I don't understand the semantics of andthen, so... :)
16:37 TimToady it's 'and' with topicalization of the lhs result, more or less
16:37 jnthn m: my @x = gather take $_ and last if $_ > 5 for 1...10; say @x;
16:37 camelia rakudo-moar 0f3f80: OUTPUT«6␤»
16:37 jnthn ah
16:38 jnthn so pointlessly used here
16:38 _mg_ joined #perl6
16:38 jnthn (as in, "and" does just fine too)
16:38 TimToady right
16:38 TimToady and 'andthen' is still a WIP
16:38 jnthn m: say 1 andthen 2
16:38 camelia rakudo-moar 0f3f80: OUTPUT«1␤»
16:38 jnthn m: say 1 andthen (say 'omg')
16:38 camelia rakudo-moar 0f3f80: OUTPUT«1␤omg␤»
16:38 jnthn hm :)
16:38 andreoss m: say (1 andthen 2)
16:38 camelia rakudo-moar 0f3f80: OUTPUT«2␤»
16:38 jnthn h
16:38 jnthn *oh
16:39 jnthn 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␤»
16:39 jnthn hm, not prec :)
16:40 jnthn hm, is andthen a way to chain method calls? :P
16:40 jnthn .foo andthen .bar andthen .baz :)
16:40 TimToady kinda, but mostly intended for logic programming someday
16:40 jnthn ok
16:40 TimToady using lazy lists like STD does
16:40 TimToady where I wished I had 'andthen' :)
16:42 andreoss my @x = gather take $_ andthen (say "last" if $_ > 5)  for 1...10; say @x;
16:42 andreoss m: my @x = gather take $_ andthen (say "last" if $_ > 5)  for 1...10; say @x;
16:42 camelia rakudo-moar 0f3f80: OUTPUT«last␤last␤last␤last␤last␤1 2 3 4 5 6 7 8 9 10␤»
16:42 andreoss m: my @x = gather take $_ andthen (last if $_ > 5)  for 1...10; say @x;
16:42 camelia rakudo-moar 0f3f80: OUTPUT«1 2 3 4 5 6 7 8 9 10␤»
16:44 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:45 TimToady where $C is the current cursor, but we're continually having to retopicalize (if $C is the topic here)
16:47 TimToady and orelse is the flip side, except it topicalizes to $! instead, iirc
16:48 TimToady I also wanted to differentiage 'orelse' from p5's 'dor', which I view as a bit of a mistake
16:51 jnthn .oO( d'or )
16:52 raiph joined #perl6
16:55 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.…»
16:56 TimToady did that one ever get RT'd?
16:56 jnthn Never seen it before
16:56 jnthn It only shows uup under "no strict"?
16:57 TimToady yeah, the first arg to .{} ends up Mu
16:57 jnthn hm
16:57 TimToady and works with $ instead
16:57 TimToady so % isn't auto-creating somehow
16:57 jnthn Yeah
16:58 jnthn BTW, is "no strict" in the REPL intentional?
16:58 TimToady I did not participate in that discussion :)
16:58 jnthn OK. I don't like it being :P
16:59 jnthn Means typo = annoying, instead of helpful error.
16:59 jnthn Which sucks if you're doing live demos. :)
16:59 TimToady I agree
16:59 Ulti +1 for strict in REPL I'd want the REPL environment to be near enough the same as a script executing
16:59 TimToady esp if you can just arrow up and add the 'my'
16:59 jnthn OK, I'll prolly make it so tomorrow.
16:59 jnthn Right. :)
16:59 jnthn I can up arrow fine on Windows :D
17:00 jnthn 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
17:01 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 ?
17:01 jnthn ben_m: "require 'file'" I think
17:01 TimToady um....'use'?
17:01 jnthn Or use :)
17:01 jnthn require I guess doens't import them :)
17:02 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.
17:02 jnthn But yeah, module works out fine.
17:02 jnthn > use Test;
17:02 jnthn > plan 1
17:02 jnthn 1..1
17:02 Ulti I was hoping the REPL would *justwork* with my Slang so that I could do perl6 -MBioInfo to have an augmented REPL
17:02 ben_m Could've just tried that I suppose, thanks.
17:02 jnthn Ulti: I think it should already?
17:03 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 Ulti was a while ago though
17:04 cygx I think I'll get rid of an explicit mode argument to open and just add more named parameters
17:05 cygx the list of flags: https://gist.github.com/cygx/89984bc8b82c4609d280
17:07 jnthn cygx: Looks sensible at first glance.
17:08 * TimToady sics the masakbot on the 'no strict' bug
17:09 * jnthn suspects the masakbot is at the same dinner that he's on the train to... :)
17:10 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!
17:11 jnthn I've more than enough of those already to look at. :)
17:12 jnthn 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:13 jnthn TimToady: There's an RT complaining about .assuming not working on Block
17:13 jnthn TimToady: In S06 it suggests it lives on the Callable role...
17:13 jnthn But there's not much precedent for putting anything else on there... :)
17:13 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 #perl6
17:14 jnthn Callable is just of/returns
17:14 jnthn hoelzro: No idea without looking into it a bunch more, sorry.
17:14 hoelzro no worries
17:14 hoelzro guess I'll have to go with my do { PRE { ... } } workaround =/
17:15 jnthn TimToady: I could imagine putting assuming in Block, or maybe in Code (the latter is the type of thunks)
17:15 jnthn Any preference?
17:16 domidumont joined #perl6
17:17 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
17:18 TimToady 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
17:19 dnmfarrell TimToady: jnthn thanks! let me try those
17:19 jnthn uh, dynvar :)
17:19 * TimToady still thinks some of our internal dynvar usage is a bit smelly
17:19 diana_olhovik_ joined #perl6
17:20 TimToady $*ACTIONS is probably slowing down the parser, both directly and through opportunity cost to the optimizer
17:22 jnthn TimToady: Indeed, also by making a polymorphic callsite
17:22 TimToady and language braids probably should be coming in through cursors, not %*LANG
17:22 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
17:22 TimToady but that's more about correctness than speed, I'll warrant
17:23 jnthn TimToady: So it becomes monomorphic and so inlinable/specializable
17:23 jnthn So yeah, it is sub-optimial in 2 ways to do actions as $*ACTIONS
17:23 TimToady one would eventually like the action code to just be a kind of wrapper for an inlined parse rule, maybe
17:24 TimToady 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.
17:24 jnthn And spehs can decide if inlining is worth it.
17:25 jnthn *spesh
17:25 TimToady nod, so probably equivalentish
17:25 jnthn Aye
17:25 jnthn It'd also fix that RT about spurious calls when .parse is not passed a :actions
17:27 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 TimToady which I talked about in one of the apos but never got much traction
17:27 TimToady I suppose people would call that the expression problem nowadays
17:28 TimToady kinda touche on AOP too
17:28 TimToady *es
17:29 jnthn I'm kinda touché on AOP also :P
17:29 TimToady AOP is one of those half-paradigms :)
17:29 TimToady I'd put DBC in the same category
17:30 TimToady or maybe they're only a third of a new paradigm...hard to quantify that...
17:34 eli-se joined #perl6
17:34 eli-se hi
17:44 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
17:45 TimToady or did you wish to ignore leap seconds?
17:46 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 nwc10 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
17:47 nwc10 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 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?
17:48 nwc10 aha, thanks.
17:49 nwc10 I think that it's Ascention
17:49 nwc10 I cant spell
17:50 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␤␤»
17:52 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␤␤»
17:52 TimToady m: say now - DateTime.new("2000-01-01T00:00:00Z").Instant
17:52 camelia rakudo-moar 0f3f80: OUTPUT«484854764.793363␤»
17:52 TimToady that's in atomic time, including leap seconds
17:52 nwc10 m: say now - DateTime.new("2000-01-01T00:00:00Z").Instant
17:52 camelia rakudo-moar 0f3f80: OUTPUT«484854783.420377␤»
17:53 jnthn detrain; bbl &
17:54 TimToady m: say time - DateTime.new("2000-01-01T00:00:00Z").posix
17:54 camelia rakudo-moar 0f3f80: OUTPUT«484854892␤»
17:55 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.
17:56 nwc10 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␤␤»
17:56 nwc10 bother. what did I mess up...
17:56 TimToady copied my syntax error
17:56 TimToady move the ) inside .Instant
17:57 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␤»
17:57 nwc10 and now I go check to see if there were 3 leap seconds...
17:58 nwc10 oh yes. and I should repeat this in about 6 weeks. :-)
17:58 TimToady yes, drat it
17:59 TimToady (Lords a Leaping)--
18:07 TimToady 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␤»
18:08 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
18:08 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 TimToady oops
18:09 TimToady m: my @a = ^100; my @p = map { start { [ @a ] } }, ^10; say @p».result».elems
18:09 camelia rakudo-moar 0f3f80: OUTPUT«100 100 100 100 100 100 100 100 100 100␤»
18:09 TimToady m: my @a = ^100; my @p = map { start { [ @a ] } }, ^10; say @p».result».elems
18:09 camelia rakudo-moar 0f3f80: OUTPUT«100 100 100 100 100 100 100 100 100 100␤»
18:09 TimToady well, I won't spam that more
18:10 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:11 RabidGravy I think that is somewhat broken
18:12 dalek perl6-roast-data: 4a92e9b | coke++ | / (9 files):
18:12 dalek perl6-roast-data: today (automated commit)
18:12 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/4a92e9bb45
18:13 RabidGravy It does *not* happen if non-compiled versions of the files are loaded
18:13 TimToady weird
18:14 dolmen joined #perl6
18:14 RabidGravy I'll rakudobug it, but just wondered if anyone had a theory as to what is going on with that
18:15 TimToady does it also fail if you write directly to $PROCESS::OUT?
18:15 cygx RabidGravy: known
18:15 cygx I already submitted that
18:15 cygx (I think - let me check)
18:15 cygx https://rt.perl.org/Public/Bug/Display.html?id=125090
18:15 TimToady would be nice to know if the problem is in the dynvars or in PROCESS
18:20 TimToady 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 :
18:20 RabidGravy Two terms in a row
18:20 RabidGravy at ./tt:5
18:20 RabidGravy ------> $PROCESS::OUT.say⏏"foo");
18:21 TimToady needs a :
18:21 TimToady m: $PROCESS::OUT.say: "foo"
18:21 camelia rakudo-moar 0f3f80: OUTPUT«foo␤»
18:21 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 #perl6
18:22 RabidGravy ah yes, okay it's not weirder than that
18:22 RabidGravy the result is however the same
18:22 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.
18:22 timotimo dunno
18:22 timotimo just musing, really
18:23 rjbs Okay!
18:23 TimToady okay, so not really a dynvar problem, but a PROCESS setup issue, likely
18:23 * timotimo afk for a bit again
18:24 telex joined #perl6
18:25 molaf joined #perl6
18:27 fhelmberger joined #perl6
18:28 grondilu Range div Int dies uglily.
18:28 grondilu m: say ^10 div 3
18:28 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␤␤»
18:28 grondilu hum, wait.
18:29 grondilu I had "Unimplemented spesh ops hit" locally.
18:29 grondilu it may be because I'm currently compiling Moar, though.
18:31 grondilu in any case, why does ^10 div 3 look for infix:<div> with ten Int as parameters?
18:31 grondilu m: say (^10) div 3
18:31 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␤␤»
18:32 grondilu that's just weird
18:32 colomon grondilu: because it numifies the range, which has 10 numbers in it
18:32 colomon oh!
18:32 colomon guess it’s not, that’s a bug, I think
18:33 colomon m: say ^10 + 1
18:33 camelia rakudo-moar 0f3f80: OUTPUT«11␤»
18:33 colomon m: say ^10 div 1
18:33 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␤␤»
18:33 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
18:34 grondilu like "cutting a range in $n parts"
18:34 _mg_ joined #perl6
18:34 grondilu basically like the "cut" sub I wrote for http://rosettacode.org/wiki/Mandelbrot_set#Perl_6
18:35 moritz infix:<div> is specifically for meant for two operands of the same type
18:36 grondilu ok
18:36 grondilu infix:</> then?
18:36 moritz m: sub cat(Int() $parts, *@e) { @e.rotor((@e / $parts).ceiling) }; say cut 3, ^10
18:36 grondilu m: say ^10 / 3
18:36 camelia rakudo-moar 0f3f80: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_mhDGwXXc7␤Undeclared routine:␤    cut used at line 1. Did you mean 'cat'?␤␤»
18:36 camelia rakudo-moar 0f3f80: OUTPUT«3.333333␤»
18:36 moritz m: sub cut(Int() $parts, *@e) { @e.rotor((@e / $parts).ceiling) }; say cut(3, ^10).perl
18:36 camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2, 3), (4, 5, 6, 7))␤»
18:36 moritz m: sub cut(Int() $parts, *@e) { @e.rotor((@e / $parts).floor) }; say cut(3, ^10).perl
18:36 camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤»
18:37 moritz better
18:37 grondilu that's not quite what I had in mind though.
18:38 grondilu I was thinking of cutting a Range in $n intervals of equal length.
18:38 moritz oh
18:39 TimToady maybe Range.rotor should be returning ranges
18:41 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␤»
18:41 PerlJam .oO( Range.rover? )
18:42 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␤»
18:42 TimToady hmm
18:42 TimToady hyper seems to be losing the ()s
18:42 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
18:42 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 #perl6
18:43 grondilu (Rat FTW)
18:44 TimToady m: say (^10).rotor(3).map: *.minmax
18:44 camelia rakudo-moar 0f3f80: OUTPUT«0 1 2 3 4 5 6 7 8␤»
18:44 TimToady m: say (^10).rotor(3).map(*.minmax).perl
18:44 camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8)␤»
18:44 TimToady hmm
18:45 TimToady m: say (^10).rotor(3).perl
18:45 camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤»
18:45 TimToady who's losing the ()s?
18:45 TimToady m: say (^10).rotor(3).map({$_}).perl
18:45 camelia rakudo-moar 0f3f80: OUTPUT«((0, 1, 2), (3, 4, 5), (6, 7, 8))␤»
18:46 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)␤»
18:46 TimToady m: say (^10).rotor(3).map((*.minmax,)).perl
18:46 camelia rakudo-moar 0f3f80: OUTPUT«Method 'count' not found for invocant of class 'Parcel'␤  in block <unit> at /tmp/_wS9dpZFPk:1␤␤»
18:46 TimToady m: say (^10).rotor(3).map(({.minmax)}).perl
18:46 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…»
18:46 TimToady m: say (^10).rotor(3).map({.minmax)}).perl
18:46 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…»
18:46 TimToady m: say (^10).rotor(3).map({.minmax}).perl
18:47 camelia rakudo-moar 0f3f80: OUTPUT«(0, 1, 2, 3, 4, 5, 6, 7, 8)␤»
18:47 TimToady weird
18:47 TimToady m: say (^10).rotor(3).map({.minmax.WHAT}).perl
18:47 camelia rakudo-moar 0f3f80: OUTPUT«(Range, Range, Range)␤»
18:48 TimToady who's flattening the ranges?
18:49 TimToady m: say (0..2, 3..5, 6..8).perl
18:49 camelia rakudo-moar 0f3f80: OUTPUT«(0..2, 3..5, 6..8)␤»
18:49 timotimo m: say (^10).rotor(3).map({.WHAT}).perl
18:49 camelia rakudo-moar 0f3f80: OUTPUT«(Parcel, Parcel, Parcel)␤»
18:49 timotimo m: say (^10).rotor(3).map({.perl}).perl
18:49 camelia rakudo-moar 0f3f80: OUTPUT«("(0, 1, 2)", "(3, 4, 5)", "(6, 7, 8)")␤»
18:49 timotimo so the result of the ranges of minmax gets flattened again?
18:50 timotimo 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)␤»
18:50 timotimo m: say (^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)␤»
18:50 timotimo m: say (^3).map({(1, 2, 3)}).perl
18:50 camelia rakudo-moar 0f3f80: OUTPUT«((1, 2, 3), (1, 2, 3), (1, 2, 3))␤»
18:50 TimToady tres weird
18:52 TimToady 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)␤»
18:52 TimToady m: say (^3).map({(^5).item}).perl
18:52 camelia rakudo-moar 0f3f80: OUTPUT«(0..^5, 0..^5, 0..^5)␤»
18:52 TimToady something is flattening there that shouldn't oughta
18:54 TimToady m: say {^5}().perl
18:54 camelia rakudo-moar 0f3f80: OUTPUT«0..^5␤»
18:54 TimToady must be the map, I guess
18:59 [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.
19:00 TimToady well, we're still mid-GLR here
19:01 TimToady m: say (1..5,42).list.perl
19:01 camelia rakudo-moar 0f3f80: OUTPUT«(1, 2, 3, 4, 5, 42)␤»
19:01 TimToady .list is flattening ranges
19:01 TimToady I wonder what depends on that behavior...
19:03 * nwc10 awaits dalek with the "let's find out" commit...
19:04 TimToady hafta figger out where it's doing it, first...it's down in the nqp/vm level somewhere, I think
19:05 timotimo so, p6list or something?
19:05 TimToady which means nqp might be depending on it
19:05 timotimo as in, nqp::p6list?
19:05 timotimo do we even have ranges in nqp?
19:05 FROGGS that's extops, no?
19:05 TimToady dunno, offhand
19:06 TimToady brane is runnin low on nutriments
19:06 FROGGS there are no ranges in nqp
19:06 TimToady well, I still suspect that .list is badly overloaded to mean more than one thing here
19:09 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 #perl6
19:10 arnsholt Bug didn't trigger for my test user locally, since that user had id=1...
19:10 FROGGS eww
19:10 hobbs that's why all test users should have id=42
19:10 arnsholt Good point, good point
19:11 arnsholt Lesson learned, I guess =)
19:11 berekuk joined #perl6
19:11 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? :)
19:12 TimToady as long as 42 also numifies to 1, there's no problem :)
19:14 berekuk joined #perl6
19:19 DrForr Of course it does... in the correct base.
19:19 TimToady all those bases am not belong to us
19:20 mst all those base amn't belong to us # scans better
19:42 mohij joined #perl6
19:49 cygx more modes for opening files, v2: https://github.com/rakudo/rakudo/pull/426
19:53 rurban joined #perl6
20:08 PerlJam cygx++
20:11 laouji joined #perl6
20:14 PerlJam cygx: What's the distinction between $mode and $llmode?  Why have both?
20:17 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 cygx PerlJam: I let the multi-dispatcher handle that instead of putting a given or a hash inside the method
20:18 cygx PerlJam: that's why that open is a private method as its signature is an implementation detal
20:18 cygx *detail
20:18 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:20 cygx PerlJam: if I omit either of the mode arguments, there's no way around implementing another lookup mechanism
20:24 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:28 cygx PerlJam: it's also part of the error message of the `$!path eq '-'` branch in guise of $_
20:29 cygx so you either have to live with a worse error message, or implement a new lookup mechanism just for that single case
20:30 PerlJam or make nqp::open() use Perl6y modes natively :)
20:31 cygx PerlJam: but what, if for whatever reason, I wanted to open a file in mode -cax
20:34 colomon joined #perl6
20:38 FROGGS m: if 0 -> $a { } else -> $b { say $b }
20:38 camelia rakudo-moar 0f3f80: OUTPUT«0␤»
20:38 PerlJam cygx: I guess you've struck a good balance then.
20:39 FROGGS m: my $i = 0; if $i -> $a { } elsif $i++ -> $b { } else -> $c { say $c }
20:39 camelia rakudo-moar 0f3f80: OUTPUT«0␤»
20:40 FROGGS m: my $i = 0; if $i -> $a { } elsif Str -> $b { } else -> $c { say $c }
20:40 camelia rakudo-moar 0f3f80: OUTPUT«(Str)␤»
20:40 FROGGS nice
20:41 lizmat joined #perl6
20:42 * lizmat waves from Echt
20:43 [Coke] hio, lizmat
20:43 FROGGS m: my x; repeat while $x < 10 { say $x++ }
20:43 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++ }␤»
20:43 FROGGS m: my $#x; repeat while $x < 10 { say $x++ }
20:43 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++ }␤»
20:43 FROGGS m: my $x; repeat while $x < 10 { say $x++ }
20:43 camelia rakudo-moar 0f3f80: OUTPUT«0␤1␤2␤3␤4␤5␤6␤7␤8␤9␤»
20:43 FROGGS hi lizmat
20:43 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)
20:43 DrForr m: sub foo ( Int ) returns Int returns Int { 1 }
20:43 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…»
20:44 lizmat FROGGS [Coke] o/
20:44 eli-se joined #perl6
20:45 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␤»
20:45 TimToady FROGGS: I'd write it ^^
20:45 TimToady that's one of the main reasons we allow the conditional at the front, despite testing it at the end
20:46 * PerlJam isn't sure why ...
20:47 PerlJam m: my $i = 0; if $i -> $a { } elsif Str -> $b { } else -> $c { say $c }
20:47 camelia rakudo-moar 0f3f80: OUTPUT«(Str)␤»
20:47 PerlJam says (Str)
20:48 FROGGS TimToady: yes yes... I'm just testing things :o)
20:48 TimToady nod
20:48 FROGGS I need an inspiration to do something today
20:48 FROGGS though, not much time left
20:51 yqt joined #perl6
20:52 dalek rakudo/nom: 8e8936b | coke++ | t/spectest.data:
20:52 dalek rakudo/nom: run fudged test
20:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8e8936bb97
20:54 zengargoyle else has the thing that failed the previous if test.
20:55 PerlJam zengargoyle: yeah, re-reading S04 now
20:55 zengargoyle i think i remember reading it somewhere and it making sense.. :)
20:55 PerlJam It's a nuance I hadn't had a care to ever use or think about.
21:02 cygx_ joined #perl6
21:03 cognominal joined #perl6
21:03 Gruber joined #perl6
21:04 rivarun joined #perl6
21:05 sjn__ joined #perl6
21:05 moritz_ joined #perl6
21:05 Pauekn_ joined #perl6
21:05 pmichaud_ joined #perl6
21:05 betterworld joined #perl6
21:05 krunen_ joined #perl6
21:07 petercom1and joined #perl6
21:08 Hor|zon_ joined #perl6
21:09 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␤»
21:09 tony-o_ m: my $p = start { sleep 1; say $*SET; }; our $*SET = 5; await $p;
21:09 camelia rakudo-moar 0f3f80: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
21:10 RabidGravy joined #perl6
21:10 |Tux| joined #perl6
21:10 tictac joined #perl6
21:11 muraiki joined #perl6
21:14 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:20 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:26 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 Peter_R joined #perl6
21:27 dalek perl6-examples: 013b0fc | paultcochrane++ | categories/cookbook/09directories/09-0 (5 files):
21:27 dalek perl6-examples: [cookbook] Correct minor whitespace issues
21:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/013b0fca1f
21:27 dalek perl6-examples: e290958 | paultcochrane++ | categories/cookbook/10subroutines/10-01arguments.pl:
21:27 dalek perl6-examples: [cookbook] loop over sorted hash keys for output consistency
21:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/e290958745
21:27 dalek perl6-examples: df763c1 | paultcochrane++ | categories/cookbook/10subroutines/10-01arguments.pl:
21:27 dalek perl6-examples: [cookbook] replace tabbed output with spaces
21:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/df763c181e
21:27 dalek perl6-examples: 15e77c3 | paultcochrane++ | t/categories/cookbook/10subroutines.t:
21:27 dalek perl6-examples: [cookbook] add test for 10subroutine subcategory
21:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/15e77c3e3c
21:27 dalek perl6-examples: 01c837a | paultcochrane++ | categories/ (2 files):
21:27 dalek perl6-examples: Merge branch 'master' of github.com:perl6/perl6-examples
21:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/01c837ae2b
21:27 PZt joined #perl6
21:28 tony-o_ m: my $p = start { sleep 1; say $OUTER::SET; }; our $SET = 5; await $p;
21:28 camelia rakudo-moar 8e8936: OUTPUT«5␤»
21:28 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
21:31 hoelzro tony-o_: you want multiple start blocks to share a single closed over variable?
21:32 tony-o_ it sounds that way, i'll show you my actual code: https://github.com/tony-o/perl6-green/blob/reclass/lib/Green.pm6#L84
21:33 hoelzro tony-o_: what about multiple threads messing with shared state, though?
21:33 tony-o_ here is the test file for that - https://github.com/tony-o/perl6-green/blob/reclass/t/05-test-right-sets.t#L8
21:33 hoelzro that sounds iffy
21:33 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
21:35 tony-o_ so it finds it but it's always undefined on subsequent calls
21:35 colomon joined #perl6
21:35 TimToady maybe cached it too early
21:37 tony-o_ what does that mean?
21:38 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;
21:38 camelia rakudo-moar 8e8936: ( no output )
21:40 TimToady m: my $*SET = 5; await start { sleep .25; say $*SET; };
21:40 camelia rakudo-moar 8e8936: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
21:40 TimToady hmm, that doesn't fit my theory :)
21:41 TimToady m: my $*SET = 5; { await start { sleep .25; say $*SET; }; }
21:41 camelia rakudo-moar 8e8936: OUTPUT«===SORRY!===␤Dynamic variable $*SET not found␤»
21:42 TimToady maybe it's breaking the chain of callers somehow
21:42 tony-o_ the caller is definitely different with the start block than without
21:42 dolmen joined #perl6
21:43 tony-o_ m: my $x = 5; await start { sleep .1; say $OUTER::x; };
21:43 camelia rakudo-moar 8e8936: OUTPUT«5␤»
21:43 tony-o_ m: my $x = 5; { await start { sleep .1; say $OUTER::x; }; };
21:43 camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
21:43 tony-o_ hm
21:43 TimToady use OUTERS there
21:43 tony-o_ m: my $x = 5; await start { sleep .1; say $OUTERS::x; };
21:43 camelia rakudo-moar 8e8936: OUTPUT«5␤»
21:44 TimToady m: my $*SET = 5; await start { sleep .25; say CALLERS::<$*SET>; };
21:44 camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
21:44 TimToady "there it was, gone completely"
21:45 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))␤»
21:45 tony-o_ m: sub t { say OUTERS::.hash; }; await start { sleep .25; t; }; t;
21:45 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,…»
21:45 TimToady m: my $*SET = 5; await start { sleep .25; say OUTER::<$*SET>; };
21:45 camelia rakudo-moar 8e8936: OUTPUT«5␤»
21:46 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␤»
21:46 tony-o_ m: my $*SET = 5; sub t { say OUTERS::<$*SET>; }; await start { sleep .25; t; }; t;
21:46 camelia rakudo-moar 8e8936: OUTPUT«5␤5␤»
21:47 TimToady yeah, something broke in the call chain, seems
21:47 TimToady or something is marked is_thunk that maybe shouldn't be
21:48 TimToady 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␤»
21:48 tony-o_ glad i'm not crazy, i could've sworn i had it working that way like 6 months ago
21:49 TimToady seems like it oughta work to me
21:49 TimToady but then, I'm about to narcoleptic...
21:49 TimToady *to go
21:49 TimToady nap &  # obviously overdue...
21:51 hoelzro @tim-today.nap({ ... })
21:51 hoelzro grr
21:51 hoelzro $tim-toady
21:51 hoelzro messed up my own joke!
21:51 tony-o_ haha
21:52 tony-o_ 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
21:57 RabidGravy I was playing with somthing like:
21:57 RabidGravy m: my $e = sub f($SET) { sleep 1; say $SET }; my $p = start $e.assuming(5); await $p;
21:57 camelia rakudo-moar 8e8936: OUTPUT«5␤»
21:59 RabidGravy which is a way of avoiding the closure altogether
21:59 laouji joined #perl6
22:02 airdisa joined #perl6
22:03 literal /W 4
22:04 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:21 andreoss joined #perl6
22:27 dalek perl6-examples: 8d42c4c | (Andrei Osipov)++ | categories/interpreters/lisp.pl:
22:27 dalek perl6-examples: a typo
22:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/8d42c4c097
22:27 dalek perl6-examples: 0100381 | (Andrei Osipov)++ | / (7 files):
22:27 dalek perl6-examples: Merge branch 'master' of https://github.com/perl6/perl6-examples
22:27 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/01003810ee
22:39 aborazmeh joined #perl6
22:39 aborazmeh joined #perl6
22:43 cygx left #perl6
22:44 aborazmeh joined #perl6
22:44 aborazmeh joined #perl6
22:45 egrep joined #perl6
22:51 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.
22:52 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:55 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␤»
22:55 tony-o_ m: my $a = 5; (sub ($a is rw = $OUTER::a) { say $a; })();
22:55 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␤»
22:56 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␤␤»
22:56 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/qCSPcd8309:1␤  in block <unit> at /tmp/qCSPcd8309:1␤␤»
22:57 rjbs Huh.  I thought the repl used to kvetch if I tried to refer to an undeclared variable.
22:57 skids joined #perl6
22:58 jdv79 does turning on strict help?
22:58 jdv79 tony-o_: was looking at https://rt.perl.org/Ticket/Display.html?id=78280 but it seems to be outdated maybe
22:58 rjbs jdv79: on a line by line basiss
22:59 rjbs I just wasted a bunch of time because of this.  Is there a way to get the whole repl strict?
22:59 rjbs perl6 -M strict
22:59 rjbs m: my $
22:59 camelia rakudo-moar 8e8936: ( no output )
22:59 rjbs Why doesn't that error?
22:59 jdv79 nice
23:03 rjbs More idiomatic way to say: $a[ $a.elems .. 2 ] = 1 xx 3 - $a.elems
23:06 kurahaupo1 joined #perl6
23:07 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!
23:07 rjbs I want to say: pad this list to size 3 with 1's.
23:07 TimToady ah
23:09 TimToady I think $a[ *+0 .. 2 ] = 1 xx * should work
23:10 TimToady m: my @a = 0; @a[ *+0 .. 2 ] = 1 xx *; say @a
23:10 camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
23:12 rjbs Man, that * shows up everywhere! :)
23:12 TimToady when we get shaped arrays, my @a[3] is default(1) might do it
23:12 TimToady if you don't actually care how big it is, but just want it to default that high
23:12 TimToady m: my @a is default(1) = 0; say @a[^3]
23:12 camelia rakudo-moar 8e8936: OUTPUT«0␤»
23:13 TimToady hmm
23:13 TimToady m: my @a is default(1) = 0; say @a[0,1,2]
23:13 camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
23:13 TimToady I guess ranges autotruncate there
23:13 rjbs m: my @a is default(1) = 0; say @a[0..2]
23:13 camelia rakudo-moar 8e8936: OUTPUT«0␤»
23:14 dalek roast: 6c87a83 | (Justin DeVuyst)++ | S32-io/io-handle.t:
23:14 dalek roast: Annotate test for RT #78454.
23:14 dalek roast: review: https://github.com/perl6/roast/commit/6c87a83156
23:14 rjbs Okay.
23:14 TimToady m: my @a is default(1) = 0; say @a[0 ...^ 3]
23:14 camelia rakudo-moar 8e8936: OUTPUT«0 1 1␤»
23:14 rjbs Woah, what's that?
23:14 TimToady sequence operator
23:14 TimToady m: say 1,2,4 ...^ 256
23:14 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." ;-)
23:15 TimToady well, that's kinda what ast output does...
23:16 rjbs Can I get that with --target or something?
23:16 rjbs trying!
23:17 rjbs Hm.  I'm not ready to read this yet. :)
23:17 TimToady perl6-m --target=ast -e 'say 1,2,4 ...^ 256'
23:18 TimToady 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.
23:19 rjbs 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
23:19 rjbs Right!
23:19 TimToady unlike in p5 where it lies to itself continually
23:19 TimToady and the obfuscates it all
23:19 TimToady *then
23:19 TimToady I can say that since it's largely my fault :)
23:20 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
23:20 rjbs Hm.  I can't do this?
23:20 jdv79 er, i mean graphviz i think
23:21 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␤…»
23:21 TimToady yeah, formal parameters aren't real arrays
23:22 TimToady so at best it could be used to constraint the actual binding to an array that had that set for a default already
23:23 TimToady defaults aren't that abstract
23:25 TimToady and binding is much more destructive than assignment (which is why it's faster)
23:26 * 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] }
23:26 camelia rakudo-moar 8e8936: OUTPUT«1 2␤3 4␤5 0␤»
23:26 rjbs I need to port my test suite over, tout suite.
23:26 rjbs TimToady: That's just what I did!
23:27 rjbs 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" }
23:27 camelia rakudo-moar 8e8936: OUTPUT«1 2 3 4␤5 0␤»
23:27 TimToady yes, bitops are demoted so we can have junctions
23:28 TimToady 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␤»
23:28 rjbs TimToady: Yeah, I just missed it.  I fixed most of them and missed that one.
23:28 rjbs https://gist.github.com/rjbs/8bdf1a710beec0f88e95
23:28 TimToady that's better
23:28 rjbs ^-- that's the ported code, "all done."
23:28 jdv79 m: class A; multi infix:<=>(A $, Str $) { 42 }; say A = "" # should this print 42?
23:28 camelia rakudo-moar 8e8936: OUTPUT«Cannot modify an immutable A␤  in block <unit> at /tmp/mYH68jtxUb:1␤␤»
23:30 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␤␤»
23:30 TimToady hmm, bufs are supposed to be mutable
23:30 rjbs Yeah, I complained about that yesterday.
23:30 rjbs I think the answer I got was "bufs aren't arrays, use [+*]"
23:31 TimToady but they're supposed to be like arrays, and we have blobs to be immutable bufs
23:32 TimToady if if it's immutable, why does the lvalue form work?
23:32 TimToady probably just missing a method push somewhere
23:32 rjbs I am exaggerating the answer I got, apparently: http://irclog.perlgeek.de/perl6/2015-05-13#i_10594007
23:33 rjbs I can rakudobug it.
23:33 TimToady m: say buf8.can('push')
23:33 camelia rakudo-moar 8e8936: OUTPUT«Method+{<anon>}.new␤»
23:33 TimToady m: say buf8.can('push')».WHY
23:33 camelia rakudo-moar 8e8936: OUTPUT«(Any)␤»
23:33 TimToady m: say buf8.can('push')».WHAT
23:34 camelia rakudo-moar 8e8936: OUTPUT«(Parcel)␤»
23:34 rjbs odd, you got a different error than I did, because I did this:
23:34 TimToady well, obviously inheriting Any.push, which is non-cooperative...
23:34 rjbs m: Buf.new(1,2,3).push(4)
23:34 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…»
23:34 TimToady so just NYI
23:34 rjbs Is that because 4 isn't a listy thing, and it ought to be?
23:34 rjbs Or is that just another head of the NYIdra?
23:36 kurahaupo joined #perl6
23:36 rjbs Oh, it's because yours was not defined...
23:36 rjbs I think.
23:37 rjbs rakudobugged, moving on.
23:41 rjbs Can I declare type synonyms?
23:42 TimToady constant MyInt = Int; my MyInt $x = 35.5;
23:43 TimToady m: constant MyInt = Int; my MyInt $x = 35.5;
23:43 camelia rakudo-moar 8e8936: OUTPUT«Type check failed in assignment to '$x'; expected 'Int' but got 'Rat'␤  in block <unit> at /tmp/cNScw8YjoV:1␤␤»
23:43 TimToady or...
23:43 TimToady m: subset MyInt of Int; my MyInt $x = 35.5;
23:43 camelia rakudo-moar 8e8936: OUTPUT«Type check failed in assignment to '$x'; expected 'MyInt' but got 'Rat'␤  in block <unit> at /tmp/G64bVMJibt:1␤␤»
23:43 TimToady in this case it's just not a proper subset :)
23:43 rjbs Interesting.  Thanks!
23:44 raiph joined #perl6
23:44 rjbs I keep forgetting which thingy is meant to be buf8 and which buf16.  Hooray for type synonyms!
23:44 rjbs and constants are default lexically scoped?
23:44 rjbs I can test tha tmyself, nm.
23:47 TimToady constants and enums are our by default
23:47 rjbs Okay.
23:47 TimToady but you can say my constant
23:47 rjbs I may just do that!
23:48 rjbs 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
23:49 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
23:50 TimToady 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 rjbs What you say makes sense, for sure.
23:51 TimToady it does use ropes for some things currently, but isn't terriby smart about it yet
23:51 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.
23:51 TimToady lots of places it gives up and flattens the ropes
23:52 TimToady well, we tried to fix everything, which is why it took so long :)
23:52 TimToady (and takes so long, sigh)
23:52 rjbs I, for one, have never resented the delay!
23:53 rjbs (I like to think I'm not the /only/ for one.)
23:53 TimToady :)
23:53 rjbs Can I parameterize the Hash type to declare a hash that must map from uint8 to Str?  Better yet, Str.chars==1 ?
23:55 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␤»
23:56 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/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…»
23:56 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/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…»
23:56 TimToady m: my Str %hash{uint8} = ^256 Z=> ("\0" ... "\xff"); say %hash[65]
23:56 camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8' but got 'Int'␤  in block <unit> at /tmp/YFhCoo2Yqp:1␤␤»
23:56 TimToady aww
23:56 rjbs It's nice to see that you're still learning Perl 6 as well. ;-)
23:56 geekosaur heh
23:56 TimToady m: my Str %hash{uint8()} = ^256 Z=> ("\0" ... "\xff"); say %hash[65]
23:56 camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8(Any)' but got 'Int'␤  in block <unit> at /tmp/RFvcOXZD7p:1␤␤»
23:56 geekosaur and I htink you want to subset Str to get your chars==1
23:57 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]
23:57 camelia rakudo-moar 8e8936: OUTPUT«Type check failed in binding key; expected 'uint8' but got 'Int'␤  in block <unit> at /tmp/D4MtGaErj2:1␤␤»
23:58 TimToady whaaa
23:58 TimToady m: my Str %hash{Int where * < 256}; %hash{^256} = "\0" ... "\xff"; say %hash[65]
23:58 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…»
23:58 * geekosaur smells something vaguely NYI (or at least LTA)
23:59 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␤␤»
23:59 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«A␤»
23:59 TimToady well, it's still a WIP
23:59 rjbs :)

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

Perl 6 | Reference Documentation | Rakudo