»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:04 user10 joined 00:05 user9 left, user10 is now known as user9 00:14 _28_ria left 00:16 BenGoldberg joined 00:17 _28_ria joined 00:24 _28_ria left 00:25 _28_ria joined 00:26 cognominal left 00:35 cyphase left 00:39 nightfrog left 00:40 cyphase joined 00:47 pierre_ joined 00:54 eliasr left 00:56 pdcawley joined 00:59 aborazmeh joined, aborazmeh left, aborazmeh joined 01:08 vendethiel left 01:09 vendethiel joined 01:16 pierre_ left, skink left, pierre_ joined
BenGoldberg m: say ++$¢; 01:19
camelia rakudo-moar a1fcee: OUTPUT«1␤»
BenGoldberg wonders what $¢'s purpose is. 01:20
01:21 pierre_ left
geekosaur isn't it something like the current capture in a regex? 01:23
viki Current Cursor in grammar 01:26
geekosaur right, it's the current state of what will become $/ after the match completes
01:27 nicq20 joined
labster viki: Thanks for asking, anyway, about Lingua::Number. For bonus points, you can fix the bug: rt.perl.org/Ticket/Display.html?id=127071 01:32
m: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/) 01:33
camelia rakudo-moar a1fcee: OUTPUT«True␤「foo」␤»
MasterDuke bisectable6: my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/) 01:37
bisectable6 MasterDuke, On both starting points (old=2015.12 new=b7201a8) the exit code is 0 and the output is identical as well
MasterDuke, Output on both points: True␤「foo」
MasterDuke bisectable6: old=2015.07 new=2015.12 my $v = rx/foo/; say("foobar" ~~ $v); say("foobar" ~~ /foo/) 01:38
bisectable6 MasterDuke, Bisecting by output (old=2015.07 new=2015.12) because on both starting points the exit code is 0
MasterDuke, bisect log: gist.github.com/3ac927ee99178823f5...ee0810cedb
MasterDuke, (2015-12-10) github.com/rakudo/rakudo/commit/f4...648ae38401
01:39 nightfrog joined, Sqirrel left 01:40 FROGGS_ joined
viki s: /foo/, 'ACCEPTS', \('foobar') 01:40
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/a1fc...gex.pm#L13
viki s: rx/foo/, 'ACCEPTS', \('foobar')
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/a1fc...gex.pm#L13
viki s: my $s = rx/foo/, 'ACCEPTS', \('foobar')
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/a1fc...gex.pm#L13
viki m: my $v = rx/meow/; dd "foobar" ~~ $v; 01:41
camelia rakudo-moar a1fcee: OUTPUT«Bool::False␤»
01:41 FROGGS left
labster does bisectable work by looking at exit code, or output? 01:41
viki labster: both
MasterDuke any change, to the exit code or output, should count 01:42
01:43 aborazmeh left
labster Ah, I see how it works. 01:43
01:44 pdcawley_ joined, pdcawley left 01:45 ilbot3 left 01:46 aborazmeh joined, aborazmeh left, aborazmeh joined
viki m: my $v = rx/foo/; say("foobar" ~~ $v); dd $/ 01:47
camelia rakudo-moar a1fcee: OUTPUT«True␤Nil $/ = Nil␤»
viki labster: no idea. You could try asking lizmat. She's might be familiar with this area. I suspect it's something to do with $/
01:47 ilbot3 joined 01:48 Sqirrel joined 01:49 pdcawley_ left
viki m: my $v = rx/foo/; say("foobar" ~~ /<$v>/); 01:49
camelia rakudo-moar a1fcee: OUTPUT«「foo」␤»
viki labster: ^ workaround
01:49 fredstorm joined
labster Well, bisectable blames Larry. 01:49
That's not great, but I might do it anyway. 01:50
viki labster: where does bisectable blame Larry? Above? That's just the "oldest" (sorta) commit it knows about. It didn't find any difference and this behaved like that since our first stable release. 01:51
labster it doesn't look like that in the log to me? 01:52
viki Or rather, it did today and on 2015-12-10. There's a caveat that the stuff behaved differently in the middle.
Ah.
viki really needs to go to bed :)
01:55 pierre_ joined
viki labster: I guess it needs a check that the QAST::Var doesn't itself contain a regex. 01:55
labster: I'll try to look into it tomorrow, unless someone beats me to it.
01:56 fredstorm left 01:58 aries_liuxueyang left 02:00 pierre_ left, pierre_ joined 02:04 pierre_ left 02:05 aries_liuxueyang joined, pierre_ joined 02:07 aborazmeh left 02:08 aborazmeh joined, aborazmeh left, aborazmeh joined 02:09 Jesmaybe joined 02:16 aries_liuxueyang left 02:20 aries_liuxueyang joined 02:36 aborazmeh left 02:42 pierre_ left 02:44 pierre_ joined 02:45 pdcawley joined 02:48 aries_liuxueyang left 02:49 noganex_ joined 02:52 wamba joined 02:53 noganex left 03:05 nicq20 left 03:06 pdcawley left, Jesmaybe left 03:08 Kop joined 03:12 Kop left 03:24 pierre_ left 03:29 pierre_ joined 03:30 Jesmaybe joined 03:36 pierre__ joined, pierre_ left 03:49 Jesmaybe left 03:54 skids left 04:01 wamba left, pdcawley joined 04:05 khw left 04:18 pdcawley left 04:28 Cabanossi left 04:30 Cabanossi joined 04:35 pierre__ left 04:36 canopus left, pierre_ joined 04:41 canopus joined 04:45 xinming joined 04:47 pierre_ left 04:53 BenGoldberg left 04:55 pierre_ joined 04:57 Penguiniator joined 05:00 pierre_ left, rurban joined, rurban left 05:03 Penguiniator left 05:06 wamba joined 05:13 pdcawley joined 05:15 skrshn joined
skrshn Newbie question: In the program (gist.github.com/anonymous/1e410ebd...afa63d1c), I want to have some arguments as required and others optional 05:15
Is this possible? 05:16
05:23 darutoko joined, cyphase left
moritz skrshn: yes, you can make named params mandatory with a ! 05:27
m: sub f(:$x!) { }; f()
camelia rakudo-moar a1fcee: OUTPUT«Required named parameter 'x' not passed␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
05:31 pdcawley left
skrshn I thought I tried it. It now works. Thanks 05:34
05:34 cyphase joined 05:42 wamba left 05:43 canopus left, _28_ria left 05:44 canopus joined 05:45 _28_ria joined 05:50 RabidGravy joined 05:56 pierre_ joined 05:58 rurban joined 05:59 snowman left 06:01 pierre_ left
moritz you're welcome 06:06
06:08 abraxxa joined
RabidGravy boom 06:09
timotimo boom gravy
06:13 abraxxa left
RabidGravy right, off to earn some quids 06:23
timotimo good quiddin'
06:25 neuraload joined, firstdayonthejob joined 06:27 FROGGS_ is now known as FROGGS, pierre_ joined 06:28 pdcawley joined, wamba joined 06:32 domidumont joined, wamba left 06:36 domidumont left 06:37 domidumont joined, abraxxa joined 06:40 firstdayonthejob left 06:42 domidumont left 06:43 Tonik joined 06:47 wamba joined 06:55 wamba left 06:56 wamba joined 06:57 ufobat joined 06:59 domidumont joined, _28_ria left 07:00 jonas2 joined 07:01 pdcawley left 07:03 _28_ria joined 07:04 eiro joined
eiro hello 07:04
timotimo hello
eiro muuuuuch more people on this channel now :)
long time no see
07:05 bjz joined
FROGGS hi eiro 07:05
07:05 Upasaka left
timotimo helps that a few of our people have been adding bots left, right, and center ;) 07:06
eiro :) 07:07
thnaks to asynchrony, each perl6 bots run dozen of clients then 07:08
07:10 Actualeyes left, pmurias joined, _28_ria left 07:11 _28_ria joined 07:12 bjz left 07:13 _28_ria left 07:15 CIAvash joined, CIAvash left 07:21 Actualeyes joined 07:25 mr-foobar left 07:26 labster left 07:27 CIAvash joined 07:28 CIAvash left 07:29 labster joined 07:34 dakkar joined 07:52 salva00 joined 07:55 TheovdH joined, pdcawley joined, abraxxa left 08:00 Sqirrel left, Sqirrel joined 08:04 aborazmeh joined, aborazmeh left, aborazmeh joined 08:07 pierre_ left 08:10 pierre_ joined 08:16 rindolf joined 08:18 pdcawley left 08:19 salva00 left 08:27 abraxxa joined 08:31 salva00 joined 08:34 ocbtec joined
lizmat .tell Zoffix the difference between my $a = rx/foo/; "foo" ~~ $a and "foo" ~~ /foo/ is in the codegen: the former goes through multi sub infix:<~~>(Mu \topic, Mu \matcher), which Boolifies the result 08:38
yoleaux lizmat: I'll pass your message to Zoffix.
lizmat m: my $v = rx/bar/; say("foobar" ~~ $v); say $/; say("foobar" ~~ /foo/); say $/
camelia rakudo-moar a1fcee: OUTPUT«True␤Nil␤「foo」␤「foo」␤»
08:41 salva00 left 08:42 wamba left, salva00 joined 08:43 gregf_ joined
lizmat Zoffix am testing a fix, but first afk for a few hours 08:43
08:47 wamba joined 08:48 salv0 joined 08:52 g4 joined, g4 left, g4 joined 08:54 __T joined
__T hello, I have a quick question 08:54
timotimo greetings
__T what is the perl6 equivalent of the qw()
timotimo just angle brackets 08:55
m: say <hello how are you>.perl
camelia rakudo-moar a1fcee: OUTPUT«("hello", "how", "are", "you")␤»
__T oooh
thats elegant
i love the gather take construction 08:56
timotimo perl6 took the opportunity to make things that are used more often shorter to type
moritz explicit qw also works, but not with ()
08:56 zakharyas joined
timotimo yeah, gather/take is really nice 08:56
that's true, like this:
m: say qw"hello how are you".perl
camelia rakudo-moar a1fcee: OUTPUT«("hello", "how", "are", "you")␤» 08:57
timotimo m: say qw^hello how are you^.perl
camelia rakudo-moar a1fcee: OUTPUT«("hello", "how", "are", "you")␤»
moritz or even
timotimo m: say qw“hello how are you”.perl
camelia rakudo-moar a1fcee: OUTPUT«("hello", "how", "are", "you")␤»
__T and implementation of gather take + start keyword for some concurrency
moritz m: say qw<hello how are you">
camelia rakudo-moar a1fcee: OUTPUT«(hello how are you")␤»
timotimo without the .perl you can't easily see where the list puts its separators then
moritz right 08:58
__T m: say 'hello world'
camelia rakudo-moar a1fcee: OUTPUT«hello world␤»
timotimo one of the best things about gather/take is that it works recursively, and even across subs/methods that don't know anything about gather/take 08:59
with python's yield it's not as nice. not by a long shot.
__T ok 09:02
i'm now trying gather/take with start keyword
so i make a list of promises
i can flatten the array of promises just with: await @promises?
timotimo that's not what flatten means, but yeah, that should do what you meant 09:03
__T yeah sorry, flatten is not the right term
how is fulfilling a promis named?
moritz keeping it
timotimo right, you can keep it or break it 09:04
__T ok, so how i keep promises
now i use .say for @promises
timotimo oh, keeping promises is something the piece that's responsible for the promise does 09:05
so, when the start { ... } block is finished and no exception happened or anything, the start block will keep its promise
the value it'll be kept with will be the return value of the start block (but be careful, you can't use return inside of a start block, because it's not a full subroutine) 09:06
__T ok, i have to jump into these promises 09:07
moritz also note that gather/take + start is a somewhat weird mix 09:08
gather/take is for creating a lazy list
and start / threads is about doing computation so eagerly that you even want it parallelized
timotimo continuations don't go very well with going between threads
moritz so, do you want lazy or eager?
__T eager 09:09
moritz then you don't really need gather/take
I mean sure, you can use it, but it's likely confusing
__T i just found a concurrency example that uses gather/take
and build from there
moritz not all examples out there are idiomatic :-)
__T so where can i use take start? 09:10
or you mean, i dont have to use take to use start
just within normal loops i guess 09:11
moritz right
timotimo yeah, start just gives you a regular old value. just a promise object
moritz you can do stuff like my @promises = map { start computation($_) }, @inputs
where computation is your sub that does the actual work
__T yes 09:12
and from that array the promises will be kept or do i have to use @a = await @b? 09:13
moritz or even my @results = @input.hyper.map(&computation)
__T hyper.map..
timotimo the promises will be kept on their own accord. if you access the .result of a promise, it'll block for you and give you the result
if you want the result of a bunch of promises at once, you best use await with a list of promises
moritz m: my @promises = map { start $_ + 2 }, 1..10; say await @promises
camelia rakudo-moar a1fcee: OUTPUT«(3 4 5 6 7 8 9 10 11 12)␤»
moritz __T: ^^ that's basically the the simplest thing you can do with promises 09:14
09:14 pdcawley joined
moritz m: sub compute($x) { $x + 2 }; say (1..10).hyper.map(&compute) 09:15
camelia rakudo-moar a1fcee: OUTPUT«HyperSeq.new␤»
moritz m: sub compute($x) { $x + 2 }; say (1..10).hyper.map(&compute).lsit
camelia rakudo-moar a1fcee: OUTPUT«No such method 'lsit' for invocant of type 'HyperSeq'␤ in block <unit> at <tmp> line 1␤␤»
moritz m: sub compute($x) { $x + 2 }; say (1..10).hyper.map(&compute).list
camelia rakudo-moar a1fcee: OUTPUT«(3 4 5 6 7 8 9 10 11 12)␤»
moritz implicit parallelization with .hyper
m: sub compute($x) { $x + 2 }; say (1..10).hyper(4).map(&compute).list
camelia rakudo-moar a1fcee: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at <tmp> line 1␤␤»
moritz m: sub compute($x) { $x + 2 }; say (1..10).hyper(batch => 4).map(&compute).list
camelia rakudo-moar a1fcee: OUTPUT«(3 4 5 6 7 8 9 10 11 12)␤»
timotimo is hyper actually stable at the moment?
moritz dunno
timotimo i thought there were still cases where hyper and map and/or grep will lose values
__T well thanks for the examples, perl 6 looks very promising 09:17
I already liked how elegant the Class implementation is
and the type subsets that you can mek
*make
timotimo yeah, they're nice
__T and ofcourse 0.1 + 0.2 == 0.3 09:18
DrForr Chained operators are handy as well.
__T i didn't read about chained operators yet
timotimo very yes
m: say "yay" if 1 < 2 < 3 < 4 09:19
camelia rakudo-moar a1fcee: OUTPUT«yay␤»
__T nice 09:20
FROGGS m: sub two { say "evaluated once"; 2 }; say "yay" if 1 < two() < 3 < 4
camelia rakudo-moar a1fcee: OUTPUT«evaluated once␤yay␤»
__T and ofcourse, something i really missed where the set operators
(in perl 5)
return is implicit still in perl 6? 09:21
so last declared value will be returned?
timotimo yes
you can annotate a function with "returns Nil" or "--> Nil" to make it not return anything 09:22
DrForr __T: How'd you run across Perl 6? Just curious.
__T ah yes, thats different from python
I started with Perl 5 long time ago
then I needed to use Python, and now i work with python
But I always loved Perl 09:23
I try to use perl 5 one liners as much as possible in my workflow
so I kept following the progress of perl6
09:24 TheovdH left
moritz so have I :-) 09:24
__T Python is really nice, but it's also boring :D
I like list comprehensions and dict comprehensions in Python 09:25
and ofcourse the whole Class system
moritz finds python classes underpowered
__T yes
its true, but for my relatively simple tasks its enought
arnsholt List comprehensions are just map and grep =)
__T i know 09:26
but without many keywords, i like it
its just hard to convince my collegues Perl6 is promising
arnsholt moritz: Having looked at how they work internally, I find them a bit weird TBH =) 09:27
__T how fast is regex now? 09:28
i used perl6 regex last year
it was very slow
timotimo depends on how you use it 09:29
we've just had a few major speed-ups with functions surrounding regex, but the regex match itself is still not the fastest
__T perhaps I used it wrongly :D
timotimo i wouldn't call it "wrong"; you'll just be able to find very fast shortcuts for many things if you really know a lot about performance in perl6
we're working on it, of course 09:30
__T I remember it was quite simple regex, just matching IP adresses over a list of lines
09:30 llfourn left
__T so what is your role timo? 09:30
[ptc] RabidGravy: just ran across Test::META. Cool stuff! The docs mention the TEST_AUTHOR env var; shouldn't that be AUTHOR_TESTING to be consistent with roughly standard P5 usage? E.g. in Dist::Zilla etc?
09:31 jnthn joined 09:34 aborazmeh left, Actualeyes left 09:37 pdcawley left
timotimo __T: i'm working on MoarVM and perl6 in general 09:40
i'm interested in getting perl6 faster and making it use less memory 09:41
not terribly good at it, though
__T well, i'm glad someone is doing that job :D
09:41 llfourn joined
timotimo many more than me are involved :) 09:41
09:42 Sqirrel left
__T btw, will there be a Learning Perl 6 book coming out? 09:43
preferably without butterfly cover
or Programming Perl 6
timotimo multiple books are in the works, i don't know when the first one will be finished
__T nice
you're proofreader? 09:44
DrForr Yes. I can't quite say when, but there are books in the works.
moritz __T: I'm creating a mailing list with updates on p6 books
__T: if you want in, /msg me your email address
timotimo i've got a review copy of one book, but i've been procrastinating continuing it :( 09:45
__T i would love to receive review copies, but my perl6 knowledges is probably not good enought to be of any use. 09:46
so i will be typical bookbuyer
09:47 TheovdH joined
__T moritz did you receive my message 09:47
moritz __T: yes
09:55 zakharyas left, zakharyas joined 09:56 labster left 10:01 pdcawley joined 10:03 huf joined 10:08 TEttinger left 10:09 pdcawley left 10:10 Zoffix joined
Zoffix Ah right, I went straight to ACCEPTS and didn't check the ~~ with sourceable 10:10
yoleaux 08:38Z <lizmat> Zoffix: the difference between my $a = rx/foo/; "foo" ~~ $a and "foo" ~~ /foo/ is in the codegen: the former goes through multi sub infix:<~~>(Mu \topic, Mu \matcher), which Boolifies the result
Zoffix s: &infix:<~~>, \(my $a = rx/foo/, 'foo') 10:11
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/a1fc...Mu.pm#L809
Zoffix s: &infix:<~~>, \(/foo/, 'foo')
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/a1fc...Mu.pm#L809
Zoffix :/
s: &infix:<~~>, \('foo', my $a = rx/foo/)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/a1fc...Mu.pm#L809
Zoffix s: &infix:<~~>, \('foo', /foo/)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/a1fc...Mu.pm#L809
DrForr Zoffix: Thanks, threw your PRs in.
Zoffix ¯\_(ツ)_/¯
10:11 zakharyas left
Zoffix Oh well... lizmat++ for fix 10:12
10:12 Zoffix left, bpmedley joined
[ptc] Zoffix++: thanks for the PR! I don't often PRs on projects of my own :-) 10:16
10:18 araujo joined, araujo left, araujo joined 10:19 araujo left 10:20 araujo joined 10:24 amalia_ left 10:27 amalia_ joined 10:29 arnsholt left
dalek c: eb172c0 | paultcochrane++ | doc/Language/modules.pod6:
Link to full META spec in modules docs
10:30
10:42 bjz joined
lizmat is back 10:44
investigating some spectest breakage
10:44 eliasr joined
viki [ptc]: RabidGravy AUTHOR_TESTING is also what our Test::When looks for: github.com/zoffixznet/perl6-Test-When#author 10:45
dalek c: 758bcb8 | paultcochrane++ | doc/Language/modules.pod6:
Link directly to META6 section

  ... which takes the user more directly to the required information.
10:46
10:47 pierre_ left 10:48 smash_ is now known as smash 10:50 arnsholt joined
[ptc] viki, RabidGravy: yeah, I was thinking about the consistency of that env var, and whether or not a patch to the Test::META docs was in order 10:54
10:54 salva00 left 11:00 llfourn left 11:01 kaare__ joined 11:03 k-man left 11:05 salva00 joined 11:07 bjz left 11:10 k-man joined 11:14 k-man left 11:15 k-man joined 11:16 itaipu joined 11:22 rurban left 11:23 vendethiel left, Actualeyes joined, bjz joined
skrshn regex q 11:30
m:"1234" ~~ /<:N - [12]>+/ && say $/;
p6: "1234" ~~ /<:N - [12]>+/ && say $/; 11:31
camelia rakudo-moar 5ac593: OUTPUT«「34」␤»
skrshn p6: "1234" ~~ /<-:N - [12]>+/ && say $/;
camelia ( no output )
skrshn I want to negate the (:N - [12]) set
11:33 __T left 11:36 stux|RC-only joined 11:40 AlexDaniel joined
viki m: say "1234" ~~ /<+:N - [12]>+/ 11:46
camelia rakudo-moar 5ac593: OUTPUT«「34」␤»
viki m: say "1234" ~~ /<-:N + [12]>+/
camelia rakudo-moar 5ac593: OUTPUT«「12」␤»
skrshn viki: thanks. how do I interpret (-:N + [12])? 11:54
I earlier thought that <-...> would negate whatever set is in ... 11:55
moritz m: say 'a' ~~ /<-:N>/ 11:56
camelia rakudo-moar 5ac593: OUTPUT«「a」␤»
moritz skrshn: seems to be parsed as (-:N) + [12]
viki skrshn: < > umm... "contains regex things"... -:N regex thing negates :N +:N regex thing adds it in. So -:N negates all :N and +[12] brings 12 back in
.oO( thingies! )
11:57
11:59 jantore joined
skrshn so the process of building the set matters 11:59
moritz it's just like in 12:00
m: say -5 + 2
camelia rakudo-moar 5ac593: OUTPUT«-3␤»
skrshn for instance, <-:N + [12]> is different from <[12] - :N>
moritz: i don't think so
-5 + 2 == 2 - 5
moritz skrshn: right 12:01
12:01 Irev joined
Irev Is Perl6 better and more modern than Perl 5? 12:01
moritz skrshn: but it kinda still makes sense; you start from [12], and then subtract all numeric letters
viki Irev: yes 12:02
AlexDaniel and not like… -5 ** 2… :P
Irev viki, is it also the future of Perl?
AlexDaniel Irev: actually, define “better”
and also “modern”
viki Irev: I don't have a chrystal ball. Perl 5 is in active development and does get new features.
Irev AlexDaniel, you know, generally better and worth learning more than Perl 5 12:03
AlexDaniel Irev: it depends on your needs
Irev: for example, right now performance is significantly better in perl 5, generally
Irev AlexDaniel, I just want to get more skilss
skrshn moritz: kinda. But the way I think it would be better to start with an empty set and start adding things to it
viki Irev: so learn both
Irev *skills not for job, but for fun and doing crazy things
viki Irev: then Perl 6
skrshn in doing <-:N>, you are adding everything to the empty set except the nubmers 12:04
viki Irev: Perl 5 is more performant and there are more jobs for it. Perl 6 has saner features IMO. You can still get them in Perl 5, but they feel like hacks over the core language.
skrshn after that, <-:N + [12]>, you would be adding [12] to that resulting set
viki Irev: and I'm obviously biased in my opinions. Hence my suggestion to try both and see which one fits your brain better. 12:05
Irev what are the relation perl6.org and rakudo.org ?
viki Irev: Perl 6 is the language. Rakudo is one of the compilers.
Irev: kinda like the relation between C and gcc
Irev viki, so Rakudo is a major implementation?
viki Irev: it's the most complete and to my knowledge the only one currently actively maintained 12:06
Irev viki, is it a compiler or JIT?
A compiler like GCC?
viki Irev: it compiles to a VM bytecode
avalenn what is the better way to use perl6 and panda in Debian (testing) for now ?
AlexDaniel avalenn: eh, well… I use rakudobrew… 12:07
viki avalenn: Rakudo Star: rakudo.org/downloads/star/
moritz avalenn: docker pull mj41/perl6-star; docker run -v $PWD:/perl6 -w /perl6 -it mj41/perl6-star panda ...
skrshn +1 for rakudobrew
viki -1 for rakudobrew
It's not for end users.
[ptc] avalenn: there are very up-to-date packages for moarvm, nqp and rakudo available in Debian testing
avalenn Ok. I tried to use packaged rakudo and it's fine but for the lack of panda.
Irev viki, why so many people say that programs in Perl are non-maintainable and is like write a program and then throw it away?
AlexDaniel avalenn: generally, the answer would be to get rakudo from repos and install panda somehow on top 12:08
[ptc] I believe 2016.09 is the current, most up to date version
AlexDaniel avalenn: however, upcoming debian freezes will probably invalidate that option rather quickly
viki avalenn: well, first, I'd recommend using zef instead of panda. And if you read its docs, it tells you how to install it: modules.perl6.org/repo/zef
DrForr Irev: Because they haven't seen cleanly written Perl code, usually.
viki [ptc]: nope, 2016.10
AlexDaniel avalenn: and rakudo is evolving a bit too fast at this moment
moritz I've thought long about how to give instructions for running rakudo in my book, keeping it minimal
[ptc] viki: oh, wow, cool!
moritz and I've decided do recommend docker, because it's so few commands, and works pretty much independent of the host 12:09
avalenn I would be interested on up-to-date rakudo packages in Debian experimental, but I am not ready to do them myself.
AlexDaniel /o\ docker
Irev viki, well, I like to give it a try. so which book is suitable for a beginner like me? I know some about computer hardware and software and networks
viki Irev: it's easy to write really shitty code in Perl 5. You get enough idiots writing crap, then of course, there will be crap. In my experience, people who say those things haven't seen Perl code for decades and a lot have changed since then.
AlexDaniel avalenn: well, I've been using debian unstable for years
moritz AlexDaniel: there's no compulsion to use it; it's just a convenient way 12:10
viki Irev: I don't think there are any up-to-date books for Perl 6 yet (we've just released last December). You can start with "For Newcomers" section here: perl6.org/resources/
DrForr Yet.
viki Yeah, there are a couple in the works. 12:11
AlexDaniel avalenn: now regarding rakudo star, if you're serious about development in perl 6 then there's a high chance that rakudo star will not do it for you… You will face bugs and will need latest bug fixes
moritz Irev: fwiw I'm starting a mailing list with updates on various Perl 6 book projects. If you want in, /msg me your email address (and optionally first name)
viki avalenn: oh!
avalenn: wait, El_Che++ has been building packages. 1 sec 12:12
AlexDaniel avalenn: so I'm not sure where all these anti rakudobrew people come from, like, are they real? :) rakudobrew is not meant for anything, yeah, but other solutions just don't cut it.
ah, El_Che packages!
moritz github.com/nxadm/rakudo-pkg/releas...ag/2016.10
viki Yeah github.com/nxadm/rakudo-pkg/releases
moritz debian packages for 2016.10
moritz faster this time
AlexDaniel yes, that's probably the best solution right now
viki AlexDaniel: I've seen enough people with rakudobrew installations who don't know wtf they're doing, get issues, and then complain that Perl 6 is broken crap. 12:13
rakudobrew is not for regular end users
You have to rehash with binaries, for one.
avalenn viki: rehash ?
viki avalenn: rakudobrew has a rehash command. 12:14
moritz is there a nice rakudo + zef docker image somewhere?
12:14 Irev left
skrshn why is zef better than panda? 12:14
viki skrshn: more actively developed
skrshn: github.com/perl6/doc/issues/894#is...-249450054 12:15
avalenn Ok. I will settle for rakudobrew with zef for now.
viki heh 12:16
[ptc] viki: should we be using zef rather than panda in the travis builds then?
viki: at present Travis uses build-panda and then the user can use panda to install the deps as required 12:17
viki people getting dev work that hasn't been tested and don't know enough to update their installation... another -1 for rakudobrew. I think it was jkramer that came with that issue when a commit broke precomp and they managed to install that version.
skrshn viki: tx 12:18
avalenn viki: thx for the recommendation, I will keep this in my head if I have problems with rakudobrew 12:19
viki And here's another person poo-pooing Perl 6, and I suspect their messing around with rakudobrew just exacerbated their original issue: www.reddit.com/r/perl6/comments/56...s/d8n58jf/ 12:20
avalenn: personally, I have `update-perl6` alias set to this: rm -fr ~/.zef; rm -fr ~/.perl6; rm -fr ~/.rakudobrew/; git clone github.com/tadzik/rakudobrew ~/.rakudobrew; rakudobrew build moar; rakudobrew build zef; zef --install A::List Of::The Modules::I::Use; 12:21
avalenn: so far, worked like a charm for me to get bleed Perl 6 on my boxes 12:22
AlexDaniel except that you have to maintain the list of packages you use
viki avalenn: that does use rakudobrew, but it nukes everything on each update
buggable: eco 12:23
buggable viki, Out of 739 Ecosystem dists, 247 have warnings and 0 have errors. See modules.perl6.org/update.log for details
tadzik . o O ( rakudbrew set autonuke )
viki [ptc]: ¯\_(ツ)_/¯ 12:25
12:25 rurban joined 12:26 mxco86 left, mxco86 joined
viki tadzik: you have a bunch of unmerged PRs BTW: github.com/issues?utf8=%E2%9C%93&a...+is%3Aopen 12:28
tadzik oh wow, indeed
tbrowder /msg moritz please add me to yr book list [email@hidden.address] Tom 12:29
viki snikers 12:30
Good thing it wasn't top secret info :)
/msg moritz the nukclear code is SDG-D4343-D
DrForr That's the same conde I use on my luggage! 12:31
tadzik /msg nickserv identify sexytadzik123
[ptc] and that's my root password!
moritz tbrowder: added 12:33
wow, four subscribers before I even put up the signup form
tbrowder ok, why didn't /msg work? that's what freenode help said 12:35
viki moritz: did samcv give you theirs?
tbrowder: you had a space before the /
tbrowder ah, thanks, i'll try to remember not to send any secrets that way 12:36
AlexDaniel by the way, if anybody wants somebody to read through their stuff (e.g. book), feel free to ping me 12:37
I'm not a native speaker, so no help with the language, but you'll get a hundred of other notes :P 12:38
viki tbrowder: you can also use /query to first query a person and then you'd be typing in their window
moritz AlexDaniel: I'll keep that in mind, thanks 12:40
AlexDaniel yea, /query first 12:46
12:46 pierre_ joined
tbrowder thanks for the hint 12:56
12:58 bjz left, stigo left 12:59 bjz joined, stigo joined 13:00 wamba left
AlexDaniel bwahahahah :D 13:01
“-1 ** 2” as an example 13:02
viki ?
It's -1
AlexDaniel no, but the use of two spaces
that's a good joke :)
viki m: say -1 ** 2
camelia rakudo-moar e4dc8b: OUTPUT«-1␤»
viki doesn't get the joke
AlexDaniel viki: github.com/perl6/doc/issues/971#is...-256633870 13:03
13:03 wamba joined
viki is reminded that it was a good idea to unsub from doc Issues 13:03
m: say -1² 13:04
camelia rakudo-moar e4dc8b: OUTPUT«-1␤»
lizmat eh, yuk ? 13:05
ah, precedence ?
m: say (-1)²
camelia rakudo-moar e4dc8b: OUTPUT«1␤»
viki -1 on "Perhaps -x ** y should produce an error telling you to use parens to disambiguate."
13:06 grondilu joined, domidumont left
viki It's basic math. x² - y² is not x² + (-y)² 13:07
Perl 6's behaviour makes perfect sense to me.
AlexDaniel lizmat: ok, if this made you go “eh, yuk ?” then all this holy war is probably justified… :)
viki: actually…
13:07 domidumont joined
viki AlexDaniel: yes? 13:07
DrForr PEMDAS doesn't care about negative values :)
AlexDaniel viki: aren't you comparing infix - with a prefix one?
viki AlexDaniel: -1² is 0 - 1², as far as I'm concerned. 13:09
Making -1² behave differently than 0 - 1² would be fine sample of insanity 13:10
AlexDaniel m: say &prefix:<->
camelia rakudo-moar e4dc8b: OUTPUT«sub prefix:<-> ($?) { #`(Sub+{<anon|53968992>}+{Precedence}|52990496) ... }␤»
AlexDaniel I mean, if your definition of sanity is to imply a zero whenever you see a prefix operator, then fine, I guess… 13:12
jnthn Folks can holy war all they want, but the chances of us changing the precedence of basic operators now is close to zero. 13:13
viki AlexDaniel: my definition of sanity is sane mathematical operations. -1² giving 1 while at the same time 0 - 1² giving -1 is insane.
jnthn++
viki can now do better things :) 13:14
DrForr "You were entitled to make suggestions at the appropriate time."
13:14 skrshn left
AlexDaniel jnthn: yeah, the old “we are not changing anything” idea, even though factually we do it all the time. But still, what do you think about making it give a warning? 13:14
viki Why? What point is the warning? It will just annoying anyone who spent 2 seconds to learn proper precedence. 13:15
moritz AlexDaniel: we change stuff, but the more fundamental it is, the less likely we are to change it
jnthn What moritz said
grondilu -1² should not give one. The exponent takes precedence over the minus prefix
moritz but do we parse it as an exponent? 13:16
or as part of the number?
viki it parses into the ** op 13:17
grondilu wasn't that discussed few days ago already?
moritz m: say -1²
camelia rakudo-moar e4dc8b: OUTPUT«-1␤»
AlexDaniel ok, I get it. So instead of fixing it we will just document another trap in the documentation. That's actually what I proposed initially (by creating a doc issue instead of rakudobugging it), even though I strongly disagree now.
13:18 ocbtec left
viki AlexDaniel: what's your reasoning for -1² being 1? It contravenes basic rules of mathematics. 13:18
AlexDaniel: for expecting it to be 1, I mean.
moritz AlexDaniel: try entering the same expression in Mathematica, for example
jnthn AlexDaniel: We do have a warning on things like ^2.map(...) iirc, so there is at least a precedent. But I'm not particularly inclined in this case, because ^2.foo will be a thinko just about all of the time, while in this case it seems the current way it is matches what a lot of people expect.
lizmat m: say -1**2 # I withdraw my yuk 13:19
camelia rakudo-moar e4dc8b: OUTPUT«-1␤»
jnthn We'd basically force people to always parenthesize with such a warning
moritz to me, all seems fine
AlexDaniel if there's a -, sure?
13:20 cdg joined
viki just now realizes ^2.map is a warning and not an exception.... 13:20
m: say quietly ^10.map: *+2 13:21
camelia rakudo-moar e4dc8b: OUTPUT«Potential difficulties:␤ Precedence of ^ is looser than method call; please parenthesize␤ at <tmp>:1␤ ------> 3say quietly ^107⏏5.map: *+2␤^1␤»
viki tsk tsk
AlexDaniel viki: my reasoning is that people read code. And when they read it, half of them will go “yuk” when they see what actually happens. They will then “spend 2 seconds to learn “proper” precedence”, and it will be fine, but I'd much rather not allow this ambiguity to happen by giving a warning
grondilu comparison with ^$n.map is a good one. I've always found slightly annoying to have to add parens in that case. 13:22
AlexDaniel anyway, to all of you who think how this makes sense so much, perhaps you can contribute to the documentation (document this trap) by showing your way of thinking to others
viki AlexDaniel: and the other half of people who know math are now forced to type parentheses all the time? 13:23
AlexDaniel: OK, I can document a trap
AlexDaniel viki++
[Coke] (/query) - huh. I had by habit used (/msg moritz .) in the past.
AlexDaniel [Coke]: in emacs, moritz would have to reply with . to make it pop up a new window 13:24
13:28 skids joined
viki .u nonbreaking space 13:32
yoleaux No characters found
viki .u non-breaking space
yoleaux U+00A0 NO-BREAK SPACE [Zs] ( )
[Coke] viki: for docs? (I finally broke down and memorized the vim sequence to insert one.) 13:33
moritz Ctrl-k space space
dalek c: 5a5b428 | (Zoffix Znet)++ | doc/Language/traps.pod6:
Document behaviour of -1² in Traps

Closes #971
13:34
viki used GitHub editor
bah 13:36
dalek c: e10d6e0 | (Zoffix Znet)++ | doc/Language/traps.pod6:
Fix output shown for say (-1)²
13:40 profan joined
AlexDaniel OK folks, now with that out of our way, how do we fix -Inf ? 13:41
m: say -∞**2 13:42
camelia rakudo-moar e4dc8b: OUTPUT«-Inf␤»
AlexDaniel m: say -Inf**2
camelia rakudo-moar e4dc8b: OUTPUT«Inf␤»
grondilu well that's surprising
AlexDaniel We can add -∞ as another exception to this precedence feature
m: say -Inf**2 13:43
camelia rakudo-moar e4dc8b: OUTPUT«Inf␤»
AlexDaniel m: say - Inf**2
camelia rakudo-moar e4dc8b: OUTPUT«-Inf␤»
AlexDaniel but will all respect to everyone, this makes zero fucking sense…
viki Yeah. It's due to -Inf being in grammar: github.com/rakudo/rakudo/blob/nom/....nqp#L3386
grondilu maybe Inf should not be allowed in arithmetic expressions
viki oh god...
grondilu the literal Inf I mean
after all Inf**2 is *not* defined. 13:44
viki Says who?
AlexDaniel are you sure about that?
grondilu I'm pretty sure, yes.
viki opens up a copy of IEEE 754-2008
DrForr Well, Inf really isn't a number, inasmuch as it's not commutative for starters. 13:45
Inf+1 == Inf, 1+Inf != Inf. 13:46
grondilu -Inf can be allowed, but basically nothing else.
jnthn I think -Inf is special-cased in the grammar. 13:47
It may be more entirley historical reasons
viki That's not true. IEEE defines a whole ton of operations with Inf
jnthn *for
m: say -Inf
camelia rakudo-moar e4dc8b: OUTPUT«-Inf␤»
jnthn m: say -(Inf)
camelia rakudo-moar e4dc8b: OUTPUT«-Inf␤»
jnthn Could just try removing the special case
13:48 rudolfochrist joined
DrForr I'm just speaking to the mathematical point of view - Infinity isn't something that you add or take things away from, it's the size of the natural (and real) numbers. 13:48
viki m: say −Inf
camelia rakudo-moar e4dc8b: OUTPUT«-Inf␤»
viki :)
m: say −1²
camelia rakudo-moar e4dc8b: OUTPUT«-1␤»
grondilu DrForr: that's what I meant as well. 13:49
but if IEEE really defines operations on it, then fair enough
viki Amusingly, it doesn't appear to say what Inf**N is supposed to be. It does list -Inf/+Inf as valid domain, but no indication that overflow exceptions should be given and then deleaniates dozens of cases of Inf/NaN combinations but none for the specific case of Inf**Integer :P 13:52
Well, section 6.1, I guess: "The behavior of infinity in floating-point arithmetic is derived from the limiting cases of real arithmetic with 13:54
operands of arbitrarily large magnitude, when such a limit exists.
m: say 9e99**20
camelia rakudo-moar e4dc8b: OUTPUT«Inf␤»
viki &
13:56 kurahaupo joined 14:00 ugjka joined
dalek c: 9727473 | coke++ | xt/doc:
Remove file

sample file that should not have been checked in
14:01
14:04 jonas2 left, amalia_ left
[Coke] m: my Pair $p2 = ('Perl' => (5, 6)); say $p2.invert 14:05
camelia rakudo-moar e4dc8b: OUTPUT«(5 => Perl 6 => Perl)␤»
lizmat afk&
viki m: say -Inf² 14:06
camelia rakudo-moar e4dc8b: OUTPUT«Inf␤»
viki Yeah, removing the special case fixes -Inf², but it breaks literal -Inf in signatures, which is why I suspect it was added originally. I'll take care of it on the weekend, as part of fixing RT#129915 14:07
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129915
AlexDaniel viki++ 14:14
viki First sign of trouble was actually in a spectest: github.com/perl6/roast/commit/697b...01010c841c 14:16
Message for -Inf.Int tests for "-Inf" yet message for -∞.Int test for "Inf" :} This Zoffix guy is blind
14:18 sivoais left
eythian I hope there's different keywords for countable and uncountable infinities. 14:19
[Coke] Nope, just one Inf in Perl 6. 14:20
viki Sure. my $countable = Inf; my $uncountable = Inf but role Uncountable {}
:}
eythian but then you have to express that $uncountable > $countable
14:21 bjz left, Actualeyes1 joined
viki easy 14:21
14:21 Actualeyes left
viki m: role Uncountable {}; multi infix:«>»(Inf, Uncountable) { True }; my $countable = Inf; my $uncountable = Inf but Uncountable; say $countable > $uncountable 14:21
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki well, if you type it right, it'll give the right results :} 14:22
eythian heh
14:22 nicq20 joined
nicq20 Hello o/ 14:23
viki \o
DrForr m: א₀ == \C
camelia rakudo-moar e4dc8b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3א7⏏5₀ == \C␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement modifier␤ statement modifier lo…»
14:24 tokomer joined
eythian what is \C? 14:25
14:26 sivoais joined
DrForr Doesn't matter, I was just riffing on the Continuum hypothesis that Zoffix was geting at :) 14:26
viki m: my \א₀ = "w00t"; say א₀ 14:27
camelia rakudo-moar e4dc8b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Term definition requires an initializer␤at <tmp>:1␤------> 3my \א7⏏5₀ = "w00t"; say א₀␤»
viki too bad subscripts don't work
m: my \א = "w00t"; say א
camelia rakudo-moar e4dc8b: OUTPUT«w00t␤»
viki m: my \term:<א₀> = "w00t"; say א₀
camelia rakudo-moar e4dc8b: OUTPUT«w00t␤»
DrForr . o ( m: @x₀ == 1 ) 14:28
Though subscripts are terribly overloaded in maths.
eythian m: say ℵ₁==ℶ₁ 14:29
camelia rakudo-moar e4dc8b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Bogus postfix␤at <tmp>:1␤------> 3say ℵ7⏏5₁==ℶ₁␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ statement end␤ statement modifier␤ …»
eythian I guess it remains unproven... 14:30
viki m: sub term:<ℵ₁> {1}; sub term:<ℶ₁> {1}; say ℵ₁==ℶ₁ 14:31
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
masak well, that settles that.
eythian maths: completed 14:33
14:42 raiph left, rudolfochrist left
viki m: class al { has $.c; method Numeric { $.c } }; sub prefix:<ℵ> { al.new: :$^c }; sub infix:<**> ($, al $a1) {al.new: :c($a1.c-1) }; dd ℵ⁰ == 2**ℵ¹ 14:47
camelia rakudo-moar e4dc8b: OUTPUT«Bool::True␤»
14:48 raiph joined
viki m: class ℵ {}; sub prefix:<ℵ> { +ℵ.new: :$^c }; dd ℵ⁰ 14:51
camelia rakudo-moar e4dc8b: OUTPUT«Memory allocation failed; could not allocate 101408 bytes␤»
viki I wonder why that hangs. Wouldn't the + before ℵ make it expect a term, so it'd know to use the class and not the prefix op? 14:52
jnthn No, otherwise you'd not be able to use multiple prefix ops together
viki m: say +-2
camelia rakudo-moar e4dc8b: OUTPUT«-2␤»
viki oh, didn't realize you could 14:53
m: say +-+-+-+-2
camelia rakudo-moar e4dc8b: OUTPUT«2␤»
viki haw
jnthn +~$something (numify the stringification of an object) is perhaps are more useful example
Or ?+$foo (boolify the numification)
m: say ?'0'
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
jnthn m: say ?+'0'
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
14:54 ggoebel left 14:56 ggoebel joined, AlexDani` joined 15:00 MorayJ joined 15:01 AlexDaniel left 15:03 wamba left, wamba joined 15:04 neuraload left 15:06 snowman joined 15:15 wamba left
avalenn m: Buf.new(65699) 15:21
camelia ( no output )
avalenn m: say Buf.new(65599).perl 15:22
camelia rakudo-moar e4dc8b: OUTPUT«Buf.new(63)␤»
viki That's by design
m: say Buf.new(256)
camelia rakudo-moar e4dc8b: OUTPUT«Buf:0x<00>␤»
timotimo m: say Buf[int64].new(65599).perl 15:23
camelia rakudo-moar e4dc8b: OUTPUT«Buf[int64].new(65599)␤»
viki :o
avalenn Ok. Default Buf is 8 bits
That's what I looked for. Thanks viki and timotimo 15:24
timotimo YW
15:25 chris2 joined 15:27 AlexDani` is now known as AlexDaniel 15:29 g4 left, lmfjeh[m] joined
grondilu how do I specify that a sub returns Nothing for nativecall? 15:43
I guess I could just not put any returns trait 15:44
jnthn Just don't put a returns statement
*trait
Right
15:48 pierre_ left, pierre_ joined, pierre_ left
[Coke] riiiiiiight 15:48
15:52 tokomer left 16:00 domidumont left
cosimo win 30 16:02
16:04 rurban2 joined 16:05 rurban3 joined 16:06 araujo_ joined
FROGGS .oO( ohh noes! he finally cloned himself! ) 16:06
16:06 araujo__ joined 16:07 rurban left 16:09 araujo left, rurban2 left 16:10 araujo_ left 16:14 wamba joined
moritz is anybody interested in doing art work for a book cover? 16:21
I thought of a butterfly, naturally
either painted, or extracted from a photograph 16:22
16:24 amalia_ joined
gfldex i would like to put the following into the docs but I can't decide where. Any suggestions? www.reddit.com/r/perl6/comments/59...u_can_get/ 16:31
16:32 domidumont joined 16:33 gregf_ left 16:35 canopus left 16:36 Actualeyes1 left
ugexe fwiw Zef has a file fetcher that can load sets of modules by encapsulating them in classes (not exporing subs) 16:36
my $fetchers := self.plugins.grep(*.fetch-matcher($uri))
16:37 dakkar left
ugexe and the plugin/dynamic loading logic: github.com/ugexe/zef/blob/master/l...f.pm6#L110 16:38
viki m: cache 16:40
camelia ( no output )
viki TIL
Oh, it's same as .cache :} 16:41
[Coke] gfldex: how slow is the type lookup that using the $ // = makes it worth it?
16:41 Actualeyes joined 16:44 canopus joined 16:46 nicq20 left, nicq201 joined, nicq201 left 16:50 ocbtec joined 16:52 __T joined
__T hello, i have a short question 16:52
16:52 wamba left
__T is there a way to prevent the perl6 shell from printing out an array or lazy list i declare? 16:53
viki You mean the REPL?
16:53 lostinfog joined
viki It always prints out the last line, unless you're producing some output yourself. 16:53
__T i guess its the repl yes
viki *the result of last line.
timotimo you can put a ; 1 at the end of your lines 16:54
gfldex [Coke]: i didn't benchmark it
dalek c: f59ad3e | gfldex++ | doc/Language/typesystem.pod6:
doc dynamic subset
c: 961c5f4 | gfldex++ | doc/Language/modules.pod6:
link to dynamic lookup/dynamic subset
__T if i make a lazy list
it tries to print it right
viki Really?
__T: would you rakudobug that please.
huggable: rakudobug
huggable viki, [email@hidden.address] or use perl6 query on rt.perl.org ; see github.com/rakudo/rakudo/#reporting-bugs
viki ummm...
__T: I just tried and it prints it as simply [...] 16:55
__T well not always
very strang
now i make 1..Inf and it doesnt
that should be the behaviour
viki __T: and what happens? It just hangs? 16:56
ugexe you should show an example that *does* sometimes give incorrect behavior
timotimo the .. operator gives you a Range object
__T yes, but i'm just trying to make sure its not just me being silly
triple dot forces lazy right? 16:57
ugexe well if you show us the code we can tell you if its you being silly or not 16:58
viki __T: tripple dot is the sequence operator.
I do spot a different bug in REPL. The auto-print-last-expression's-value consumes Seqs and you can't use them again 16:59
timotimo how is that a bug?
that's exactly how Seq works
you don't suggest the repl .cache every seq we come across? 17:00
viki m: dd [(1…4).is-lazy, (1…∞).is-lazy]
camelia rakudo-moar e4dc8b: OUTPUT«[Bool::False, Bool::True]␤»
viki timotimo: I've not made use of the Seq in my code. The bug is that a diagnostic feature of the REPL is affecting my code. 17:03
I don't need to make any suggestions to claim that to be a bug.
timotimo OK, i guess that's fair
gfldex m: my $i = 1; my $start = now; $i ~~ ::('Int') for 1..10000; say now - $start; $start = now; $i ~~ Int for 1..10000; say now - $start;
camelia rakudo-moar e4dc8b: OUTPUT«0.55654043␤0.00901874␤»
gfldex [Coke]: ^^^
i would say that is a wee bit faster :)
viki m: my $s = (1…4); my $o = [$s.clone]; .say for |$o; .say for |$s 17:04
camelia rakudo-moar e4dc8b: OUTPUT«1␤2␤3␤4␤»
viki s: ().Seq, 'clone', \()
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/e4dc...Mu.pm#L611
timotimo neither the static optimizer nor the dynamic optimizer can pull the constant out of the loop there
gfldex m: subset DInt where $ = ::('Int'); my $i = 1; my $start = now; $i ~~ DInt for 1..10000; say now - $start; $start = now; $i ~~ Int for 1..10000; say now - $start; 17:05
camelia rakudo-moar e4dc8b: OUTPUT«0.65682002␤0.0089549␤»
17:06 Actualeyes left, mspo joined
[Coke] gfldex: nifty. thanks. 17:06
gfldex m: subset DInt where ::('Int'); my $i = 1; my $start = now; $i ~~ ($ = ::('Int')) for 1..10000; say now - $start; $start = now; $i ~~ Int for 1..10000; say now - $start; 17:07
camelia rakudo-moar e4dc8b: OUTPUT«0.5601499␤0.0075087␤»
17:08 Actualeyes joined
gfldex m: my $i = 1; my $type = Int; my $start = now; $i ~~ $type for 1..10000; say now - $start; $start = now; $i ~~ Int for 1..10000; say now - $start; 17:08
camelia rakudo-moar e4dc8b: OUTPUT«0.0112901␤0.00799491␤»
tbrowder viki: should i change anything for that module with two versions?
dalek rl6-most-wanted: 4f26bb0 | titsuki++ | most-wanted/bindings.md:
Make is WIP
__T so ranges arent lazy by default 17:09
timotimo ranges aren't lists, actually
__T unless you assign them to a @?
timotimo assigning to @ vars will .list things
gfldex Range is a pair of two values
17:10 kaare__ left
timotimo m: my $foo = 1..10; say $foo.WHAT; my @bar = 1..10; say @bar.WHAT 17:10
camelia rakudo-moar e4dc8b: OUTPUT«(Range)␤(Array)␤»
viki m: use nqp; my $s = (1…4); my $o = $s.clone; nqp::bindattr(nqp::decont($o), Seq, Q|$!iter|, nqp::getattr(nqp::decont($s), Seq, Q|$!iter|).clone); .say for |$o; .say for |$s; 17:11
camelia rakudo-moar e4dc8b: OUTPUT«1␤2␤3␤4␤1␤2␤3␤4␤»
17:13 kaare__ joined, kaare__ left
viki m: dd [(1..4).is-lazy, (1..∞).is-lazy] 17:14
camelia rakudo-moar e4dc8b: OUTPUT«[Bool::False, Bool::True]␤»
17:16 kaare_ joined
dalek c: 9dd9ede | coke++ | doc/Language/ (2 files):
fix spelling mistakes
17:16
c: 11552fe | coke++ | xt/code.pws:
new code word
[Coke] BTW, doc folks, you can run the spell checker on individual files.
viki m: subset DInt where ::("Int"); my $i = 42; $i ~~ DInt for 1..10000; say now - INIT now; 17:19
camelia rakudo-moar e4dc8b: OUTPUT«0.7093227␤»
viki m: subset DInt where $ = ::("Int"); my $i = 42; $i ~~ DInt for 1..10000; say now - INIT now;
camelia rakudo-moar e4dc8b: OUTPUT«0.7464075␤»
viki m: subset DInt where $ //= ::("Int"); my $i = 42; $i ~~ DInt for 1..10000; say now - INIT now; 17:20
camelia rakudo-moar e4dc8b: OUTPUT«0.7201939␤»
viki m: subset DInt where ::("Int"); my $i = 42; $i ~~ DInt for 1..10000; say now - INIT now;
camelia rakudo-moar e4dc8b: OUTPUT«0.691085665␤»
viki Seems the whole caching trickery just makes it slightly slower
lizmat yeah, caching is a tricky business 17:21
__T m: 'hello world'.say 17:22
camelia rakudo-moar e4dc8b: OUTPUT«hello world␤»
timotimo also depends on how spesh is able to get a handle on the thing staying the same
17:22 seatek joined
__T m: my @a = 1..100;?@.grep(99); 17:22
camelia rakudo-moar e4dc8b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable @.grep used where no 'self' is available␤at <tmp>:1␤------> 3my @a = 1..100;?@.grep(99)7⏏5;␤»
__T m: my @ = 1..100;?@a.grep(99); 17:23
camelia rakudo-moar e4dc8b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3my @ = 1..100;?7⏏5@a.grep(99);␤»
__T wtf
viki lol
timotimo haha :D
viki m: my @a = 1..100; @a.grep(99).say;
camelia rakudo-moar e4dc8b: OUTPUT«(99)␤»
viki m: my @a = 1..100; @a.grep(99).so.say;
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
gfldex m: my $type = ::("Int"); my $i = 42; $i ~~ $type for 1..10000; say now - INIT now;
camelia rakudo-moar e4dc8b: OUTPUT«0.01177583␤»
__T is grep the fastest wayt to check for presence in a list? 17:24
gfldex there is something wrong with the `$ =` part
timotimo nah
__T ?@x.grep
viki __T: depends on the list. We have .first too
__T: premature optimization is the root of all evil.
timotimo also, you'll want to check the .defined of the result
viki m: say 99 ∈ 1..100
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
timotimo because if you are looking for something that boolifies to False, but it's in the list, you'll get the element from .first 17:25
viki m: say 99 ~~ 1..100
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki That one is probably the most idiomatic way
timotimo for ranges, yes
__T ah the smart match
timotimo for lists and arrays, no. 17:26
viki Why not?
timotimo because it won't do membership testing
viki s: say 99 ~~ [1..100]
SourceBaby viki, Something's wrong: False␤␤ERR: Cannot resolve caller sourcery(Bool); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
viki m: say 99 ~~ [1..100]
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
viki :(
timotimo you'll need element ~~ @foo.any for that 17:27
viki s: [], 'ACCEPTS', \(99)
Robot!
:(
timotimo :o 17:28
viki s: [], 'ACCEPTS', \(99)
s: say 99 ~~ [1..100]
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/e4dc...st.pm#L755
viki, Something's wrong: False␤␤ERR: Cannot resolve caller sourcery(Bool); none of these signatures match:␤ ($thing, Str:D $method, Capture $c)␤ ($thing, Str:D $method)␤ (&code)␤ (&code, Capture $c)␤ in block <unit> at -e line 6␤␤
17:28 dalek left 17:29 dalek joined, ChanServ sets mode: +v dalek
viki I see. 17:29
ugexe m: say [1..100].contains(99)
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki heh 17:30
m: say [1..100].contains("98 99")
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T hmm,
viki To me that feels like List needs a .contains blocker. Don't python or something or other have .contains to check membership of lists? 17:31
__T m: [0..100].contains("1 2"); 17:34
camelia ( no output )
viki m: say ("a"…"z").contains: "nop".comb 17:35
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
ugexe you have to do something with it, like "say" it
viki hahaha :)
__T [0..100].contains("1 2").say
viki __T: don't use that. It's basically an artefact of Arrays being Cool. It gets stringified into one string and then the given argument is searched in it
__T m: [0..100].contains("1 2").say 17:36
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
timotimo yeah, cool is a tiny bit wonky sometimes
17:36 hankache joined
__T well, i find it cool :D 17:36
ugexe m: [0..100].contains(1, 2)
camelia ( no output )
ugexe m: [0..100].contains(1, 2).say
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T well, i still like my grep
viki likes ∈ 17:37
even though it's slower and very picky :}
__T m: [0..100].grep(1).defined
seatek the prong :)
camelia ( no output )
__T m: [0..100].grep(1).defined.say 17:38
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki m: [0..100].grep(423423423423).defined.say
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki __T: you want .so
__T: the .defined was for .first, which returns the first element that matches
timotimo yes, sorry, i should have made that more clear
__T haha
viki m: [0..100].first(423423423423).defined.say 17:39
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
timotimo grep will return a list, if there's nothing you get an empty list, but that's still a defined value
viki m: [0..100].first(42).defined.say
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T m: [0..100].grep(999).defined.say
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T m: [0..100].first(999).defined.say; 17:40
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
viki FWIW, you can also /msg camelia to run commands
viki &'
seatek m: [0..100].grep(999).elems.say
camelia rakudo-moar e4dc8b: OUTPUT«0␤»
seatek m: [0..100].grep(34..38).elems.say 17:42
camelia rakudo-moar e4dc8b: OUTPUT«5␤»
__T viki: arent set operators abit slow 17:49
or is it efficient to first convert to set and then check for presence of an element? 17:50
like i read in the example in the perl6doc
m: my @a = <foo bar buzz>; say @a.Set<bar buzz>;
camelia rakudo-moar e4dc8b: OUTPUT«(True True)␤»
viki __T: as I've said, premature optimization is the root of all evil. Write your code to work right first. Then find the bottle neck. Then optimize it. "a" ∈ <a b c> is short to type and fast to read. I don't care how long it takes to run when I use it. 17:52
__T: the ∈ would convert its arguments to sets first. 17:53
s: &infix:<∈>
SourceBaby viki, Sauce is at github.com/rakudo/rakudo/blob/e4dc...ors.pm#L10
__T m: (0..100).Set<55>
camelia ( no output )
__T m: (0..100).Set<55>.say
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
__T only work for string sets i guess 17:54
viki m: (0..100).Set{55}.say
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
viki __T: that's the "pickiness" of ∈ that I mentioned. It descerns between Int, IntStr, and Str, so 2, <2>, and "2" are different elements to it. 17:55
and .Set<55> is looking for IntStr 55
__T hmm ok 17:56
viki Well, Setties, Baggies, and parametarized Maps do.... not a specialty of ∈ per say 17:57
m: dd set 2, <2>, "2" 17:58
camelia rakudo-moar e4dc8b: OUTPUT«set(IntStr.new(2, "2"),2,"2")␤»
17:58 perlpilot joined
viki m: my %hash{Any}; dd %hash{ 2, <2>, "2" } 17:58
camelia rakudo-moar e4dc8b: OUTPUT«(Any, Any, Any)␤»
viki m: my %hash{Any}; dd %hash{ 2, <2>, "2" } = (1, 2, 3); dd %hash 17:59
camelia rakudo-moar e4dc8b: OUTPUT«(1, 2, 3)␤Hash[Any,Any] %hash = (my Any %{Any} = 2 => 1, IntStr.new(2, "2") => 2, "2" => 3)␤»
18:06 rurban joined
__T well thanks for all the examples viki :D 18:06
i realize that perl is not very forgiving, and i like it 18:07
18:08 abraxxa left 18:10 rurban3 left 18:21 wamba joined 18:23 rurban left 18:24 rurban joined, rurban left
ugexe its pretty darn forgiving 18:26
__T it depends how you look at it 18:29
18:29 MorayJ left, cdg left
__T perl6 will easily cheat on you 18:30
if you're not fully informed
seatek it's got a nice balance of forgiving, fascism, methodology and insanity
__T haha, well said
m: <foo bar buzz 42>.grep: Int 18:31
camelia ( no output )
timotimo m: <foo bar buzz 42>.>>.WHAT.say
camelia rakudo-moar e4dc8b: OUTPUT«(List)␤»
timotimo ah, yeah
__T m: say <foo bar buzz 42>.grep: Int
camelia rakudo-moar e4dc8b: OUTPUT«(42)␤»
timotimo m: <foo bar buzz 42>.map({ $_.WHAT }).say 18:32
camelia rakudo-moar e4dc8b: OUTPUT«((Str) (Str) (Str) (IntStr))␤»
viki And IntStr is Int
__T and Str 18:33
m: say <foo bar buzz 42>.grep: Str
camelia rakudo-moar e4dc8b: OUTPUT«(foo bar buzz 42)␤»
__T IntStr is good when creating subsets, but it seems abit quirky to me 18:35
but perhaps my fault for not being explicit
m: say ['foo', 'bar', 'buzz', 42].grep: Str 18:36
camelia rakudo-moar e4dc8b: OUTPUT«(foo bar buzz)␤»
18:37 Actualeyes left 18:38 erdic joined 18:44 erdic left
ugexe personally i think @x.contains("foo") looks better and is easier to understand than @x.any ~~ "foo" 18:49
masak ugexe: at some point a suggested way to write it was @x ~~ (*, "foo", *), too 18:50
__T m: [0..100].contains("1 2").say 18:52
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T [0..100].contains(999).say 18:53
m: [0..100].contains(999).say
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
18:54 dolmen_ joined
__T m: [0..100].grep(999).defined.say 18:55
camelia rakudo-moar e4dc8b: OUTPUT«True␤»
__T m: [0..100].Set{999}.say 18:57
camelia rakudo-moar e4dc8b: OUTPUT«False␤»
__T TIMTOWDI
:D
18:58 erdic joined 18:59 Actualeyes joined, ggoebel left 19:00 vendethiel joined, TEttinger joined 19:04 sufrostico left 19:11 hankache left 19:13 araujo_ joined 19:14 ggoebel joined, darutoko left 19:17 araujo__ left 19:19 erdic left 19:22 itaipu left 19:23 leont joined
leont Why are we adding mandatory fields to the meta spec without having a version on the meta spec? 19:23
viki leont: 6.c 19:24
leont You miss my point
viki Don't think so.
leont *without having a version on the spec"
viki The META spec is part of the language. 19:25
We didn't add the "perl" field. It existed since 6.c release. 19:26
leont I see 19:27
perlpilot Where are the tests in roast for the META spec?
ugexe the meta spec has never been finalized 19:28
there is a field for the spec version, `meta`, which was added somewhat recently. but i'd prefer that to use `meta-spec` since thats what perl 5 uses 19:29
viki There can be (•_•) ( •_•) >⌐■-■ (⌐■_■)
ugexe so CPAN::Meta could parse it all the same
viki perlpilot: I grepped for `provides` and `depends`. Nothing came up 19:31
There's also this doc issue: github.com/perl6/doc/issues/764
ugexe the previous "test" was Distribution.new(:name<xxx>)
when Distribution was nothing more than a struct with required attributes 19:32
19:36 domidumont left 19:37 leont left
ugexe m: sub validate(%meta (Str :$name!, :$auth!, :$ver!)) { %meta<provides> //= {}; %meta; }; my %meta = name => "xxx", auth => "fff", ver => 1; say validate(%meta) # this is the pattern I generally use 19:46
camelia rakudo-moar e4dc8b: OUTPUT«{auth => fff, name => xxx, provides => {}, ver => 1}␤»
19:47 nicq201 joined
ugexe still have to handle auth/author/authority combinations, ver/version, various `depends` fields allowing arrays of alternatives, etc 19:49
19:51 bjz joined 19:55 wamba left 19:56 cdg joined 19:58 labster joined 20:02 erdic joined 20:03 imcsk8_P1O is now known as imcsk8_PTO 20:11 mcsnolte joined 20:19 erdic left, stanley joined 20:20 gensym joined
RabidGravy boo! 20:26
20:26 grondilu left 20:29 itaipu joined 20:30 salv0 left
moritz blog.robertelder.org/switch-stateme...pressions/ I'm now afraid of C 20:32
20:32 Timtico joined
Timtico m: say 'Hello World'; 20:33
camelia rakudo-moar e4dc8b: OUTPUT«Hello World␤»
20:36 Timtico left
viki moritz, I think it's possible to concoct a similar thing with our given/when :) 20:40
or rather, the first weird switch the article shows. 20:42
(tl;dr) for the rest
moritz viki: the rest is where it gets interesting :-) 20:43
viki :) 20:44
20:50 Ven joined 20:52 erdic joined 21:00 labster left 21:01 labster joined
moritz perl6book.com/ # not much there at the moment, just the mailing list signup form 21:03
21:03 rurban joined 21:04 __T left 21:09 skids left, FROGGS left 21:11 FROGGS joined, bjz left 21:12 erdic left 21:13 nicq201 left, ufobat left 21:16 Ven left
perlpilot moritz++ 21:19
21:21 sftp left 21:22 Actualeyes left 21:23 sftp joined 21:29 firstdayonthejob joined 21:33 perlpilot left 21:35 leont joined 21:41 RabidGravy left 21:43 Actualeyes joined 21:47 rindolf left, erdic joined 21:51 espadrine joined 21:56 lostinfog left 22:06 espadrine left
stanley moritz: any idea when it will be out for? 22:10
22:11 erdic left
lucs Christmas ;) 22:12
22:14 dalek left, dalek joined, ChanServ sets mode: +v dalek 22:15 itaipu left 22:16 pierrot joined 22:17 itaipu joined 22:22 firstdayonthejob left 22:26 erdic joined, captain-adequate joined 22:27 labster1 joined 22:29 pmurias left 22:30 labster left, dolmen_ left 22:32 TheovdH left
timotimo twitter.com/darksuji/status/791771672114176000 - well, someone is certainly very unhappy 22:41
timotimo goes to bed 22:42
FROGGS does that differ to other languages?
22:45 labster1 is now known as labster, labster left, labster joined 22:47 erdic left 22:48 Tonik left 22:52 sufrostico joined 22:54 dolmen_ joined
seatek say 2² 22:55
m: say 2²
camelia rakudo-moar 8c3548: OUTPUT«4␤»
seatek m: say -2²
camelia rakudo-moar 8c3548: OUTPUT«-4␤»
seatek m: say -(2²) 22:56
camelia rakudo-moar 8c3548: OUTPUT«-4␤»
seatek m: say -(2)²
camelia rakudo-moar 8c3548: OUTPUT«-4␤»
seatek my $x = -2; say $x²
m: my $x = -2; say $x²
camelia rakudo-moar 8c3548: OUTPUT«4␤»
seatek so the 2 isn't a 2, or the power gets precedence
i've run across a few weird things like that 22:57
i generall just curse the horrors of objects
awwaiid greetings seatek. I thought you were sartak and got all excited but I accept you all the same 22:58
seatek awwaiid, no not sartak, i'm pretty sure :)
awwaiid hehe
23:04 dolmen_ left 23:08 mohae joined 23:22 erdic joined 23:28 kyclark joined
kyclark docs (docs.perl6.org/language/regexes#Ze...r_more:_*) say "*" is still 0-or-more matches, but "'foobar' ~~ /o*/" returns nothing 23:29
MasterDuke m: say "foobar" ~~ /o*/ 23:31
camelia rakudo-moar 8c3548: OUTPUT«「」␤»
MasterDuke m: say "foobar" ~~ /o/
camelia rakudo-moar 8c3548: OUTPUT«「o」␤»
MasterDuke m: say "foobar" ~~ /o+/
camelia rakudo-moar 8c3548: OUTPUT«「oo」␤»
MasterDuke m: say "foobar" ~~ /o**0..Inf/
camelia rakudo-moar 8c3548: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed Range. If attempting to use variables for end points, wrap the entire range in curly braces.␤at <tmp>:1␤------> 3say "foobar" ~~ /o**0..7⏏5Inf/␤ expecting any of:␤ term␤»
MasterDuke m: say "foobar" ~~ /o**0..9/ 23:32
camelia rakudo-moar 8c3548: OUTPUT«「」␤»
MasterDuke m: say "foobar" ~~ /o**1..9/
camelia rakudo-moar 8c3548: OUTPUT«「oo」␤»
MasterDuke bisectable6: say "foobar" ~~ /o*/ 23:33
bisectable6 MasterDuke, On both starting points (old=2015.12 new=5ac593e) the exit code is 0 and the output is identical as well
MasterDuke, Output on both points: 「」
23:34 sftp left, sftp_ joined 23:35 erdic left, sftp_ is now known as sftp 23:36 erdic joined
MasterDuke perl 5 does the same thing 23:37
say $1 if "foobar" =~ /(o*)/
23:41 erdic left
jast btw I don't see anything wrong with the 2²-related results above. it works exactly the same way in math. 23:41
in math, power binds more tightly than the negative sign, and so every language does it that way, too 23:42
23:43 jameslenz left 23:44 jameslenz joined
kyclark Sorry, is this a bug then? Do I get a cookie or something? :-) 23:46
23:47 skids joined 23:51 rurban left 23:58 cdg left