»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
TimToady well, the exact semantics might change a bit, to more like, returns the first defined value, or Empty 00:01
dha Oh. Ok, Will not patch. :-) 00:05
00:06 japhb left, japhb joined 00:10 Akagi201 left 00:13 Akagi201 joined 00:17 dha left, Akagi201 left 00:21 vendethiel left 00:22 khw joined 00:25 ShimmerFairy left 00:26 vendethiel joined 00:27 gfldex left 00:37 ShimmerFairy joined
ugexe finally got this installing modules on windows. but for how long... 00:43
00:45 laouji joined 00:48 vendethiel left
ugexe installs panda to a further stage than panda itself, but it stills fail testing 00:49
00:56 dayangkun joined 01:11 rmgk left 01:13 rmgk joined 01:18 BenGoldberg joined, araujo left 01:21 araujo joined 01:26 yqt left 01:38 skids joined, AlexDani` left 01:42 tinyblak joined 01:44 yeahnoob joined 01:45 ilbot3 left 01:47 ilbot3 joined 02:13 nys left 02:19 aborazmeh joined, aborazmeh left, aborazmeh joined 02:20 raiph left 02:22 jack_rabbit joined 02:28 vendethiel joined 02:29 jack_rabbit left 02:36 Akagi201 joined 02:37 Dee22 joined 02:40 VinceDee left 02:44 Akagi201_ joined 02:47 Akagi201 left
dalek kudo/nom: 63de9a1 | TimToady++ | src/Perl6/Grammar.nqp:
catch obvious misuse of ^100.method
02:52
02:53 noganex joined 02:55 noganex_ left 02:56 aborazmeh left 03:11 kaare_ joined
TimToady m: say ^100.pick 03:19
camelia rakudo-moar a32c1d: OUTPUT«0..^100␤»
03:19 vendethiel left
TimToady m: say ^100.pick 03:21
camelia rakudo-moar 63de9a: OUTPUT«Potential difficulties:␤ Precedence of ^ is looser than method; please parenthesize␤ at /tmp/db2BxGAzgx:1␤ ------> 3say ^1007⏏5.pick␤Use of Nil in numeric context in block <unit> at /tmp/db2BxGAzgx:1␤0..^0␤»
03:28 vendethiel joined
dalek kudo/nom: 852340f | TimToady++ | src/Perl6/Grammar.nqp:
oops, warning shouldn't move cursor position
03:34
lizmat good *, #perl6! 03:45
03:50 vendethiel left
kanl m: my %a = a => *; my %b = %a.invert; %b.say; 03:50
camelia rakudo-moar 63de9a: OUTPUT«Whatever<140359990650704> => a␤»
kanl m: my %a = a => *, b => *; my %b; %b.push: %a.invert; %b.say; 03:51
lizmat kanl: this is unexpected why ?
camelia rakudo-moar 63de9a: OUTPUT«␤»
lizmat ah... hmmm... 03:52
kanl m: my %a = a => <1>, b => <1 2>; my %b; %b.push: %a.invert; %b.say;
camelia rakudo-moar 852340: OUTPUT«1 => a b, 2 => b␤»
kanl lizmat: so i was expecting Whatever => a b 03:53
03:56 vendethiel joined
lizmat to really get Whatever as the key value, you should use a typed hash, aka 'my %b{Any}' 03:57
otherwise you'll get a stringification of Whatever as the key
however, that doesn't solve the problem
brb
m: my %h{Any}; %h{Whatever} = "a"; say %h.perl # golfed down problem 04:04
camelia rakudo-moar 852340: OUTPUT«Hash[Any,Any].new()␤»
lizmat m: my %h = a => 42, b => 666; %h{*} = 43,667; say %h.perl # {*} means all keys in the hash 04:08
camelia rakudo-moar 852340: OUTPUT«{:a(43), :b(667)}<>␤»
lizmat now, since the order of the keys is random, assignment as such would be rather roulette like 04:09
kanl: so I'm afraid this is a case of DIHWIDT 04:11
since the roulette nature of assigning to {*}, one could wonder whether this should be allowed at all or not 04:12
kanl lizmat: thanks! so i should not be considered a bug then? though i'd still prefer it does what i meant :p 04:16
^it
lizmat well, but that's just it: it currently *is* doing what is meant 04:17
04:17 gfldex joined
lizmat it's just not doing what *you* meant :-) 04:17
m: my %h = a => 42, b => 666; say %h{*} # slice all keys 04:18
camelia rakudo-moar 852340: OUTPUT«42 666␤»
lizmat m: my %h = a => 42, b => 666; say %h{*} = pi; say %h 04:19
camelia rakudo-moar 852340: OUTPUT«3.14159265358979 (Any)␤a => 3.14159265358979, b => (Any)␤»
dalek kudo/nom: bccd76d | lizmat++ | src/core/hash_slice.pm:
Don't allow assignment to %h{*}

Since the order of the keys as given by {*} is non-deterministic, it is rather roulette-like trying to use them as a list to assign to. To avoid confusion, it is probably better to not allow this at all. Or perhaps a warning should be in order instead.
04:22
kanl fair enough, i'll try and digest it. lizmat++ 04:23
lizmat kanl: why are you using Whatever as a value anyway?
m: my %a = a => <*>, b => <*>; my %b; %b.push: %a.invert; %b.say; # perhaps confusing, perhaps what you need ? 04:24
camelia rakudo-moar 852340: OUTPUT«* => a b␤»
lizmat aka, use the string '*' instead of the type * 04:25
kanl lizmat: it would work for me, only if the * means Whatever when used as a hash key. 04:26
i'll try it
lizmat no, it won't mean Whatever in that case 04:27
it will just look like Whatever
kanl close enough, i can just check it as a special case, i guess :)
lizmat still feels like an X Y issue here, though 04:29
what are you trying to achieve with Whatever as a key value ?
kanl getting all the keys in an hash from time to time. i'm trying to write a system monitoring too with functions like FALLBACK( $name, *%index ), with name being DF, IOSTAT, etc. and %index being Capacity => </ /foo /bar>, Iuse => *, etc. etc. long story :) 04:31
i can gist you the code if you'd like, but it probably just adds too much noise :p 04:32
lizmat m: my %h = a => 42, b => 666; say %h{}'
camelia rakudo-moar 852340: OUTPUT«5===SORRY!5=== Error while compiling /tmp/VOjTXlGIw8␤Strange text after block (missing semicolon or comma?)␤at /tmp/VOjTXlGIw8:1␤------> 3my %h = a => 42, b => 666; say %h{}7⏏5'␤ expecting any of:␤ infix␤ infix stoppe…»
lizmat m: my %h = a => 42, b => 666; say %h{}
camelia rakudo-moar 852340: OUTPUT«a => 42, b => 666␤»
lizmat m: my %h = a => 42, b => 666; say %h{%h.keys}
camelia rakudo-moar 852340: OUTPUT«42 666␤»
lizmat m: my %h = a => 42, b => 666; say %h{}:k
camelia rakudo-moar 852340: OUTPUT«a b␤»
lizmat m: my %h = a => 42, b => 666; say %h{}:v 04:33
camelia rakudo-moar 852340: OUTPUT«Unexpected named parameter 'v' passed␤ in block <unit> at /tmp/ZODGmkMsyH:1␤␤»
lizmat hmmm... that is surprising
kanl but yeah, for now <*> would work for me, and i'd just check for it as a special case :)
lizmat okidoki
04:34 Akagi201_ left
kanl i'm sure this is one of those dumb yahoo + not enough doc problem :) 04:34
lizmat well, actually, you pointed out a glitch in the matrix, afaiac 04:37
for typed hashes, what does %h{*} mean?
does it indicate all of the keys, or does it just take Whatever as its key?
04:41 vendethiel left 04:42 laouji left, laouji joined
kanl m: say 'FOO' if < 1 1 30 1 1 1 3 1 1 -1 0 1 0 1 25 2 1 1 >.none > 20; 04:47
camelia ( no output )
04:47 laouji left
lizmat those are strings, not numbers 04:52
kanl right. and it looks right, i think. 04:53
lizmat m: say < 1 1 30 1 1 1 3 1 1 -1 0 1 0 1 25 2 1 1 >.none.Int > 20 04:54
camelia rakudo-moar bccd76: OUTPUT«none(False, False, True, False, False, False, False, False, False, False, False, False, False, False, True, False, False, False)␤»
lizmat m: say "FOO" if < 1 1 30 1 1 1 3 1 1 -1 0 1 0 1 25 2 1 1 >.none.Int > 20 04:55
camelia ( no output )
kanl was just trying to see if it typecasts to Int or not
lizmat it doesn't, you need to do that yourself
kanl oh..
but i'm getting the expected behavior, no? ( no output ) 04:56
lizmat ah, I see where you're getting at now 04:57
kanl apologies for any confusion i might've caused :p 04:59
lizmat nonono, you're teaching me something :-)
I guess using the > on the junction, automatically does force the string to be numerically interpreted
so indeed, you don't need to do the .Int yourself 05:00
TimToady yes, it does
m: say ^100.pick 05:01
camelia rakudo-moar bccd76: OUTPUT«Potential difficulties:␤ Precedence of ^ is looser than method call; please parenthesize␤ at /tmp/XqFgxBcxPR:1␤ ------> 3say ^1007⏏5.pick␤0..^100␤»
05:03 khw left 05:05 BenGoldberg left
dalek kudo/nom: 2904f3a | lizmat++ | src/core/hash_slice.pm:
Add :v candidates for %h{*} and %h{}

Not sure why they were missing before
05:10
lizmat m: say ^100.Int 05:16
camelia rakudo-moar bccd76: OUTPUT«Potential difficulties:␤ Precedence of ^ is looser than method call; please parenthesize␤ at /tmp/K92pr9lSrV:1␤ ------> 3say ^1007⏏5.Int␤0..^100␤»
05:17 laouji joined
lizmat m: say ^"100".Int 05:17
camelia rakudo-moar bccd76: OUTPUT«0..^100␤»
TimToady it's only trying to recognize the most common case; it doesn't even look for ^$foo.method, since .method might well be a normal way to produce an integer on whatever $foo contains 05:20
skids m: sub f (::T $a) { my T $b; { T.WHICH.say; $b.WHICH.say } }; f(1); 05:22
camelia rakudo-moar bccd76: OUTPUT«Int␤Int␤»
skids m: sub f (::T $a) { { my T $b; T.WHICH.say; $b.WHICH.say } }; f(1);
camelia rakudo-moar bccd76: OUTPUT«Int␤Method 'WHICH' not found for invocant of class 'T'␤ in sub f at /tmp/BRvz9zBD_p:1␤ in block <unit> at /tmp/BRvz9zBD_p:1␤␤»
skids This underlying bug caused the elide-type code to break:
m: :(::T $a, T $b).perl.say
camelia rakudo-moar bccd76: OUTPUT«Method 'WHICH' not found for invocant of class 'T'␤ in block <unit> at /tmp/WOh7wT2yZO:1␤␤»
05:23 coffee` left
skids tries to find an RT 05:23
lizmat catches some more sleep 05:28
05:33 vendethiel joined 05:35 Akagi201 joined 05:37 coffee` joined 05:40 telex left 05:42 telex joined, Akagi201 left 05:46 Psyche^ joined, Akagi201 joined 05:48 skids1 joined 05:50 Psyche^_ left, skids left 05:52 g4 joined, g4 left, g4 joined 05:54 Gruber joined
skids1 submits RT#125537 05:55
05:57 _mg_ joined 05:58 _mg_ left 05:59 _mg_ joined
kanl my $s = '[foo:bar]'; $s.= subst: /'[' (\w+) ':' (\w+) ']'/, "baz.$0-$1"; ( $/, $0, $1, $s )>>.say; 06:02
06:03 diana_olhovik_ joined
skids1 m: my $s = '[foo:bar]'; $s.= subst: /'[' (\w+) ':' (\w+) ']'/, "baz.$0-$1"; ( $/, $0, $1, $s )>>.say; 06:04
camelia rakudo-moar 2904f3: OUTPUT«Use of Nil in string context in block <unit> at /tmp/D9SoMUZWyc:1␤Use of Nil in string context in block <unit> at /tmp/D9SoMUZWyc:1␤baz.-␤「foo」␤「bar」␤「[foo:bar]」␤ 0 => 「foo」␤ 1 => 「bar」␤»
kanl skids: thanks. 06:07
m: my $s = '[foo:bar]'; $s.= subst: /'[' (\w+) ':' (\w+) ']'/, "baz.$0-$1"; $s.say;
camelia rakudo-moar 2904f3: OUTPUT«Use of Nil in string context in block <unit> at /tmp/eLzq5gebaI:1␤Use of Nil in string context in block <unit> at /tmp/eLzq5gebaI:1␤baz.-␤»
kanl hmm.. not getting why it's not replacing. 06:09
skids1 m: my $s = "[foo:bar]"; $s .= subst: /"[" (\w+) ":" (\w+) "]"/, { "baz." ~ $_[0] ~ "-" ~ $_[1] }; ( $/, $0, $1, $s )>>.say; 06:13
camelia rakudo-moar 2904f3: OUTPUT«baz.foo-bar␤「foo」␤「bar」␤「[foo:bar]」␤ 0 => 「foo」␤ 1 => 「bar」␤»
skids1 The match is passed to the second argument as an argument, not put in $/.
(not totally sure it should not be in $/ as well) 06:14
kanl skids1: thank you. 06:17
[Tux] I know, I know, work in prgress, but today I see additionall slowdown. just FYI
test 50000 44.229 44.140
test-t 50000 42.542 42.454
06:28 RabidGravy joined 06:31 [Sno] left
RabidGravy morning! 06:44
06:53 domidumont joined 06:57 domidumont left, kanl left 06:58 domidumont joined 06:59 rurban joined 07:03 kanl joined
kanl m: sub foo( *%h ) { %h.say }; foo( a => 1 ); foo( 'a%' => 1 ); 07:06
camelia rakudo-moar 2904f3: OUTPUT«a => 1␤Too many positionals passed; expected 0 arguments but got 1␤ in sub foo at /tmp/Nr_YC7kyJj:1␤ in block <unit> at /tmp/Nr_YC7kyJj:1␤␤»
kanl m: sub foo( *%h ) { %h.say }; foo( a => 1 ); foo( | hash 'a%' => 1 ); 07:08
camelia rakudo-moar 2904f3: OUTPUT«a => 1␤a% => 1␤»
kanl pulls hair
moritz m: sub foo( *%h ) { %h.say }; foo( a => 1 ); foo( |{'a%' => 1} ); 07:09
camelia rakudo-moar 2904f3: OUTPUT«a => 1␤a% => 1␤»
07:10 Woodi joined, cdc_ joined, dams_ joined
kanl why wouldn't "naked" 'a%' => 1 work like a => 1? 07:10
07:10 garu_ joined, rvchangue_ joined 07:11 cdc left, dams left, rmgk left, salv0 left, rvchangue_ is now known as rvchangue, salv00 joined, rmgk joined 07:12 pRiVi joined
moritz kanl: because pairs with quoted LHS don't count as named arguments 07:12
kanl to an unsophiscated user like me, the intuitive thing is, either both work, or both fail.
moritz m: sub f(*@pos, *%named) { say "pos: @pos.perl(); named: %named.perl()" }; f a => 1; f 'a' => 1; 07:13
camelia rakudo-moar 2904f3: OUTPUT«pos: []<>; named: {:a(1)}<>␤pos: [:a(1)]<>; named: {}<>␤»
07:15 Akagi201 left 07:16 rurban left
kanl i can appreciate the explanation, but (to rant) do not love the subtle differences in various things. 07:16
07:18 [Sno] joined 07:20 darutoko joined 07:21 rurban joined
moritz kanl: how would you all passing of literal Pairs to named parameters? 07:23
s/all/allow/
07:28 phdphil left 07:30 amurf left 07:31 rurban1 joined 07:33 rurban left 07:35 zakharyas joined 07:36 Woodi left, Woodi joined 07:48 laouji left 07:51 fxbrain joined, laouji joined 07:53 laouji left, laouji joined 07:56 skids1 left, rindolf joined 08:10 yeahnoob left 08:22 laouji left, rurban joined
masak morning, #perl6 08:22
or, um, antenoon. 08:23
BooK sssh, don't wake the americans
08:24 laouji joined
ShimmerFairy masak: I've got a truly horrendous script that counts the partitions in the 2D version of hexslide, I'll put it up in a little bit :) 08:24
masak ShimmerFairy: I played around with some ideas yesterday too. it looked promising, but nothing conclusive.
ShimmerFairy masak: The most annoying thing about hexslide I've found is that I don't have the mathematical knowledge to formally prove the conjectures I have, so nothing is 100% certain for me. 08:25
masak ShimmerFairy: we could discuss it over privmsg if you want.
ShimmerFairy Perhaps :) 08:26
BooK doc.perl6.org/routine.html # how is this generated? I'd be willing to add html anchors so one could link to a specific routine directly (at least the ones with an alphabetical name) 08:29
masak BooK: think it's this one: github.com/perl6/doc/blob/master/htmlify.p6 08:35
BooK masak: cool, will have a look 08:37
I'm also recording my travel into the perl 6 realm
08:37 rurban1 left
masak \o/ 08:38
BooK can any unicode character be used to define operators? 08:41
DrForr Nope. 08:42
ShimmerFairy masak: here is the horrid code: github.com/lue/hexslide
DrForr The first exception is any combining character, which IMO is a real bummer, and sort of contravenes Unicode Tech Note #25.
08:43 Akagi201 joined
DrForr They're treated as part of the identifier, not as a standalone character. Which is fine for most cases, such as umlauts, cedilla and diaresis. 08:44
masak ShimmerFairy: kudos on the README
DrForr But IMO anything with an IsMath property shouldnt' appear in an identifier.
BooK DrForr: is the charactestics of what can be used documented somewhere?
masak ShimmerFairy: "It's recommended that you keep all row/column names unique" -- no, it's necessary to keep all row/column names unique :) don't make the problem harder than it already is :) 08:45
08:45 darutoko- joined
DrForr Not to my knowledge, but I haven't investigated the relevant docs. 08:45
ShimmerFairy masak: considering how the regex works, you _could_ get away with non-unique names, but you really, _really_ shouldn't :) (it matches characters from the name specification part, so as long as the second through last characters of a piece contain one unique name, the regex could maybe figure out what you were going for) 08:46
masak: Also, just noticed an error in the conjecture in the README, in case you spot it too (fixed it) 08:48
08:48 darutoko left
RabidGravy in a case where I want to do something like "method do-something { ... start { self.do-something-else } }" is it best to get the self as an argument instead? 08:51
masak ShimmerFairy: in fact, I would be even more boring than you currently are in your format. 08:52
RabidGravy i.e "method do-something(Thing $self:) { ... start { $self.do-something-else } }" ?
masak ShimmerFairy: I'd specify rows and columns like this: "ABCD\n123\n"
BooK still experimenting.
masak ShimmerFairy: or maybe even leave that out, and have the program assign those names. 08:53
BooK find / | perl6 -e 'run( <rev>, :out, :!chomp ).out.lines.say' # why does this only give me the first 100 lines and '...' at the end?
ShimmerFairy masak: yeah, the reason why I did it visually was so I didn't have to spend so much time trying to visualize rows and columns mentally :)
masak: and letting you specify your own names somehow seemed the easier route to me :) 08:54
masak ShimmerFairy: your conjecture at the bottom is trivially true. but it's an "if", not an "if and only if", so it's not that interesting.
ShimmerFairy: it's not the easier route. if you want to have a board to look at, allow `#` comments in the format instead. :) 08:55
BooK find / | perl6 -e '.say for run( <rev>, :out ).out.lines' # DWIM, i.e. prints all lines, without hanging
ShimmerFairy masak: well, my current idea of dividers are that they are spots that will always be taken by a piece, so there's no way to clear them. I'd be interested in getting a counterexample
08:56 espadrine joined
masak oh, I see. 08:56
RabidGravy BooK, I think it's something to do with the .gist on the List
masak that seems tricky to define somehow. but maybe it can be done.
RabidGravy you can also do .... list>>.say
ShimmerFairy (also, the ease in specifying names was in not having to spend time figuring out One True Naming System for things in general) 08:57
RabidGravy lines rather
.. lines>>.say
ShimmerFairy masak: my code recursively finds dividers (starting with fake dividers surrounding the board) from all the pieces until no new dividers show up. It basically moves pieces to the extremes they can go to, and takes the overlap as dividers. 08:58
masak I think I just figured out why I don't like the .say method form most of the time.
because it puts the important thing too far to the right in the statement. it should be up front, at the left.
which I guess is why I'm fine with `.say;` in loops and stuff
so it's not so much the .say method as a method I don't like, it's syntactically mis-balancing the statement. 08:59
ShimmerFairy masak: with a special case before that recursive search for "intra-groove" dividers (caused by things like <>.<> creating vertical groove dividers .X.X. )
BooK RabidGravy: yup, my first use of »
ShimmerFairy I usually use .say when I'm typing the line and I realize I forgot to put "say" in front :P
BooK now how do I silence the standard error
RabidGravy grooviness, special bonus points and stuff if you use »
BooK meh, the error I see is not from rev, it's from find 09:00
so perl can't do anything about it
RabidGravy Boo! bad find bad! bad!
masak ShimmerFairy: that doesn't sound like a way to end up with a readable program. 09:01
ShimmerFairy masak: check my script, and you'll see that's so far true :P
masak (doing something because you forgot something)
RabidGravy » is one of the few unicode operators I use as I can remember how to type it 09:02
ShimmerFairy oh, talking about .say :)
masak: Usually for one-liners, as in perl6 -e '... @a.sort.grep({stuff}). .oO(oh hey I forgot to put a say in front, I'll just tack it on the end instead of cursoring back to the beginning) .say' 09:03
masak ok, fair enough. it's a question of scale. script vs application. 09:04
still, I have little sympathy for that line of reasoning, because *I don't forget to put `say` at the beginning*. :P
I don't really see how that would happen. :)
dalek ok: d3296e5 | PerlJam++ | src/preface.pod:
Update section on obtaining Rakudo
09:05
ok: fa18755 | PerlJam++ | src/regexes.pod:
Add a little more explanatory text
masak (cue someone digging up a place in the backlog where masak feeds camelia something without a `say` at the beginning...)
dalek ok: ad5d765 | PerlJam++ | src/regexes.pod:
a few other minor edits
ok: 54fc3fa | PerlJam++ | src/basics.pod:
Some wording updates
BooK I need to find a way to ignore dalek highlighting me
ShimmerFairy masak: it happens :) I have a hard time dealing with 2D arrays even! (So when I rewrite the script I shared to make it readable, it'll _definitely_ feature enough code where I don't constantly have to make sure I got the rows and columns right)
masak I don't really see what's so hard about 2D arrays. 09:06
BooK fooling around with infinite streams, I get "Malformed UTF-8" errors
masak m: my @board = [1, 2], [3, 4]; say @board[1][0]
camelia rakudo-moar 2904f3: OUTPUT«3␤»
masak voilà, 2D array
BooK I'm surprised :bin does not help
masak BooK: me too. 09:07
BooK oooh I need to set :enc
masak even for :bin ?
BooK looks like
ShimmerFairy masak: the problem is my brain doesn't automatically know how to interpret @board[1][0] ; not in the same way I automatically know what @board[2] means. 09:08
BooK doc.perl6.org/type/IO%3A%3AHandle#E...ng_options # reading this, it feels like :bin and :enc are mutually exclusive 09:09
ShimmerFairy It's just something weird about my brain, not too big a deal. It just means I'd ideally label which one is the row number and which one is the column number :)
masak ShimmerFairy: seems more like a mental barrier (fixable with conditioning) than a language problem :)
ShimmerFairy: write a sub so that you can pos(@board, :$row, :$column) :) 09:10
ShimmerFairy BooK: well, considerings encodings are about text files, not binary ones...
masak ShimmerFairy: then it's hard to go wrong :)
RabidGravy BooK, well if you supply :bin it totally ignores any :enc so yes
ShimmerFairy masak: of course, I'm not blaming the language at all, it's definitely a conceptual issue of some kind :) (the reason why I fought through it with the listparse.p6 script, instead of defining convenience functions, was in an interest to get something working as fast as possible) 09:11
jnthn Make sure to use .read/.write with a binary file
BooK find / -type f | xargs cat | perl6 -e 'run( <cut -b 1-8>, :out, :bin ).out.lines».say' # then why does this die with Malformed UTF-8 in block <unit> ?
jnthn: ooh, say expects text ?
jnthn BooK: More immediately, .lines returns a List of Str 09:12
BooK i see
jnthn Str being at Unicode grapheme level. .read/.write work in terms of Buf, which is the byte level thing.
BooK "A file opened with :bin may still be processed line-by-line, but IO will be in terms of Buf rather than Str types." 09:13
ShimmerFairy masak: it's also precisely why I have a visual name specifier for the boards. I think I did consider supporting comments, but I didn't want to go through the trouble of adding that in for a "simple text file" :) 09:14
BooK so how do I iterate on the Buf?
masak ShimmerFairy: don't make the problem more difficult to solve than it already is. there's essential complexity, and then there's complexity you add on top of that. 09:15
jnthn BooK: Just put it in list context somehow 09:16
m: for @('abc'.encode('utf-8')) { .say }
camelia rakudo-moar 2904f3: OUTPUT«97␤98␤99␤»
ShimmerFairy masak: for sure, the script as it stands is the result of going for whatever seemed faster to do at the moment (whether or not it actually was). I'll get to reworking it soon for readability and general sanity :) 09:17
09:18 amurf joined
BooK jnthn: I have run( <cut -b 1-8>, :out, :bin ).out 09:19
so I guess I need to .read($bytes) from it
jnthn BooK: I guess so; I'm a bit behind on the latest IO bits, I'm afraid.. 09:20
BooK can't yet figure out a way to get a stream of Buf of size $bytes from that 09:21
which I'll then be able to ».write($*OUT) I guess
jnthn gather { while $handle.read(256) -> $buf { take $buf } } # or so 09:22
09:23 amurf left
kanl moritz: i don't know. while i appreciate named parameters, i do miss being able to 'slurp' in k => v pairs via @_, without caring whether the lhs is quoted or not, like in p5. e.g. my %named = @_; 09:25
RabidGravy I'm guessing that it's the content of "binary" files that is shagging it up 09:26
e.g. find . -type f -name '*.pm' | xargs cat | perl6 -e 'run( <cut -b 1-8>, :out ).out.lines».say' works fine 09:27
BooK RabidGravy: yes it is
09:31 TEttinger left
RabidGravy On a completely unrelated note regarding tutorials etc has anyone mentioned www.livecoding.tv/ ? 09:31
BooK can't find the doc for gather/take in doc.perl6.org 09:32
kanl moritz: but thanks for the demonstration. i guess i can just easily do { %named.push: @pos } 09:33
RabidGravy BooK, I think take is only documented in docs.perl6.org/routine/take 09:35
gather nowhere as far as I can tell, this probably should be remedied 09:36
BooK although I have a hard time getting this oneliner running, I really like that Perl6 does not let you get away with the ambiguity of a chunk of bytes being used as a string and the other way around 09:38
this is annoying, but I'm sure this prevents a lot of bugs that are more annoying 09:39
RabidGravy yeah, it definitely stops you from getting shagged up multibyte characters being rendered as ascii 09:40
09:44 bin_005 joined 09:53 brrt joined 10:00 ggoebel2 left 10:10 wolf_work joined 10:13 domidumont left 10:14 domidumont joined 10:15 rurban1 joined 10:17 fxbrain left, Woodi left 10:21 rurban1 left, darutoko joined, bjz joined 10:23 darutoko- left 10:24 Woodi joined 10:27 aborazmeh joined, aborazmeh left, aborazmeh joined 10:32 Akagi201 left 10:34 kanl left 10:40 RabidGravy left, virtualsue joined 10:54 Dee22 left 10:56 yqt joined 11:01 aborazmeh left 11:04 bin_005 left 11:06 rurban1 joined 11:08 amurf joined 11:12 amurf left
BooK ok, so I only have annoting questions 11:17
annoying
11:17 cognominal joined, cschwenz joined
masak shoot 11:18
BooK like, how do I portably set the locale+encoding for a program I'll call with run()
moritz locale through %*ENV, I guess 11:20
and encoding with :enc
masak moritz++ beat me to it :)
moritz portable? locales aren't portable 11:21
masak .oO( you can't just pick France up and carry it to Egypt! )
BooK they aren't ?
moritz I don't think so
BooK indeed the key word was "portably"
like, does windows respect it? 11:22
moritz I'm not aware of a windows locale mechanism, except system (or maybe user)-wide 11:23
I don't see how Perl 6 could change that for existing windows programs
BooK oh well, I guess I have to know how to tell the program I'm run()ing which encodibg to expect from me, and which I expect from it
I was somehow hoping some combination of LC_ALL to magically fix the issue for me :-) 11:24
obviously, I'm a dreaming optimistic
11:24 laouji left 11:32 rurban1 left
lizmat re irclog.perlgeek.de/perl6/2015-07-03#i_10843541 : I would like to reiterate my stance that we should disambiguate :a(42) and a => 42 notation 11:32
11:33 Akagi201 joined
lizmat into :a(42) *always* being a named parameter, and a => 42 *always* being a Pair constructor 11:33
foo( :a(42) ) would this always be a named parameter
foo( a => 42 ) would always be a positional Pair 11:34
</rant>
sjn in what way are those two different? (I'd assume that a named parameter _is_ a pair) 11:35
jnthn They're the same today 11:36
The discontinuity is in "a" => 42
Where the LHS is not an auto-quoted literal
One immediate reason is that efficient compilation of named parameters comes a lot more difficult when you don't know the names at compile time.
11:37 Akagi201 left
masak I think we can shove the discontinuity around, but there will always be one, and it will always chafe a bit. 11:38
the reward of putting the discontinuity in a better place should be weighed against the breakage to the ecosystem the move will inevitably cause. 11:39
ShimmerFairy It would be nice if there were a clearer distinction between Pairs and named arguments, methinks
moritz there is.
masak what moritz said.
moritz oh, "clear*er*"
sjn wonders about the circumstances around not knowing names at compile-time
jnthn sjn: |($key => $value) works
And looks like more effort, and probably costs at least 10 times as much 11:40
ShimmerFairy masak: I guess I'm misunderstanding the problem then. Isn't the issue that a => 42 is treated the same as :a(42)
jnthn ShimmerFairy: I don't consider that an issue
sjn jnthn: right.
jnthn Anyway, I think I'm just going to shoot this down with "no, too late"
I'm not interested in revisiting such fundemental things now. 11:41
ShimmerFairy or "please try again in 6.1" :P
11:41 brrt left
jnthn And I don't particularly dislike the way it is now anyway. 11:41
11:41 dayangkun left
jnthn I think foo => ... looks nicer than :foo(...) in a lot of cases too 11:41
masak I agree with "too late". 11:42
timotimo you can still slang it
masak I use both forms, and I never encounter any bugs due to confusion. it's a matter of learning the (simple) rules.
timotimo: yes, and that. thanks.
11:42 laouji joined
timotimo :) 11:42
nine lizmat: FWIW I'd miss => for named arguments because it makes lining up vertically easy. Also because I'm just so used to it from Perl 5 :) However I do think that the difference between a => 42 and 'a' => 42 is one of the few warts that got added with Perl 6. 11:43
ShimmerFairy The only named parameter issue I run into is implict *%_ :) 11:44
*implicit
timotimo hehe
jnthn The implicit *%_ is one thing I'd like to see addressed pre-6.0, yes
lizmat I think it is a wart on the same scale as sigil variance in Perl 5 is
timotimo oh wow
that's a harsh wart 11:45
lizmat like, a hell to teach newbies
masak then you write a slang where that wart is gone.
and you promote it at conferences, telling people why.
lizmat but, having had a "too late" from both jnthn and masak, I will not bring this up again
I will reserve the right to say "I told you so" in the future :-) 11:46
nine It's absolutely surprising and non-obvious
masak lizmat: I do that a lot :P
ShimmerFairy I do want to point that, for me at least, :a(42) and a => 42 seem like different things, at least to me (one is "when I want to give a named parameter", one is "when I want a pair"), so I can see possible issues with Perl 6 not holding the same views
masak has someone said harsh words about the use of parens, too? like (a => 42)? 11:47
timotimo i value being able to use :a(42)and a => 42 interchangably for named parameters
masak m: sub foo(*@poses, *%nameds) { say +@poses, "; ", +@nameds }; foo( a => 42 ); foo( (a => 42) ) 11:48
camelia rakudo-moar 2904f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/t_OJ32oBBq␤Variable '@nameds' is not declared. Did you mean '%nameds'?␤at /tmp/t_OJ32oBBq:1␤------> 3@poses, *%nameds) { say +@poses, "; ", +7⏏5@nameds }; foo( a => 42 ); foo( (a => 42␤»
masak m: sub foo(*@poses, *%nameds) { say +@poses, "; ", +%nameds }; foo( a => 42 ); foo( (a => 42) )
camelia rakudo-moar 2904f3: OUTPUT«0; 1␤1; 0␤»
masak I think I was a little upset first time I saw that.
ShimmerFairy timotimo: I don't disagree, I'm simply stating that they _feel_ like different things; => looks Pair-like and :() looks parameter-like
masak because Perl also believes that "parentheses are only for grouping"
timotimo masak: the pair gets to be its own group :) 11:49
masak ShimmerFairy: but... named parameters are implemented as pairs, and that implementation is exposed/sold pretty heavily to the user. (through slurpies and flattening, etc)
ShimmerFairy: saying that they look like one another is missing that it's a feature, not a bug.
ShimmerFairy masak: I understand that (and it's pretty nice, I think), but I can't pretend that I don't see the two syntaxes in a lightly different way from each other. 11:50
masak ShimmerFairy: ...aaaand again the problem that needs fixing is inside your mind, not outside it ;)
ShimmerFairy masak: basically, even though %h = :a(1), :b(2) is perfectly fine, it looks really weird to me (but foo(a => 1) doesn't really look weird. Huh.) 11:52
masak .oO( Perl 6: "it's easy to use if you just learn this simple rule" -- ShimmerFairy: "but it doesn't work when I use this different rule!" )
11:53 yqt left
masak I'm one of your "get off my lawn" types, even though I joined somewhere around 2005. I remember a time before we had the :a(42) syntax. 11:53
so your only choice was a => 42
so I guess I always think of the former as convenient sugar for the latter 11:54
and *boy* is it convenient!
not only :$a, but also things like :$^a and :$!a
ShimmerFairy And :42a is even more convenient! :)
masak ShimmerFairy-- # you deserve that one :)
I don't take away karma lightly :> 11:55
ShimmerFairy aw :<
masak :42a syntax has *exactly* one use, in my world: :2nd et al
jnthn m: :100ways-to-annoy-masak
camelia ( no output )
jnthn :)
lizmat ShimmerFairy++ # need to compensate 11:56
masak jnthn-- # don't get to do this often :)
the colon syntax for named args is so convenient that it has affected the way I name variables before a call.
jnthn :D
lizmat masak: my only argument is that it should be used for named args exclusively 11:57
masak I'm more likely to name a callee argument variable after a parameter, because of the colon syntax.
lizmat: I guess what I'm saying is I don't see it that way, because I was present when it was introduced as sugar.
lizmat: to me, a => 42 is the "real" way to write a named arg
lizmat: and I'm lucky enough to *also* get to write it as :a(42) or :$a or :$.a because Perl 6 is awesome 11:58
some day I might cook up a slang that allows me to write :$<a>, by the way :)
ShimmerFairy m: say DateTime.new(:1year); # tell me this doesn't look cool, masak :P
camelia rakudo-moar 2904f3: OUTPUT«0001-01-01T00:00:00Z␤»
masak ShimmerFairy: you... have a point.
ok! two uses! but that's *it*! :P 11:59
ShimmerFairy (too bad you can't do :2years , since there's no :$years)
11:59 rindolf left
ShimmerFairy 11:59
12:00 jantore joined
masak ShimmerFairy: in fact, the .later and .earlier methods on Date/DateTime do support :years 12:01
12:01 rindolf joined
ShimmerFairy Interestingly: 12:01
m: say DateTime.new(:1month);
camelia rakudo-moar 2904f3: OUTPUT«Must provide arguments to DateTime.new()␤ in block <unit> at /tmp/7IgHuCh4M1:1␤␤»
ShimmerFairy DateTime's constructor complains if you don't have :year , but the error message doesn't tell you that at all.
masak ShimmerFairy: nice find. please submit a rakudobug and/or make a patch :) 12:02
ShimmerFairy++ ++ShimmerFairy
ShimmerFairy Looks like a simple fix (just have to change the error message; should I spectest a change regardless, in the interest of paranoia?) 12:06
moritz yes please
paranoia++
ShimmerFairy That's what I thought. "It's just a simple string!" (but you never know...) :) 12:07
I'm assuming TEST_JOBS is the only parallelization feature? 12:12
timotimo yeah
er ... for what exactly?
ShimmerFairy will be doing a before and after spectest, just so she's absolutely sure
moritz and you can build with 'make -j' or 'make -j4'
ShimmerFairy timotimo: for testing a change I'll be making 12:13
moritz: Ah, forgot to specify I was talking about testing parallelization
timotimo building with -j* sadly doesn't help very much 12:14
ShimmerFairy not for rakudo, at least :(
masak does someone want to reply to Tom's latest p6u email? 12:15
moritz it does do the 'git pull' in roast in parallel with the build
which helps on slow networks
masak looks pretty easy -- he doesn't seem aware that 0 boolifies to False.
moritz aye 12:16
masak: seems like you want to answer :-)
masak I can do that.
ShimmerFairy Heh, my network incidentally is being slow atm, thanks to ~certain people~.
masak main reason I was checking is that there's some lag on p6u so many people tend to give the same answer
lizmat masak: maybe also mention .starts-with("#")
12:18 cschwenz left 12:19 raiph joined
masak lizmat: oops, sent without seeing the above. 12:20
lizmat: feel free to add that in a separate reply ;) 12:21
lizmat will do
masak (my email was about everything else)
BooK I like using :a for a => True 12:27
timotimo me, too
and of course the :$foo form is a very nice thing indeed
ShimmerFairy masak: good thing "0" doesn't boolify to False anymore, though :) (...right?) 12:28
lizmat mail sent
timotimo right, ShimmerFairy 12:29
moritz m: say ?'0'
camelia rakudo-moar 2904f3: OUTPUT«True␤»
lizmat m: say +'0'
camelia rakudo-moar 2904f3: OUTPUT«0␤»
lizmat m: say +?'0'
camelia rakudo-moar 2904f3: OUTPUT«1␤»
lizmat :-)
jnthn m: say ?+'0'
camelia rakudo-moar 2904f3: OUTPUT«False␤»
timotimo m: say say ?+~?'0'
camelia rakudo-moar 2904f3: OUTPUT«False␤True␤»
timotimo er 12:30
%)
m: say ?~?'0'
camelia rakudo-moar 2904f3: OUTPUT«True␤»
lizmat
.oO( stop stop stop! this is getting way too silly! )
ShimmerFairy m: my @a = 1,2,3; say +^@a; # always a weird typo to leave unnoticed
camelia rakudo-moar 2904f3: OUTPUT«-4␤»
12:31 Akagi201 joined
timotimo ouch, that's mean :) 12:31
12:31 Akagi201_ joined
ShimmerFairy In case it's not obvious, it's supposed to be ^+@a . There have been a couple of times where I wondered why there was this unwanted negative number for an index inside a for +^@a { ... } 12:32
timotimo took me a few seconds 12:33
i don't do bitwise ops often in p6 12:34
ShimmerFairy Yeah, I think prefix:<+^> is particularly uncommon, at least in my experience.
12:35 shlomif joined, rindolf left, shlomif is now known as rindolf
ShimmerFairy By the way, what about the bitwise string ops? Do they no longer work on Stringy types, because S03 itself says it indicates a design error? :) 12:35
12:35 Akagi201 left
timotimo welllll~ 12:36
stringy things are NFG now ..
so how does that work :D
oh, obviously we also need stringy set ops that go grapheme-wise and act on combining characters
ShimmerFairy "hello" ~& "world" :carefully 12:37
12:37 rurban1 joined
jnthn data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wAARCAJzAfQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqD 12:37
BooK timotimo: is :$foo an indirection?
ShimmerFairy timotimo: I'm of the opinion that the bitwise string ops should have never been defined for anything more than buffers. (Have you see that S32::Stringy I wrote a looong time ago and have shared a few times recently, by any chance?) 12:38
timotimo BooK: no, it's short for foo => $foo
jnthn The hell did I just paste...
timotimo ShimmerFairy: i think i saw it
jnthn: it's a small image, possibly an icon?
BooK oh, nice
ShimmerFairy jnthn: Base64 data of an image. Because.
jnthn epic fail
BooK depends on an image of what it is...
jnthn It was supposed to be a meme :P 12:39
ShimmerFairy could be worse; could've been a moderately-sized image :P (or, your client wouldn't've cut off the data)
jnthn Apparently instead of giving me a link to an image, it gave me a data: protocol URL with the whole image :P
BooK so undecidably safe for work
jnthn Not at all, it was one about bitwise ops :P 12:40
timotimo i'm not entirely sure if that's the picture you pasted or my browser telling me the data is broken
because it looks like an icon for a broken image %)
jnthn heh
jnthn goes back to writing code :)
ShimmerFairy timotimo: the pasted stuff looks suspiciously like it ends at the cutoff length for IRC messages
BooK jnthn: I just realized we've known each other for about ten years... 12:41
timotimo ah, of course
ShimmerFairy By the way, what kind of Uniform Resource Locator doesn't locate the resource, but just gives it to you instead? :P
timotimo the one for content-addressed storage :) 12:42
BooK chartreuse and fishnet, what a welcome in the perl community ;-)
jnthn BooK: Yes, YAPC::EU 2005 was my first YAPC and second Perl event :) 12:43
And what fun it was :)
BooK++ # one of the folks who made me feel very welcome in the Perl community 12:44
ShimmerFairy fail "Must provide arguments to DateTime.new()"; <-- should "DateTime" be instead "{self.^name}", or is that thinking ahead too much? (Derived classes and so on) :P
12:45 woolfy joined
lizmat welcomes woolfy 12:47
jnthn woolfy! \o/ 12:48
masak ShimmerFairy: "0" ? why would "0" boolify to false? that's insane. that'd be like the strings "nul", "zero" and "zilch" also boolifying to false :P
woolfy hey jnthn
masak woolfy! \o/ 12:49
ShimmerFairy m: say ?"The Earth is flat."; # this is clearly a bug, masak
camelia rakudo-moar 2904f3: OUTPUT«True␤»
masak ShimmerFairy: well, I certainly welcome you submitting a patch to fix that one! 12:50
ShimmerFairy: don't just solve special cases, though. you have to come up with a general solution. 12:51
jnthn Just implement it by delegating to Rule 1...
ShimmerFairy sub prefix:<?>(Str:D $a) { Wikipedia::query($a) || StackOverflow::query($a) || ... } 12:52
woolfy hey masak
(just passing by, showing #perl6 to a friend)(byebye) 12:53
12:53 woolfy left
dalek p/multidim: b296e1b | jnthn++ | src/vm/moar/QAST/QASTOperationsMAST.nqp:
Map multi-dim array ops on MoarVM.
12:54
p/multidim: 8deb3b8 | jnthn++ | t/moar/02-multidim.t:
Tests for VMArray supporting new multi-dim ops.

Only run on MoarVM for now. This checks that existing dynamic arrays will play nice with the new multi-dim access APIs, which may ease some code-gen (but mostly checks the ops are basically functional).
p/multidim: 287814e | jnthn++ | docs/6model/repr-compose-protocol.markdown:
Extend REPR array compose protocol for dimensions.
13:00
13:00 lucasb joined
lucasb good friday to everyone 13:01
jnthn
.oO( he said crossly )
japhb Just had to share this, as it cracked me up ... got a cold email from a recruiter today that begins "We’ve analyzed your open source contributions in Github, and we identified you as a potential good fit for a position as Software Developer at Booking.com." You mean, I wrote some Perl? 13:04
timotimo %) 13:05
ShimmerFairy japhb: got that too, seemed spammy
lizmat didn't get that :-( :-) 13:07
japhb lizmat: Clearly you're nto qualified to work at Booking! ;-) 13:08
ShimmerFairy tries to imagine what :-( ... :-) would mean :P
lizmat yeah, not enough commits on github :-)
japhb ShimmerFairy: The :-( was tongue in cheeck, methinks
Man, my connection from brain to fingers is a little broken today 13:09
ShimmerFairy japhb: I meant as a language construct :P (see how it's a matching pair?)
rurban1 we get a lot of excellent and qualified devs with no single github commit
lizmat that would qualify me :-)
japhb ShimmerFairy: I would think :-( and )-: would be the matching pair ... or (-: and :-) for the more positive 13:10
masak what's the idiomatic way to call a MAIN multi from another? 13:11
ShimmerFairy The only change I got in the spectest was a different Wstat for t/spec/S17-lowlevel/lock.rakudo.moar , but I imagine that's not surprising
japhb Emotion markers! "This is sad code ... and this is happy code!"
masak: nextsame?
lizmat masak: samewith(...)
tadzik samwich()
japhb goes to look in bench, I'm pretty sure I did that
ShimmerFairy masak: shell("$*PROGRAM-NAME ...") ? :P 13:12
japhb Oh interesting, I just directly call MAIN with the appropriate args.
masak tries samewith
japhb wonders if that was once a backwards compat hack or something ... I've forgotten why I did it that way now. 13:13
masak ooh, interesting. that fails, with "Could not find 'self'"!
lizmat ah, of course
masak of course?
lizmat samewith is for methods...
masak m: multi MAIN() { samewith('foo') }; multi MAIN('foo') { "foo'd you!" }
camelia rakudo-moar 2904f3: OUTPUT«Could not find 'self'␤ in sub MAIN at /tmp/b9x1yueixg:1␤ in block <unit> at /tmp/b9x1yueixg:1␤␤»
masak how is samewith for methods? 13:14
13:14 brrt joined
japhb m: multi MAIN() { nextwith('foo') }; multi MAIN('foo') { "foo'd you!" } 13:14
camelia ( no output )
ShimmerFairy Wouldn't it be nextwith/callwith ?
japhb m: multi MAIN() { nextwith('foo') }; multi MAIN('foo') { say "foo'd you!" }
camelia ( no output )
japhb What ...?
masak japhb: I think `nextwith` uses the original list of candidates... 13:15
japhb m: multi MAIN() { callwith('foo') }; multi MAIN('foo') { say "foo'd you!" }
camelia ( no output )
japhb OK, that explains why I did it the old fashioned way, then.
dalek kudo/nom: 7b9145f | ShimmerFairy++ | src/core/Temporal.pm:
Improved error message for missing :year in DateTime.new()
13:17 xfix joined, xfix left, xfix joined 13:18 _mg_ left
masak jnthn: are we just unlucky with nextwith/samewith/callwith above, or is something broken, or have we misunderstood their purpose altogether? 13:23
does &?ROUTINE refer to a single candidate, or to all of them?
jnthn masak: nextwith/callwith iterate the existing candidate list 13:24
masak: If you supply incompatible arguments, that's your problem
samewith...I don't know, I think lizmat++ added that and I think it re-dispatches 13:25
But I don't see why it coudln't handle subs too
I mean, callwith etc does
masak right. I was surprised about "only for methods".
oh, well.
lizmat fwiw, it was one of my first implementations
jnthn I don't immediately see why we can't liberalize it to all routines
lizmat and I actually eradicated it from the core itself because of the overhead involved
masak it's not like MAIN is going to be refactored to have another name :) might as well write `MAIN` :)
lizmat: mind if I submit a rakudobug for it not working with subs? 13:26
lizmat I don't :-)
masak submits rakudobug
obviously, `samesame` is missing from the set we currently spec/implement ;) 13:34
timotimo m: samesame 13:35
camelia rakudo-moar 2904f3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bl347FUvYd␤Undeclared routine:␤ samesame used at line 1. Did you mean 'callsame', 'samecase'?␤␤»
masak jnthn: S12:954 13:36
synbot6 Link: design.perl6.org/S12.html#line_954
masak nextwith(1,2,3); # redispatch with a new set of arguments (no return)
samewith(1,2,3); # same dispatcher with new arguments (no return)
jnthn masak: Uhh...
masak jnthn: makes it sound like it's `nextsame` the gets a new candidate list and `samewith` that keeps l'old one
jnthn Whoa
When did that happen?
masak nextwith* 13:37
so in that case, I'd expect `nextwith` to have worked with MAIN...
jnthn I think next is the right name though; I mean, you're doing "next" on the candidate list...
I think S12 is out of line.
masak no idea
just reporting a discrepancy
I find that redispatching on the *same* candidate list as the first time is almost never what I want to do anyway.
in fact, I find I don't think naturally in terms of candidate lists when I code. I just think in terms of subs/methods with the same name but different signatures. 13:38
jnthn Remember that delegating to a base class is the most common use of these.
masak that is true.
13:38 RabidGravy joined
masak yeah, I can see that use case making sense. 13:39
and that doesn't translate well to my MAIN case.
answer from question before: &?ROUTINE refers to a single multi, not to all the multis.
(as one might expect) 13:40
jnthn Oh, I expect it to refer to the leixcally enclosing routine
masak right.
jnthn &?ROUTINE.dispatcher # gets you the proto
13:40 _mg_ joined
masak I'd rather write `MAIN` :P 13:40
gtodd withnext withsame :)
jnthn Me too :P
13:42 mr-foobar left 13:43 mr-foobar joined 13:45 telex left 13:46 telex joined
hoelzro morning #perl6 13:58
13:58 abraxxa left
hoelzro I found some behavior using heredocs, and I'm not really sure what the right thing to do is 14:00
gist.github.com/hoelzro/3b1ff9951908c9ce5aa4
it's concerning how leading whitespace removal is handled when one has an embedded newline via \n in a heredoc
14:02 g4 left
timotimo oh, interesting 14:03
i hadn't considered newlines that are escaped inside heredocs like that when i wrote the new dedenting code
hoelzro timotimo: I hadn't considered it either until I was converting code that used a single non-heredoc line and came across that =/ 14:06
I would file a ticket, but I don't even know if that's a bug. I don't even know what I expect it should do!
timotimo the latter part is the hard part 14:07
hoelzro indeed 14:08
lucasb Is there a way to dedent the heredoc literal text before expanding newline escape sequences? 14:09
hoelzro TimToady may have to weigh in
timotimo at the point the dedent code gets a hold of it, the information of literal \n and escaped \n is no longer available ;( 14:11
masak I'm... not sure I feel that's a bug...
timotimo in theory, the heredoc parser could emit the "required" number of spaces before a \n when it sees one
that would get rid of the warning
hoelzro masak: "not sure" is the thing with me too =/
masak what I see is a string with a newline with no spaces after it, which is fewer than the four spaces required. 14:12
that would normally qualify for the warning we see.
I can understand the argument that this \n newline is not part of the heredoc's actual newlines, but...
timotimo hehe
masak ...I'm also not ready to tear up compiler internals just to fix this one. 14:13
but let's see if TimToady has some nice insight about it.
colomon why would you want to embed a \n in a heredoc? 14:14
masak it's kind of related to (but not the same as) strangelyconsistent.org/blog/here-be-heredocs under the heading "Indentation, revisited"
colomon: that's a good, but separate question :)
we're exploring "what happens when you do?"
I don't believe it should be illegal.
hoelzro colomon, masak: there's no good reason, I just found it interesting
masak it is interesting. 14:15
hoelzro I was converting a long single double quoted string with multiple embedded newlines into a heredoc while refactoring a program
masak I mean, from the user's point of view, a \n in a heredoc isn't the same as a hard newline in a heredoc.
hoelzro right
14:15 laouji left
colomon what happens if you embed a string with a newline in it? I actually do that quite a bit in my (mostly p5) scripts 14:16
masak and the "Indentation, revisited" section chronicles when we decided (sort or) that only hard newlines should be indented (not newlines in interpolated strings)
colomon: read the blog post I linked.
colomon: there was a debate at some point.
hoelzro colomon: *that* is a really good question
RabidGravy hoelzro, you're interested in tutorial stuff have you seen www.livecoding.tv/ ?
masak hoelzro: yes, but it's been *resolved*.
hoelzro: read the post :)
hoelzro masak: working on it =) 14:17
jnthn I seem to remember I did it one way in the original herdocs impl in Rakudo, and something was off and got changed (probably what masak++ is referencing)
masak yes.
hoelzro RabidGravy: I did, but I don't know if I'm brave enough to do it live =S
jnthn I think I spliced in all the bits and then de-dented or something
timotimo that's right
masak yes.
hoelzro what's on YT is the result of lots of preperation, re-takes, and edits
masak which was surprising to users.
timotimo hoelzro: how long did it take you for just the recording phase? 14:18
masak timotimo++ implemented the less surprising behavior for indentation.
hoelzro timotimo: I just had to do two takes, so I think 20-30m?
jnthn *nod*
Yeah, the examples were pretty convincing.
hoelzro the live RT fixing took me a lot more takes, about 1h, iirc
timotimo <3 14:19
masak jnthn: not at first... it's one of the few times when I as a user supplied what I felt was a clear bug, and you as a compiler implementor gave a response equivalent to "orka!" :P
jnthn: but that's all Yeti under the bridge. it works as expected now. :)
14:21 khw joined
dalek kudo/nom: 9efa091 | lizmat++ | src/core/Backtrace.pm:
Fix error in Backtrace generation, skids++
14:22
kudo/nom: add2827 | lizmat++ | src/core/array_slice.pm:
Make [*]:v and []:v slices slightly faster
jnthn masak: Yes, well, being a compiler writer is one of those tasks where most interactions you have with users are when something doesn't work, 'cus when it does work they've little reason to come to you. And I can be pretty darn human about that sometimes. :) 14:24
masak jnthn: nod. completely understandable.
jnthn VM writer is even more like that, 'cus mostly folks only get concious of the VM when it says SIGSEGV or panics :P
(And yes, I do enjoy working on these things; it's just the nature of working on any infrastructural thing. You're building the stuff that people use to build the exciting shiny stuff, largely. :)) 14:25
colomon masak: believe it or not, indented heredocs was one of my main “must have p6 now!!!!” features back in 2004. 14:26
my $work scripts that generate C++ code use heredocs A LOT. 14:27
and the fact that they cannot be indented has very serious effects on the readability of said code.
hoelzro colomon: hah, that's *exactly* what I was working on
colomon (err, the perl part, not the c++ part) 14:28
hoelzro C++ generating code
colomon yes, generating C++ with Perl is one of my main tricks of my $work code 14:29
gtodd colomon: hehe 14:31
timotimo i had python code that generated c++ code some time ago 14:32
masak jnthn: also worth pointing out that the "torment the implementor" counter-argument is always worth hearing out, even in the cases where we eventually decides to go ahead and make the implementation difficult
colomon: as seen in that blog post, I was a latecomer to being enthusiastic in that way. but I'm all on board now. 14:33
RabidGravy I think for any given pairwise combination of languages I know I've written code in one to generate code in the other 14:34
colomon masak: April of this year? Yeah, you were a decade behind me. :)
hoelzro masak: nice post 14:36
gtodd colomon: so you have a large installed base of commercial production code written in written in perl6 14:37
14:37 tinyblak_ joined
gtodd colomon: written in (written in perl6) 14:38
colomon gtodd: no
well, guess it depends on what you mean.
gtodd :-D I'm trying to be irrational here
colomon I ship C++ source code. My customers never seen the Perl frame that makes much of it.
hoelzro it's 4th of July weekend here in the US, so I'll probably not be online much for the rest of the weekend. later #perl6! 14:39
DrForr Have fun, frighten the wits out of some dogs for me!
colomon gtodd: also, I’m a pretty conservative coder, so generally the p5 is only changed to p6 when I need to make significant changes in a script. 14:40
gtodd: so probably 75% of it is still p5, even though it would be vastly better in p6.
14:41 tinyblak left 14:42 _mg_ left
colomon life’s too short to change working code unnecessarily. 14:43
lucasb I think heredoc whitespace handling should happen very early in the compilation, before things like "\n\n\n $interpolvar { some-huge-text() } etc." gets evaluated. As a user, I think that is what I would expect. 14:44
But I understand it must be very hard to hook this things into the lexer/parser. There is that rule of knowing at which language one is at a time, so idk if it is possible to process the heredoc before other things.
14:45 gtodd left 14:46 amurf joined 14:50 amurf left
lizmat I just found some inconsistencies in the use of Whatever slices: 14:51
m: my @a = ^10; my $b = Whatever; say @a[*]; say @a[$b]
camelia rakudo-moar 7b9145: OUTPUT«0 1 2 3 4 5 6 7 8 9␤Indexing requires an instance, tried to do: @a[ (Whatever) ]␤ in block <unit> at /tmp/p3vLdfQCe2:1␤␤»
lizmat m: my %a = ^10; my $b = Whatever; say %a{*}; say %a{$b}
camelia rakudo-moar 7b9145: OUTPUT«9 7 5 1 3␤9 7 5 1 3␤»
14:52 noganex left
lizmat so I wonder whether the Whatever slice should be a syntax feature 14:52
aka, only allowing a literal * to trigger it
or whether a Whatever slice should be value driven (as it is now in the hash case)
jnthn m: say (*).perl 14:53
camelia rakudo-moar add282: OUTPUT«WhateverCode.new␤»
lizmat in any case, I think the behaviour should be independent of whether it is on an array or on a hash
jnthn aww
m: my $a = *; say $a.perl
camelia rakudo-moar add282: OUTPUT«*␤»
jnthn lizmat: Note that * is an instance of Whatever, not just Whatever the type object.
lizmat m: my $a = *; say $a.defined 14:54
camelia rakudo-moar add282: OUTPUT«True␤»
jnthn m: my @a = ^10; my $b = Whatever.new; say @a[*]; say @a[$b]
camelia rakudo-moar add282: OUTPUT«0 1 2 3 4 5 6 7 8 9␤0 1 2 3 4 5 6 7 8 9␤»
lizmat jnthn: good point 14:55
ugexe m: say [*]
camelia rakudo-moar add282: OUTPUT«1␤»
14:55 AlexDani` joined
timotimo m: say [Whatever] 14:55
camelia rakudo-moar add282: OUTPUT«(Whatever)␤»
14:56 noganex joined
ugexe m: say [*, 2] 14:56
camelia rakudo-moar add282: OUTPUT«* 2␤»
dalek p/multidim: e719094 | jnthn++ | t/moar/02-multidim.t:
Tests for setting up MultiDimArray REPR.
14:59
14:59 [Sno] left 15:02 skids joined 15:03 vendethiel left
ugexe Version needs some Whatever love too it looks like 15:03
m: say Version.new(*); say Version.new('*')
camelia rakudo-moar add282: OUTPUT«vWhatever.140438490100392␤v*␤»
lizmat m: say Version.new(i) # eek 15:05
camelia rakudo-moar add282: OUTPUT«v0.1.i␤»
timotimo m: say Version.new("a", "b", "c") 15:06
camelia rakudo-moar add282: OUTPUT«Default constructor for 'Version' only takes named arguments␤ in block <unit> at /tmp/Ua3ZhRrmE_:1␤␤»
timotimo m: say Version.new("abc")
camelia rakudo-moar add282: OUTPUT«vabc␤»
timotimo tee hee
15:07 diana_olhovik_ left, RabidGravy left
ugexe m: say Version.new('0.01') cmp Version.new('0.1'); # there is also stuff like this, but with the way versions are i would probably blame the author of the changing version scheme 15:09
camelia rakudo-moar add282: OUTPUT«Same␤»
15:09 vendethiel joined
skids masak: actually :34x :45y :3width works really well in SVG code. FWIW. 15:09
ugexe i implemented a better ACCEPTS for Version but its sloppy string chopping 15:10
15:12 domidumont left
timotimo m: say (:4.5m) 15:13
camelia rakudo-moar add282: OUTPUT«5===SORRY!5=== Error while compiling /tmp/JLOuU19_qZ␤Malformed radix number␤at /tmp/JLOuU19_qZ:1␤------> 3say (:47⏏5.5m)␤ expecting any of:␤ number in radix notation␤»
timotimo do we want that to work? :P
.o( masak says NNNNNOOOOOOoooooo! )
15:17 rurban1 left 15:19 rurban left 15:20 RabidGravy joined 15:24 SmokeMachine_ joined, rurban joined 15:26 Sqirrel left 15:28 Sqirrel joined 15:31 vendethiel left 15:33 berekuk joined 15:34 vendethiel joined 15:37 jack_rabbit joined 15:42 zakharyas left
lucasb To me, Whatever is just a special value like Nil. Why is it needed more than one instance of it? Why is it needed instances of it at all, since you can treat a typeobject as a value, just like Nil? 15:43
If Nil === Nil.new, so why not have Whatever === Whatever.new === * === $var-holding-whatever? This way, constructs that work if one kind, would work with all 4 representations the same way.
15:49 jack_rabbit left
lucasb m: say (* + 2)(3) 15:49
camelia rakudo-moar add282: OUTPUT«5␤»
lucasb m: say { $^a + 2 }(3)
camelia rakudo-moar add282: OUTPUT«5␤»
lucasb What are the differences between these two? After a WhateverCode is constructed, it as special as a normal subroutine/block with arguments, right? Why differentiate then?
masak colomon: heh, I got convinced quite some time ago :) 15:50
skids: no, that still qualifies as a "bad use" to me. "34 x" and "3 width" don't sound good when read out loud. "2nd" and "2 years" do.
skids masak: I try never to read anything XMLish out load though. :-) 15:51
masak: When "reading out load" X,Y coordinates, like longitude, latitude, the number is often read first. 15:58
16:01 Akagi201_ left
dalek p/multidim: 42bece2 | jnthn++ | t/moar/02-multidim.t:
Test set/introspect dimensions of multi-dim array.
16:07
masak skids: well, not liking how :3x looks is subjective. but I don't like how it looks. 16:14
skids :-) it is a bit of a weird feature
timotimo :3x looks like a cat with a bow tie 16:15
so of course i like how it looks :)
TimToady :3D <- happy cow 16:16
masak .oO( "in 2015, we realized where the language was heading, and just renamed it LOLCAT 6..." )
or LOLCOW 6 16:17
timotimo COWCODE
jnthn
.oO( "the top type was also renamed to Moo" )
16:18
skids wishes someone with too much time on their hands would leverage locales for humorous purposes.
timotimo LC_MESSAGES="angry"
skids LC_MESSAGE="pirate" 16:19
16:19 berekuk left
skids or lolcat, or comicbookguyfromthesimpsons 16:20
geekosaur github.com/crawl/crawl/blob/master...ng-fake.cc :p
TimToady but you have to specify which kind of pirate, fr.pirate, es.pirate, en.pirate... 16:21
geekosaur although less so than it used to be, since it's filters now instead of pretending to be actual languages
16:21 uncleyear left 16:23 uncleyear joined, tinyblak_ left
skids
.oO(is t/spec/S24-testing/line-numbers.t failing for anyone else or is that my new code)
16:24
16:24 _mg_ joined
geekosaur I'll be spectesting a just-finished pull-and-build in a couple minutes... 16:25
16:26 VinceDee joined
geekosaur (and then see if I can figure out a prototype for that \sigil warning from list discussion) 16:29
skids \sigil warning? 16:30
(which list?) 16:31
geekosaur p6u but I don't see it in the archive yet. subject "Passing a hash to a subroutine: best method?" 16:32
oh, archive direct page lands in june, whoops :) 16:33
16:33 _mg_ left
geekosaur www.nntp.perl.org/group/perl.perl6....g2148.html 16:33
16:34 amurf joined
skids Ah. 16:35
16:39 amurf left, brrt left 16:41 vendethiel left 16:42 tinyblak joined
geekosaur t/spec/S24-testing/line-numbers.t (Wstat: 65280 Tests: 0 Failed: 0) 16:42
think that'd be a "yes" :)
skids That is probably also what is breaking panda install Inline::Perl5 16:43
nine skids: that's broken? 16:44
skids Maybe the new run() stuff.
nine: via a submodule
erm, dependency 16:45
16:48 rurban left
masak geekosaur: I don't think %() is the opposite of \ 16:51
timotimo t.h8.lv/early_deaths_percentage.html - i'd be interested to learn if anybody makes sense of the "early deaths" numbers that can be found where the Allocations are
geekosaur no, it's not
timotimo jnthn: also for you -^
skids nine: File::Directory::Tree fails its test suite in much the same way as t/spec/S24-testing/line-numbers.t
geekosaur but if you're an experienced perl5 programmer, it *looks* like \%foo / %$foo 16:52
(the former making a ref and the latter dereferencing it)
(and the generalized form of the latter being %{expr}
) 16:53
16:53 vendethiel joined
timotimo 90.5% early deaths for Scalar objects seems good 16:53
jnthn The IntAttrRef survival rate is...curious 16:54
timotimo "109.73% early deaths" ... that's curious :S
i must be dividing by the wrong value 16:55
DrForr It done kilt 'em *good*.
skids I think I might be ready to unleash the new .assuming I've been working on. Needs github.com/rakudo/rakudo/pull/454 first though.
timotimo what are all those numbers %)
skids
.oO(zombie scalars oh noes)
16:56
timotimo i don't get it :) 17:01
17:02 diana_olhovik_ joined, Akagi201 joined
DrForr I for one welcome our new weakly typed overlords. 17:03
dalek p/multidim: 4219437 | jnthn++ | t/moar/02-multidim.t:
Tests for atposnd/bindposnd for multi-dim array.
jnthn I don't always program in 30C+, but when I do I write lots of tests... 17:04
timotimo i've apparently forgotten to build another hash to accumulate some data differently
jnthn dinner &
timotimo damn, i misinterpreted ... i think 17:06
the html app for the profiler is kinda hard to grok 17:08
i have a need for a nap, i think
17:09 xfix left 17:13 Akagi201 left 17:28 domidumont joined
lucasb so, there was some change recently about run external programs? 17:37
maybe that's why S24-testing/line-numbers.t is failing
skids FROGGS++ did some IO related stuff.
lucasb It tries to match qqx[$cmd] ~~ /.../
but since qqx failed, well, it dies. or so I think 17:38
geekosaur hm, so on the assumption that most intended captures are \(...) I added a warning to the other case; I should figure out how to only warn about it once, though. 17:41
...and guess I need to be more specific, since \key won't be a p5-ism (but *is* in the setting) 17:44
TimToady and please be sure to include the recommendation to parenthesize if you really mean it 17:46
ugexe lucasb: it fails because it tries to use a non-existant directory 17:48
lucasb ugexe: if we are talking about the same dir, it exists here on my end
I added a "...; true" to the line $cmd = "$*EXECUTABLE $full-path 2>&1; true"; 17:49
17:49 yqt joined
lucasb so that the command always returns success 17:49
17:49 spider-mario joined
lucasb What is a cleaner way of running a program you expect to fail, but just want the output? My work-around is silly, but it worked :) 17:49
ugexe ah so it works, its just the wrong exit code?
geekosaur yes, I will add that (esp. since I was looking at one such to make sure I was doing the right thing :)
ugexe btw, "true" is an exitcode of 0 17:50
geekosaur right now I'm testing with the first cut, just to get some idea of whether it's a sane text
*test
lucasb yeah, exitcode of 0 is success, right? :) 17:51
geekosaur you hope :)
TimToady .tell pmichaud I'm going to assume that, if you're prototyping the new efficient underpinnings as a module, I can safely work on removing most flatteners from the API, so we have more time to work out the programmer-visible gotchas (or in other words, Break All The Things sooner rather than later) 17:52
yoleaux TimToady: I'll pass your message to pmichaud.
17:53 yqt left
ugexe QX inherits stderr already 17:54
lucasb does it joins stdout and stderr in the same output? idk, I was just taking a look at why the code was failing 17:55
s/join/merge/ 17:56
ugexe its supposed to i think. or give you 2 streams
but right now that doesnt work
geekosaur heh, I think this might be my first submission since I derailed the original smartmatching in 2007 or thenabouts :) (still spectesting to validate it) 17:57
ugexe there is also a bug where if you try to call .status before you .close on the stderr/stdout, then it will give a bad exitcode even though the command will have executed successfully
seems that whatever reads the pipe buffer fails to close the stream for some reason and waits forever
you are right though. its busted. 18:00
18:02 espadrine left 18:05 nys joined
TimToady re \n in heredocs, the dedent should be happening before \n interpolation, just as it happens before $I-contain-a-newline interpolation 18:07
so re irclog.perlgeek.de/perl6/2015-07-03#i_10845432 I'd call it a bug 18:09
18:10 yqt joined 18:11 Akagi201 joined
TimToady recall that dedent is only for the purposes of establishing a false margin on the literal text, so from the user's perspective it really needs to happen before any kind of string processing 18:14
I can think of several ways to fix it 18:16
one is to treat \n interpolation more like $newline interpolation 18:17
18:17 Akagi201 left, nowan left
TimToady another is to substitute a sentinel character for \n inside heredoc parsing, and only dedent after the sentinel (and replace the sentinel with a real \n) 18:17
geekosaur got one unexpected fail, checking if that's because spectest is now ahead of his source or if it's related to his change 18:20
TimToady if it's t/spec/S24-testing/line-numbers.t, that's been failing for a while 18:21
geekosaur no, that one was why I said "unexpected fail" :)
18:21 [Sno] joined 18:22 bjz_ joined, Sqirrel left, Sqirrel joined
TimToady well, there are still some flappers 18:23
18:23 bjz left
geekosaur looks like it was a flap indeed, no error this time around 18:28
18:30 zakharyas joined 18:32 _mg_ joined 18:36 tinyblak left, zakharyas left
AlexDani` Hm, I remember there was a way to group some of the regexes in a grammar, so that using <thatgroupname> will result in using one of the regexes of that group, OR SOMETHING, I don't really remember what was that thing. Maybe there was no such thing at all and I made it up. Does anybody know what I'm talking about? 18:36
jnthn protoregexes? 18:39
ugexe proto token scheme {*}; token scheme:sym<http> { <sym> }; token scheme:sym<https> { <sym> }
18:40 noganex left
AlexDani` yea! 18:41
thanks
18:41 tinyblak joined, noganex joined 18:46 noganex_ joined, noganex left
AlexDani` Is it possible to negate a regex? Like match a thing that is NOT something. Or 'after' and 'before' are the only ways to do that? 18:52
masak AlexDani`: !~~
AlexDani` masak: um, but in a grammar? 18:53
geekosaur I should redo my repo as a github fork so I can pull-request...
jnthn Note that for <before <foo>> and <!before <foo>> can be expressed as <?foo> and <!foo> respectively
AlexDani` oh, so it is just <!foo> 18:54
jnthn Yeah. Note that it's still a zero-width assertion
AlexDani` oh
jnthn If you have a rule that matches a single char then you can use it as if it was a char class
masak submits TimToady-approved heredoc n de-indentation rakudobug
jnthn <-foo>
AlexDani` jnthn: this actually makes sense. Thanks 18:55
jnthn So <-alpha> means nything non-alphabetic.
darn my any key isn't working...
18:56 tinyblak left
AlexDani` jnthn: although I wonder why that single char limitation exists. Theoretically it can work with any fixed-width regex, no? 18:56
jnthn AlexDani`: Yeah but...how do we know the width? :) 18:57
You can always write <!foo> .**4 if it were 4 wide, for example 18:58
AlexDani` jnthn: I don't know, but I remember seeing something like that in perl5
skids m: my multi bar ($) { }; my sub foo () { my $q := bar($q); }; foo();
camelia rakudo-moar add282: OUTPUT«(signal SEGV)»
AlexDani` like "sorry, this regex is not fixed-width, I cannot do lookaround with this+
"
19:00 VinceDee left
skids ah, RT#125371 maybe 19:01
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125371
19:02 nowan joined
skids I'll tack it on there as a potentially-related. 19:02
timotimo answerized Tom on p6u 19:03
dalek p/early_death_percentage: 3268d38 | timotimo++ | src/vm/moar/profiler/template.html:
profiler template changes for "early death percentage"

currently sometimes displays values above 100%
19:06
19:07 bin_005 joined, nowan left
lucasb Would you agree if I said these contextualizers @(...), %(...) play *two* roles? They serve both to "dereference" an itemized aggregate and also as an aggregate constructor. I think I don't like they having both roles. 19:16
masak in timotimo++'s recent posting to p6u, is there something *theoretically* standing in the way of the typechecker going "hm, I have this constant `[1, 2, 3]` which will never work against the constraint `Int @bar`, but it *would* if I instantiated the array as an Array[Int]... so let's quietly do that behind the scenes" ...? 19:21
(I suspect it's possible but a bad idea, just like a lot of silent "fixing up" of failure conditions are a bad idea) 19:22
timotimo if you do it for constants only, you'll confuse the user when they extract that constant into a variable, i suppose 19:23
19:23 Begi joined
masak ...yeah. 19:24
timotimo i could see "here's a unified patch to fix that problem", though :P :P
masak right, it's like putting a patch on a leak, only to discover that the user is now dismayed by a bunch of leaks further out.
such a unified patch would need to do a lot of code flow analysis.
if I'm understanding you correctly, that is 19:25
jnthn I'm not sure "let's quietly do this O(n) operation on a potentially infinite thing BEHIND THE SCENES" is a great idea. ;) 19:27
19:27 nowan joined
TimToady lucasb: yes, but with the GLR we're de-emphasizing itemization to the point where it will be less of an issue 19:28
jnthn More generally, though, I don't get why people choose to opt in to stricter typing, then complain when they have to make some effort to follow the very rules they chose for themselves.
timotimo :)
Begi Jonathan, I'd like tell you THANKS for your talks ! 19:29
jnthn Begi: Welcome. I'm looking forward to the next round this summer :) 19:30
TimToady we might have some sugar on the caller end that says "please coerce the rest of this list to the nominal type we bind to"
lucasb TimToady: thanks! 19:31
19:31 nowan left
TimToady also, @() and %() are coercers, not obligate constructors 19:32
masak nice long de-indentation bug summary here: rt.perl.org/Ticket/Display.html?id=125543
TimToady whereas [] and {} are obligate constructors/composers
but your question does relate to a fundamental issue we have to nail down with the GLR, which is detangle the two meanings of .list, which has the same 2-function problem 19:33
lucasb If @() and %() don't get an itemized aggregate of the right type as their first and only argument, they work (more or less) like constructors: @(1,2,3), %{a=>1,b=>2}
jnthn lucasb: @(1,2,3) is just syntax sugar for (1,2,3).list, and % for .hash 19:34
And 1,2,3 in Perl 6 is a first-class thing that can be coerced
TimToady I consider .list to be the real amibiguity, because we use it to iterate things, as well as to coerce to list 19:35
and those are really two different things
19:36 domidumont left
lucasb After the GLR, the [] vs []<> and {} vs {}<> will still exist? 19:37
TimToady no
[] and {} will no longer itemize
nor will [] flatten inside
19:38 VinceDee joined
TimToady we might or might not need a p5flat primitive to flatten the () without flattening []/{} 19:39
but we don't know if anyone will really want that distinction, post-GLR, other than making it work more like p5
or some more general .tree-like method that can choose what to flatten and what not to 19:40
lucasb I may have not understood: post-GLR, my @a = [1,2],[3,4] will be [1,2,3,4] ?
TimToady no
lucasb Oh, good :)
TimToady the outer comma causes you to have two top-level elemens
basically one of those spots where we say, just take the top node and iterate it 19:41
so my @a = [1,2] iterates teh top Array, while my @a = [1,2],[3,4] iterates the top List
much like for does currently 19:42
m: for (1,2) { .say }
camelia rakudo-moar add282: OUTPUT«1␤2␤»
TimToady m: for (1,2),(3,4) { .say }
camelia rakudo-moar add282: OUTPUT«1 2␤3 4␤»
TimToady [] will work the same after we de-itemize it
m: for (1,2), { .say } 19:43
camelia rakudo-moar add282: OUTPUT«5===SORRY!5===␤Expression needs parens to avoid gobbling block␤at /tmp/4hPVQnKJPu:1␤------> 3for (1,2), { .say }7⏏5<EOL>␤Missing block (apparently taken by expression)␤at /tmp/4hPVQnKJPu:1␤------> 3for (1,2), { .say }7⏏5<EOL>␤␤»
TimToady m: for (1,2),Empty { .say }
camelia rakudo-moar add282: OUTPUT«1 2␤»
TimToady m: for ((1,2),) { .say }
camelia rakudo-moar add282: OUTPUT«1 2␤»
TimToady m: for $(1,2) { .say } 19:44
camelia rakudo-moar add282: OUTPUT«1 2␤»
TimToady three workarounds if you don't want the outer parens to be ignored
lucasb It made things clear, thanks 19:48
19:48 nnms left, domidumont joined
dalek p/multidim: caee034 | jnthn++ | t/moar/02-multidim.t:
Test for 3D native packed int array.
19:49
masak the THIRD DIMENSION 19:52
19:56 nowan joined, mr-foobar left, darutoko left 19:59 raiph left, Akagi201 joined 20:04 domidumont left 20:06 Akagi201 left
ugexe pr sent to allow setting cwd of proc::async proccess via await $proc.start(CWD => "/some/other/path"); instead of always using $*CWD 20:06
RabidGravy works for me 20:07
ugexe keeps one from having to do the chdir shuffle if you have to send relative file paths as an argument to whatever you want to run 20:08
20:11 _mg_ left, amurf joined
dalek kudo/nom: d67674b | (Nick Logan)++ | src/core/Proc/Async.pm:
allow Proc to be started in any directory

Allows the use of relative file path arguments to `$!path` to work.
This allows avoiding CWD related boilerplate like:
   my $cwd-bak = $*CWD;
   chdir("/home/foo");
   # execute some process that expects CWD to be /home/foo
   chdir($cwd-bak);
20:12
kudo/nom: c28ad62 | lizmat++ | src/core/Proc/Async.pm:
Merge pull request #459 from ugexe/patch-7

allow Proc::Async to be started in any directory
jnthn wonders a little about the uppercase parameter name... 20:15
geekosaur probably shouldn't be, although I can see why
ugexe its used in IO that way which is why. not a good reason i admit, but i didnt really think about it :) 20:16
20:16 amurf left
lizmat m: my $q := $q.foo 20:18
camelia rakudo-moar add282: OUTPUT«Cannot call method 'foo' on a null object␤ in block <unit> at /tmp/VohBd_wlEv:1␤␤»
lizmat I wonder whether we should allow binding a new variable to itself, whether that id directly or not 20:19
m: my $q := $q
camelia ( no output )
lizmat m: my $q is default(42) := $q
camelia ( no output )
lizmat m: my $q is default(42) := $q; say $q
camelia rakudo-moar add282: OUTPUT«(signal SEGV)»
lizmat m: my $q := $q; say $q
camelia rakudo-moar add282: OUTPUT«(signal SEGV)»
geekosaur somehow I had a feeling that was going to happen
lizmat I know it's a matter of DIHWIDT 20:20
TimToady no, it's a matter of nobody's implemented stringifying recursive structures yet
jnthn That one is because we optimize such lexicals into locals, and there's some mishandling of nullness there 20:21
I've known the issue for a while, but it didn't reach top of the list yet, not least 'cus it's always a NULL it hits rather than an exploitable...
Will make srue to deal with it ahead of the .birthday release. 20:22
TimToady m: my $q := $q; say $q.DEFINITE
camelia rakudo-moar add282: OUTPUT«False␤»
TimToady m: my $q := $q; say $q.WHAT 20:23
camelia rakudo-moar add282: OUTPUT«(signal SEGV)»
lizmat m: my $q := $q; $q.gist # don't think the SEGV is because of the stringification 20:24
camelia rakudo-moar add282: OUTPUT«Cannot call method 'gist' on a null object␤ in block <unit> at /tmp/DHb7uZHQak:1␤␤»
TimToady nod 20:25
dalek kudo/nom: 1d82c95 | usev6++ | src/core/Mu.pm:
Prevent calling .clone with new attributes affect the original

fixes RT #118559
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=118559
dalek kudo/nom: 362c456 | lizmat++ | src/core/Mu.pm:
Merge pull request #448 from usev6/rt118559

Prevent calling .clone with new attributes affect the original
20:28 Begi left
dalek p/multidim: d3dbc81 | jnthn++ | t/moar/02-multidim.t:
Test we can't do dimension-changing ops.
20:31
p/multidim: 37bf89d | jnthn++ | t/moar/02-multidim.t:
Fix thinkos in tests.
p/multidim: 1092020 | jnthn++ | t/moar/02-multidim.t:
Tests for atpos/bindpos ops on MultiDimArray.
ugexe it seems a similar cwd parameter will work for Proc.pm's new spawn/shell/run commands. time for more tests
20:33 espadrine joined, mr-foobar joined
ugexe if i were to submit a similar pr for that, should i use 'cwd' or 'CWD'? 20:42
TimToady cwd seems fine to me 20:46
dalek p/multidim: 4b77efd | jnthn++ | t/moar/02-multidim.t:
Another few thinko fixes.
20:47
p/multidim: fac0b5c | jnthn++ | t/moar/02-multidim.t:
Test elems/setelems ops on MultiDimArray REPR.
ugexe i see the light now. with a sig of ($CWD = $*CWD), it never saves the user anything as calling func(:$*CWD) is redundant. But in IO:: modules its binding to attributes and whatnot 20:51
20:57 diana_olhovik_ left 20:58 lucasb left
moritz m: sub f(Int() @a) { say @a.join }; f [1, 2, 3] 21:03
camelia rakudo-moar 362c45: OUTPUT«Type check failed in binding @a; expected 'Positional[Any]' but got 'Array'␤ in sub f at /tmp/VU1E0y65N3:1␤ in block <unit> at /tmp/VU1E0y65N3:1␤␤»
moritz m: sub f(Int(Mu) @a) { say @a.join }; f [1, 2, 3]
camelia rakudo-moar 362c45: OUTPUT«Type check failed in binding @a; expected 'Positional[Mu]' but got 'Array'␤ in sub f at /tmp/YnUpt5_ljK:1␤ in block <unit> at /tmp/YnUpt5_ljK:1␤␤»
21:03 bin_005 left
moritz m: my Int @a = 1, 2, 3; say @a 21:05
camelia rakudo-moar 362c45: OUTPUT«1 2 3␤»
dalek ast: d466fc7 | usev6++ | S32-array/push.t:
Add test for RT #112660
21:06
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=112660
21:07 TimToady left 21:09 TimToady joined
timotimo moritz: that'd just parameterize the "wanted" type with a coercive type, not coerce on assignment. but cute idea anyway 21:11
dalek ast: e84a51c | usev6++ | S32-array/push.t:
Adjust test to make description clearer
21:13
moritz just wrote a longish rant to p6u about typed arrays 21:15
21:16 TEttinger joined
timotimo uh oh 21:16
21:20 Sqirrel left 21:21 nowan left, bin_005 joined
masak moritz++ # good rant :) 21:22
moritz++ # "yours ranting"
geekosaur rantiloquent 21:23
21:24 nowan joined
skids m: gist.github.com/skids/d1552470ba7c4ca6d3 21:25
camelia rakudo-moar 362c45: OUTPUT«gist not found»
21:29 rindolf left
skids (That gist is what I found irksome about Cursor) 21:30
21:41 VinceDee left 21:48 Akagi201 joined 21:50 rurban joined
timotimo it's a 404, though 21:51
21:54 Akagi201 left
skids Oh, I thought camelia was just not doing gists still. What did I... oh gist.github.com/skids/d1552470ba7c4ca6d318 selection fail. 21:55
21:58 awwaiid left
jnthn 'night, #perl6 21:58
timotimo gnite jnthn 21:59
21:59 kaare_ left
RabidGravy erp 21:59
timotimo and plane well tomorrow :)
jnthn Thanks! :)
o/
22:01 awwaiid joined, amurf joined
timotimo it won't be terribly hot on the plane at least :) 22:01
22:06 amurf left 22:16 spider-mario left, telex left
masak 'night, #perl6 22:17
22:18 telex joined 22:28 espadrine left 22:34 Akagi201 joined 22:39 colomon left
dalek kudo/nom: 0c88527 | lizmat++ | src/core/Mu.pm:
Fix .clone issues a bit better
22:42
22:43 vendethiel left
dalek ast: fa49fa9 | lizmat++ | S12-attributes/ (2 files):
Unfudge now passing .clone test, fixes #118559
22:44
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=118559
lizmat calls it a day as well 22:46
so good night, #perl6!
skids o/ 22:47
22:48 vendethiel joined 22:50 rurban left
skids github.com/skids/rakudo/tree/assuming_alpha buildable snapshot of my current .assuming work if anyone wants to play with it. Everything of consequence is in src/core/Block.pm 23:02
23:13 BenGoldberg joined, newbie joined, yqt left, newbie left
dalek Iish/pg-config: 7e5eff5 | lembark++ | .gitignore:
ignore editor cruft
23:14
Iish/pg-config: 9b7f194 | lembark++ | t/ (4 files):
use PG environment variables to configure connection; update POD to avoid user having to pre-create hardwired database and user
23:14 dj_goku joined 23:16 RabidGravy left
japhb skids: What are you changing about .assuming? 23:17
skids japhb: github.com/skids/rakudo/commit/975...8856e2e240 23:18
And it all started by trying to fix one simple RT :-) 23:20
23:23 bin_005 left, bin_005_j joined 23:30 rvchangue left, rvchangue joined 23:31 avalenn left, steve_mc left
japhb skids: Ah, interesting! 23:31
23:32 avalenn joined, Ben_Goldberg joined 23:33 BenGoldberg left
skids Eventually will have to figure out whether macros or some sort of MOP are the best approach to ridding it of EVAL. 23:33
23:34 steve_mc joined 23:45 virtualsue left, virtualsue joined 23:50 amurf joined 23:54 amurf left