lue o/ 00:00
arlinius rakudo: my::foo 00:02
p6eval rakudo 1f2bd0: OUTPUT«Malformed my at line 11, near "::foo"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
arlinius rakudo: my ::x
p6eval rakudo 1f2bd0: OUTPUT«Malformed my at line 11, near "::x"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
lue is currently a azombie 00:05
lue needs to drink caffeine, aaaaandc fast
00:24 daemon left, daemon joined 00:33 airbase joined
lue I'll be here for the nightshift :D 00:41
00:48 nihiliad left 00:55 nihiliad joined 01:11 ascent_ left 01:12 ascent_ joined 01:18 lestrrat is now known as lest_away 01:23 yinyin joined 02:11 lest_away is now known as lestrrat 02:16 astrojp left 02:25 nihiliad left 02:27 Chillance left 02:34 quester joined 02:47 rgrau left 02:49 f00li5h[HireMe] joined 02:50 wknight8111 left 03:01 nihiliad joined 03:24 nihiliad left 03:26 am0c left
colomon 25085 passing tests, and then to bed. 03:29
03:34 agentzh joined 03:40 nihiliad joined 03:41 am0c joined 03:43 mikehh left 03:47 alester joined 03:51 eternaleye left 04:39 xinming_ joined 04:43 xinming left, nihiliad left 05:12 Sarten-X2 left
lue anybody here? Or all you all off watching the olympics :) 05:18
Tene I'm here, for a bit. 05:20
Sleeping shortly.
lue good. It's been quiet for hours here. Good thing I wasn't here the whole time :) 05:23
05:27 xomas joined, xomas left, xomas joined 05:31 yinyin left 05:34 mssm left 05:56 am0c is now known as am0c_away 06:13 Trashlord left 06:33 eternaleye joined 06:49 eternaleye left 06:50 kaare joined, kaare is now known as Guest73108 06:52 uniejo joined 06:53 justatheory left 07:01 quester left 07:08 masak joined
masak a very good morning to you, #perl6. happy new week! 07:08
phenny masak: 28 Feb 20:46Z <Tene> tell masak "For a given grammatical category, a default parsing rule or set of rules is used". The spec doesn't discuss where this "default parsing rule" is defined.
masak: 28 Feb 20:53Z <Tene> tell masak That was the big omission, at least. Search the logs for mention of that quote to find my discussion with TimToady about it. 07:09
masak: 28 Feb 20:55Z <Tene> tell masak I hear you're going to get a lot of messages. Good luck with that.
masak: 28 Feb 21:00Z <Tene> tell masak Ah, nevermind, I was misinformed. Looks like it's only me in your messages so far.
masak Tene: well, if I'm getting a lot of messages, I know whom to blame. :P anyway, thanks for the information. 07:10
07:13 eternaleye joined
Tene masak: morning 07:21
07:22 Su-Shee joined
Su-Shee good morning 07:23
masak Tene, Su-Shee: good morning. 07:24
07:29 alester left
Tene up way too late, sleeps. 07:32
masak Tene: 'night
hejki good morning to you masak :) 07:33
masak found the macro discussion at irclog.perlgeek.de/perl6/2009-12-22#i_1862388
hejki: \o
hejki :>
Tene masak: I'll be interested to see any comments you have on macros.
looking at it again, there are several cases that it looks like I could handle just fine.
masak sounds great. 07:34
Tene anything with an "is parsed" is do-able.
masak I'll see if I have any comments.
Tene I guess that many macros are parsed just as the name of the macro. The 'macro moose' example, for example.
I need to finish with exceptions refactor in parrot first, though, I think. 07:35
(not related, just want to get it finished)
masak nod.
07:36 agentzh left 07:59 quester joined 08:05 jonasbn joined
masak any Japanese readers online? what does the person say? twitter.com/osa9/status/9787029741 08:05
something about 'no sign of it'. 08:06
lestrrat "there's no sign of Perl6 arriving"
masak thanks.
lestrrat "there's no sign of Perl6 arriving (any time soon)" -- is probably more accurate. 08:07
08:10 iblechbot joined
masak I replied this: twitter.com/carlmasak/status/9815984415 08:10
I would use Google Translate to reply in Japanese, but I don't trust it not to botch my English into something unintelligible, insulting, or both. 08:11
jonasbn masak: just to clarify, you need accomodation for Friday, Saturday, Sunday and Monday - right 08:12
08:12 am0c_away left
jonasbn ? 08:12
masak jonasbn: right. sorry for being so unclear before.
jonasbn masak: no problem, writing the OSD ppl now, have not hear a THING from them about the hotels 08:13
I do not know whether to be concerned or not
masak huh.
jonasbn: I'm working on my presentation as we speak. it makes me really look forward to giving the talk. :) 08:14
jonasbn great :)
masak jonasbn: before I forget: thank you for pulling this together. it's a great opportunity to meet, hack, talk and generally push Perl 6 and Rakudo forward in time for the Rakudo * release. 08:16
jonasbn no problem, I got my Copenhagen release ;-) 08:17
masak :-)
jonasbn one thing I have learned over the years with open source community is that it is often easier to do things yourself 08:18
I need coffee 08:19
masak [backlogging] fwiw, I'd expect that an optimizer would turn '@a ?? ... !! ...' and '+@a ?? ... !! ...' and '?@a ?? ... !! ...' into the same bytecode.
jonasbn: yes. but there's a distinction between doing things yourself, and doing things in isolation. I certainly wouldn't be as active with Perl 6 if I were working in a vacuum. 08:20
(cue "no, you would be asphyxiating" jokes)
jonasbn agreed
well apart from the "asphyxiating" part, I have to look that up 08:21
ah, hehehe
masak rakudo: my @a=0..*; @a[Inf]=3; say @a[Inf]; # found by lue 08:24
I mean lue++
p6eval rakudo 588a34: OUTPUT«Cannot use negative index on arrays␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
masak rakudo: my @a; say @a[Inf];
p6eval rakudo 588a34: OUTPUT«Cannot use negative index on arrays␤current instr.: '&die' pc 16676 (src/builtins/Junction.pir:347)␤»
masak submits rakudobug
jonasbn masak: shouldn't you submit a test? 08:25
masak jonasbn: I'm sorry?
jonasbn masak: nothing, I was just wondering
08:26 xomas left
moritz_ good morning 08:26
masak moritz_: \o
jonasbn masak: I have so much to learn at the hackathon :)
masak jonasbn: it's been proposed before. the conclusion of that discussion was that I'll happily leave it to more competent people to submit tests, and not be encumbered by a complicated bug submitting process.
moritz_ jonasbn: did you organize the accommodation? 08:27
masak moritz_: we talked about that in the backlog. :)
08:27 am0c_away joined
masak moritz_: seems the hotel is ping-timeouting or something. 08:27
jonasbn moritz_: I have mailed the information to the OSD ppl, but I have not heard anything back
masak oh, the OSD people.
jonasbn yeah, hence the comment about open source community :-/ 08:28
masak ah. :)
jonasbn :)
masak maybe you accidentally emailed the OCD people, and they've been meticulously working on a reply ever since. :P
jonasbn now for that coffee
hejki coffee is bad, drink tea :)
jonasbn hejki: no
masak is more of a rooibos kinda guy
hejki i quitted coffee and it actually did increase my productivity :) 08:29
rooiboses (or how the heck you make a plural out of it) are nice, but tend to be too sweet for my likings 08:31
and those aren't actually tea afaik, someone to back me up on this one? :) 08:32
masak hejki: then the unflavoured one just might be for you.
hejki :o
masak hejki: no, it's not tea. that's consistent with what I've said so far. :)
hejki i have only seen 2 flavors here in finland
jonasbn hejki: I appreciate what you are saying, but I am adicted
hejki ye. it's some shrubbery they're making it from?
jonasbn: i was too, the physical symptoms stop after 5-7 days
after that your body normalizes and you should see increase in productivity as well as in common alertness :) 08:33
masak I'm not so sure the flavoured rooibos types are so good for the environment. many are transported through Germany just to be flavoured.
hejki and it's a scientific fact that caffeine doesn't make you any more awake
Su-Shee jonasbn: ignore it, coffee has many advantages. as usal it depends on the dosage.
hejki masak: well my GF drinks some "organic rooibos" stuff, not sure how good that is for the env :P 08:34
Su-Shee masak: by driving through germany you get flavour? cool. :)
jonasbn my only problems is, if drink too much, it ruins my concentration
masak hejki: rooibos is made from some shrubbery, yes. it's also transported by African swallows.
hejki Su-Shee: yup, the land most often makes everyone taste and smell like sausages and beer ;>
masak Su-Shee: causation/correlation :P
Su-Shee I would have called it semantics.. :)
hejki jonasbn: yup, caffeine is totally unbeneficial for human beings when addicted
masak hejki: 'organic', misnomer as it is, usually means 'good for the environment' :) 08:35
Su-Shee we have like 20 variations of rooibos in the office.
hejki masak: yeh, usually :)
masak: the stuff is still made in africa and then transported :P
can't see how that's good for the environment tho :P
masak hejki: in my family, it means 'not dissolvable in water'.
jonasbn hejki, I am also addicted to the Internet and cake
hejki heh :)
Su-Shee jonasbn: let's have cake and a cup of coffee. :)
hejki jonasbn: internet addiction is not curable, cake is a lie so you can't be addicted to that
jonasbn a lie? 08:36
masak you can be addicted to a lie.
jonasbn: that's a "Portal" reference.
jonasbn portal?
jonasbn is lost and addicted
hejki someone doesn't know "the cake is a lie"-meme? :o
08:36 riffraff joined
hejki you should google and sophisticate yourself a bit 08:37
masak jonasbn: www.youtube.com/watch?v=nd6RhzsO5js
here at #perl6, we welcome people from all segments of the meme path. :) 08:38
hejki tbh i'd pay good money in order to forget some of the internet memes i've seen 08:39
like tubgirl/typicalmacintoshuser
masak perhaps this video better explains the meme, actually: www.youtube.com/watch?v=0pig3PbHyJY
jonasbn okay, my coffee and cake issues seem very insignificant compared to the "portal" thing you lot got going 08:40
hejki :> 08:41
masak now, ain't that the truth. 08:43
hejki i haven't played portal tbh
i just know the meme and i think the idea behind it is wonderful 08:44
and reflects how modern world works
your boss praises your good job without giving the words any meaning
08:56 payload joined 08:57 mssm joined 09:01 pmurias joined 09:06 dakkar joined 09:07 IllvilJa left
pugssvn r29896 | moritz++ | test for RT #73136, stripping of leading and trailing ws in angle brackets 09:09
09:36 jonasbn left 09:38 eternaleye left 09:40 Trashlord joined 09:43 eternaleye joined 09:44 quester left 09:45 Trashlord left
masak so, class Child is Parent; both have a .foo method, each with a PRE block. we call $child.foo, the PRE block in Child.foo fails, but the PRE block in Parent.foo succeeds, so no exception is thrown. did I get that right? 09:47
the followup question to that is: why does it work like that, rather than, say, the PRE blocks of the methods in the class and its ancestors being &&-ed together, like the POST blocks. 09:48
s/\.$/?/
09:53 JimmyZ joined 09:54 JimmyZ left 09:55 JimmyZ joined 09:56 JimmyZ left, lestrrat is now known as lest_away 10:07 Trashlord joined 10:14 snarkyboojum left 10:18 mikehh joined 10:26 orafu left, orafu joined 10:33 pmurias left 10:40 ruoso left
moritz_ masak: substitution principle 10:46
masak I'm listening.
moritz_ masak: the child method substitutes the parent method, so it has to accept at least what the parent method accepts
it can only weaken the precondition
masak ah.
so the PRE in Child is interpreted as a weaker alternative? 10:47
that does make sense.
Liskov strikes again! :)
10:47 IllvilJa joined 10:51 hanekomu left 11:09 lest_away is now known as lestrrat 11:27 lichtkind joined
lichtkind cognominal: hi 11:31
11:40 mikehh left, mikehh joined 11:43 payload left 11:50 kfo joined
cognominal lichtkind, hi 11:52
lichtkind cognominal: :)
11:57 iblechbot left
jnthn o/ 11:59
lichtkind jnthn: hai 12:04
12:13 IllvilJa left
colomon \o 12:13
lichtkind jnthn: ping 12:20
12:21 cognominal left
lichtkind masak: ping 12:23
jnthn lichtkind: pong 12:26
12:29 snearch joined 12:30 b_jonas joined 12:34 ruoso joined 12:37 synth left
masak lichtkind: pong 12:38
12:40 synth joined 12:41 [synth] joined 12:42 mikehh left, mikehh joined 12:44 ruoso left 12:49 takadonet joined
takadonet morning all 12:49
12:49 cognominal joined
masak takadonet: \o 12:49
12:59 ruoso joined 13:01 payload joined 13:05 am0c_away is now known as am0c 13:06 ignacio_ joined 13:12 ruoso left 13:15 jaldhar left 13:19 iblechbot joined, jaldhar joined
colomon rakudo: my sub abc (:$äöü) { 1000 + $äöü }; say abc(äöü => 42) 13:20
p6eval rakudo 588a34: OUTPUT«Malformed UTF-8 string␤␤current instr.: 'perl6;PCT;HLLCompiler;evalpmc' pc 972 (compilers/pct/src/PCT/HLLCompiler.pir:538)␤»
masak rakudo: $ä 13:21
p6eval rakudo 588a34: OUTPUT«Symbol '$\xE4' not predeclared in <anonymous>␤current instr.: 'perl6;PCT;HLLCompiler;panic' pc 137 (compilers/pct/src/PCT/HLLCompiler.pir:101)␤»
masak rakudo: my $ä
p6eval rakudo 588a34: ( no output )
pugssvn r29897 | colomon++ | [t/spec] Add single fudge so Rakudo parses this.
jnthn There's something about unicode and named params. :-/
It's odd because the code gen looks sane.
masak rakudo: my $äöü
p6eval rakudo 588a34: ( no output )
13:22 [synth] left
jnthn rakudo: my $łöł 13:22
p6eval rakudo 588a34: ( no output ) 13:23
masak LOL: The Polish-German edition. 13:24
pmichaud I'm guessing parrotbug.
(good morning, #perl6)
colomon That was the only test (well, pair of tests) failing in S02-lexical-conventions/unicode.t. I've fudged and will push the test as soon as my spectest finishes.
m-locks gm pm
colomon o/ 13:25
jnthn hi pmichaud
masak hi pmichaud++ 13:26
colomon hmmm.... we need something like a thousand tests back a week to get back to alpha's passing level in time for R*? 13:30
dalek kudo: 1bd66da | (Solomon Foster)++ | t/spectest.data:
Turn on S02-lexical-conventions/unicode.t.
13:31
jnthn colomon: Yes, but S05-* has LOADS.
That can probably be won back relatively quickly-ish.
colomon oooo, 4000+, I see...
13:34 mikehh left
colomon rakudo: say "\x[6211" 13:34
p6eval rakudo 588a34: OUTPUT«\x[6211␤»
colomon S02-literals/char-by-number.t has that in a eval_dies_ok test.... master just seems to shrug and get on with life instead of dying. 13:35
13:35 cognominal left 13:37 mikehh joined
colomon rakudo: say "\123" 13:37
p6eval rakudo 588a34: OUTPUT«\123␤»
m-locks oh noes 13:38
masak alpha: "\123"
p6eval alpha 30e0ed: OUTPUT«\123 form deprecated, use \o123 instead at line 10, near "\\123\""␤in Main (file <unknown>, line <unknown>)␤» 13:39
masak submits rakudobug
lichtkind masak++ 13:42
masak ;)
pugssvn r29898 | colomon++ | [t/spec] Fudge to work around masak's latest bug. 13:44
13:46 mikehh left 13:47 snearch left, mikehh joined, EXAAFZJ9 joined
colomon rakudo: say qw/$foo $bar/ 13:49
p6eval rakudo 588a34: OUTPUT«Confused at line 11, near "say qw/$fo"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
13:49 jaldhar left, jaldhar joined 13:50 jaldhar left 13:51 jaldhar joined 13:54 mikehh_ joined 13:55 mikehh left 13:56 SmokeMachine joined 13:58 alester joined 14:00 payload1 joined 14:02 payload left
masak anyone else get just an empty page on npw2010.fsfi.is/ ? 14:05
colomon masak: me
masak hokay. thanks.
jnthn Oh no, masak breaks another thing
;-)
masak it wasn't me, I promise!
jnthn hehe :-)
yay iceland :-) 14:06
jnthn expects it to be a really cool conference.
m-locks yes, its empty
masak jnthn: I'm seriously considering going there. :)
jnthn laik srsly?
colomon rakudo: say Mu eq Mu
p6eval rakudo 588a34: OUTPUT«No applicable candidates found to dispatch to for 'infix:<eq>'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
jnthn ng: Object eq Object 14:07
oops
alpha: Object eq Object
p6eval alpha 30e0ed: ( no output )
jnthn ...
D'oh.
Wonder if master had eq written in PIR
m-locks rakudo: say Mu ~~ Mu
p6eval rakudo 588a34: OUTPUT«1␤»
colomon rakudo: say Int eq Int 14:08
p6eval rakudo 588a34: OUTPUT«1␤»
jnthn colomon: The siggy of infix:<eq> is (Any, Any) or so.
So Mu won't bind.
colomon ah.
easy fix?
jnthn Not meant to be fixed.
That's why my $a; defaults to Any rather than Mu now :-)
14:08 alester left
colomon hmmmm... guess this test is broken, then. 14:09
jnthn Maybe Any eq Any is a more sensible test now.
14:11 IllvilJa joined
colomon rakudo: say sqrt(2).[perl 14:12
p6eval rakudo 588a34: OUTPUT«Confused at line 11, near "say sqrt(2"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (ext/nqp-rx/src/stage0/HLL-s0.pir:328)␤»
colomon rakudo: say sqrt(2).perl
p6eval rakudo 588a34: OUTPUT«1.4142135623731␤»
14:12 mikehh_ left
colomon rakudo: say sqrt(2).perl.eval 14:12
p6eval rakudo 588a34: OUTPUT«␤»
colomon rakudo: say 1.4142135623731
p6eval rakudo 588a34: OUTPUT«No applicable candidates found to dispatch to for 'infix:<div>'␤current instr.: 'perl6;Rat;new' pc 317124 (src/gen/core.pir:37411)␤»
colomon arrrgh.
m-locks lol 14:13
colomon rakudo: say "}".perl 14:16
p6eval rakudo 1bd66d: OUTPUT«"}"␤»
colomon rakudo: say "\}".perl
p6eval rakudo 1bd66d: OUTPUT«"\\}"␤»
colomon rakudo: say "\{".perl
p6eval rakudo 1bd66d: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1664 (ext/nqp-rx/src/stage0/Regex-s0.pir:907)␤»
colomon rakudo: say '{'.perl
p6eval rakudo 1bd66d: OUTPUT«"\{"␤» 14:17
14:17 ignacio_ left
colomon rakudo: say '{'.perl.eval 14:17
p6eval rakudo 1bd66d: OUTPUT«␤»
colomon rakudo: say "hello".perl.eval 14:19
p6eval rakudo 1bd66d: OUTPUT«hello␤»
colomon rakudo: say '$a @string %with &sigils()'.perl
p6eval rakudo 1bd66d: OUTPUT«"\$a \@string \%with \&sigils()"␤»
14:19 jonasbn joined
colomon rakudo: say True.perl 14:22
p6eval rakudo 1bd66d: OUTPUT«1␤»
colomon suspects he can fix this one easily. 14:23
yup. 14:29
pugssvn r29899 | colomon++ | [t/spec] Fudge for Rakudo.
14:34 cognominal joined 14:36 jaldhar left, jonasbn left, JimmyZ joined
lichtkind colomon++ 14:39
colomon: are you interested in hackin on november?
colomon lichtkind: in vague theory, but in practice I'm pretty sure I don't have the time. :) 14:40
masak I know the feeling. :)
lichtkind :)
we all here :)
jnthn ETOOMUCHTOHACKON 14:41
colomon rakudo: sub rt69516( :f($foo) ) { "You passed '$foo' as 'f'" }; &rt69516.signature.perl ~~ m/ ':f(' \s* '$foo' \s* ')' / 14:42
p6eval rakudo 1bd66d: ( no output )
colomon rakudo: sub rt69516( :f($foo) ) { "You passed '$foo' as 'f'" }; say &rt69516.signature.perl ~~ m/ ':f(' \s* '$foo' \s* ')' /
p6eval rakudo 1bd66d: OUTPUT«:f($foo)␤»
colomon Huh. I've broken that someone locally. 14:43
> sub rt69516( :f($foo) ) { "You passed '$foo' as 'f'" }; say &rt69516.signature.perl ~~ m/ ':f(' \s* '$foo' \s* ')'
Confused at line 1, near "say &rt695"
any notions? I think all I've done is define Bool.perl.... 14:44
crazy, removing Bool.perl fixes it... 14:53
rakudo: sub rt69516( :f($foo) ) { "You passed '$foo' as 'f'" }; say &rt69516.signature.perl 14:55
p6eval rakudo 1bd66d: OUTPUT«:(Any :f($foo)␤»
14:56 b_jonas left
colomon > sub rt69516( :f($foo) ) { "You passed '$foo' as 'f'" }; say &rt69516.signature.perl 14:57
:(Any :f($foo where Bool::True)
jnthn: help? 14:58
14:58 Guest73108 left 14:59 bacek joined
bacek o hai 15:00
colomon o/
bacek rakudo: foo(/\b/, "{}")
p6eval rakudo 1bd66d: OUTPUT«Null PMC access in get_string()␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
bacek rakudo: foo(/\b/, "{$1}")
p6eval rakudo 1bd66d: OUTPUT«Method 'postcircumfix:<[ ]>' not found for invocant of class ''␤current instr.: '!postcircumfix:<[ ]>' pc 10518 (src/builtins/Role.pir:45)␤»
bacek interesting... 15:01
15:04 JimmyZ left
jnthn colomon: Oh, may be some hack in Signature.perl. 15:05
colomon jnthn: finally found the code.... no idea what's the problem, though
jnthn colomon: let me look
15:05 eternaleye left
jnthn (sorry, packing is rather consuming me atm) 15:05
colomon: line 61 of Signature.pm is RONG. 15:06
15:06 ruoso joined
jnthn s/'1'/'Bool::True'/ should do it. 15:07
15:07 mikehh_ joined
colomon trying. 15:08
15:09 zostay joined
colomon \o/ 15:10
15:11 stepnem joined, abra joined
colomon will push as soon as spectest passes (he said, fingers crossed) 15:13
lichtkind hacking should only be fun !! 15:14
15:14 nihiliad joined 15:15 uniejo left, bacek left 15:18 wasy left
jnthn Wow. While packing I just found tokens for the Minsk and Moscow metros! 15:20
15:21 Salada345 joined 15:23 wasy joined
colomon okay, changes pushed 15:29
afk
15:30 hanekomu joined
dalek kudo: 9efead6 | (Solomon Foster)++ | src/core/Bool.pm:
Add Bool.perl.
15:33
kudo: bbe9441 | (Solomon Foster)++ | t/spectest.data:
Turn on S02-literals/char-by-number.t and S02-names_and_variables/perl.t.
kudo: af0424a | (Solomon Foster)++ | src/core/Signature.pm:
"Bool::True" instead of "1", as per jnthn.
15:46 Patterner left 15:47 Psyche^ joined, Psyche^ is now known as Patterner 15:52 pmurias joined
pmurias hello 15:52
lichtkind pmurias: hai
15:54 lichtkind left, ignacio_ joined 16:03 riffraff left 16:04 justatheory joined, riffraff joined 16:05 alester joined 16:10 f00li5h[HireMe] left 16:12 abra left 16:13 uniejo joined 16:15 jaldhar joined 16:25 f00li5h[HireMe] joined
masak slow business today. :) 16:40
can someone give me a really juicy use case for Perl 6 macros? 16:41
Su-Shee can't you take a famous lisp macro use case and translate it?
masak good idea. 16:42
can someone give me a really juicy LISP macro use case? :P
Su-Shee *haha* :))
16:42 am0c left
masak outsourcing ftw. :) 16:42
jnthn Only if it produces results. :-) 16:43
Su-Shee I have to prepare perl 6 developer lessons.
16:45 xomas joined, xomas left, xomas joined
masak there actually seems to be a classic LISP use case. something called with-transaction, that makes sure to always do either commit or proper rollback. 16:50
actually, there's seemingly a whole family of those with-* macros: with-open-file, with-output-to-string, with-timeout, etc. weitz.de/macros.lisp 16:51
TimToady obviously we need metamacros... 16:52
16:53 payload1 left
TimToady we could call them, oh, monads, or something 16:54
masak hides
Tene weitz.de/macros.lisp details with-transaction 16:55
I don't see what the advantage of with-transaction as a macro is over with-transaction as a function
masak I suppose the same could be done with phasers in Perl 6. 16:56
TimToady when all you have is a macro, everything starts looking like an AST
masak could be worse :)
colomon heh. 16:57
16:57 pmurias left
colomon one thing I've been wondering... an awful lot of the trig functions are exactly identical modulo a string change. 16:57
so Any.sin is
multi method sin($x) { $x.Num.sin; } 16:58
Any.cos is
multi method cos($x) { $x.Num.cos; }
etc.
(actually, that leaves out the $base argument, but the end result is exactly the same.)
It would be pretty awesome if Perl 6 had a way to say
masak can that be made into a macro?
that would be kinda neat? 16:59
s/\?/./
colomon for <sin cos tan etc> -> $function multi method $function($x) { $x.Num.$function }
Yeah, I don't know if that's a macro thing or not.
but thought it might be worth mentioning. :)
TimToady problem is getting a run-time statement to poke the right thing into the right lexical scope 17:00
jnthn Macro would be desirable.
Because...what TimToady sai.d
TimToady a BEGIN can make it run at the right time, but we don't have indirection in declarative names 17:01
masak macro add_trig($name) { multi method {{{$name}}}($x) { $x.Num.{{{$name}}} } }
TimToady multi method ::($function)() or some such
masak would that work?
TimToady no
masak suspected that :)
I'm kind of a Perl 6 macro n00b. 17:02
TimToady you're using quasi unquoting gwithout a quasi quote
masak oh.
masak reads up
macro add_trig($name) { quasi { multi method {{{$name}}}($x) { $x.Num.{{{$name}}} } } } 17:03
how about now?
TimToady but it looks like you're trying to do an unhygienic macro anyway with text substitution
masak that sounds uncomfortably accurate :) 17:04
TimToady I think quasi unquotes only work where certain grammatical things are expected, and a name may not be one of them
masak so, is there no good way to do this, or have I just not stumbled upon it yet?
TimToady at a minimum, you might have to convert $name into something different for the one spot than the other
deflongname vs methodname, or some such 17:05
whatever it is that the parser expects at that point 17:06
Tene macro statement_control:sym<when>($cond, $body) { quasi { if $_ ~~ {{{ $cond }}} { {{{ $body }}} } } } 17:07
TimToady otoh, if we did have the ::() syntax as a declarative name, then you could just use the macro as a fancy BEGIN
Tene Look, it has a lot of trailing close symbols! It *must* be lisp!