»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
TimToady finds "%0{$!l}d" the most readable, or maybe "%0{ $!l }d" 00:00
00:04 daniel-s joined 00:06 virtualsue left 00:07 ajr_ left 00:09 Rotwang left 00:18 sisar left 00:25 xenoterracide joined 00:26 xenoterracide left, xenoterracide joined 00:30 jnap1 left
thilp r: my $a = if 1 { 2 } else { 3 } 00:31
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!===␤Word 'if' interpreted as a listop; please use 'do if' to introduce the statement control word␤at /tmp/tmpfile:1␤------> my $a = if⏏ 1 { 2 } else { 3 }␤Unex…»
00:31 xenoterracide left
grondilu r: say my $ = 1 ?? 2 !! 3; # 00:41
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«2␤»
grondilu r: say my $ = do if 1 { 2 } else { 3 }
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«2␤»
01:01 jnap joined 01:03 iolympian1 joined, iolympian1 left 01:04 iolympian2 joined 01:05 jnap left 01:07 iolympian2 left 01:11 raiph joined
grondilu r: say (my uint64 $ = 2**42 + 1) == 1; # I got True this on local 01:12
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«False␤»
raiph lizmat++ # perlmonks post 01:19
01:24 grondilu left 01:37 slavik left
[Coke] URL? 01:38
01:40 slavik joined
skids perl6 -e "require NativeCall 'trait_mod:<is>'; sub a is native { };" # This gives "Can't use unknown trait 'is native' in a sub declaration." Trying to figure out runtime conditional NativeCall loading. 01:42
thilp I don't get it: I've the same rakudos than camelia, but I got a "Null PMC access in get_string()" with perl6-p and an infinite loop of "Word 'if' interpreted as…" + "Unexpected block in infix position (two terms in a row)" 01:46
with my $a = if 1 { 2 } else { 3 } I mean
with perl6-m for the last error message* 01:47
this is 1c1a085 on branch nom, no doubts… 01:48
skids Does "do if" work?
thilp yes it does, with both :) 01:49
I know this is bad syntax, but the error messages seem buggy 01:50
skids star gives the "Word if" error message, but not in an infinite loop.
star: my $a = do if 1 { 2 } else { 3 }; $a.say 01:51
thilp star is on parrot, right? And yet I got a PMC… Could this be something local?
camelia star 2013-09: OUTPUT«2␤»
skids Yes.
wait 2013-09? 01:52
thilp I --gen'd nqp and parrot and moar in Configure.pl…
01:54 kurahaupo left
thilp will investigate later with a fresh star, thanks 01:56
02:02 jnap joined 02:06 jnap left
dalek rl6-roast-data: df86307 | coke++ | / (4 files):
today (automated commit)
02:09
02:25 xragnar left 02:27 xragnar joined
raiph S11: "OVERVIEW: This synopsis discusses those portions of Apocalypse 12 that ought to have been in Apocalypse 11." 02:30
02:43 hoverboard joined 02:44 bjz left 02:45 bjz joined, klapperl joined 02:46 raiph left 02:48 klapperl_ left 02:51 FROGGS_ joined 02:52 Sqirrel left 02:54 Sqirrel joined, FROGGS left 02:57 thou left 03:02 jnap joined 03:07 jnap left 04:00 BenGoldberg left 04:02 araujo left 04:03 jnap joined 04:07 jnap left 04:10 hoverboard left 04:20 hoverboard joined 04:48 ggoebel11117 joined 04:58 rurban1 joined 05:02 rurban2 joined, telex left 05:03 rurban1 left 05:04 jnap joined, telex joined 05:07 kaare__ joined 05:08 jnap left 05:19 xenoterracide joined 05:22 cibs joined 05:47 Mouq joined 05:57 daniel-s left, daniel-s joined 05:58 xinming_ left
Mouq r: say "abcd" ne "abcd" ne "efg" 06:01
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«False␤»
Mouq r: say "abcd" ne "abcd" ne "abcd"
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«False␤»
Mouq Aww
r: say [ne] "abcd", "abcd", "abcd" 06:02
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«False␤»
Mouq is spoiled by chaining comparators
r: say set "abcd", "abcd", "abcd"
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«set(abcd)␤»
Mouq r: say +set "abcd", "abcd", "abcd"
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1␤»
Mouq That works though
06:05 jnap joined 06:07 logie_ left 06:09 jnap left 06:10 logie_ joined
Mouq r: say (1,2,3,4).sort 06:10
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1 2 3 4␤»
Mouq r: say ([1,42],[2,24],[3,56],[4,44]).sort(*.[0])
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1 42 2 24 3 56 4 44␤»
Mouq r: say ((1,42),(2,24),(3,56),(4,44)).sort(*.[0]) 06:11
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1 42 3 56 4 44 2 24␤»
Mouq r: say ((1,42),(4,44),(2,24),(3,56)).sort(*.[0])
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1 42 2 24 4 44 3 56␤»
Mouq ...
what?
r: say ((1,42),(4,44),(2,24),(3,56)).sort({$^v.say;$^v[0]) 06:12
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse expression in block; couldn't find final '}' ␤at /tmp/tmpfile:1␤------> ,44),(2,24),(3,56)).sort({$^v.say;$^v[0]⏏[…»
Mouq r: say ((1,42),(4,44),(2,24),(3,56)).sort({$^v.say;$^v[0]})
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1␤42␤4␤44␤2␤24␤3␤56␤1 42 2 24 4 44 3 56␤»
Mouq r: say ([1,42],[4,44],[2,24],[3,56]).sort({$^v.say;$^v[0]})
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1 42␤4 44␤2 24␤3 56␤1 42 2 24 3 56 4 44␤»
Mouq r: say (my$=42)[0] 06:13
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«42␤»
Mouq r: say ((1,42),(4,44),(2,24),(3,56)).sort({$^v[0].say;$^v[0]})
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«1␤42␤4␤44␤2␤24␤3␤56␤1 42 2 24 4 44 3 56␤»
dalek ast: 16020ff | Mouq++ | S (3 files):
Some updates and fudges for JVM
06:15
Mouq isn't sure what's going on with baghash.t and mixhash.t
06:19 rurban2 left, kaare__ left 06:21 cibs left 06:35 xenoterracide left
dalek ast: 8a6c445 | Mouq++ | S02-lexical-conventions/comments.t:
Unfudge test that passes on all rakudo backends
06:40
06:44 daniel-s left 06:45 daniel-s joined 06:52 xenoterracide joined 06:57 Mouq left 06:58 vincent22 joined 07:03 logie_ left 07:05 jnap joined
moritz \o 07:08
nwc10 o/
07:09 anna joined, anna is now known as Guest66412 07:10 jnap left 07:13 hoverboard left 07:19 Guest66412 is now known as anna_ 07:20 rurban1 joined
Timbus <Mouq> r: say "abcd" ne "abcd" ne "abcd" 07:21
huh.. did he want that to.. not chain
r: say <asdf asdf asdf>.reduce(&infix:<ne>) #does this work 07:22
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«True␤»
Timbus .. why didnt i just use (* ne *) =\ 07:24
07:24 rurban1 left 07:47 arnsholt joined 07:49 [Sno] left 07:53 xenoterracide left 07:55 virtualsue joined, molaf joined 07:57 aindilis joined 08:06 jnap joined 08:10 jnap left 08:20 rurban1 joined 08:22 dmol joined 08:23 anna_ left 08:25 rurban1 left 08:26 virtualsue left 08:37 anna joined, anna is now known as Guest4885 08:45 darutoko joined
colomon dagurval_: Time::Duration is failing my smoke tests. Two nights in a row now... 08:58
09:00 SamuraiJack_ joined 09:01 Guest4885 left 09:06 cibs joined 09:07 arnsholt left, jnap joined 09:11 jnap left
sergot morning o/ 09:13
masak good antenoon, #perl6 09:15
r: say <asdf asdf asdf>.reduce( (* ne *) ) 09:16
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«True␤»
masak I'm not sure (* ne *) chains the way &infix:<ne> does.
trying to think up a chain of three values that would show that. 09:17
oh, wait. 09:18
<asdf asdf asdf> should've come out False if either of them chained. 09:19
...so they don't, I guess.
09:20 FROGGS_ is now known as FROGGS
FROGGS morning 09:20
09:21 rurban1 joined
xfix github.com/masak/markdown/blob/mas...own.pm#L29 09:22
I love magic.
Anyway, any idea how to match indents, like in CoffeeScript or Python using Perl 6 grammars?
masak xfix: arnsholt++ has worked out a good answer to that. 09:25
xfix: I think it deserves a blog post, actually. stand by for that. not today, but soon.
xfix: it involves contextual variables, that's all I know.
09:26 rurban1 left
masak xfix: that table was actually lifted wholesale from the original Markdown program, IIRC. 09:26
xfix: but I think I shouldn't be looking so much at what the original program does internally. I should just re-create the outwards semantics.
xfix I was hoping that Markdown would help me, but not really. 09:27
It doesn't even support more complex parts of Markdown, such as code blocks.
masak yeah :/
would like to work on it more, but... tuits.
xfix: pmichaud has also solved the indentation problem once, and could probably give a good explanation. but he's not often here.
xfix YAML module only outputs YAML. 09:28
So YAML module isn't of help either.
masak let me see if I can figure it out in a 5-minute coding session. 09:29
xfix Thanks.
09:30 Guest4885 joined
xfix Contextual variables... could be helpful, I guess. 09:30
09:39 brrt joined 09:40 Sqirrel left
masak ok, I have a prototype working. it gave me some insights. 09:43
gist.github.com/masak/9703867 09:44
but I realize that the above isn't going far enough.
09:44 Guest4885 left
masak what we want is for the parser to divide things into "blocks". 09:44
each block consists of a sequence of simple strings (lines), or other blocks. 09:45
masak codes up that solution
09:57 FROGGS[mobile] joined 10:03 brrt left 10:07 denis_boyun joined 10:08 jnap joined 10:12 jnap left 10:20 SamuraiJack_ left
masak ok, I think I have a fully functional solution now. 10:20
10:20 rindolf joined
masak xfix: gist.github.com/masak/9703867 10:22
10:22 rurban1 joined, Alula joined 10:26 rurban1 left
masak so, yeah, I guess that's how you do it :) 10:28
dang, now I probably have to apply that to arnsholt++'s Python project :P
10:29 spider-mario joined
JimmyZ :P 10:32
masak I keep coming up with fixes and simplifications, too. 10:33
10:33 NATANaYELL joined
masak now I eliminated the $*INDENT variable. only @*SUITES left. 10:33
verra nice.
10:45 virtualsue joined
masak added two more error conditions. 10:48
heh, "five minutes" :P 10:49
10:52 denis_boyun left 10:55 Rotwang joined
masak I'll really really try to write this up. it was an interesting exercise. 11:03
but in short, learnings on the way: 11:04
(a) contextuals are a really good fit for this
(b) TDD rocks when developing a grammar -- especially when remembering to test for all the error conditions
(c) the 'handles' keyword rocks 11:05
11:06 Rotwang left, NATANaYELL left, Rotwang joined 11:08 jnap joined 11:13 jnap left 11:14 virtualsue left 11:17 arnsholt joined
arnsholt o/ 11:17
dalek p/jastcompiler: 99ca7b8 | (Arne Skjærholt)++ | src/vm/jvm/runtime/org/perl6/nqp/jast2bc/J (4 files):
Remove dependence of JASTCompiler on static caches.

First attempt at this attached static caches of the various JAST::Node type objects in the compiler class, which caused failures under the evalserver, as the type objects form the first compile would be reused for all subsequent compiles. Now, we only cache the type objects per compilation.
The Rakudo sanity tests now pass.
masak arnsholt: gist.github.com/masak/9703867 11:18
arnsholt: I... think I know what my first contribution to snake will be :)
arnsholt \o/ 11:19
That's awesome! 11:20
masak btw, if I were allowed to bikeshed the project name: 'snake' is fine, but 'serpentine' or 'slytherin' would be funnier :>
also, people won't confuse it with a en.wikipedia.org/wiki/Snake_(video_game) implementation 11:21
11:23 rurban1 joined 11:24 rurban2 joined 11:25 arnsholt left 11:27 rurban1 left
FROGGS btw, I would have called it Parsel instead of snake :o) 11:27
masak oh, that works too :) 11:28
anything which *hints* at the connection between Python and snakes is funnier than something which states it outright.
11:29 rurban2 left
FROGGS masak: I just like the quote: "Parsel, Harry. Snake language?" 11:35
masak: ahh btw, do you have slides of a talk you thing worked out very well?
I need to prepare my talks for the gpw, and it would be nice to steal some ideas :o)
masak FROGGS: I have quite a number of slides here: feather.perl6.nl/~masak/ 11:36
FROGGS masak: which is the best? :o)
which one*
masak FROGGS: things tend to work out the best when I follow en.wikipedia.org/wiki/Takahashi_method , have adequate time to prepare, and have nice images.
FROGGS: hm.
FROGGS hmmm 11:37
masak objectively, www.perlworkshop.no/npw2009/talk/1734 worked out the best.
but I have no idea why. :) it was just popular. maybe right things to the right audience.
FROGGS k, thank you :o) 11:38
I enjoyed mst++'s talks, which use this method very well it seems 11:39
but his talk was some kind of rant, and my talks are nothing like that
masak well, they don't have to be rants. 11:43
that said, don't underestimate the power of taking a strongly negatice stance on *something*.
FROGGS yeah I know, but this feels very difficult to do for me... 11:44
masak people react better to strong feelings, and ranting seems to be the easiest way for a beginner to do well at talks :)
11:44 pecastro joined
masak though more generally, showing that you're passionate about something is the important bit 11:44
FROGGS okay, perhaps it would work out... at least it seems kind of possible now that I look at my slides from YAPC::NA 2013 11:52
11:53 Sqirrel joined
FROGGS masak: my talks will be in german, do you think it is feasible to have these large words in german and at the bottom like english sentences? 11:55
simula67 cosimo: What do you think ? github.com/cosimo/perl6-lwp-simple/pull/27 11:56
vendethiel r: given 301 { when 301 | 302 { say "hello, i'm a turtle"; } } 11:58
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«hello, i'm a turtle␤»
vendethiel not why is github.com/cosimo/perl6-lwp-simple...ple.pm#L85 using regexps 11:59
masak vendethiel: dunno, but the semantics is a little different. 12:04
vendethiel: the regexp is essentially an .index operation, looking for a substring.
12:09 jnap joined 12:13 arnsholt joined
arnsholt And hello again 12:13
masak: Sorry for disappearing. Train Wifi isn't terribly reliable =)
12:14 jnap left
arnsholt I'm not at all committed to a name at this point, either 12:14
Many good suggestions in the backlog
tadzik cudl.lib.cam.ac.uk/view/MS-ADD-04000/28 this is awesome 12:22
Isaac Newton's college notebook
450 years old
er, 350, more like 12:23
12:25 rurban1 joined 12:26 arnsholt left
colomon r: 2014 - 1664 12:26
camelia ( no output )
colomon r: say 2014 - 1664
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> say 2014 - 16⏏64␤ expecting any of:␤ postfix␤ infix s…»
colomon r: say 2014 - 1664 12:27
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«350␤»
12:30 rurban1 left
colomon is not sure why his brain thought 450 years, but is somewhat relieved that tadzik made the same mistake. 12:37
12:49 myfree joined
FROGGS my $dbh = ...; my @rows = -> 'Carl%' { use SQL:$dbh; SELECT * FROM foo WHERE name LIKE ? } # '?' is a placeholder valiable here 12:52
how useful would be this kind of thing?
moritz it'd be a PITA, because $dbh would need to be available at compile time 12:53
FROGGS I guess the most useful aspect is that it would die at compile time when there is a syntax error in the sql statement 12:54
true
moritz also, IMHO there should still be some form of delimiter
but, what kind of SQL are you talking about?
FROGGS well, it could also just compile to a call that will run later
I just know about mysql 12:55
moritz mysql is not the only kind of sql
and every dialect has a slightly different syntax
FROGGS moritz: this is just about a slide for my talk, nothing I would implement right away
12:55 myfree left 12:57 kurahaupo joined, ClarusCogitatio left
FROGGS I try to find some examples of slangs that are not about programming languages, but about other things that turn text into either a structure or into something that does something :o) 12:58
moritz FROGGS: it's the kind of idea that looks very cute, but is full of conceptual problems
(with SQL)
FROGGS yeah, probably
13:00 ClarusCogitatio joined, jnap joined 13:01 Mouq joined
Mouq Timbus: Oh, I was reading what I was doing wrong. Thanks :) 13:01
13:06 ClarusCogitatio left 13:07 ClarusCogitatio joined
spider-mario rakudo.org/downloads does not contain nqp 2014.03 13:12
FROGGS lol: www.archaicbinary.net/wp-content/up...-Error.jpg
tadzik: ping
tadzik FROGGS: pong 13:15
spider-mario: rakudo.org/downloads/rakudo/ does
FROGGS tadzik: unping then :o)
Mouq Should we still upload nqp to rakudo.org/downloads/nqp/? 13:16
tadzik unrelated: i.imgur.com/iEXc9t5.gif
Mouq *n't
FROGGS tadzik: there is no nqp
spider-mario only rakudo, though, not nqp?
tadzik :o 13:17
troo
'tis true
masak FROGGS: I want to flick this post your way: zachholman.com/posts/slide-design-f...evelopers/ 13:19
Mouq arnsholt++ # JASTCompiler branch :D
masak FROGGS: I dunno, I just vibe very much with what's written in it.
tadzik if somebody can quick-fix this, I'd be delighted, I have to run soon 13:21
masak colomon, tadzik: here's why you both made the 450 mistake: subtraction kind of contains a built-in off-by-one error. 13:22
tadzik yep :)
masak the brain looks at 20xx and 16xx and thinks "oh, that's four centuries in between [and maybe some years more]"
and so it's much more likely to go 400 + 50 than 400 - 50.
FROGGS masak: thanks a lot! that looks very nice indeed :o) 13:23
masak the best remedy for the off-by-one in subtraction is to *never do subtraction* :)
which is less ridiculous than it sounds, because addition and subtraction can be defined in terms of each other.
notice how for example clerks always do this when they give you change back.
if you're to pay 650 and give them a 1000, they give you change back by adding 650 + 100 + 100 + 100 + 50 == 1000. 13:24
FROGGS but then you don't care about the sum of the exchange 13:25
13:26 rurban1 joined
masak the sum is 1000. you care about giving enough change to reach that sum. 13:27
all I'm saying really is that Z - Y == X and X + Y == Z are equivalent statements, but that humans are better equipped to do the latter. 13:28
13:31 rurban1 left
FROGGS that is true, yes 13:31
but if you want to know the difference, adding stuff to the smaller number and sum these additions is not better than doing subtractions 13:32
(might be just because HT is not turned on for my brane)
masak yes, it *is* better, and that's my point. 13:34
the brain is less likely to stumble on the off-by-one when carrying over a ten during the addition than during the subtraction.
equivalently, you're much less likely to do the 650 + 450 != 1000 mistake than you are doing the 1000 - 650 != 450 mistake. 13:35
13:35 VINU joined
FROGGS hmm, yeah, I think you are right 13:36
masak mental arithmetic is full of those little tricks. I loved learning them when I was younger. 13:39
13:40 VINU left 13:42 wooden joined, wooden left, wooden joined
FROGGS .u check 13:52
yoleaux U+237B NOT CHECK MARK [So] (⍻)
U+2447 OCR AMOUNT OF CHECK [So] (⑇)
U+2611 BALLOT BOX WITH CHECK [So] (☑)
timotimo o/ 13:55
FROGGS hi timotimo 13:57
Mouq r: say ($_,.chr,.&uniname) if .chr.&uniname ~~ /CHECK/ for 0..0xffff
camelia rakudo-moar 1c1a08: OUTPUT«9083 ⍻ NOT CHECK MARK␤9287 ⑇ OCR AMOUNT OF CHECK␤9745 ☑ BALLOT BOX WITH CHECK␤9989 ✅ WHITE HEAVY CHECK MARK␤10003 ✓ CHECK MARK␤10004 ✔ HEAVY CHECK MARK␤» 13:58
..rakudo-jvm 1c1a08: OUTPUT«uniname NYI on jvm backend␤ in sub uniname at gen/jvm/CORE.setting:6768␤ in sub uniname at gen/jvm/CORE.setting:6768␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-parrot 1c1a08: OUTPUT«uniname NYI on parrot backend␤ in sub uniname at gen/parrot/CORE.setting:6772␤ in sub uniname at gen/parrot/CORE.setting:6772␤ in block at /tmp/tmpfile:1␤␤»
timotimo i don't yet have an idea what to hack on during the GPW if i get time to hackathonize ...
sphere.chronosempire.org.uk/~HEx/8402/ - someone made this thing!
FROGGS Mouq++ # that contains the one I was looking for! :o)
14:03 salv0 left, sunnavy left 14:05 Tene joined, Tene left, Tene joined 14:06 zamolxes joined, apejens joined, PerlJam joined, ashleydev joined 14:07 larks joined, sjn joined, anocelot joined, sunnavy joined, ruoso joined, sjohnson joined, Yappo__________8 joined, takesako____ joined, djanatyn joined, masak joined 14:08 awwaiid joined, felher joined, segomos joined, amkrankruleuen joined, amkrankruleuen left, amkrankruleuen joined, clkao joined 14:09 gfldex joined, yeltzooo joined, Gothmog_ joined, mattp_ joined, dalek joined, ChanServ sets mode: +v dalek, integral joined, jnthn joined, frettled joined, salv0 joined, woolfy joined, silug____ joined, integral left, integral joined 14:10 xybre joined
masak netsplit: *sigh*, you. 14:10
14:10 bonsaikitten joined, ivan`` joined, go|dfish joined
timotimo oh, you 14:10
14:10 labster joined 14:11 eternaleye joined, hugme joined, ChanServ sets mode: +v hugme, lestrrat joined
timotimo that was a rather short netsplit, though 14:11
14:12 camelia joined, Rotwang left, FrankG joined, LordV joined
masak "could be worse. could be raining." 14:12
14:12 huf joined, jnap left, ChanServ sets mode: +v camelia 14:13 dagurval joined, ponbiki joined, ponbiki is now known as Guest97287, sergot_ joined
FrankG Hello, I am learning Perl 6, could you suggest where I can sample code demonstrating usage of "callable"? 14:13
14:14 FROGGS left
Mouq r: my &callable = -> 14:14
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Malformed parameter␤at /tmp/tmpfile:1␤------> my &callable = ->⏏<EOL>␤ expecting any of:␤ infix noun␤ …»
Mouq Ooops
r: my &callable = ->{say "like this?"}; callable
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«like this?␤»
Mouq r: my &callable = ->{say "like this?"}; callable for 1..15
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤like this?␤»
14:14 FROGGS joined
Mouq FrankG: What do you mean, exactly? 14:14
14:14 klapperl_ joined
skids r: sub a { }; &a.^roles.say # or like this? 14:14
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«(Callable)␤»
masak FrankG: Callable is just a type for things that can be called with .()
r: sub x {}; say x ~~ Callable
14:14 Timbus left 14:15 Khisanth left
colomon m: say ($_,.chr,.uniname) if .chr.uniname ~~ /CHECK/ for 0..0xffff 14:15
14:15 Alina-malina left, sergot left, klapperl left
camelia rakudo-parrot 1c1a08: OUTPUT«use of uninitialized value of type Callable in string context in any at gen/parrot/Metamodel.nqp:1481␤␤Too many positional parameters passed; got 1 but expected 0␤ in sub x at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤» 14:16
..rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«use of uninitialized value of type Callable in string context␤Too many positional parameters passed; got 1 but expected 0␤ in sub x at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
masak r: sub x {}; say &x ~~ Callable
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«True␤»
masak r: say { "Block of code" } ~~ Callable
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«True␤»
FROGGS m: say (-> { 42 }) ~~ Callable
camelia rakudo-moar 1c1a08: OUTPUT«True␤»
14:16 Timbus_ joined
masak r: say "Just a string, not callable" ~~ Callable 14:16
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«False␤»
14:16 Khisanth joined
camelia rakudo-moar 1c1a08: OUTPUT«No such method 'uniname' for invocant of type 'Str'␤ in block at /tmp/L5RfygAxbp:1␤␤» 14:16
FrankG I was fascinated by how expressive Perl6 is, reading the code of "OddWord".
FROGGS m: say (sub foo { }).^mro
camelia rakudo-moar 1c1a08: OUTPUT«(Sub) (Routine) (Block) (Code) (Any) (Mu)␤»
masak FrankG: :)
FrankG: rosetta code?
14:16 BitPuffin left
FrankG it reads: my &in = { $*IN.getc // last }; 14:16
masak TimToady++'s plan is working! \o/
rosettacode.org/wiki/Odd_word_problem#Perl_6 14:17
14:17 BitPuffin joined
FrankG is & a sigil for callable? 14:17
FROGGS yes
14:17 Alina-malina joined
FROGGS though, mostly the & is omitted 14:17
but to make it clear that a variable contains something callable, you can use the & sigil 14:18
FrankG and how is the input from stdin magically converted to a block, and assign to a callable?
masak TimToady: Randall Schwartz would glare at you for `ow(in) x .print`. twice. :)
FROGGS FrankG: no, &in is just like a subroutine, when you call it, it will execute the stuff in the block
masak FrankG: the first line merely says "this is how you do input" 14:19
FROGGS yeah, a declaration
masak FrankG: it's declaring a callable thing that reads a line or exits the loop if there is no more input.
FrankG like closure?
masak yeah.
then the other occurrectes of 'in' are calls.
FROGGS m: my &thing = { say 42 } 14:20
camelia ( no output )
FROGGS m: my &thing = { say 42 }; &thing()
camelia rakudo-moar 1c1a08: OUTPUT«42␤»
14:20 virtualsue joined
masak s/line/character/ 14:20
FrankG in that case, & is used to be a reference to subroutine, how is it related to callable? 14:21
Mouq FrankG: In this case, it's just another way to say "sub in () { $*IN.getc // last }"
But because it's declared as a variable, &in is reassignable and has lexical scope 14:22
*declared as a 'my' variable
masak FrankG: @ is for Positional (like arrays), % is for Associative (like hashes), & is for Callable (like subs) 14:23
Mouq m: my &not-callable = 1; not-callable
camelia rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/1m9hkeMAqS␤Undeclared routine:␤ callable used at line 1. Did you mean 'callsame'?␤␤»
Mouq Erm
m: my &not_callable = 1; not_callable
camelia rakudo-moar 1c1a08: OUTPUT«Type check failed in assignment to '&not_callable'; expected 'Callable' but got 'Int'␤ in block at /tmp/R4e5DMNn02:1␤␤»
masak Mouq: type check failed in *assignment*. 14:24
m: my &not_callable = 1
camelia rakudo-moar 1c1a08: OUTPUT«Type check failed in assignment to '&not_callable'; expected 'Callable' but got 'Int'␤ in block at /tmp/EDDqVu8CET:1␤␤»
Mouq m: my &not_callable = 1 but Callable; not_callable
camelia rakudo-moar 1c1a08: OUTPUT«Cannot find method 'postcircumfix:<( )>'␤ in block at /tmp/BMDlTiiKJt:1␤␤»
Mouq :P
FrankG yeah, I got it, very helpful, Thanks so much,
masak m: my &fake_callable = 1 but role :: does Callable { method postcircumfix:<( )>($) { say "mwhaha!" } }; fake_callable 14:29
camelia rakudo-moar 1c1a08: OUTPUT«mwhaha!␤»
masak :D
Timbus_ aaaaaaAAAA 14:30
masak today's evil code!
Timbus_ tries to stuff the worms back in the can
FROGGS hmmm, stuffed worms
Mouq m: my &fake_callable = 42 but role :: does Callable { method postcircumfix:<( )>($) { say "mwhaha!" } }; say &fake_callable 14:31
camelia rakudo-moar 1c1a08: OUTPUT«42␤»
Mouq :)
timotimo how can you live with yourself? :) 14:34
Timbus_ guess he found a meaning 14:35
masak I don't do evil, I merely provide it to others as educational examples.
in short, I sleep pretty well at night. :)
14:35 Timbus_ is now known as Timbus
timotimo :3 14:36
14:39 daniel-s left, rurban1 joined
masak is there a corpus somewhere of all the URLs linked on HN, ever, along with their discussion threads? 14:46
relatedly, has someone ever created "find HN discussion thread for this URL or domain name" as a service? :)
timotimo HNaaS? 14:50
Mouq beat sphere.chronosempire.org.uk/~HEx/8402/! o/ 14:52
masak timotimo: more like *reverse* HNaaS.
14:52 molaf left
skids Mouq: now you just have to loop the game around so people are playing PvP without knowing it. 14:54
Mouq skids: That's what I was hoping the "AI" was when I first opened the page, but alas 14:55
vendethiel Mouq++, masak++ # evil geniuses 14:57
Mouq masak: hn.algolia.com/api?
hn.algolia.com/api/v1/search?url=X
Maybe?
Nope
15:00 ClarusCogitatio left, ClarusCogitatio joined
vendethiel I often forget last and others are dynamically scoped in perl 6. I like it. 15:05
masak it's the more general form, and therefore something Perl 6 would naturally do. :) 15:06
15:06 jnap joined
masak that said, a smart-enough compiler should cheat as much as it could, and reduce all dynamic exception-mediated control flow to static jumps. 15:06
vendethiel though you can simulate that behavior in any language that has *at least* one dynamic jump (like exception) 15:07
most languages have them (break, continue) lexically scoped 15:08
masak well, lexically scoped is the "sane" option. 15:09
dalek ecs: eb7c5b3 | (Elizabeth Mattijsen)++ | S22-package-format.pod:
Wave some hands about bundles
15:10
masak easy to explain, implement, and debug.
masak waves some hands to lizmat :)
vendethiel masak: though I believe that's "easy to explain" because people are used to it
lizmat waves back at masak and the rest of #perl6
vendethiel (which is true for most features)
vendethiel waves at #perl6 and the rest of lizmat 15:11
15:11 jnap left, xenoterracide joined
masak vendethiel: you don't consider the lexical variant inherently conceptually simpler? I do. 15:11
15:11 kaare__ joined 15:12 virtualsue left
vendethiel masak: I think it makes one less concept to explain if you have to explain exceptions after/before 15:12
that's probably easier to keep *track of*, but not to understand
15:12 logie_ joined
masak exceptions or no exceptions, with lexical scoping the behavior comes down to "you can only next/last/redo within the textual boundaries of the loop". 15:14
with dynamic scoping it comes down to "you can only next/last/redo within the (dynamic) life time of the loop itself"
vendethiel or just "you can only next/last/redo within a loop"
masak that could describe both, and is not precise enough. 15:15
vendethiel we should have an experiment -- would person that get the explanation "you can only next/last/redo within a loop"
masak I dunno, I just find textual boundaries easier to think about.
vendethiel without prior experience in programming
and see if they understand the "within" as lexical or dynamic :). Though I'd think they'd understand lexical, because you see it
masak right, that's what I mean. 15:16
"within" sounds like a spatial restriction.
whereas the temporal restriction of dynamic lookup is a bit less obvious.
vendethiel "while a loop is running", maybe
but then it's a bit harder to grasp, I guess ... 15:17
masak that covers it better, yes. 15:18
15:19 xenoterracide left 15:23 kurahaupo left
vendethiel masak: WRT TimToady++'s plan, what would be the best perl6 examples you'd recommend to interest somebody ? 15:25
I linked him the same example as FrankG and he seemed interested
15:26 aborazmeh joined 15:30 xenoterracide joined
masak vendethiel: I don't have a good enough overview of RC to answer that... 15:31
vendethiel: I think grondilu has edited RC quite a lot. maybe ask him.
&
15:32 raiph joined 15:37 xenoterracide left 15:38 logie_ left 15:44 FROGGS[mobile] left 15:48 xenoterracide joined, vincent22 left
Mouq debates where to put his tuits 15:52
16:00 xenoterracide left, jnap joined 16:04 jnap left 16:08 yogan joined
vendethiel I'll wait for grondilu to be back then :) 16:09
16:10 xenoterracide joined 16:14 aborazmeh left
masak might want to consult TimToady++ for nice examples as well. 16:23
he wrote a bunch of them :) 16:24
xfix Is it possible to stringify macro argument? 16:25
FROGGS I guess that really depends in what one is interested in... (like I am not very interested in maths, but grondilu most certainly is)
xfix For example, in C I can do #define assert(condition) printf(#condition).
vendethiel he's interested in FP :p
xfix I need this because of codegolf.stackexchange.com/question...ining-logs 16:26
FROGGS vendethiel: then I guess it will be interesting for him how we pass named args (flattened hashes and things like :$foo, :$<foo>, :!bar) 16:29
I have no example to show though
masak xfix: you're thinking of "textual macros". they're not currently supported in any compiler, except Pugs. 16:31
vendethiel "only" quasiquotes are implemented atm, right ?
TimToady why can't you stringify within the quasy
quasi*
or do you need the string at compile time? 16:32
xfix I want to stringify AST object.
vendethiel I guess he wants to generate `if !COND { die "COND" }`
or something along those lines
xfix Yeah, something like this.
Mouq `unless COND -> $c { $c.die }`? 16:33
masak we should definitely be able to stringify AST objects, I think.
that's a reasonable request.
TimToady r: macro foo($a) { say $a }; foo($_ + 42); # curious
camelia rakudo-moar 1c1a08: OUTPUT«AST.new()␤===SORRY!===␤Not enough positional parameters passed; got 2 but expected 3␤»
..rakudo-parrot 1c1a08: OUTPUT«AST.new()␤===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
..rakudo-jvm 1c1a08: OUTPUT«AST.new()␤===SORRY!===␤Wrong number of arguments passed; expected 3..3, but got 2␤»
masak don't think it works right now, though.
huh. 16:34
Mouq r: macro A ($ast) { say ~$yus; quasi {$ast} }; A(1+1)
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Variable '$yus' is not declared␤at /tmp/tmpfile:1␤------> macro A ($ast) { say ~$yus⏏; quasi {$ast} }; A(1+1)␤ expect…»
Mouq r: macro A ($ast) { say ~$ast; quasi {$ast} }; A(1+1)
camelia rakudo-jvm 1c1a08: OUTPUT«AST<66511588>␤»
..rakudo-moar 1c1a08: OUTPUT«AST<140387194419848>␤»
..rakudo-parrot 1c1a08: OUTPUT«AST<-825766304312482331>␤»
Mouq r: macro A ($ast) { say $ast; quasi {$ast} }; A(1+1)
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«AST.new()␤»
masak yeah.
I think it could be made to stringify to its souce code.
I'm not 100% that's Least Surprise, but I agree it would be Nice. 16:35
xfix Also, I don't like this {{{ }}} syntax, but that's probably just me.
Cannot it be something like .run method, or something? 16:36
vendethiel Well, there should something else than {{{ }}} imho
xfix (well, not .run, run() already exists)
geekosaur that sounds like a bad mixing of levels to me
{{{ }}} is ugly but it's at the right level, it's telling you something is being spliced at that point instead of a normal evaluation happening 16:37
there might be cleaner ways to do it (maybe some unicode bracket if they're not all taken already)
vendethiel "crying cat face brackets" seems good.
geekosaur .u skull and crossbones 16:38
yoleaux U+2620 SKULL AND CROSSBONES [So] (☠)
geekosaur .u splice
yoleaux No characters found
Mouq r: say ($_,.chr,.&uniname) if .chr.&uniname ~~ /ARROW/ for 0..0xffff 16:40
TimToady {{{}}} is going to go away
camelia rakudo-jvm 1c1a08: OUTPUT«uniname NYI on jvm backend␤ in sub uniname at gen/jvm/CORE.setting:6768␤ in sub uniname at gen/jvm/CORE.setting:6768␤ in block at /tmp/tmpfile:1␤␤»
..rakudo-moar 1c1a08: OUTPUT«706 ˂ MODIFIER LETTER LEFT ARROWHEAD␤707 ˃ MODIFIER LETTER RIGHT ARROWHEAD␤708 ˄ MODIFIER LETTER UP ARROWHEAD␤709 ˅ MODIFIER LETTER DOWN ARROWHEAD␤751 ˯ MODIFIER LETTER LOW DOWN ARROWHEAD␤752 ˰ MODIFIER LETTER LOW UP ARROWHEAD␤753 ˱ MODI…»
..rakudo-parrot 1c1a08: OUTPUT«uniname NYI on parrot backend␤ in sub uniname at gen/parrot/CORE.setting:6772␤ in sub uniname at gen/parrot/CORE.setting:6772␤ in block at /tmp/tmpfile:1␤␤»
timotimo :}}}
vendethiel what's the synopsis with macros ?
Mouq keeps forgetting to only use m: on that
vendethiel is really glad perl 6 has macros 16:41
vendethiel is really glad perl 6 has all these features, anyway.
16:42 raiph left
TimToady S06:Macros 16:42
masak everybody loves to hate {{{ }}} -- but counterproposals are few and far between, let alone ones I could see working out.
vendethiel think macros are a huge topic that can probably have their own synopsis. Maybe not right now, though 16:43
geekosaur yeh, that's the problem
16:44 nagu joined
vendethiel yeah. IIRC, scala uses q"" with normal interpolation 16:44
Mouq ↬ and ↫? :9
geekosaur also while {{{ }}} is big and ugly, that also means it is distinctive which IMO is good here
since it's a big obvious flag that something unusual is going on 16:45
Mouq geekosaur: But isn't macro and quasi enough of an indication of that?
geekosaur not really, imo 16:46
xfix $code.INTERPOLATE
vendethiel r: macro stuff($foo) { quasi < 2 + <<< $foo.chars >>> > }; say stuff("abc");
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Missing block␤at /tmp/tmpfile:1␤------> macro stuff($foo) { quasi ⏏< 2 + <<< $foo.chars >>> > }; say stuff(␤ expectin…»
vendethiel NYI, then
xfix This should work according to specification.
Yes, NYI.
dalek c: 5065843 | Mouq++ | lib/modules.pod:
Copy more formatting from archived wiki
xfix std: macro stuff($foo) { quasi < 2 + <<< $foo.chars >>> > }; say stuff("abc");
camelia std 09dda5b: OUTPUT«===SORRY!===␤Bogus term at /tmp/7wzgIUH3gH line 1:␤------> foo) { quasi < 2 + <<< $foo.chars >>> > ⏏}; say stuff("abc");␤Parse failed␤FAILED 00:01 138m␤»
masak yes, NYI.
geekosaur xfix: that is a level confusion, everything else is *not* evaluated but .INTERPOLATE there is 16:47
vendethiel r: macro stuff($foo) { quasi < 2 + { {{{ $foo.chars }}} } }; say stuff("abc");
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Missing block␤at /tmp/tmpfile:1␤------> macro stuff($foo) { quasi ⏏< 2 + { {{{ $foo.chars }}} } }; say stuf␤ expectin…»
geekosaur this is very bad
vendethiel r: macro stuff($foo) { quasi { 2 + {{{ $foo.chars }}} } }; say stuff("abc");
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Method 'chars' not found for invocant of class 'AST'␤at /tmp/tmpfile:1␤------> ␤»
geekosaur and may be even more confusing if you can do multiple levels in there (a macro inside a macro, anyone?)
xfix I always thought of macros as functions that took functions as arguments (like `map` in Perl 5). 16:48
But I guess this is wrong.
vendethiel that's higher order functions
geekosaur what is happening with the splice is completely different from what is happening with everything else in the macro; it should not look like a magic method call
Mouq QUASI
:P
xfix That a 2 + 2; is actually syntactic sugar for NONMACRO::a sub {2 + 2}.to-ast, assuming that .to-ast and NONMACRO:: namespaces exist. 16:49
namespace exists*
The problem with {{{ }}} is that it's a valid syntax. 16:51
rn: {{{ say "Hello, world!" }}}
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08, niecza v24-109-g48a8de3: OUTPUT«Hello, world!␤»
xfix Why it changes meaning in macros? 16:52
TimToady quasis are a different language
vendethiel r: (defmacro addlen [str] `(+ 2 (length ~str)))
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> (defmacro addlen [str] ⏏`(+ 2 (length ~str)))␤ expecting any of:␤ …»
TimToady jsut as "" and // are different languages
vendethiel perl 6 is a very bad lisp, apparently.
xfix C uses # for special characters in macros. Except that doesn't change anything, as # is unused in language itself. 16:53
vendethiel r: macro mouse ($arg) { my $l = $arg.chars; quasi { 2 + $l } }; say mouse("abc") 16:55
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Method 'chars' not found for invocant of class 'AST'␤at /tmp/tmpfile:1␤------> ␤»
xfix r: macro double($code) { quasi { {{{ $code }}}, {{{ $code }}} } }; double say("WORLD!"); 16:56
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«WORLD!␤WORLD!␤»
xfix How is that different from a function that takes a function as an argument?
vendethiel WORLD is eval'd two times ?
xfix r: sub double(&code) { code, code }; double { say("WORLD!") };
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«WORLD!␤WORLD!␤»
xfix vendethiel, it's not eval-ed. It's AST object.. 16:57
vendethiel r: sub saytwo($r) { say $r ~ $r; }; sub gettext() { "WORLD" }; saytwo(gettext());
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«WORLDWORLD␤»
vendethiel r: sub saytwo($r) { say $r ~ $r; }; sub gettext() { say "side effect"; return "WORLD" }; saytwo(gettext());
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«side effect␤WORLDWORLD␤»
vendethiel r: macro saytwo($r) { quasy { {{{ $code }}} ~ {{{ $code }}} } }; sub gettext() { say "side effect"; return "WORLD" }; saytwo(gettext());
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Variable '$code' is not declared␤at /tmp/tmpfile:1␤------> macro saytwo($r) { quasy { {{{ $code⏏ }}} ~ {{{ $code }}} } }; sub …»
xfix I said, a function taking a function as argument. 16:58
Timbus queasy
vendethiel r: macro saytwo($r) { quasy { {{{ $r }}} ~ {{{ $r }}} } }; sub gettext() { say "side effect"; return "WORLD" }; saytwo(gettext());
camelia rakudo-parrot 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Could not find sub &quasy␤at /tmp/tmpfile:1␤------> ␤»
vendethiel sighs
camelia ..rakudo-jvm 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤java.lang.NullPointerException␤at /tmp/tmpfile:1␤------> ␤»
..rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Cannot invoke null object␤at /tmp/tmpfile:1␤------> ␤»
xfix r: macro saytwo($r) { quasi { {{{ $r }}} ~ {{{ $r }}} } }; sub gettext() { say "side effect"; return "WORLD" }; saytwo(gettext());
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«side effect␤side effect␤»
vendethiel here.
r: macro saytwo($r) { quasi { say {{{ $r }}} ~ {{{ $r }}} } }; sub gettext() { say "side effect"; return "WORLD" }; saytwo(gettext());
^ that, really
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«side effect␤side effect␤WORLDWORLD␤»
xfix r: sub saytwo($r) { say $r ~ $r; }; sub gettext() { say "side effect"; return "WORLD" }; saytwo {gettext()}; 16:59
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«␤»
xfix Oh, right
vendethiel but that just demonstrates that, in the macro case, since you pass in the AST "gettext()" instead of the function's value, it's gonna get executed two times
xfix r: sub saytwo(&r) { say r ~ r; }; sub gettext() { say "side effect"; return "WORLD" }; saytwo {gettext()};
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«side effect␤side effect␤WORLD␤»
vendethiel (other languages such as scala offer call-by-name parameters, doing the same thing)
17:01 jnap joined 17:04 SamuraiJack_ joined 17:06 jnap left
Mouq xfix: gist.github.com/masak/3438222 17:07
xfix Ok, I doubt a function could do this easily. 17:08
Macros save context. right...
vendethiel perl 6 sdl game - 0.5 fps :) 17:10
Mouq xfix: If you can replace a macro with a sub, I don't see any reason not to, and I don't see it as an argument against macros
macros are supposed to be for doing weird things you shouldn't be allowed to do but it's Perl 6 so you can anyway 17:11
;)
tadzik vendethiel: which one? 17:13
vendethiel tadzik: none yet !
tadzik I hope so 17:14
mine are running on stable 120fps
xfix Perl 6 is now faster than Perl 5.
vendethiel tadzik: SDL+perl6 ?
tadzik yep
vendethiel well, that's impressive ;-)
tadzik :)
vendethiel I'd like to get a gist, though
tadzik oh, you can play them too :) 17:15
github.com/tadzik/p6steroids is the only one I released so far
Mouq tadzik++
tadzik I'm working on a full-blown framework now
based on SDL2
vendethiel tadzik++
tadzik gist.github.com/tadzik/9710797 preview 17:16
but don't tell anybody, it's a secret
vendethiel oh okay. I won't :)
It's cool if you get to 120fps, though. Do you know which features not to use not to blow up ? 17:17
17:17 iolympian joined
masak tadzik++ 17:18
vendethiel TimToady, do you know cool and expressive examples I could link to my interested friend ? (fp-style is a bonus, I know you wrote one) 17:20
r: { !!! }
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«Stub code executed␤ in block at /tmp/tmpfile:1␤␤»
vendethiel r: { ... } 17:21
camelia rakudo-jvm 1c1a08: OUTPUT«Unhandled exception: Stub code executed␤ in throw (gen/jvm/CORE.setting:10978)␤ in sink (gen/jvm/CORE.setting:12406)␤ in MAIN (gen/jvm/main.nqp:47)␤ in (gen/jvm/main.nqp:41)␤ in (gen/jvm/main.nqp)␤␤»
..rakudo-parrot 1c1a08: OUTPUT«Stub code executed␤current instr.: 'throw' pc 417025 (src/gen/p-CORE.setting.pir:174619) (gen/parrot/CORE.setting:10998)␤called from Sub 'sink' pc 454426 (src/gen/p-CORE.setting.pir:188619) (gen/parrot/CORE.setting:12427)␤called from Sub 'MAIN' pc …»
..rakudo-moar 1c1a08: OUTPUT«Unhandled exception: Stub code executed␤ at src/gen/m-CORE.setting:11035 (/home/p6eval/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:throw:129)␤ from src/gen/m-CORE.setting:12461 (/home/p6eval/rakudo-inst-1/languages/perl6/runtime/CORE.…»
vendethiel r: { ??? }
camelia rakudo-parrot 1c1a08: OUTPUT«Stub code executed in block at /tmp/tmpfile:1␤␤»
..rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«Stub code executed␤»
tadzik vendethiel: well, nothing blows up that's not a programming error 17:23
but if you call a perl6 sub from C code, and don't give a good number of arguments, it explodes in a very nasty way
17:23 iolympian left
masak tadzik: have you seen impactjs.com/ ? it impressed me a lot, and you might be able to st^Wborrow some ideas from it. 17:25
Mouq vendethiel: A simple one: rosettacode.org/wiki/Greatest_commo...sor#Perl_6 17:27
tadzik masak: I'm borrowing from phaser.js mostly 17:28
Mouq `cd Perl6; ls | wc -l` -> 73 17:30
I think I need to clean up a bit 17:31
17:31 pecastro left
masak tadzik: ah. nice. 17:32
colomon Mouq: nice 17:36
FROGGS tadzik: would be cool, to a have what I did for P5's SDL, an SDLx::LayerManager 17:37
colomon though I think I'd make the concise sub gcd($a, $b) { ($a.abs, $b.abs, * % * … 0)[*-2] } 17:38
the series version is awesome, at any rate.
er, sequence version. :) 17:41
FROGGS tadzik: because this thing offers all what you'd need for a board or card game
17:41 denisboyun joined
tadzik FROGGS: hmm, I'll look that up 17:43
colomon attention is suddenly on what FROGGS is saying after that last comment.
FROGGS here is a solitaire game in 448 loc, which uses the said layermanager: github.com/FROGGS/Games-Solitaire/...litaire.pl 17:45
17:46 guru joined, guru is now known as ajr_
FROGGS a screenshot of that game: i.imgur.com/pboCxPG.jpg 17:47
if somebody needs card games images, feel free :o) 17:48
tadzik: this layermanager resolves a layer for you when you click somewhere in your app 17:52
and you can attach information to a layer, like the color/suite of the card 17:53
and the layermanager is responsible for drawing the layers
so we could do this in p6: $layer-manager.at(:$x,:$y).meta<on-click>() 17:55
(in case you want to put callbacks into a layer, which could be a button in this case)
this is a base for a chess game, where you can move the figures: github.com/PerlGameDev/SDL/blob/ma...r_Chess.pl 18:00
(only 139 loc)
18:02 jnap joined, raiph joined
vendethiel tadzik: I mean blow up performance-wise, sory 18:04
colomon FROGGS++ 18:05
vendethiel thanks Mouq
18:06 jnap left
colomon BTW, live streaming robot competition from the high school down the road: www.first-glbr.org/event-livestream.html 18:06
FROGGS "Live Streaming is wegen Rechteproblemen in Deutschland leider nicht möglich." -.- 18:07
colomon :(
wonder if there's any sort of valid reason? 18:08
FROGGS it is about the GEMA 18:09
same reason why I can't see some music videos, one would have to do payments to the GEMA to broadcast this content
18:13 araujo joined
nwc10 .tell arnsholt works on "my" machine (jastcompiler, that is), did one run, but numbers look better. 18:18
yoleaux nwc10: I'll pass your message to arnsholt.
18:19 wooden left, Alula_ joined
dalek ecs: 0fa12d8 | (Konrad Borowski)++ | S02-bits.pod:
Use space instead of underscore in Wikipedia reference.

While both forms, `Mu_(negative)` and `Mu (negative)` are correct, only the form with the space inside is intended to be public version
  (however, the version with underscore is also correct because of
technical details - otherwise it would have to represented with `%20` which is just ugly).
If you disagree with this change, then I propose to change the Perl 6's name to Perl_6. After all, this is what technically it is on Wikipedia. Or Perl-6, after all Perl 6 prefers hyphens instead of underscores.
The alternative options are "無 (negative)", "Moo", "Mu.new", "MU",
  "Star Trek [Ii]nto Darkness", and some more. However, I'm not going to
consider them, because it would ridiculous.
Then again, this commit changes one character. This is ridiculous anyway. But it's not that I'm going to consider "Moo" instead of "Mu", even considering this minor change with huge commit description (yes, I noticed).
18:22
xfix ...
xfix I fail
18:22 Alula left
lue wat 18:24
Mouq FROGGS⨤⨤ 18:25
Mouq wonders why his terminal renders ⨤ but his browser doesn't
18:28 bcode joined 18:31 hoverboard joined
colomon 's home robot team is up next. 2619. :) 18:32
vendethiel That's one long commit message...
18:34 raiph left
Mouq Oh, shoot, why did I think that commit was by FROGGS? 18:34
xfix⨤⨤ :P 18:35
Because it's incredibly important to trail strange, meaningless symbols after the *correct* person's name!
tadzik vendethiel: well, no specific things 18:38
dalek kudo/nom: ffa5722 | Mouq++ | src/Perl6/Grammar.nqp:
Let, e.g., B«I<boldlyimportant>» work
18:44
colomon finally figured out he and his son could watch the robots on his Windows box, leaving the MBP free for $work.
18:54 denis_boyun joined 18:55 denisboyun left 18:58 kurahaupo joined 19:03 jnap joined, darutoko left
masak xfix: please try to correlate long commit messages with significant commits. thank you. ;) 19:03
lue masak: to put it another way, "huffmanize your commit messages" :) 19:07
19:07 jnap left
masak right. 19:09
19:12 ajr_ left
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'abcba' ~~ /%letters*/ 19:12
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「」␤␤»
Mouq r: my @letters = a , b , c; say 'abcba' ~~ /@letters*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Preceding context expects a term, but found infix , instead␤at /tmp/tmpfile:1␤------> my @letters = a ,⏏ b , c; say 'abcba' ~~…»
Mouq r: my @letters = <a b c>; say 'abcba' ~~ /@letters*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「abcba」␤␤»
tadzik lol, that commit message 19:13
19:13 guru joined 19:14 guru is now known as Guest3873, Guest3873 is now known as ajr_
masak r: my @letters = <a b c>; say 'abcda' ~~ /@letters*/ 19:15
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「abc」␤␤»
masak \o/
19:16 mtk joined
Mouq just wonders what /%letters*/ does 19:16
lue Mouq: absolutely nothing! 19:17
or rather, absolutely [reserved]!
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'abcba' ~~ /@%letters.keys*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«Nil␤»
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'abcba' ~~ /@%letters.keys()*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Null regex not allowed␤at /tmp/tmpfile:1␤------> c => 2; say 'abcba' ~~ /@%letters.keys(⏏)*/␤ expecting any of:␤ …»
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'abcba' ~~ /@%letters*/ 19:18
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「」␤␤»
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'a5' ~~ /@%letters*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「」␤␤»
Mouq r: my %letters = a => 5, b => 15, c => 2; say 'a 5' ~~ /@%letters*/
camelia rakudo-parrot 1c1a08, rakudo-jvm 1c1a08, rakudo-moar 1c1a08: OUTPUT«「」␤␤»
19:19 SamuraiJack_ left
Mouq & 19:19
19:31 FrankG left 19:33 BitPuffin left, iolympian joined, iolympian left 19:38 logie_ joined 19:43 kurahaupo left 19:50 kurahaupo joined 20:03 jnap joined
tadzik argsh 20:05
something is super-wrong with nativecall :/
screenshot, because people usually can't read my shell logs anyway: imgur.com/mXai9lQ
can provide code if someone wants to try to reproduce it
20:06 nebuchadnezzar joined
tadzik it's the same on all the backends 20:07
it's weird, because nativecall tests all pass for me
masak tadzik: it's working 2 times out of 7! that's great! :P
20:08 jnap left
tadzik quick math: how much of a working chance do I have if the game works 6 textures? :P 20:08
s/works/loads/
jnthn tadzik: "has int32 $.test"
masak m: sub percent { say $^n.fmt("%.2f%%") }; say percent (2/7) ** 6 20:09
camelia rakudo-moar ffa572: OUTPUT«0.00%␤True␤»
masak m: sub percent { $^n.fmt("%.5f%%") }; say percent (2/7) ** 6 20:10
camelia rakudo-moar ffa572: OUTPUT«0.00054%␤»
masak er.
m: sub percent { ($^n * 100).fmt("%.5f%%") }; say percent (2/7) ** 6
camelia rakudo-moar ffa572: OUTPUT«0.05440%␤»
masak tadzik: ^
tadzik: one chance in ~200. not bad.
m: sub percent { ($^n * 100).fmt("%.3f%%") }; say percent (2/7) ** 6
camelia rakudo-moar ffa572: OUTPUT«0.054%␤»
20:10 nebuchadnezzar left
tadzik jnthn: :o 20:10
20:11 nebuchadnezzar joined
jnthn tadzik: int in C is never any bigger than 32 bits, but in Perl 6 int tends to me "whatever is a comfortable integer size for whatever we're running on" 20:11
tadzik of course it helps :)
jnthn Yeah, it worked when you were lucky enough that the next 4 bytes are zeroes.
If you check the numbers you got in binary I suspect it'll make more senes :) 20:12
tadzik jnthn: yeah, the bittage thought even crossed my mind, but somehow I thought "well, I wrote «has int», not «has long»...." :)
jnthn Or even in hex will do :)
tadzik yeah, probably :)
now I'm back to the 'C calls Perl6' bug... 20:14
TimToady vendethiel: rosettacode.org/wiki/Pattern_matching#Perl_6 rosettacode.org/wiki/Same_Fringe#Perl_6 rosettacode.org/wiki/Partial_functi...ion#Perl_6 rosettacode.org/wiki/First-class_fu...ons#Perl_6 rosettacode.org/wiki/Function_composition#Perl_6 rosettacode.org/wiki/Fibonacci_n-st...ces#Perl_6 rosettacode.org/wiki/Runge-Kutta_method#Perl_6 20:16
vendethiel TimToady++
Thanks !
jnthn If you're having C callbacks on Moar, there's two things that the VM will get REALLY upset about and probably poop unicorns in response to: unwinding an exception handler across the boundary, and taking a continuation over the boundary. 20:17
I actually don't know what it will do, I just know I didn't take the time to put in proper handling of the two cases yet.
I guess making them panic is a reasonable start. 20:18
C has no concept of exceptions so it's really icky knowing what to do if the Perl 6 code throws one.
tadzik Internal error: Unwound entire stack and missed handler is what I get now
it used to do that when I called a perl6 sub from C that had a wrong signature or something 20:19
jnthn oh, that's not actually terrible...compared to a SEGV :)
tadzik now I have no idea what's happening :)
20:19 pippo_ joined
pippo_ Hello #perl6! 20:19
masak hello pippo_! 20:20
jnthn Well, you can put a CATCH in your callback that dumps the exception I guess
tadzik it's not even a callback
jnthn I wonder what semantics we (a) want and (b) can sanely implement here...
tadzik well, it's from a callback, somehow
jnthn Oh...
tadzik C calls Perl6 calls C
jnthn Yeah
That'd do it
I mena, it's fine, but if that Perl 6 ever results in an exception at the moment, things will hurt.
pippo_ Hi masak! Backlogging I have seen this { $*IN.getc // last }
tadzik X::AdHoc.new(payload => "Native call expected object with CPointer representation, but got something else") 20:21
ha!
masak m: constant p = "p"; constant i = "i"; constant o = "o"; constant underscore = "_"; say "hello {p}{i}{p xx 2}{o}{underscore}!"
camelia rakudo-moar ffa572: OUTPUT«hello pip po_!␤»
tadzik I wonder, why can't NativeCall do that for me
masak m: constant p = "p"; constant i = "i"; constant o = "o"; constant underscore = "_"; say "hello {p}{i}{p x 2}{o}{underscore}!"
camelia rakudo-moar ffa572: OUTPUT«hello pippo_!␤»
jnthn tadzik: "that"?
pippo_ but I do not understand how it works. For me // is an empty regex but ther is no math operator before???
tadzik yay, works
jnthn: well, I expect to get a Perl6-level exception if something breaks 20:22
and I get a weird moarvm error
masak pippo_: "defined or", see S03.
Mouq pippo_: perlcabal.org/syn/S03.html#Tight_or_precedence
jnthn tadzik: Yeah; I'm more inclined to find a MoarVM-level way to more safely propagate or report the exception. 20:23
pippo_ masak: Mouq: Thank you!!
Mouq doc.perl6.org/language/operators#in...%252F%252F
tadzik jnthn: that'd be great 20:24
jnthn tadzik: It was already on my todo list; I just ran out of tuits this side of the Rakudo release. :) 20:26
20:27 kaare__ left
jnthn Also there's something I'm planning to build out of nativecall things in the coming weeks, so I hope to discover/hunt more bugs out of that too :) 20:27
tadzik okay :)
masak pippo_: also in Perl 5.10+ 20:29
Mouq Hurm 20:32
20:32 jnap joined
nwc10 jnthn: hmm, int on I-forget-which-sort of Cray was 64 bit. As was short. 20:33
Mouq So I added a dynamic variable to Pod::To::HTML and the compiled-to-moarvm version of the module now segfaults… rebuilding RM in case it's just me
nwc10 no, there was no type which had a sizeof(...) 2. Or 4.
jnthn nwc10: We may need to introduce c_int, c_long, c_short, c_side, etc. that some point for dealing with this... 20:35
pippo_ masak: thanks!
nwc10 "was" in that I'm not sure how many are still around 20:36
then again, there's at least one PDP11 in Canada for at least 36 years: www.vintage-computer.com/vcforum/sh...-GE-Canada 20:37
20:41 virtualsue joined 20:44 rindolf left
Mouq Oh, nope, fresh build, reverted Pod::To::HTML to before my recent changes, and it still segfaults; I musta borked panda... 20:49
20:52 iolympian1 joined, iolympian1 left
FROGGS run it in gdb? 20:53
20:55 ajr_ left 21:10 hoverboard left 21:14 kurahaupo left
Mouq FROGGS: How? 21:14
FROGGS Mouq: that is for perl6-m? 21:15
Mouq Yes
FROGGS do:
which perl6-m
then: cat /path/to/perl6-m
Mouq FROGGS: Ok 21:16
FROGGS and then: gdb --args /path/to/moar <option until $@> -e 'whatever you did before'
options*
without the $@ in fact
and then when you are in the gdb prompt, type: run 21:17
Mouq FROGGS: Ok, thank you
FROGGS and when it segfaults: bt full
Mouq: you might want to recompile MoarVM with --debug though, otherwise you will not see much
(you dont have to recompile nqp or rakudo afterwards)
pippo_ good night #perl6! 21:21
21:21 pippo_ left
Mouq o/ pippo_ 21:21
Program received signal EXC_BAD_ACCESS, Could not access memory. 21:23
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000070
0x0000000100013804 in AO_fetch_and_add_full ()
21:23 zakharyas joined
FROGGS Mouq: can you no-paste the bt full? 21:23
Mouq gist.github.com/Mouq/38b74be36e0834cb8248 21:24
But rerunning with --debug
FROGGS yeah, --debug will help 21:25
Mouq gist.github.com/Mouq/6d7a158e3046d93e5b47
FROGGS #1 0x00000001000137d7 in MVM_frame_inc_ref (tc=<value temporarily unavailable, due to optimizations>, frame=0x0) at src/core/frame.c:43 21:27
that frame there is NULL
that p6captureouters is new I think 21:28
jnthn It changed recently
FROGGS rakudo/src/vm/moar/ops/perl6_ops.c:502: outer->outer = MVM_frame_inc_ref(tc, ((MVMCode *)tgt)->body.outer); 21:29
must be this
s/must/could/
21:29 Alula_ is now known as Alula
jnthn Hm, if that ends up being null that's...less than useful. 21:29
FROGGS hmmm, no, I don't think it can be NULL 21:32
that outer->outer two lines before would explode in that case
ohh, no 21:33
I am unable to read properly :o)
21:35 mtk left, daniel-s joined, virtualsue left 21:40 mtk joined 21:41 jnap left
vendethiel r: my &gcd = { (abs $^a, abs $^b, * % * ... 0)[*-2] }; gcd 1, 2; 21:43
camelia rakudo-moar ffa572: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤»
..rakudo-jvm ffa572: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block at gen/jvm/CORE.setting:16576␤ in block at gen/jvm/CORE.setting:16514␤ in block at gen/jvm/CORE.setting:7614␤ in block at gen/jvm/CORE.setting:7616␤ in method reify a…»
..rakudo-parrot ffa572: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
Mouq r: my &gcd = { (abs $^a, abs $^b, * % * ... 0)[*-2] }; gcd(1, 2);
camelia rakudo-moar ffa572: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤» 21:44
..rakudo-jvm ffa572: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block at gen/jvm/CORE.setting:16576␤ in block at gen/jvm/CORE.setting:16514␤ in block at gen/jvm/CORE.setting:7614␤ in block at gen/jvm/CORE.setting:7616␤ in method reify a…»
..rakudo-parrot ffa572: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤ in block at /tmp/tmpfile:1␤ in block at /tmp/tmpfile:1␤␤»
Mouq m: my &gcd = { abs $^a, abs $^b, * % * ... 0 }; gcd(1, 2);
camelia rakudo-moar ffa572: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤»
Mouq ?
vendethiel my question exactly
Mouq m: my &gcd = { abs $^a, abs $^b, ->$a,$b{$a % $b} ... 0 }; gcd(1, 2);
camelia rakudo-moar ffa572: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤»
jnthn m: my &gcd = { say 'in call'; abs $^a, abs $^b, * % * ... 0 }; gcd(1, 2); 21:45
camelia rakudo-moar ffa572: OUTPUT«in call␤===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤»
jnthn I think it's the * % * maybe?
Mouq m: my &gcd = ->$a,$b{ abs $a, abs $b, ->$c,$d{$c % $d} ... 0 }; gcd(1, 2);
vendethiel I believe it
camelia rakudo-moar ffa572: OUTPUT«===SORRY!===␤Not enough positional parameters passed; got 1 but expected 2␤»
Mouq Oh!
r: my &gcd = { (abs($^a), abs($^b), * % * ... 0)[*-2] }; gcd(1, 2); 21:46
camelia ( no output )
Mouq r: my &gcd = { (abs($^a), abs($^b), * % * ... 0)[*-2] }; say gcd 1, 2;
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«1␤»
Mouq r: my &gcd = { ($^a.abs, $^b.abs, * % * ... 0)[*-2] }; say gcd 1, 2;
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«1␤»
vendethiel hahahaha, might need RC fix then
Mouq vendethiel++ 21:47
vendethiel TimToady++ # linking these RC 21:48
not sure why that's ..., though. 21:49
can it filter out explicit results ?
Mouq vendethiel: What do you mean?
vendethiel oh no, it's just [*-2] ¬¬
I'm blind
Mouq doc.perl6.org/language/operators#infix+... 21:50
vendethiel r: say 1, 2, 3 ... 1;
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«1␤»
vendethiel okay, that's what I meant
Mouq Oh
okay
21:50 spider-mario left
Mouq r: say 1, 2, 3 ... 0; 21:50
vendethiel Broke it.
Mouq (timeout)? 21:51
vendethiel Not quite.
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«(timeout)»
Mouq (timeout).
vendethiel although ...
say 1, 2, 3 ... * > 0;
(timeout)?
Mouq vendethiel: Missing r: 21:52
vendethiel Mouq++ # I'm so blind ¬¬
r: say 1, 2, 3 ... * > 0;
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«1␤»
vendethiel Oh, I guess 1 > 0. Makes sense.
r: say so 1 > 0 21:53
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
lizmat r: say 1 > 0
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
vendethiel r: say 1, 2, 3 ...^ * > 0; 21:54
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«␤»
lizmat not sure why you would need a so there
vendethiel Much better.
lizmat, because I think "say so" looks cool :)
lizmat r: say so.so :-) 21:55
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Two terms in a row␤at /tmp/tmpfile:1␤------> say so.so ⏏:-)␤ expecting any of:␤ method arguments␤ …»
lizmat r: say so.so
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«False␤»
vendethiel lizmat++ # even if I'm not sure what's going on 21:56
lizmat r: say 1.so 21:57
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
lizmat r: say so .so
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«False␤»
lizmat r: $_=1; say so .so 21:58
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
Mouq r: say so.so given ~so.so
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
lizmat does that make sense?
vendethiel oh.
yeah.
r: say so$_;
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«False␤»
vendethiel cause it's (Any) 21:59
lizmat r: say so$_=1
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
lizmat r: say so True
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«True␤»
vendethiel damn, now I'm gonna feel obligated to write my boolean tests like that: `say so.so given 1;` 22:00
lizmat :-) 22:01
22:02 kivutar joined
FROGGS m: say ?^+?$0.?so # linenoise++ 22:04
camelia rakudo-moar ffa572: OUTPUT«True␤»
vendethiel linenoise is easy to get with custom ops.
FROGGS there is nothing custom in it :o)
vendethiel Yeah, but you can do whatever you want :p 22:05
FROGGS yes, that is the plan basically
you should be allowed to mess with it
22:10 logie_ left 22:12 jnap joined 22:16 jnap left 22:22 xenoterracide left 22:26 Mouq left
lizmat sleep& 22:27
FROGGS lizmat: it got merged! github.com/andk/pause/pull/106 22:28
lizmat: now I just need to implement the bits for the indexer :o)
(should not be too hard now)
lizmat cool! 22:29
really sleep now :-)
FROGGS lizmat: sleep well!
22:33 rurban1 left 22:50 daniel-s left 22:51 daniel-s joined
masak m: grammar G { regex TOP { foo } }; say so G.parse("how utterly foo-lish") 22:52
camelia rakudo-moar ffa572: OUTPUT«False␤»
masak so, TOP has implicit ^ and $ nowadays, huh? :)
lue yep 22:53
vendethiel m: grammar G { regex TOP { foo } }; say so G.parse("how utterly \nfoo\n-lish")
camelia rakudo-moar ffa572: OUTPUT«False␤»
vendethiel m: grammar G { regex TOP { ^^ foo $$ } }; say so G.parse("how utterly \nfoo\n-lish")
camelia rakudo-moar ffa572: OUTPUT«False␤»
lue m: grammar G { regex TOP { foo } }; say so G.subparse("how utterly foo-lish") 22:54
camelia rakudo-moar ffa572: OUTPUT«False␤»
lue I thought subparse was supposed to work there.
FROGGS p: grammar G { regex TOP { foo } }; say so G.subparse("fooo") 22:56
camelia rakudo-parrot ffa572: OUTPUT«True␤»
FROGGS p: grammar G { regex TOP { foo } }; say so G.subparse("xfooo")
camelia rakudo-parrot ffa572: OUTPUT«False␤»
vendethiel that's, uh, surprising
FROGGS implicit ^ for some reason
lue subparse shouldn't have implicit anchors at all, unless I'm seriously misremembering what it's for.
22:56 Mouq joined
timotimo "some" reason? 22:56
i thought parse is for having anchors, subparse is for not having any 22:57
FROGGS "some" in like "wrong" :o) 22:58
22:59 xenoterracide joined 23:02 zakharyas left 23:06 Psyche^ joined 23:10 Psyche^_ left 23:13 jnap joined 23:17 jnap left 23:22 jnap joined
dalek kudo-star-daily: eda5956 | coke++ | log/ (5 files):
today (automated commit)
23:23
rl6-roast-data: 6f94935 | coke++ | / (4 files):
today (automated commit)
23:24 BenGoldberg joined
masak Text::Indent published: github.com/masak/text-indented 23:25
proceeding to blog.
timotimo coolio :)
masak if someone could be so kind as to pull-request the à la mode module/Panda stuffs, that would be muchly appreciated. 23:26
timotimo is there a way to do things like "brackets allow you to have not indented stuff on the next line"?
especially "wrong" unindents 23:27
masak no, but if you pull-request a test for that, I might consider it :)
timotimo you drive a hard bargain 23:28
masak :3 23:29
23:29 Fg_ joined
Mouq masak: Do you mean perl6/ecosystem? 23:29
Gah, Perl 5. If @_ = (0), is `if (!@_)` run? :| 23:30
timotimo huh? 23:31
masak Mouq: no.
Mouq: the list has 1 element, so !@_ is falsy.
Mouq masak: Even in p5?
masak even in p5.
there's no mixing of those two levels.
Mouq Ok :) Thanks
masak $ perl -Mstrict -wE '@_ = (0); if (!@_) { say "does not run" }; say "see?" ' 23:32
see?
Mouq Ok, perl5++ for not being completely insane :) 23:33
masak in general, both in Perl 5 and Perl 6, if the test is !@ary, then you can be sure that only the size of the array is under test, not its contents.
23:34 telex left 23:36 telex joined
masak is there an RT TODO ticket for /<atom> ** {+N}/ ? 23:43
Mouq r: class A { has $.foo; method bar (:$op = $.foo) { say $op } }; my $a = A.new; $a.bar; $a.foo = 42; $a.bar
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«(Any)␤Cannot assign to a readonly variable or a value␤ in block at /tmp/tmpfile:1␤␤»
Mouq r: class A { has $.foo is rw; method bar (:$op = $.foo) { say $op } }; my $a = A.new; $a.bar; $a.foo = 42; $a.bar 23:44
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«(Any)␤42␤»
lue masak: a quick search for "block case of" turned up nothing for me. 23:46
vendethiel r: role A[::T]; class B[::T] does A[T]; 23:52
camelia rakudo-parrot ffa572, rakudo-jvm ffa572, rakudo-moar ffa572: OUTPUT«===SORRY!=== Error while compiling /tmp/tmpfile␤Unable to parse class definition␤at /tmp/tmpfile:1␤------> role A[::T]; class B⏏[::T] does A[T];␤ expecting any of:…»
vendethiel r: role A[::T] {}; role B[::T] does A[T] {};
camelia rakudo-parrot ffa572: OUTPUT«Could not instantiate role 'B':␤Not enough positional parameters passed; got 1 but expected 2␤current instr.: 'specialize' pc 22132 (src/gen/perl6-metamodel.pir:10426) (gen/parrot/Metamodel.nqp:2102)␤called from Sub '' pc 27863 (src/gen/perl6-metam…»
..rakudo-moar ffa572: OUTPUT«Unhandled exception: Could not instantiate role 'B':␤Not enough positional parameters passed; got 1 but expected 2␤ at <unknown>:1 (/home/p6eval/rakudo-inst-1/languages/nqp/lib/Perl6/Metamodel.moarvm:specialize:4294967295)␤ from src/gen/m-Metamode…»
..rakudo-jvm ffa572: OUTPUT«Unhandled exception: Could not instantiate role 'B':␤Not enough positional parameters passed; got 1 but expected 2␤ in specialize (gen/jvm/Metamodel.nqp:2025)␤ in (gen/jvm/Metamodel.nqp:2465)␤ in (gen/jvm/Metamodel.nqp:2461)␤ in compose (gen…»
vendethiel Why's that :(
masak lue: I searched to, and came up empty-handed. just wanted to check. 23:56