»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:01 jevin joined, tarch joined 00:02 tarch left
TimToady perl6: say (1 ... *) min (2 ... *) 00:04
p6eval rakudo 33fb02, niecza v14-19-g256172a: OUTPUT«(timeout)» 00:05
..pugs b927740: OUTPUT«*** ␤ Unexpected " min"␤ at /tmp/2q4vFjni03 line 1, column 14␤»
TimToady perl6: say [1 ... 5] min [2 ... 6]
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected "["␤ expecting bare or pointy block construct, ":", identifier or operator␤ at /tmp/412ncUxsUC line 1, column 5␤»
..rakudo 33fb02, niecza v14-19-g256172a: OUTPUT«1 2 3 4 5␤»
TimToady but...
perl6: say ([1 ... *] min [2 ... *])[^20]
p6eval niecza v14-19-g256172a: OUTPUT«(timeout)» 00:06
..rakudo 33fb02: OUTPUT«2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "["␤ expecting expression or ")"␤ at /tmp/HDgLNYfup2 line 1, column 6␤»
TimToady rakudo is closest to correct, but, er, not
perl6: say [1 ... 5] min [2 ... 4] 00:07
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected "["␤ expecting bare or pointy block construct, ":", identifier or operator␤ at /tmp/gPrXS_9SYU line 1, column 5␤»
..niecza v14-19-g256172a: OUTPUT«2 3 4␤»
..rakudo 33fb02: OUTPUT«1 2 3 4 5␤»
TimToady rakudo: say [1 ... *] cmp [2 ... *] 00:08
p6eval rakudo 33fb02: OUTPUT«-1␤»
TimToady oops, missing Order enum... 00:09
but if it's correctly an Increase, why is min picking the max of 1...* and 2...* 00:10
(and why doesn't it work with () lists instead of [], if list comparisons are done lazily?) 00:11
doy [1 ... *] cmp [2 ... *] should clearly be 0, shouldn't it? 00:12
TimToady no, Positionals should compare position by position until a difference is found, so it should return after only examining the first position 00:13
(s) 00:14
00:14 bluescreen100 joined
TimToady this is obviously what it is doing in the finite case, since it correctly returns 1...5 00:15
00:15 rgrau left
TimToady nom: say ([1 ... *] min [2 ... 5])[^20] 00:15
p6eval nom 33fb02: OUTPUT«2 3 4 5 Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any()␤»
TimToady that's just wrong 00:16
nom: say ([1 ... 5] min [2 ... *])[^20]
p6eval nom 33fb02: OUTPUT«1 2 3 4 5 Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any() Any()␤»
TimToady that's correct
well, except that [^20] should probably be autotrimming
or maybe it's only infinite ranges that autotruncate these days, hmm 00:18
nom: say ([1 ... 5] min [2 ... *]).munch(20) 00:19
p6eval nom 33fb02: OUTPUT«1 2 3 4 5␤»
TimToady I guess there's that
nom: say munch 20, [1 ... 5] min [2 ... *] 00:20
p6eval nom 33fb02: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&munch' called (line 1)␤»
TimToady aww
perl6: say 1 => 2 => 3 min 2 => 3 => 4; 00:22
p6eval rakudo 33fb02, niecza v14-19-g256172a: OUTPUT«1 => 2 => 2 => 3 => 4␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "min"␤ expecting operator, ":" or ","␤ at /tmp/f_ATPAavE4 line 1, column 17␤»
TimToady oops 00:23
perl6: say (1 => 2 => 3) min (2 => 3 => 4);
p6eval pugs b927740: OUTPUT«*** ␤ Unexpected "min"␤ expecting operator, ":" or ","␤ at /tmp/tAEpV2uIbW line 1, column 19␤»
..rakudo 33fb02, niecza v14-19-g256172a: OUTPUT«1 => 2 => 3␤»
TimToady perl6: my $a; my $l = 1 => 2 => $a; $a = 3 => 4; $l = $l.value; say $l 00:26
p6eval niecza v14-19-g256172a: OUTPUT«2 => 3 => 4␤»
..pugs b927740: OUTPUT«2 ␤»
..rakudo 33fb02: OUTPUT«2 => Any␤»
TimToady niecza++
(can do cons lists that can GC the head when no longer referenced)
probably need to maintain $a = Nil on the end to keep pushing though 00:27
00:35 Trashlord left
sorear good * #perl6 01:00
TimToady wonders if there's any way to generate a => list lazily using ... 01:30
01:34 tokuhirom left 01:45 scott__ joined 01:47 Chillance left
colomon \o 02:06
niecza: say ('a' => 1, { .key++ => .value++ } ... *.value > 10).perl 02:08
p6eval niecza v14-19-g256172a: OUTPUT«Unhandled exception: Unable to resolve method key in class Any␤ at /tmp/eTJ5Jb_Nur line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3705 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3706 (module-CORE @ 65) ␤ at /home/p6…
colomon niecza: say ('a' => 1, -> $p { $p.key++ => $p.value++ } ... *.value > 10).perl 02:09
p6eval niecza v14-19-g256172a: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/CV9TWjT2tU line 1 (ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2988 (ANON @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 2995 (ANON @ 17) ␤ at <unknown> line 0 (KERNEL dogather …
02:29 bluescreen100 left, bluescreen10 left 02:54 whiteknight left 02:56 woosley joined
dalek ecza: 18249a6 | (Solomon Foster)++ | lib/CORE.setting:
Improve (?) KeyBag.new, tweaks to a bunch of KeyBag routines, O(number of different keys) routine for KeyBag.pick and KeyBag.roll.
03:01
ast: c46f211 | (Solomon Foster)++ | S02-types/keybag.t:
Another 44 tests.
colomon sorear: running a proper timing now, but I'd swear a spectest run takes twice as long as it did a week ago. 03:09
03:12 benabik left
TimToady niecza: say <a b c> ∪ <b c d> 03:12
p6eval niecza v14-20-g18249a6: OUTPUT«===SORRY!===␤␤Confused at /tmp/gFVtTuIflF line 1:␤------> say <a b c> ⏏∪ <b c d>␤␤Parse failed␤␤»
TimToady wants that to work
colomon TimToady: sorry, I wasn't able to get the operators to work on the first go 03:15
I've been meaning to get back to it, but the basic functionality for all of them isn't in place yet
sjn rakudo: say <a b c> ∪ <b c d> 03:18
p6eval rakudo 33fb02: OUTPUT«===SORRY!===␤Confused␤at /tmp/DZx2lmeptV:1␤»
03:18 benabik joined
sjn aw :-( 03:18
sjn likes that thought too
colomon needs to port the KeyBag tests / fixes back to Bag
TimToady well, I like the way you're doing it better than the way I'm not doing it. :) 03:19
colomon Actually, that does bring up a question, as long as I've got your ear 03:20
TimToady yessir
colomon right now IO 03:21
'v
try that again
03:22 jferrero left
colomon right now I've got KeyBag.new set up so it's a slurpy list, and if any of the components of the list are Sets, Bags, KeyBags, KeySets, Hashes, or Pairs, it treats them like you wanted to add the components of that object to the KeyBag 03:23
TimToady as opposed to their keys
colomon no, I mean it adds the key / value pairs.
03:23 wolfman2000 joined
TimToady which is different from how hash assignment works 03:23
colomon like KeyBag.new(set <a b c>, set<a c d>) would give you a=>2, b=>1, c=>2, d 03:24
TimToady you mean it adds the pair as a key?
colomon no, it splits up the Pair into key and value
TimToady I think that's probably right
03:24 jferrero joined
TimToady I don't think we should optimize for sets of sets and such 03:25
colomon yeah, that's what I was wondering about
TimToady can always add (foo => bar) => True
generally we want to optimize for sets of values, I think
colomon okay, great, that's how I've been doing it. 03:26
TimToady well, it should really fall out of list context anyway that way
since in list context a set or a bag is not the pairs
just hte keys
*th
colomon hmmm, really?
I've got it that way for sets, but not for bags.
TimToady niecza: say join ',', set <a b c> 03:27
p6eval niecza v14-20-g18249a6: OUTPUT«set(< a b c >)␤»
TimToady that's not right
colomon well, I thought I had it that way for sets...
method list() { %!elems.keys }
TimToady say join ',', set(<a b c>).list
niecza: say join ',', set(<a b c>).list 03:28
p6eval niecza v14-20-g18249a6: OUTPUT«a,b,c␤»
TimToady that's more like
but I don't think the .list should be necessary, by spec
colomon you think Bag.list should do the same, rather than being a=>1, b=>1, c=>1?
sorear colomon: a timing run wouldn't do much good unless you can also find out _why_
colomon: also, please don't leave notes here and expect me to read them 03:29
colomon sorear: it will at least establish I'm not dreaming.
sorear colomon: I *won't*
TimToady colomon: yes, you can always ask for .pairs if you want it
colomon sorear: oh, okay
sorear I don't have time this week/month/semester
03:30 jaldhar joined
colomon sorear: I'll try to get a proper binary search for the slowdown going tomorrow, if I have time. 03:30
TimToady niecza: my %set := set < a b c >; say %set
p6eval niecza v14-20-g18249a6: OUTPUT«set(a, b, c)␤»
colomon sorear: would you prefer I leave messages for you with phenny or e-mail? Or should I just not bug you for a month?
TimToady that should flatten
niecza: my $set := set < a b c >; say $set 03:31
p6eval niecza v14-20-g18249a6: OUTPUT«set(a, b, c)␤»
TimToady that shouldn't
sorear colomon: email's better because I can save emails 03:34
colomon sorear: okay
skids What should I be setting to make niecza's '@path' happy?
colomon skids: for "use" paths?
skids yes
colomon skids: -Idir 03:35
so mono run/Niecza.exe -Ilib (for instance)
skids thx colomon++
colomon sorear: okay, I've got a timing. remember me saying it took me 5 minutes to run a spectest a few weeks ago? Well, it's 24 minutes now. Like I said, I'll bisect things looking for the slowdown ASAP. 03:36
TimToady: thanks for the help 03:38
03:43 am0c joined
sorear colomon: thanks a lot 03:47
03:50 orafu left, orafu joined 03:53 Transformer joined, Transformer left 03:59 Psyche^ joined, Psyche^ is now known as Patterner 04:03 Patterner left 04:04 Psyche^ joined, Psyche^ is now known as Patterner 04:23 Su-Shee_ joined 04:27 Su-Shee left, xinming left 04:28 Patterner left 04:31 Psyche^ joined, Psyche^ is now known as Patterner 04:33 chee is now known as bot-chee 04:34 bot-chee is now known as chee 04:37 xinming joined 04:39 am0c left 04:56 Patterner left 04:58 Psyche^ joined, Psyche^ is now known as Patterner 05:02 birdwindupbird joined 05:24 Patterner left, Psyche^ joined, Psyche^ is now known as Patterner 05:54 Patterner left
moritz o/ 05:55
05:55 Psyche^ joined, Psyche^ is now known as Patterner
sorear o/ 05:56
06:07 Patterner left 06:15 Psyche^ joined, Psyche^ is now known as Patterner 06:17 koban joined, koban left 06:25 ruoso left 06:33 ruoso joined 06:40 13WAAFDVP left, tarch joined 07:04 dbr joined 07:09 GlitchMr joined 07:11 Patterner left, Psyche^ joined, Psyche^ is now known as Patterner 07:19 wtw joined
masak o/ 07:22
sorear /o 07:24
jnthn wtf, it's already morning again... 07:38
phenny jnthn: 06 Feb 22:50Z <not_gerd> tell jnthn turns out what I'm proposing is actually the addition of a second meta-object which only known how to deal with a fixed set of parrot-specific messages
jnthn: 06 Feb 22:50Z <not_gerd> tell jnthn feel free to leave a comment at the gist instead of leaving a note with phenny
jnthn I mean, er, good morning #perl6
07:39 benabik left
moritz mrning jnthn 07:39
07:40 benabik joined
masak mornington, Worthingwon. 07:46
*Worthington 07:47
sorear masak++ # finally got around to reading ze psyde post. 07:50
masak ooh, feedback :)
thanks for that.
yeah, I need to push myself to do these things. I'm happy about my blog, but I've realized I won't ever reach those goals without predeclaring them. 07:51
07:52 Patterner left 07:56 PacoAir joined
jnthn masak: bleh, I ain't staying at the mornington this time... 07:59
I'm at this other place 30 mins away
masak pun fail :) 08:01
jnthn At least I could use the metro 08:03
But it seems so crappy compared to the Moscow one.
ok, time for class :)
masak every metropolitan railway system -- except for maybe Tokyo's and/or Seoul's -- seems crappy compared to Moscow's. 08:05
I mean, you can't beat a marbled underground castle with stairs and chandeliers. you just can't. 08:06
bonsaikitten masak: tried shanghai? they are doing a pretty good job at getting there
including the fastest maglev train to connect the airport with some random place outside the city 08:07
08:08 PacoAir left 08:10 Su-Shee_ is now known as Su-Shee 08:14 bbkr1 left, GlitchMr left
masak no, haven't tried Shanghai yet. sounds like another place that might be doing pretty well on the metro scale, though. 08:17
bonsaikitten largest metro system these days in terms ok track length, and I think they are #1 with passengers too 08:18
tadzik 'morning 08:22
masak morning-tadzik! \o/ 08:23
08:28 DrEeevil joined 08:29 bonsaikitten left 08:30 broquaint joined 08:34 DrEeevil is now known as bonsaikitten 08:36 mj41 joined 08:37 woosley left 08:43 bonsaikitten left, bonsaikitten joined
cognominal_ Calvin or TimToady? :) "verbing weird languages" 08:44
08:47 snearch joined
masak both Calvin and TimToady uses "verb" as a verb quite a bit, I believe. 08:47
it's a delightful habit. I should habit verbing a bit more myself, I believe. 08:48
use*
moritz right, we don't verb enough!
cognominal_ we don't weird enough either. 08:49
08:51 am0c joined 08:56 woosley joined
masak ponders whether we language enough 08:58
I just realized that the majority of "how many <X> does it take to screw in a light bulb?" jokes qualify as autopuns. 08:59
moritz nom: my @a = <a b c d e f g>; my $start = 2; my $dir = -1; say @a[$start, { ($_ + $dir) % @a ...^ $start] 09:00
p6eval nom 33fb02: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 2␤»
moritz nom: my @a = <a b c d e f g>; my $start = 2; my $dir = -1; say @a[$start, { ($_ + $dir) % @a} ...^ $start]
p6eval nom 33fb02: OUTPUT«␤»
moritz huh? 09:01
nom: my @a = <a b c d e f g>; my $start = 2; my $dir = -1; say $start, { ($_ + $dir) % @a} ...^ $start
p6eval nom 33fb02: OUTPUT«␤»
moritz nom: my @a = <a b c d e f g>; my $start = 2; my $dir = 1; say $start, { ($_ + $dir) % @a} ...^ $start
p6eval nom 33fb02: OUTPUT«␤»
moritz why is that empty?
nom: my @a = <a b c d e f g>; my $start = 2; my $dir = 1; say ($start, { ($_ + $dir) % @a} ...^ $start).perl 09:02
sorear aggressive trimming is my guess
p6eval nom 33fb02: OUTPUT«().list␤»
sorear TimToady has in the past expected ...^ to be as lazy as possible
I doubt it even *sees* the generator, rather aborting during the literal prefix 09:03
moritz oh.
masak nom: say .for 1, * + 1 ...^ 1
p6eval nom 33fb02: OUTPUT«===SORRY!===␤Confused␤at /tmp/UWNiZ0VVuw:1␤»
sorear .say for
masak nom: .say for 1, * + 1 ...^ 1
p6eval nom 33fb02: ( no output )
masak nom: .say for 1, * + 1 ...^ 1; say "alive"
p6eval nom 33fb02: OUTPUT«alive␤»
moritz niecza: .say for 1, * + 1 ...^ 1; say "alive" 09:04
p6eval niecza v14-20-g18249a6: OUTPUT«alive␤»
masak moritz: I think it's because it figures "oh, 1 already, and then don't print the 1".
moritz maybe we should change that?
masak moritz: so it's the *same* 1 in some sense.
moritz masak: right
masak: but is it useful as is?
masak moritz: I dunno, could go both ways on what's actually right here.
it feels wrong in this use case.
might be just right in others.
moritz right
masak try changing it in nom and see what spectests fail :)
sorear but we're very constrained by the maximal-laziness thing
I don't think TimToady's prime generating one-liner is an actual spectest but he whined when I broke it in niecza last :p 09:05
masak nom: my @a = 1..10; .say for @a ...^ 5
moritz the thing that feels wrong is that the LHS of the ... does not appear in the output
p6eval nom 33fb02: OUTPUT«1␤2␤3␤4␤»
sorear zzz
masak good zzz, sorear. 09:06
moritz dream of repeated characters :-)
masak :)
timotimo nom: sub postfix:<zzz>($a) { say "$_ little fluffy sheeple..." for 0 .. * }; "sorear"zzz; 09:07
p6eval nom 33fb02: OUTPUT«(timeout)0 little fluffy sheeple...␤1 little fluffy sheeple...␤2 little fluffy sheeple...␤3 little fluffy sheeple...␤4 little fluffy sheeple...␤5 little fluffy sheeple...␤6 little fluffy sheeple...␤7 little fluffy sheeple...␤8 little fluffy sheeple...␤9 little fluffy … 09:08
timotimo hm, zzz is pure, i could make repeated usages of it faster with memoization!
well, not only pure, but constant 09:09
moritz timotimo: pure? it produces output
timotimo ... excuse me, i'll go wake up before producing any more code/text
moritz nom: say 'foo'; say $*OUT.tell 09:13
p6eval nom 33fb02: OUTPUT«foo␤4␤»
timotimo oh, that's cute, $*OUT behaves like a file? 09:14
moritz well, it's an IO handle
timotimo can i seek backwards, though? or does it only do it if i tell it to buffer everything?
moritz you can't seek in a stream
timotimo well, i suppose the right question would be if i can read from it
probably not, then
moritz no, it's opened for writing only
you like you can't read from open('foo', :w) 09:15
s/you/just/
09:17 chee left
masak I just got a great idea for a module: InPlaceIO. 09:23
it basically removes all the boilerplate for when you want to do 'perl -i'-like processing inside a program.
InPlaceIO.open($filename).grep($re...ion).save; 09:24
moritz +1 09:25
though I'd factor it a bit differently
InPlaceIO.new(:$filename).map: { ... }
or maybe don't call it 'map'
09:25 am0c left 09:26 dakkar joined
moritz reasons: 09:26
1) dealing propery with exceptions
2) if you just get a lazy list and return one, you aren't restricted to return stuff that can .save 09:27
hm, then that doesn't even need to be OOish
in-place($filename, &closure);
masak ooh, I like that one best. 09:29
the fluent interface was a red herring in this case.
tadzik lovely! 09:30
moritz I know, but I couldn't miss the opportunity to press on that point a bit
masak but I think that &closure should be per-line, and that 'next' and 'last' and 'redo' should work as expected in them.
tadzik maybe with stuff like :lines, :words, :chars etc
masak tadzik: how do you mean? 09:31
tadzik well, it'll default to :lines
I'm still thinking about a usecase though, so it may be not worth it :)
moritz well, if you do in-place($filename, :words, &closure) the closure is processed word by word
jnthn for in-place($filename) -> $line is rw { $line *= 2 }
do gather/take...after it comes back from the take, it will write the line back 09:32
take-rw of course.
May work.
moritz jnthn: then a 'last' will skip writing the file :/
jnthn arse.
OK, then making next/last etc. work will be...fun. :S
moritz well 09:33
once we've got DESTROY
masak maybe it's a macro? :)
moritz that might be possible
jnthn DESTROY is like "yeah, write the file...sometime before VM shutdown" :)
moritz masak: some people, when faced with a problem, ...
masak moritz: I wouldn't place any... what jnthn said.
moritz: ...help create a better world by making the language more expressive using macros? :D 09:34
I'm pretty sure that's how the saying goes.
I think `inplace($filename, &closure)` is the nicest solution. 09:38
tadzik +1
masak ...at least until we have good enough macros.
I should tell the guy who's supposed to be working on that to hurry up. 09:39
jnthn masak: When will macros be released?
masak: When will we have macros 6.0.0?
jnthn hopes we'll have something in the next release ;) 09:40
masak too
maybe we should have a macrathon sometime soon? :)
jnthn: you're free to do other stuff, of course, as long as I can pester you with silly questions about the innards of Rakudo. ;) 09:41
09:42 daxim joined
jnthn masak: Sure, did we manage to pick any of our Perl 6 days this month on the same day? :) 09:42
09:42 woosley left 09:44 arlinius left
moritz gist.github.com/1758788 09:45
that's the very first shot at in-place file editing 09:46
masak jnthn: I dunno, do you have any Fridays? 09:47
otherwise my weekends are pretty fungible.
I expect people here will appreciate www.romancortes.com/blog/1k-rose/
jnthn no, all out of Fridays. The great Friday shortage of February.
masak oh, ok.
jnthn Weekends...yeah, can do those. 09:48
masak \o/
moritz oh btw, we need a release manager for February
jnthn Guess its the 23rd. 09:49
masak moritz: I think what 'perl -i' does is rename the original, and open the new file for writing.
jnthn it's
moritz's way seems a little safer...
The CATCH may need to close $tmp-f before unlinking it. 09:50
(if the open worked out)
moritz adds $tmp.?close; 09:51
jnthn Guess the level of need for it varies by OS :)
moritz aye 09:52
well, it doesn't work on windows anyway, since I use shell("mv")
masak Perl 5 has &rename 09:54
moritz I know
and it's really awefull
masak why is it awful?
moritz because it doesn't work across file system boundaries, for example
masak huh.
moritz it just redispatches to the rename() system call
masak right, even `perldoc -f rename` refers to using File::Copy instead :) 09:55
I can see the point of doing it the simple way, like Perl 5, and just redispatching to the rename() system call.
moritz it was a sensible decision back in the days. 09:56
masak sometimes I feel we do too little of that in Perl 6, and just shoot for perfection.
moritz we want to offer safer defaults, no?
masak oh, most definitely.
I'm not saying it's an easy balance. 09:57
I'm saying something like -- I'd prefer to have Perl 5's crappy &rename in Rakudo CORE than none at all. 10:01
moritz agreed
10:03 spine_ joined 10:05 dbr left 10:06 scott__ left
masak moritz++ # figuring out on #parrot how to implement &rename in Rakudo 10:07
10:08 scott__ joined 10:09 scott__ left 10:11 woosley joined 10:16 sftp left 10:17 sftp joined 10:22 wtw left 10:23 dbr joined 10:25 wtw joined, sftp left, sftp joined 10:35 sftp left
moritz nom: say ().pick.defined 10:41
p6eval nom 33fb02: OUTPUT«True␤»
moritz nom: say ().pick.perl
p6eval nom 33fb02: OUTPUT«().list␤»
moritz uhm
shouldn't that return something like Nil?
niecza: say ().pick.perl
p6eval niecza v14-20-g18249a6: OUTPUT«Any␤»
moritz or that
masak I think I can make a stronger case for Nil than for Any. 10:43
but it depends on how much a special case .pick() is compared to .pick($n).
moritz perl6: say (1, 2).pick(3).perl 10:44
p6eval rakudo 33fb02, niecza v14-20-g18249a6: OUTPUT«(2, 1).list␤»
..pugs b927740: OUTPUT«(1, 2)␤»
moritz perl6: say ().roll.perl 10:45
p6eval niecza v14-20-g18249a6: OUTPUT«Any␤»
..rakudo 33fb02: OUTPUT«Nil␤»
..pugs b927740: OUTPUT«*** No such method in class Array: "&roll"␤ at /tmp/84DMEkAF45 line 1, column 5 - line 2, column 1␤»
10:45 sftp joined
masak nom: say ().pick.defined; say ().roll.defined 10:51
p6eval nom 33fb02: OUTPUT«True␤False␤»
masak yeah. not kosher.
masak submits rakuodbug
moritz github.com/moritz/perlgeek.de/blob...ilemma.txt any comments before I publish it? 10:56
masak reads 10:57
huh -- you don't mention the actual scores anywhere... :) 10:58
surely it makes a difference to the strategy if the defect penalty is twice the cooperation reward, or 1e6 times as big? 10:59
I see the scores are in the code gist, but IMHO they belong in the post as well, along with a clarification on what they mean.
moritz right; they are in the gist I linked to
ok 11:00
masak s/Friday 17's February/Friday February 17/
I will probably enter this contest, but I don't expect to win. 11:01
moritz please do anyway; it's not about winning, but about the fun of it 11:02
11:02 woosley left
masak oh, sure. 11:02
masak will spend lunch thinking about strategies now
moritz++ 11:03
oh, and I didn't say it during the p6cc prep, so I'll say it now: reading the harness code, I can see why you enjoyed writing it. it's good code. 11:04
moritz thanks
11:04 sftp_ joined
masak Perl 6 is really coming of age. 11:04
11:05 sid__ joined, sftp left
daxim stackoverflow.com/questions/9173043...rom-perl-6 11:07
moritz blog post draft updated
masak moritz: if it's not too late to change it -- the named parameters 'my' and 'theirs' are a bit inconsistent. 11:09
it should be 'mine' and 'theirs'
moritz not too late
masak or -- less likely -- 'my' and 'their'
moritz I thought about s/my/mine/ 11:10
masak you may or may not need to update your checksum as a consequence ;)
moritz but since you mention it, it's the tipping point
masak: that will give you important hints :-)
masak I just noticed it.
yeah, but quite a weak hint ;)
moritz a much stronger hint would be to check the p6cc repo :-) 11:11
masak didn't think of that -- I don't feel tempted to, though. 11:14
I want to figure out a strategy on my own.
moritz that's good
moritz publishes the blog post 11:15
perlgeek.de/blog-en/perl-6/iterated...lemma.html 11:16
moritz hopes lots of people will submit strategies 11:17
masak publish it to reddit :) 11:18
then you'll get lots of... comments of how Perl 6 is dead, and besides that irrelevant and slow. 11:19
moritz www.reddit.com/r/programming/commen...s_dilemma/ there you go 11:21
11:21 woosley joined
masak .oO( redditor's dilemma ) 11:23
should a random commenter cooperate, and say "this is pretty cool!", or defect, and say "Perl 6 has missed the boat, stop posting stuff about it" :P 11:24
moritz and the obvious answer is "no, ey should submit one or two strategies" 11:25
masak fwiw, the boat comes once a year to pick up emergent languages from The Island of Obscurity to The Mainland of Mainstream. Haskell consistently refuses to get in it, because the boat is impure.
moritz: oh, have you started spivaking too now? 11:27
11:27 pernatiy left
moritz spivaking? 11:27
masak "ey". 11:28
en.wikipedia.org/wiki/Spivak_pronoun
moritz not consistently
.oO( strangely inconsistent, the evil twin blog )
11:29
masak mwhahaha
11:30 benabik left
tadzik nom: say 3**4**5; say (3**4**5)/2 11:34
p6eval nom 33fb02: OUTPUT«3733918487410200435329597541848665882254097767837340077506369317220790406172652512299936889388039772204687650654314751581087270545921608585813513369828091873141917485942625809388070199519564042855718180410466812887974029255176680123406172983965747316191523867230462351…
tadzik nom: say (3**4**5)/2; say 3**4**5;
p6eval nom 33fb02: OUTPUT«Inf␤373391848741020043532959754184866588225409776783734007750636931722079040617265251229993688938803977220468765065431475158108727054592160858581351336982809187314191748594262580938807019951956404285571818041046681288797402925517668012340617298396574731619152386723046…
tadzik so Inf is smaller than 3**4**5, it
'd seem
jnthn nom: say ((3**4**5)/2).perl 11:35
p6eval nom 33fb02: OUTPUT«3733918487410200435329597541848665882254097767837340077506369317220790406172652512299936889388039772204687650654314751581087270545921608585813513369828091873141917485942625809388070199519564042855718180410466812887974029255176680123406172983965747316191523867230462351…
jnthn Something with Rat stringification I guess. Forget the exact wording of the spec there. 11:36
I guess we .Num it to show it
And that's where the Inf slips in. 11:37
tadzik aye 11:38
11:41 xinming left 11:42 xinming joined
colomon I've been thinking we maybe should spec smarter Rat -> Num conversions. 11:53
flussence re: rename - 11:59
nom: use NativeCall; module POSIX; sub rename(Str $oldpath, Str $newpath) returns Int is native() is export { ... }
p6eval nom 33fb02: OUTPUT«===SORRY!===␤Could not find NativeCall in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/nom-inst1/lib/parrot/4.0.0-devel/languages/perl6/lib, .␤»
flussence (you get the idea) 12:00
jnthn try star 12:15
12:15 PacoAir joined
flussence star: use NativeCall; module POSIX; sub rename(Str $oldpath, Str $newpath) returns Int is native() is export { ... } 12:15
p6eval star 2012.01: ( no output ) 12:16
flussence I keep forgetting that's there now :)
12:25 xinming left
flussence $ perl6 -e 'for $*ARGFILES.lines { next unless /^ "extern" \s+ (.*?) \s+ (.*?) \s* "(" (.*) ")" \s* ";" $/; say "sub $1\($2) returns $0 is native() \{ ... }"; }' /usr/include/stdio.h # one-liner to get 70% of stdio.pm6 12:25
12:30 xinming joined 12:34 dbr left, bluescreen10 joined 12:38 benabik joined
masak flussence: if you're looping over $*ARGFILES.lines, why not use -n ? 12:40
perl6 -n -e 'next unless /^ "extern" \s+ (.*?) \s+ (.*?) \s* "(" (.*) ")" \s* ";" $/; say "sub $1\($2) returns $0 is native() \{ ... }" }'
flussence I keep forgetting about things like that too :)
masak :) 12:41
moritz and even if not, lines() is shorter than $*ARGFILES.lines :-)
12:45 pernatiy joined
masak I went straight for the shortest one ;) 12:53
I think "why does `for lines { ... }` not do what I want will be a FAQ. 12:54
std: for lines { .say }
p6eval std 48335fc: OUTPUT«===SORRY!===␤Function 'lines' needs parens to avoid gobbling block at /tmp/jUWEOog4aR line 1:␤------> for lines⏏ { .say }␤Missing block (apparently gobbled by 'lines') at /tmp/jUWEOog4aR line 1:␤------> for lines { .say }[33…
timotimo in soviet tetris?
masak that is a good error message, though.
timotimo in wrong channel?
masak s/what I want/what I want?/
timotimo: I thought all tetris was Soviet... 12:55
dalek ecza: 4561a78 | (Solomon Foster)++ | lib/CORE.setting:
Switch KeyBag.list to return just keys.
13:00
ast: afb17b9 | (Solomon Foster)++ | S02-types/keybag.t:
Fix tests after discussion with TimToady++.
13:02
kudo/nom: 8c84b8e | moritz++ | src/core/ (2 files):
implement &rename

  ... until we get the real thing.
13:03
13:05 xinming left 13:06 xinming joined, xinming left 13:07 skids left
masak heh -- I decided to try and find the first few emails in the perl6-language list. 13:08
look at the number of the last page: code.activestate.com/lists/perl6-la...?page=1337
huf cant be a coincidence
timotimo wow, the first message is from 1980? people really spent a long time thinking about how to bring perl to the next level 13:10
moritz huh? I only see some from 2000 13:11
masak timotimo: yeah, saw that too. must be a mis-dating somehow.
moritz ah, the last in the list
benabik I'm guessing someone had a misconfigured mail client.
masak but holy schmoly the list had a lot of traffic on 2000-08-01.
benabik (And the list software trusts the headers)
masak compared to that, Perl 6 is practically dead today :)
guess even people with short attention spans were active and eager back then... 13:12
moritz++ # rename
13:13 xinming joined
masak jnthn: can AUTOLOAD behavior be emulated through a metaclass? my guess is "yes" :) 13:13
colomon silly masak. you can do ANYTHING with a metaclass. ;) 13:14
moritz masak: I think that several MOP examples that jnthn++ produced override find_method
you can also use add_fallback in ClassHOW 13:15
masak code.activestate.com/lists/perl6-language/406/ -- "I wouldn't even mind if someone wrote a pragma that lets you program Perl in Latin." 13:17
four months later... Lingua::Perligata hits CPAN :P
moritz: ooh, add_fallback. 13:18
13:18 xinming left, xinming_ joined
timotimo my god 13:19
masak timotimo: what what?
timotimo the latin thing is really elaborate 13:20
masak yes. it is.
13:21 benabik left
masak ooh -- dev.perl.org/perl6/rfc/meta/larry-3.txt -- so *that's* how far the "take my marbles and go home"/"nuclear blackmail" meme stretches. 13:25
it's almost two years ago now. k23z__ was unhappy at me because I suggested he might be a troll. 13:26
timotimo what happened then? 13:27
did he turn out to be a troll or did he turn out to be a really important asset to the perl6 community?
masak <k23z__> if you label me a troll again I will never enter this channel 13:28
<TimToady> nuclear blackmail? then stay away, by all means 13:29
13:29 simcop2387 left, simcop2387 joined
masak <TimToady> take your marbles and run while you can 13:29
moritz hm, irclog.perlgeek.de/search.pl?nick=k...=;offset=0 doesn't find that 13:30
masak moritz: irclog.perlgeek.de/perl6/2010-03-06#i_2071596 13:31
15 minutes later, I end up hugging k23z__ ;)
and he ends up admitting that he was wrong.
timotimo aaw, that's sweet 13:32
13:32 baest_ joined
timotimo i admire people who are able to change their minds in situations where it makes sense 13:32
flussence
.oO( "Blackmail that glows in the dark!™" )
masak in retrospect, he wasn't a troll (just like diakopter thought), but he had some communication trouble and acted a bit threatening.
dalek kudo/nom: 96ef170 | moritz++ | src/SAFE.setting:
mask &rename in SAFE.setting
13:33
kudo/nom: 0dc3384 | moritz++ | tools/build/Makefile.in:
missing dependency in Makefile
13:34 woosley left, baest left 13:35 xinming_ left
jnthn add_fallback is the meta-space hook for AUTOLOADy things. 13:36
For now. :)
13:37 xinming joined
dalek ecza: 68c9f28 | masak++ | lib/Test.pm6:
[lib/Test.pm6] removed sigils from \ parameters

Annoyance-driven development: warnings kept showing up in my test runs, and they weren't from my code but from Niecza. Now they're gone.
13:38
13:44 ab5tract joined 13:45 Woodi left
timotimo nom: say { say "hello" }.^methods 13:46
p6eval nom 8c84b8: OUTPUT«Method 'gist' not found for invocant of class 'Sub'␤ in method gist at src/gen/CORE.setting:4061␤ in sub say at src/gen/CORE.setting:5958␤ in block <anon> at /tmp/T17lDyp6IT:1␤ in <anon> at /tmp/T17lDyp6IT:1␤»
timotimo how do i understand this? a block is not an object?
moritz no
the problem is that one of the returned objects from the list doesn't have a .gist method 13:47
timotimo oh, do i need to add ()?
moritz no
jnthn Our metacircularity is still a little square in places
moritz aye
masak .oO( metasquareularity )
timotimo nom: my @methods = { say "hello" }.^methods
not better
p6eval nom 8c84b8: OUTPUT«Cannot assign a non-Perl 6 value to a Perl 6 container␤ in method REIFY at src/gen/CORE.setting:5206␤ in method reify at src/gen/CORE.setting:4381␤ in method gimme at src/gen/CORE.setting:4763␤ in method eager at src/gen/CORE.setting:4738␤ in method STORE at src/…
masak hm, that's a bug, I think. 13:48
moritz well, the error message points much closer to the thruth
jnthn Needs fixing in the BOOTS TRAP. Need to ponder exactly how...
timotimo it's interesting to me that there is a thing as a "non-Perl 6 value" in perl6 :) 13:49
masak submits rakudobug
timotimo: it's because Perl 6 really is all the world's languages in disguise.
timotimo niecza: my @methods = { say "hello" }.^methods
p6eval niecza v14-21-g4561a78: OUTPUT«Potential difficulties:␤ @methods is declared but not used at /tmp/1xUm5OmrpZ line 1:␤------> my ⏏@methods = { say "hello" }.^methods␤␤Unhandled exception: Unable to resolve method methods in class ClassHOW␤ at /tmp/1xUm5OmrpZ line 1 (…
timotimo ah, that
niecza: my @methods = { say "hello" }.^methods; say @methods[0];
moritz timotimo: mostly parrot objects leaking through
p6eval niecza v14-21-g4561a78: OUTPUT«Unhandled exception: Unable to resolve method methods in class ClassHOW␤ at /tmp/PvFKab6lvQ line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3738 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3739 (module-CORE @ 65) ␤ at…
timotimo no, do i have to use { } there? or < >?
masak [], like you did. 13:50
{ } for hashes, or for arrays with a hash interface (NYI).
.<> is just sugar for .{}
moritz niecza doesn't do that part of introspection yet
timotimo what's the difference between {} and .{}?
moritz the dot :-) 13:51
there's no semantic difference
timotimo ah, and it's sugar, because you could write {"foo"} or <foo>, right?
moritz correct
masak right. 13:52
timotimo that also neatly explains, why it shouldn't be (and isn't) sugar for []
masak nom: my %h = 1..6; say %h<3 3 1 5>
p6eval nom 8c84b8: OUTPUT«4 4 2 6␤»
timotimo that returns a list? or a parcel maybe?
masak timotimo: <foo bar baz> is sugar for ('foo', 'bar', 'baz'), though.
nom: my %h = 1..6; say %h<3 3 1 5>.^name 13:53
p6eval nom 8c84b8: OUTPUT«Parcel␤»
timotimo oh, is that syntax for a tuple?
masak no, it's also just a Parcel :)
timotimo OK
masak nom: say <foo bar baz>.^name
p6eval nom 8c84b8: OUTPUT«Parcel␤»
13:53 benabik joined
timotimo i was audibly happy when i heard, that i could put a junction into .{}, btw. that was really cool. 13:53
but it's kind of hard to get a real overview over perl6. there's just so much stuff! but all of it seems to make lots of sense, so that's really good 13:54
moritz that's good to hear 13:55
masak timotimo: we always want to make the learning process easier, simpler, and more fun for newcomers.
timotimo of course, i haven't done much yet, so that might just be the outermost layer being well-designed, hiding lots of ugly internals ;)
[Coke] b: say 19612 - 19655 ; # 02/06/2012 - niecza at 100.21%
p6eval b 1b7dd1: OUTPUT«-43␤»
masak timotimo: we're working on it all the time, but it's a slow process by nature.
timotimo: if you have any ideas, feel free to share them.
[Coke] colomon++ # the pendulum swings.
masak oh noes, Niecza is ahead again!
how long was it since last time?
timotimo is there a reason for try.perl6.org to not exist any more? and back when it existed, it didn't work at all for me (that one time i tried) 13:56
jnthn Fear not! I have Rakudo day on Thursday and look forward to swinging! :)
masak timotimo: short answer: try.perl6.org is brittle and doesn't really have a maintainer.
[Coke] is reminded to keep hacking on DateTime!
moritz jnthn: have you had a chance to think about throwing typed exceptions from the MOP and C? 13:57
colomon jnthn: I don't know, once I port the new KeyBag tests back to Bag, Set, and KeySet, that's a probably a couple hundred more tests for Niecza.
timotimo does the parrot vm give you sandboxing for free or something?
colomon of course, you could just port the implementations of those classes to nom, I suppose.... ;)
moritz colomon: no 13:58
colomon: that's the plan :-)
sorry, the "no" was meant for timotimo
jnthn colomon: Yes, I'll be happy to grab those classes into Rakudo :)
colomon don't port them yet, I've still got some fixes that need to go in there!
jnthn ;)
moritz also advises against porting much of the exceptions stuff to niecza just yet 13:59
14:01 GlitchMr joined 14:03 xinming left 14:06 xinming joined 14:11 xinming left
colomon just decided KeyBag wasn't done yet either. 14:11
14:11 xinming joined 14:20 xinming left 14:21 xinming joined 14:23 Trashlord joined 14:27 Woodi joined 14:31 xinming left
moritz nom: sub f() { return }; say f.perl 14:37
p6eval nom 0dc338: OUTPUT«Nil␤»
14:42 xinming joined
masak nom: sub Nil { return }; say Nil() === Nil 14:43
p6eval nom 0dc338: OUTPUT«True␤»
moritz cute.
masak nom: sub Nil { say "called!"; return }; say Nil() === Nil
p6eval nom 0dc338: OUTPUT«called!␤True␤»
masak and very correct. I was afraid it might get called twice.
moritz no, that's a part that rakudo does correctly 14:44
14:45 zjmarlow left
TimToady fsdo correctly 14:45
14:45 zjmarlow joined
moritz hm, did you expect/want it to be differently? 14:48
TimToady it depends on whether you think keywords exist
masak it does? 14:49
moritz only to the extend that constants and terms exist
masak I'm happy with the above behavior. 14:50
it's unsurprising, and flexible.
moritz perl6: constant a = 5; {my sub a() { 10 }; say a, a(); }
p6eval rakudo 0dc338: OUTPUT«510␤»
..pugs b927740: OUTPUT«*** ␤ Unexpected "="␤ expecting ":" or "("␤ at /tmp/ASpTWyyYlE line 1, column 12␤»
..niecza v14-21-g4561a78: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in class Int␤ at /tmp/0Q77yJsuep line 1 (ANON @ 3) ␤ at /tmp/0Q77yJsuep line 1 (mainline @ 2) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3738 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/…
TimToady just pointing out that it's not the only value of "correct"
in another value of correct, you'd have to use 'Nil() === CORE::<Nil>' 14:51
14:51 colomon left
moritz how does the spec define 'correct'? 14:51
TimToady the spec is largely silent on the subject 14:52
14:52 skids joined
TimToady but we seem to have re-invented keywords, with () as an escape hatch, which, as you say, is at least okay 14:52
14:53 DarthGandalf left
masak here's a suggestion: both &say and &print use .gist on things which aren't Str already. semantics become consistent between &print and &say again, and easier to explain and defend to beginners. anyone who wants .Str semantics just need to do 'print ~$a' instead of 'print $a'. 14:54
TimToady it would be possible, however, to set things up such that you can override any identifier, and that system would be more flexible; not saying I want to go that far, but it's another view of "correct"
14:54 xinming left
masak we have only re-invented keywords in the sense that they fall nicely out of how other things work in the language. 14:55
TimToady or we resurrect spew or some such
masak was spew ever dead?
I thought it was just a bad idea that was never taken seriously.
TimToady I was hoping for a different verb :)
masak that's what I mean.
moritz spew? 14:56
masak opposite of slurp.
moritz oh
masak I don't really see the connection to &print and &say, to be honest.
spew works on files.
14:56 xinming joined
dalek kudo/nom: 925e3cd | moritz++ | src/core/List.pm:
return Nil for ().pick and .roll (RT #110038)
14:56
moritz niecza: say ().pick.perl 14:57
p6eval niecza v14-21-g4561a78: OUTPUT«Any␤»
moritz niecza: say ().roll.perl
p6eval niecza v14-21-g4561a78: OUTPUT«Any␤»
TimToady that should probably be Nil
moritz ok, then I'll test it as such
TimToady and I'm still thinking that Match, Nil, and Failure are all signalling types that pass through smartmatching like Bool does. 14:59
they are varying degrees of success and failure 15:00
dalek ast: b13a406 | moritz++ | S32-list/ (2 files):
().pick and .roll return Nil
15:00 xinming left 15:01 xinming joined 15:02 birdwindupbird left
masak RT ticket was open for 4 hours. nice turnover. moritz++ 15:03
15:05 snearch left 15:09 DarthGandalf joined
TimToady thinks we do in fact weird enough 15:09
moritz but do we language enough? 15:11
15:11 birdwindupbird joined
TimToady the fact that ... tests the LHS for ending the list is by design, and has nothing to do with laziness per se 15:13
2,4,6 ... $end # this is the sequence of even integers, even if you want fewer than the ones on the left 15:14
masak guessed as much
TimToady we tried the other semantics, and they were bogus
or at least, incompatible with any kind of dwimmery 15:15
masak the more I think about the current semantics, the more I like things the way they are. 15:17
moritz it just wasn't convenient for the thing I just had in mind :-) 15:18
TimToady it was a fairly long spiral getting to them, so I'm not likely to change them any time soon :)
masak nom: my @a = 1..99; my $ARBITRARY_MAXIMUM = 11; .say @a ... $ARBITRARY_MAXIMUM
p6eval nom 0dc338: OUTPUT«===SORRY!===␤Confused␤at /tmp/8LCrgaZQ1Z:1␤»
masak nom: my @a = 1..99; my $ARBITRARY_MAXIMUM = 11; .say for @a ... $ARBITRARY_MAXIMUM
p6eval nom 0dc338: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤»
masak nom: my @a = 1..5, *+2; my $ARBITRARY_MAXIMUM = 11; .say for @a ... $ARBITRARY_MAXIMUM 15:19
p6eval nom 0dc338: OUTPUT«1␤2␤3␤4␤5␤7␤9␤11␤»
15:20 baest_ is now known as baest, wtw left
TimToady we might go as far as to say that Nil is just a degenerate case of Failure, or that Failure is Nil with a message in the bottle 15:32
masak gets a hesitant look 15:33
TimToady
.oO(Conservatives!)
jnthn Given we were also pondering putting Failure outside of Any... :) 15:34
TimToady so maybe Nil belongs there too
jnthn heh :)
PerlJam Any is starting to look more like Mostly
arnsholt Some? 15:35
TimToady well, Nil is arguably very similar to one() "one of nothing"
15:35 tarch left
masak everyone except complete Failures qualifies as Any! 15:35
PerlJam heh
masak TimToady: only if you squint so hard you're actually closing your eyes. 15:36
PerlJam masak: though, a complete Failure would have a message I think
But, I guess the absense of message is a message too
masak read that as "a complete Failure would have a massage, I think"
TimToady well, Nil and one() behave rather differently in a pragmatic sense
PerlJam ... and that's why we now call it Spa 15:37
15:37 sid__ left
masak nom: class Spa { method massage(Failure $f) { .say for "come in, dear $f.^name()!", "lie down.", "prepare to be kneaded." } }; sub complete_failure { fail }; Spa.massage( complete_failure ) 15:43
p6eval nom 925e3c: OUTPUT«come in, dear Failure!␤lie down.␤prepare to be kneaded.␤»
15:44 Psyche^ joined, Psyche^ is now known as Patterner 15:46 xinming left 15:48 colomon joined
PerlJam What's the way to bias .pick() or .roll()? Or am I imagining that there was something built-in for that? 15:50
colomon PerlJam: Bag / KeyBag
but as far as I know, it's only implemented semi-sanely in niecza's KeyBag 15:51
niecza: my $kb = KeyBag.new({ a => 10, b => 1}); say $kb.roll(5).perl 15:52
p6eval niecza v14-21-g4561a78: OUTPUT«("a", "a", "a", "a", "a").list␤»
colomon niecza: my $kb = KeyBag.new({ a => 10, b => 1}); say $kb.roll(20).perl
p6eval niecza v14-21-g4561a78: OUTPUT«("a", "a", "a", "b", "a", "a", "a", "a", "a", "a", "a", "b", "a", "a", "a", "a", "a", "a", "a", "b").list␤»
masak at least it's implemented. colomon++ 15:53
PerlJam indeed. colomon++ 15:54
colomon niecza: my $kb = KeyBag.new({ a => 100000000000, b => 1}); say $kb.roll(20).perl
p6eval niecza v14-21-g4561a78: OUTPUT«("a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a", "a").list␤»
TimToady looks pretty darn sane to me 15:55
colomon it's still O(N) per roll, where N is the number of keys
so it definitely could be better
hmm, probably also subject to the limitations in rand TimToady++ was talking about the other day 15:56
TimToady ah, yes, I believe you mentioned binary searching the key/cutoff list
colomon right now it's a linear search
TimToady a block search using sqrt # of keys is another way of cutting it down 15:57
O(2*sqrt(n)) I believe 15:58
but binary search probably wins unless cache lookahead allows fast traversal of short linear scans 15:59
16:00 xinming joined
TimToady another approach, sort the 20 random numbers and do 1 linear scan, then shuffle the results :) 16:00
colomon :) 16:01
dalek ast: 9d4d2d7 | (Solomon Foster)++ | S02-types/keybag.t:
More ways of getting things into KeyBags.
TimToady arguably the .gist of a KeyBag should be the pairs form 16:02
since .gist is a kind of summary 16:03
[Coke] moritz: when I edit, say, the "rakudo" tag on the stackoverflow wiki, are you one of the peers reviewing the edits?
colomon niecza: say KeyBag.new({ a => 100000000000, b => 1}).gist 16:04
p6eval niecza v14-21-g4561a78: OUTPUT«keybag("a" => 100000000000, "b" => 1)␤»
colomon TimToady: how does that differ from what you'd like?
TimToady it's fine 16:05
unless we want xx there instead of => 16:06
something to be said for that
but => is probably good education 16:07
colomon notes that Bag would try to print 100000000000 "a"s -- a lot of the KeyBag improvements need to be ported back 16:08
TimToady how many of those should be in a Baggy role that is common to both? 16:09
arguably the simplest implementation of Bag is just to reuse KeyBag and pretend it's immutable :) 16:10
.oO(Dirty Baggy: Go ahead, make my day!)
16:12
jnthn decommute & 16:13
colomon yeah, I've been wondering that myself
16:14 birdwindupbird left
colomon the differences between the two are very minor 16:14
16:14 kmwallio joined
TimToady we should probably spec some official way to declare immutability, and have it enforced wherever necessary 16:14
we could declare it as data instead of class, and confuse everyone 16:16
oh wait, Haskell already tried that...
masak that's one of the things I've never really managed to learn about Haskell -- which things are data declarations and which are type declarations, and so on. 16:18
whenever I get back to the language, I have to look it up.
16:19 icwiener joined
Su-Shee on the subject of haskell just found on twitter: "Some people see a problem and think "I know, I'll use Haskell!" Now they have a monoid in the category of problems." 16:24
colomon :) 16:25
masak .oO( what would the functors of that monoid be? )
16:25 kmwallio left
Su-Shee masak: DONT GO THERE. ;) 16:25
masak my god it's full of notation 16:28
dalek ast: 9b1c972 | (Solomon Foster)++ | S32-list/ (2 files):
Refudge for niecza.
16:32
ecza: 0699296 | (Solomon Foster)++ | lib/CORE.setting:
Add Bag.pairs, rewrite KeyBag.new to handle arbitrary Associative and Positional arguments.
TimToady beware of geeks bearing lifts... 16:36
timotimo what do i have to do to a modern nom to get NativeCall? 16:53
PerlJam S02:2400 says "Declarators generally make the colon optional: my ($a,$b,$c); # parsed as signature" That seems to imply that "my :($a,$b,$c)" should also work. Should that be the case? 16:56
timotimo: install zavolaj 16:57
16:58 icwiener left, icwiener joined
PerlJam timotimo: See github.com/jnthn/zavolaj for more info 16:58
16:59 wolfman2000 left
masak PerlJam: yes, I think it should. 16:59
std: my :($a, $b, $c)
p6eval std 48335fc: OUTPUT«===SORRY!===␤Malformed my at /tmp/c7SbkbRS7L line 1:␤------> my ⏏:($a, $b, $c)␤ expecting scoped declarator␤Parse failed␤FAILED 00:01 107m␤»
masak or maybe not. :)
masak decommutes
PerlJam I think it should too (std notwithstanding) 17:00
because then, I could say my ($n = 50, $m = $n) = @*ARGS; rather than my($n,$m) = @*ARGS; $n //= 50; $m //= $n; # and this makes me smile :) 17:01
TimToady perl6: my ($n = 50, $m = $n) = @*ARGS; say $m 17:02
sorear good * #perl6
p6eval niecza v14-21-g4561a78: OUTPUT«Unhandled exception: Lexical symbol '$n' is already bound to an outer symbol (see line 1);␤ the implicit outer binding at line 1 must be rewritten as $n␤ before you can unambiguously declare a new '$n' in this scope␤ at /home/p6eval/niecza/boot/lib/CORE…
..rakudo 925e3c: OUTPUT«Nil␤»
..pugs b927740: OUTPUT«␤»
TimToady perl6: my ($n = 50, $m = $n) ::= @*ARGS; say $m
p6eval niecza v14-21-g4561a78: OUTPUT«Unhandled exception: Lexical symbol '$n' is already bound to an outer symbol (see line 1);␤ the implicit outer binding at line 1 must be rewritten as $n␤ before you can unambiguously declare a new '$n' in this scope␤ at /home/p6eval/niecza/boot/lib/CORE…
..pugs b927740: OUTPUT«pugs: *** Wrong number of binding parameters: 1 actual, 2 expected␤ at /tmp/WpAJJrUAbp line 1, column 1␤»
..rakudo 925e3c: OUTPUT«===SORRY!===␤Cannot use bind operator with this left-hand side␤at /tmp/YU5OQhlxb_:1␤»
TimToady it ought to already be considered a signature 17:03
std: my ($n = 50, $m = $n) ::= @*ARGS; say $m 17:04
p6eval std 48335fc: OUTPUT«ok 00:01 114m␤»
timotimo what's .WHY again?
[Coke] timotimo: (nativecall) or use r-*
benabik timotimo: documentation
[Coke] star: use NativeCall; say "ALIVE"
p6eval star 2012.01: OUTPUT«ALIVE␤» 17:05
timotimo the perl6 book doesn't mention it. i guess i'll look into the synopses
[Coke] wonders if the's only one on channel who hears "WEIRD SCIENCE" every time someone uses the "alive" trick.
PerlJam [Coke]: now you've infected me with the meme at least :) 17:06
TimToady thinks of #5
PerlJam TimToady: so ... "my :($a,$b)" should parse as well? 17:07
TimToady probably 17:08
the interesting question is whether it prevents demontion to a parcel of lvalues 17:09
*demotion
17:09 kaare_ joined
PerlJam It seems like ":($a,$b,$c)" should be a short-hand for "my ($a,$b,$c)" 17:09
TimToady which makes a difference if the signature contains @ or % 17:10
a parcel assignment will assume the last @ or % is slurpy
in a sig, that would have to be explicit
PerlJam Hmm.
timotimo i'm unable to assign anything to the .WHY as in S26. wouldn't it be my $blob; #= some text - and then say $blob.WHY ? 17:11
benabik timotimo: I believe that's how it's supposed to work. I think it's NYI 17:13
TimToady I suspect it's NYI on variables
[Coke] flussence++ # browser analogy for perl5,6
timotimo OK
it's still nice to have it
PerlJam timotimo: it works on subs and methods and classes and such though 17:16
timotimo oh, great 17:17
17:18 xinming left
[Coke] gets sucked into reading a perlmonks flamewar. there's 5 minutes I'll never get back. 17:19
17:19 am0c joined, xinming joined 17:21 spine_ left
TimToady well, you already know that if either of the main culprits gets involved, it's gonna go down to level 25 or 30 17:21
[Coke] thankfully, pm is so slow I rarely dig to lower levels. ;) 17:22
TimToady not naming any names, but "silence betokens consent" is a lame excuse for always wanting the last word, in my opinion. 17:24
moritz [Coke]: (stackoverflow edits) no, I'm not reviewing edits there 17:26
PerlJam notes how most of #perl6 is consenting to TimToady
Su-Shee this is one of those "bonmots" which are driving me crazy as a political scientist. 17:27
pmichaud good morning, #perl6 17:28
moritz good am, pm 17:29
[Coke] PerlJam: no, he just talks a lot. odds are he's got the last word.
TimToady ♥ baysian statistics 17:30
[Coke] .u spade 17:32
phenny U+2660 BLACK SPADE SUIT (♠)
[Coke] is reminded to finally finish masak's poker hand ranker.
TimToady
.oO( spa.de )
17:33
17:34 MayDaniel joined 17:38 daxim left 17:43 bluescreen10 left
TimToady ♨̈ 17:48
timotimo jnthn: i'm trying to run your SDL.pl, but i get "Unknown type SDL_Surface used in native call.", although the class is created before 17:49
wait. that is yours, right? if not, look here: raw.github.com/PerlGameDev/SDL6/master/SDL.pl 17:50
never mind. is repr('CPointer') works 17:52
17:53 MayDaniel left
timotimo would it be interesting if i were to bind SDL a bit more completely the same way? 17:54
or is that the wrong way to do it?
moritz I wonder if 'copy' and 'rename' should be subs in the setting, or static methods in IO 17:56
17:56 xinming left 17:57 bluescreen10 joined, pernatiy left 17:58 xinming joined, dakkar left
flussence +1 for IO methods, I'm not a big fan of adding loose subs when there's a pre-existing namespace they'd fit into 18:00
18:00 am0c left
flussence timotimo: I wrote some NativeCall stuff, it might give you a few ideas: github.com/flussence/perl6-XMMS2/t.../lib/XMMS2 18:01
timotimo ah, i'm a fan of xmms2 and i read that perl6advent, too 18:07
but sdl can't be handled with OpaquePointer only
18:09 tarch joined, xinming left 18:10 birdwindupbird joined, xinming joined 18:11 tarch left, DarthGandalf left, tarch_ joined 18:12 DarthGandalf joined 18:13 am0c joined, tarch__ joined, tarch_ left 18:16 mj41 left 18:17 xinming left 18:18 xinming joined
dalek kudo/nom: 9d8b140 | moritz++ | src/ (3 files):
implement &copy
18:30
18:31 tarch__ left
moritz fwiw I've just implemented &copy and &rename, just so that they are available. I don't expect that to be the real thing 18:33
18:35 preflex_ joined
moritz I just hope I gave them more awesome error messages than is standard 18:37
18:37 preflex left, preflex_ is now known as preflex
moritz $ ./perl6 -e 'rename("foo", "bar")' 18:37
Failed to rename file from 'foo' to 'bar': No such file or directory
should probably remove the 'from'
PerlJam or even remove "file from " 18:38
Failed to rename 'foo' to 'bar': No such file or directory
moritz aye
TimToady funny thing is you can get that error from the right side as well as the left 18:39
rename("foo", "nonesuch/bar")
dalek kudo/nom: 3808f94 | moritz++ | src/core/Exceptions.pm:
awesomize error messages, PerlJam++
18:40
masak maybe indicate which side, then.
moritz TimToady: I know
TimToady: but I cannot provide information that the OS doesn't give me :/
TimToady well, errno doesn't help, but you can probe
so yes, you can give info that the OS provides in subsequent calls :)
PerlJam yeah, if you're dying anyway, a little extra work on the way out can be very beneficial to the users 18:41
18:43 mj41 joined
skids github.com/skids/perl6netpack # <-- first (tiny bit of) usable code from my dabblings. Comments welcome. 18:49
colomon just realized that niecza's speed is fine, it's colomon's brain which is the problem 19:01
sorear what happened to your brain? 19:02
colomon lost an underscore somewhere 19:03
TESTJOBS=4 is much slower than TEST_JOBS=4
masak skids: looks nice so far. 19:11
lots of documentation. :) 19:12
worthy of a CPAN module, I guess.
dalek kudo/nom: d69ad77 | moritz++ | src/core/IO.pm:
fix class name, kboga++
19:23
sorear colomon: glad that's resolved
colomon sorear: very sorry to have worried you about nothing 19:24
sorear colomon: it kind of worked out fine because I've been too busy to worry. :)
moritz ehm, I should test the stuff before I commit it :/ 19:25
it feels I should unify X::IO::Rename and X::IO::Copy 19:26
they are both of the form "Cannot $.operate $.from to $.to: $.os-error" 19:27
but what should the class be called?
X::IO::SourceDestOperation? sounds ugly
benabik X::IO::BinaryOp?
moritz opening a pipe is also a binary operation 19:28
dalek kudo/nom: a0a467a | moritz++ | src/core/IO.pm:
fix previous commit, moritz--
19:34
masak moritz: X::IO::Copy. 19:36
moritz masak: you mean &rename should use X::IO::Copy too?
masak I mean that.
moritz hm.
masak copying may not be how the rename is implemented underneath -- it's probably something clever with inodes -- but a move feels like a copy plus a remove when you think about it. 19:38
and in that sense, it's the "copy" part of the move that goes wrong, and so it makes sense for both of them to be X::IO::Copy :) 19:39
19:43 icwiener left, icwiener joined 19:50 birdwindupbird left
masak nice, easy-to-understand benchmarking statistics: bos.github.com/criterion/ 19:54
(in case someone is pondering doing something similar for rakudo/niecza benchmarks)
19:59 MayDaniel joined 20:00 snearch joined, tarch__ joined
masak [Coke]: yes, please finish the poker hand ranker. \o/ 20:07
PerlJam: it's funny, I was just discussing signatures/defaults like that the other day. I'll see if I can find it in the backlog.
20:13 snearch left
masak PerlJam: ah yes, here: irclog.perlgeek.de/perl6/2012-01-29#i_5070174 20:13
moritz niecza; say 123.fmt('b') 20:14
niecza: say 123.fmt('%b')
p6eval niecza v14-23-g0699296: OUTPUT«1111011␤»
sorear ow, lots I need to read for criterion 20:15
cool that bos is still around
sorear looks at moritz' latest ticket, finds eirself kind of disagreeing 20:16
mv(1) calls rename, and if that fails falls back to copy&delete 20:17
there's a lot of policy inherent in the latter
Perl 6 needs a certain amout of policy-free functionality, and we can't do that so easily if the policy is baked in at the Parrot level 20:18
20:20 pernatiy joined
masak sorear: ticket url? 20:22
PerlJam masak: it might get confusing when someone does my ($a,$b = 5) = @stuff; # since those = don't quite mean the same thing.
sorear github.com/parrot/parrot/issues/713
masak PerlJam: so maybe it makes sense to relegate such tricks to the ':($a, $b = 5) = ...' form? 20:23
sorear: thank you.
seems discussion gets going after people implement a working version of something. :) that's probably a force we can use to our advantage. 20:25
moritz sorear: I'm not suggesting to *replace* rename 20:33
20:36 icwiener_ joined
timotimo perl6: my $exitcode = 5 but False; if $exitcode { say "yup" } else { say "nop" } 20:36
p6eval pugs b927740: OUTPUT«*** Cannot cast from VBool False to VCode (VCode)␤ at Prelude.pm line 541, column 5-16␤»
..niecza v14-23-g0699296: OUTPUT«nop␤»
..rakudo a0a467: OUTPUT«yup␤»
timotimo hooray
20:37 icwiener left
benabik Hm. Why does (5 but False) .Bool and .so to False, but eval to True in if statements? (in nom) 20:42
PerlJam benabik: you're using an old nom ? 20:45
benabik PerlJam: On p6eval. 20:46
nom: my $n = 5 but False; say ?$n; say $n ?? 'T' !! 'F'
p6eval nom a0a467: OUTPUT«False␤T␤»
PerlJam crazy
timotimo how exactly does but False work? is False a type, a class or is it an instance? 20:47
perl6: Bool.WHAT
p6eval pugs b927740, rakudo a0a467, niecza v14-23-g0699296: ( no output )
timotimo perl6: say Bool.WHAT
p6eval rakudo a0a467, niecza v14-23-g0699296: OUTPUT«Bool()␤»
..pugs b927740: OUTPUT«Bool␤»
benabik False is an instance of the Bool enum. (more) 20:48
timotimo hits return
benabik 5 but False returns an object that is 5 except that the .Bool method returns False.
timotimo how exactly does perl6 get from "Bool::False" to "overide only .Bool to return False"? 20:49
benabik $foo but $bar overrides the "$bar.WHAT" method in $foo to return $bar.
IIUC
20:50 y3llow_ joined, pothos_ joined
timotimo how come evaluation in boolean context goes over .WHAT? 20:50
instead of directly?
or is every "direct" call done via .WHAT?
like .^ is done via .HOW
benabik It doesn't call .WHAT... It calls .Bool 20:51
nom: class Foo { method Bool() { True } }; say Foo.new ?? 'Hi' !! 'nope'
timotimo so how does changing .WHAT change what .Bool does?
p6eval nom a0a467: OUTPUT«Hi␤»
20:51 y3llow left 20:52 pothos left, y3llow_ left
benabik It doesn't change .WHAT. It overrides the method with the same name as $bar's .WHAT 20:52
timotimo perl6: my $nom = True but False; say $nom; say ?$nom;
benabik (Sorry if that wasn't clear)
p6eval rakudo a0a467: OUTPUT«True␤True␤»
..niecza v14-23-g0699296: OUTPUT«True␤False␤»
..pugs b927740: OUTPUT«*** Cannot cast from VBool False to VCode (VCode)␤ at Prelude.pm line 541, column 5-16␤»
20:52 y3llow joined
benabik Poor pugs. 20:52
timotimo yeah
20:53 pothos_ left, pothos joined
timotimo so class Foo { method Bool() { True } }; my $toot = 5 but Foo; should not actually change the Bool method of $toot, because the class is called Foo? 20:53
benabik Right. 20:54
timotimo because Foo.WHAT is "Foo"
i see
benabik It'll change the .Foo method.
But 5 does Foo will override Bool because it's mixing in the role.
20:54 y3llow left 20:55 y3llow joined
timotimo ah! 20:55
benabik nom: class Foo { method Bool() { True } }; my $x = 5; say ($x but Foo.new).Bool; say ($x does Foo).Bool
p6eval nom a0a467: OUTPUT«True␤Method 'specialize' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in <anon> at src/gen/Metamodel.pm:2075␤ in <anon> at src/gen/Metamodel.pm:2071␤ in compose at src/gen/Metamodel.pm:2069␤ in mixin at src/gen/Metamodel.pm:947␤ in sub infix:<doe…
benabik Oops?
nom: role Foo { method Bool() { True } }; my $x = 5; say ($x but Foo.new).Bool; say ($x does Foo).Bool
p6eval nom a0a467: OUTPUT«True␤True␤»
benabik nom: role Foo { method Bool() { False } }; my $x = 5; say ($x but Foo.new).Bool; say ($x does Foo).Bool
p6eval nom a0a467: OUTPUT«True␤False␤»
benabik Hard to see the difference when both cases do the same thing. 20:56
dalek kudo/nom: 0711f9f | moritz++ | src/ (2 files):
X::Undeclared errors for undeclared variables
20:59
21:04 GlitchMr left
timotimo perl6: say (True but 5).Int; say +(True but 5); 21:05
how come? 21:06
p6eval pugs b927740: OUTPUT«*** Cannot cast from VInt 5 to VCode (VCode)␤ at Prelude.pm line 541, column 5-16␤»
..rakudo a0a467, niecza v14-23-g0699296: OUTPUT«5␤1␤»
timotimo does + call .Num or something?
seems so
masak yeah.
benabik .Numeric, IIRC 21:07
Yes. I've said before that I think but should create methods for all roles the new value has that the old one doesn't. That way more cases like that can be caught.
timotimo is that easily introspectable? 21:08
benabik Probably?
timotimo via the .HOW object/metaobject? 21:09
benabik Yes.
timotimo oh, what did i do now? 21:11
perl6: say 5^.^methods; say 5.^methods
p6eval niecza v14-23-g0699296: OUTPUT«Unhandled exception: Unable to resolve method methods in class ClassHOW␤ at /tmp/Xz7JcA3V8j line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3744 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3745 (module-CORE @ 65) ␤ at…
..pugs b927740: OUTPUT«*** ␤ Unexpected "^.^"␤ expecting "_", fraction, exponent, term postfix, operator, ":" or ","␤ at /tmp/lk5xTHDXoy line 1, column 6␤»
..rakudo a0a467: OUTPUT«one(5, eager elems end classify uniq infinite flat tree hash list pick roll reverse sort values keys kv pairs Array grep first join map min max minmax postcircumfix:<[ ]> at_pos all any one none postcircumfix:<{ }> reduce ACCEPTS)␤Int Num Rat abs Bridge chr succ pr…
timotimo i somehow made a junction?
at least in rakudo
std: say 5^.^methods 21:12
p6eval std 48335fc: OUTPUT«ok 00:01 109m␤»
benabik nom: say (5^).WHAT
p6eval nom a0a467: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 2␤»
PerlJam timotimo: 5^ doesn't do what ever you think it does
benabik Oh. 21:13
timotimo i didn't think it did anything
benabik It's doing (5) ^ (.^methods)
timotimo i just thought ^.^ looked cute ;)
aaaaaaah, hehehe
PerlJam timotimo: what benabik said
benabik aka (5) ^ ($_.^methods)
PerlJam timotimo: there's a high probability that random text not only looks cute, but is a valid Perl 6 program ;) 21:14
timotimo what's the failure in niecza related to? not being able to enumerate the methods of the $_?
i hope i'm not annoying you with my senseless prodding at the perl6 grammar
moritz timotimo: I think niecza simply doesn't do introspection yet
timotimo that would of course explain it nicely
moritz nom: class A { sub f { has $.x } } 21:15
p6eval nom a0a467: OUTPUT«use of uninitialized value of type Mu in string context␤use of uninitialized value of type Mu in string context␤===SORRY!===␤error:imcc:syntax error, unexpected '\n'␤ in file '(file unknown)' line 488␤␤»
moritz wow :-)
benabik imcc syntax error?
[Coke] moritz++ #well played, sirl. 21:17
*sir
masak submits rakudobug
21:20 MayDaniel left, explorer__ joined 21:21 explorer__ left
[Coke] masak++ editing my send in post. 21:24
moritz niecza: class A { sub f { has $.x } } 21:25
p6eval niecza v14-23-g0699296: OUTPUT«===SORRY!===␤␤Attribute $!x declared outside of any class at /tmp/Xm690Y8LyV line 1:␤------> class A { sub f { has $.x ⏏} }␤␤Potential difficulties:␤ &f is declared but not used at /tmp/Xm690Y8LyV line 1:␤------> …
masak [Coke]: I always do that. 21:27
in my bug reports, everyone's an excellent writer. :)
I even made did talk about that twice. 21:28
s/did //
moritz masak: did you think of any interesting strategies for prisoner's dilemma over lunch? 21:29
[Coke] \o/, I finally got enough karma in SO to actually do things. ;)
too bad moritz already answered all the perl6 questions. ;)
moritz not the last one :-) 21:30
(about :from<perl5>)
[Coke] yah, i was avoiding that, as I'm pretty sure the answer is still NYI. 21:32
masak moritz: no, I got sucked into a conversation with a colleague about solutions to t4... :/
[Coke] moritz: is there a way to see who upvoted you?
moritz [Coke]: I don't think so 21:33
21:34 tokuhirom joined
moritz fwiw I've got the first prisoner's dilemma submission 21:38
moritz -> sleep
21:44 jferrero left, kaare_ left 21:46 icwiener_ left
masak 'night, moritz. dream of the ultimate prisoner's dilemma strategy ;) 21:47
21:48 sudokode left 21:52 sudokode joined 21:59 bluescreen10 left 22:13 bluescreen10 joined 22:14 bluescreen10 left 22:17 skids left 22:18 ab5tract left 22:24 unobe joined 22:36 jferrero joined
masak ...and 'night, #perl6 22:52
23:10 whiteknight joined 23:22 jlaire left 23:31 mj41 left 23:35 stepnem left 23:40 stepnem joined, jlaire joined 23:41 zjmarlow left 23:42 PacoAir left 23:43 tarch__ left 23:44 skids joined 23:45 mtk left