»ö« 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.
xenoterracide privatepaste.com/6952e0c99d looking at starting to implement a DI framework for p6, any thoughts on my syntactic sugar? 00:01
00:05
fribeiro just opened the ticket about the java interface types, let me know if I can help in any way. rt.perl.org/Ticket/Display.html?id=120879 00:28
xenoterracide method delete_key($a --> Int) # what is the behavior of $a --> Int here? 02:41
TimToady --> Int is just the return declaration 02:45
xenoterracide ah, as opposed to writing returns Int 02:47
TimToady --> looks cooler :) 02:48
and it's better to associate the return declaration with the signature, I think 02:49
especially if we get return declarations that can declare a variable
an "out" parameter as it were
these are specced but NYI
xenoterracide hmm 03:08
xenoterracide little less readable if you aren't yet familiar with it. otherwise it's 6 of 1 half dozen of another. 03:20
lue Hey, I found an error in one of the backlinks :) 03:54
dalek ast: 053243e | lue++ | S02-names/is_default.t:
[S02-names] Add missing > to backlink.
03:58
lue wonders if he can use Perl 6's formatting code rules to avoid reinventing the mess of angle counting and the like. 04:13
nope :( 04:20
xenoterracide lue: angle counting? 04:35
lue xenoterracide: Not quitting early on L<The C<say> thing> 04:37
.oO(Come to think of it, I'm not sure that example's even allowed in normal Pod6 code...)
04:39
TimToady as long as you do one-pass parsing correctly, you don't have to count angles, the grammar counts them for you 04:47
lue TimToady: you might want to tell that to Rakudo's pod_formatting_code :P 04:57
xenoterracide is a Set @ or %? (also been poking for Set docs and can't find 'em) 05:05
dalek gs.hs: cbf5153 | (Yoshikuni Jujo)++ | pugs- (5 files):
new exception system
05:09
gs.hs: 9d8b59d | 唐鳳++ | pugs- (5 files):
Merge pull request #28 from YoshikuniJujo/master

new exception system
xenoterracide pokes about trying to figure out how to have an attribute that's a set of type 05:48
what's := ? I believe it's some sort of assignment operator, but it's not documented in operators 05:56
lue xenoterracide: S03:2296 06:21
synopsebot Link: perlcabal.org/syn/S03.html#line_2296
japhb Timbus: Pull request for Net--IRC waiting for you. :-) 06:33
moritz p: say Set.^roles 06:47
camelia rakudo-parrot 53c60c: OUTPUT«(Setty)␤»
moritz p: say Setty.^roles
camelia rakudo-parrot 53c60c: OUTPUT«(Setty)␤»
moritz r: say Set ~~ Positional
camelia rakudo-parrot 53c60c, rakudo-jvm 53c60c: OUTPUT«False␤»
moritz r: say Set ~~ Associative
camelia rakudo-parrot 53c60c, rakudo-jvm 53c60c: OUTPUT«True␤»
xenoterracide is there anything like Moose's handles? for method delegation, rather than hand writing each method? 06:58
moritz yes, there is handles 07:09
r: class A { has $.x handles <sqrt chr> }; say A.new(x => 4).sqrt
camelia rakudo-parrot 53c60c, rakudo-jvm 53c60c: OUTPUT«2␤» 07:10
Timbus a command handler :o oh my, japhb 07:18
preflex Timbus: you have 1 new message. '/msg preflex messages' to read it.
Timbus japhb, just went over the whole change list; love it. and no I would not mind at all if you tried adding concurrency to the bot 07:25
i was planning to make something where you would enqueue events into the main loop. but since perl6 has an exposed 'scheduler' now I'm sure something even better could be done 07:27
japhb Timbus: Oh, excellent, thanks! 07:38
Timbus japhb, np. :) 07:42
Timbus my only requirement is 'make it as simple and cool as possible' 07:42
and make a twitter feed fetcher to prove it works 07:43
:3
japhb *chuckle* 07:47
I'll get right on that. ;-)
*yawn* 07:49
& # Time to trundle off to the land of slumber 07:50
xenoterracide r: class A { has $.x handles get_sqrt => sqrt }; say A.new(x => 4).get_sqrt 08:09
camelia rakudo-parrot 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/P97eOJ0uzl␤Not enough positional parameters passed; got 0 but expected 1␤at /tmp/P97eOJ0uzl:1␤------> ␤» 08:10
..rakudo-jvm 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/JN83YXtM4f␤Not enough positional parameters passed; got 0 but expected 1␤at /tmp/JN83YXtM4f:1␤------> ␤»
xenoterracide r: class A { has $.x handles get_sqrt => 'sqrt' }; say A.new(x => 4).get_sqrt 08:10
camelia rakudo-parrot 53c60c, rakudo-jvm 53c60c: OUTPUT«2␤»
xenoterracide r: class A { has $.x handles get_sqrt => 'sqrt' = 4 }; say A.new.get_sqrt 08:11
camelia rakudo-jvm 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/aA_0DTKWW1␤Cannot modify an immutable value␤at /tmp/aA_0DTKWW1:1␤------> ␤»
..rakudo-parrot 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/7oDV0aHiO1␤Cannot modify an immutable value␤at /tmp/7oDV0aHiO1:1␤------> ␤»
xenoterracide r: class A { has $.x handles ( get_sqrt => 'sqrt' ) = 4 }; say A.new.get_sqrt 08:12
camelia rakudo-parrot 53c60c, rakudo-jvm 53c60c: OUTPUT«2␤»
tadzik xenoterracide: you may want to look at the IoC module 09:32
FROGGS my @lines = "TODO_core_modules.md".IO.slurp.lines.grep(/^'[ ] ' <!before 'todo'>/).map({ /^'[ ] ' (\S+)/; ~$0 }); # I love it :o) 10:37
that will find all module names I am going to stub now, using this file: github.com/rakudo-p5/v5/blob/maste...modules.md 10:38
dagurval FROGGS: Is the plan to port most of those modules to v6? 10:50
FROGGS dagurval: I need to make them available by either porting them, or make them compile 10:55
dagurval: the pragma "if" for example will compile as it is, which is nice :o) 10:56
but I don't know what will work out of the box and what now, since there are too many modules and pragmas
dagurval Neat. Is it preferrable to port them or compile them as is? 10:59
FROGGS I would prefer just to compile them... 11:05
dagurval Makes sense... I was thinking that that's a nice list of porting TODOs if one knew which modules *need* to be ported :). 11:09
FROGGS true :/ 11:10
dagurval And by that, easy to help. I have no idea how to compile a v5 module ;). 11:24
FROGGS it is about trying to run it, and when it explodes you fix the issue :P 11:30
dagurval Ah :P 11:33
dagurval rp: grammar A { rule TOP { <b > }; token b { c } }; 11:34
camelia rakudo-parrot 53c60c: OUTPUT«===SORRY!===␤No such method 'rxtype' for invocant of type 'NQPMu'␤»
dagurval LTA error, or something worse? 11:35
FROGGS dunno if it is supposed to work...
dagurval I'll go for LTA. I'm playing with the examples in the advent calendar. Took me a while to find my mistake of an extra space :). 11:38
dalek kudo-star-daily: 38a7414 | coke++ | log/ (5 files):
today (automated commit)
16:59
rl6-roast-data: 507ffd5 | coke++ | / (5 files):
today (automated commit)
xenoterracide tadzik: oh yeah, I was looking for that... it really is a direct port of Bread::Board... which has been causing me frustration, I suspect due to design. So I'm trying to redesign a bit, and maybe I'll backport to p5 if it pans out 17:24
curious as to why this used exported subroutines when the reason that Moose, and Bread::Board do that is because they want it to /look/ like syntax 17:27
TimToady std: /<b >/ 17:28
camelia std 4731beb: OUTPUT«===SORRY!===␤Null pattern not allowed at /tmp/FSRj79KNbH line 1:␤------> /<b ⏏>/␤Parse failed␤FAILED 00:01 122m␤» 17:29
TimToady std has a better error message there
p: /<b >/
camelia rakudo-parrot 53c60c: OUTPUT«===SORRY!===␤No such method 'rxtype' for invocant of type 'NQPMu'␤»
xenoterracide tadzik: it'll make a nice code reference, even if it's not what I want functionality wise
TimToady so rakudo is still not detecting null regex as well as it could 17:30
dalek ecs: e8781d0 | util++ | S32-setting-library/Str.pod:
[S32/Str] Fixed copy/paste error: s/codes/graphs/;
17:38
arnsholt nqp: /<b >/ 17:40
camelia nqp-moarvm: OUTPUT«Null regex not allowed at line 2, near ">/"␤panic␤»
..nqp-parrot: OUTPUT«Null regex not allowed at line 2, near ">/"␤current instr.: 'panic' pc 15975 (gen/parrot/stage2/NQPHLL.pir:5955) (gen/parrot/stage2/NQPHLL.nqp:426)␤»
..nqp-jvm: OUTPUT«Null regex not allowed at line 2, near ">/"␤ in panic (gen/jvm/stage2/NQPHLL.nqp:379)␤ in throw_null_pattern (gen/jvm/stage2/NQPP6QRegex.nqp:59)␤ in termseq (gen/jvm/stage2/NQPP6QRegex.nqp)␤ in nibbler (gen/jvm/stage2/NQPP6QRegex.nqp:98)␤ in assertion:…»
arnsholt Well, that's weird... 17:41
TimToady I guess we should tell everyone to program in nqp instead of Perl 6... 17:42
arnsholt I just figured it'd be a bug in NQP that propagated to Rakudo 17:43
But apparently not
TimToady heh, moar simply says "Cannot find method 'rxtype'" 17:44
TimToady std: /b|/ 17:48
camelia std 4731beb: OUTPUT«===SORRY!===␤Null pattern not allowed at /tmp/pwAk7Cc1wz line 1:␤------> /b|⏏/␤ expecting any of:␤ quantifier␤ regex_infix␤ sigmaybe␤Parse failed␤FAILED 00:01 122m␤»
TimToady nqp: /b|/
camelia nqp-moarvm: OUTPUT«Unrecognized regex metacharacter | (must be quoted to match literally) at line 2, near "b|/"␤panic␤»
..nqp-parrot: OUTPUT«Unrecognized regex metacharacter | (must be quoted to match literally) at line 2, near "b|/"␤current instr.: 'panic' pc 15975 (gen/parrot/stage2/NQPHLL.pir:5955) (gen/parrot/stage2/NQPHLL.nqp:426)␤»
..nqp-jvm: OUTPUT«Unrecognized regex metacharacter | (must be quoted to match literally) at line 2, near "b|/"␤ in panic (gen/jvm/stage2/NQPHLL.nqp:379)␤ in throw_unrecognized_metachar (gen/jvm/stage2/NQPP6QRegex.nqp:55)␤ in (gen/jvm/stage2/NQPP6QRegex.nqp:108)␤ in nibble…»
TimToady p: /b|/
camelia rakudo-parrot 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/Ofi9YzzaRl␤Unrecognized regex metacharacter | (must be quoted to match literally)␤at /tmp/Ofi9YzzaRl:1␤------> /b|⏏/␤ expecting any of:␤ statement list␤ …»
TimToady wonders if we need a new category, WLTA 17:49
timotimo "way less than awesome"? 17:58
TimToady yeah :) 18:00
TimToady as in, positively misleading 18:00
TimToady or lying through its teeth, in this case 18:00
"whaddya mean, | isn't a regex metachar?!?" 18:01
timotimo i just alerted the people who run the GSM network to the fact that the GSM network is currently not doing any calls apparently 18:57
after that i'll be reachable under the PRL6 vanity :P 18:58
timotimo hm. christmas is practically over, yet nobody is pushing loads of cool rakudo or moarvm commits? :( 19:39
tadzik I suppose everybody's christmasing :) 19:41
timotimo it would appear so
japhb timotimo: Visiting relatives mark it hard to get code written. OTOH, I did manage to get some Net::IRC commits in, so that's something I suppose. :-) 19:44
TimToady has been writing pomes instead 19:47
japhb Odes to a pomegranate? 19:49
timotimo cool :) 19:50
i got tiny spec changes in during my train rides
segomos_ everyone is christmas'd out 19:53
fat dumb happy
TimToady Christmas is going, the goose is getting flat; please take a penny from the old man's hat... 19:55
lue japhb: about your Net::IRC commits, do they fix the issue where /msg bot causes the bot to send the response to itself by default?
japhb I didn't explicitly work on that, but lemme check. 19:57
tadzik I was trying to port my C asteroids to Perl 6:) 19:58
our SDL modules is not in a best shape though :/
TimToady I'll pay you a ha'penny to fix 'em. 19:59
japhb lue: Yeah, looks still broken. I'll add that to my list.
TimToady someone already took the penny from my hat...
lue japhb: here's how I fixed it: github.com/lue/Net--IRC/commit/76c...cbe35fb0aa 20:00
(don't know how different your changes have made fixing this though) 20:01
japhb lue: That toplace logic can be simplified.
lue japhb: I know the code's kinda terrible (I just realized now, for example, that I could've put the ?? !! inside the function too), I just wanted something that worked at the time :P 20:02
japhb Just: method foo($text, $to = $!default_to) ought to work (untested, though) 20:03
timotimo yeah, the right hand side of default values is thunked
japhb I'll clean it up and commit this afternoon. (Must seek lunch soon. :-) 20:04
timotimo hm, do we automatically dethunk that? i think the optimizer should do that
dalek ecs: 4db95fb | finanalyst++ | c (2 files):
revised intros and added content.pod
20:10
ecs: d1322e9 | larry++ | c (2 files):
Merge pull request #62 from finanalyst/master

revised intros and added content.pod
moritz we automatically dethunk literals, or expressions with known compile-time values
TimToady suspects we should remove <prior> from the language 20:22
timotimo i just delivered a capsule manually 20:28
TimToady especially since it's implemented wrong anyway, from the standpoint of implementing the Perl 5 feature of //
in P5 that reuses the regex, not the literal string that was matched 20:29
but it's a really low-wattage feature, and adds an attribute to every P6 cursor 20:30
so I think it's doomed
TimToady the only place R* uses it is in roast 20:32
the "low-wattage" metaphor is problematic, insofar as new, efficient LED lighting is low-wattage 20:33
I need to find a better metaphor for features that aren't worth the overhead
timotimo "low signal"? 20:34
TimToady wimpy features
overspecialized 20:35
too hard to remember for what you get
lue TimToady: I'll support <prior> only if <following> exists as well :P 20:36
TimToady blunderbusses 20:37
"Why do we even have that lever?" 20:39
trinket features 20:40
lue The closest to "low-wattage" would be "low-luminosity", though it's not as catchy. 20:42
TimToady nightlights :) 20:43
lue :D "I have to say I don't care for your proposed new features. Feels like a bunch of nightlights for core Perl 6."
TimToady Christmas tree lights :) 20:44
trinket features seems about the right level of disparagement :)
and kinda fits with the cargoculting meme :) 20:45
lue "trinket features" is way too literal though, not at all like "cargoculting" :)
FROGGS wth, rakudo's module loader preferred .pir files over .pbc files O.o
which makes loading modules like 100 times slower 20:46
lue FROGGS: uhh... reverse alphabetical order?
TimToady low-flying aircraft--very, very, low
FROGGS lue: no
lue: I'll commit in a minute (or two)
lue TimToady: going off the LHF metaphor, I can think of "squashed fruit", "inedible fruit", and "fruitless tree". 20:48
TimToady It's a dessert wax AND a floor topping! 20:50
TimToady buggy whips 20:51
lue (I still kinda like nightlight, fwiw. It's somewhat of a process to get in place, offers little reward, and most people get on fine without it in the first place.) 20:53
timotimo FROGGS: we're getting a huge speed boost for loading modules? cool 20:54
TimToady dimglow features
FROGGS timotimo: only if .pir files are present too
lue
.oO(Hopefully we can figure out a new metaphor soon; we need to make that remove <prior> commit! "[S05] <prior> removed\n\nRemoved because it's quite the {metaphor}")
20:57
low-lux has a nice ring to it methinks. 20:58
timotimo mhm
japhb
.oO( Not enough soap )
21:04
japhb Timbus: Cleaned up version of lue's Net--IRC patch sent to you in PR. 21:34
lue japhb++ for Net::IRC improvements :)
japhb Timbus: Also, in thinking about concurrency, I'm thinking $.conn.get is essentially unchanged, but the main loop {} just start{}s a task immediately upon receiving a new line. Output gets fed through a channel, so as to safely serialize writes to the socket. The sticking point is updates to state -- I'm thinking it's time to follow your conjecture comment and turn %.state into a simple class that serializes updates to the global bot state. 21:37
japhb lue: After we get Net::IRC rocking, then we just need some good email code, and we'll be rocking the 90's. ;-) 21:38
lue :)
japhb lue: FWIW, I like 'low-lux feature' 21:40
lue 2/3 of each word alliterates with the other, I think that's why it sounds nice :) 21:40
japhb And concision FTW 21:41
FROGGS damn, my patch does break something... :/ 21:49
japhb Timbus: Thinking more about concurrency, farther down the line it might also be useful to support multiple connections; turn each into a channel and select between them. The tricky part will be clearing out the various places in the code that assume there is only one connection (and thus one active nick, and so on).
moritz or you could just instantiate Net::IRC::Bot twice 21:50
japhb moritz: As long as you have some way to communicate between them. You want a factbot to learn facts from both networks, for example. 21:50
moritz give them the same "db" handle *shrug* 21:52
japhb moritz: Sure, that may handle the easy cases. 21:53
japhb wonders if DBIish is thread-safe (not thread-aware, mind you, just not thread-dangerous)
moritz has no idea 21:58
lue japhb: so far the general answer seems to be "pray it doesn't break" :) 22:06
[Coke] ~~ 22:11
[Coke] preflex: seen au? 22:33
preflex au was last seen on #perl6 307 days, 3 hours, 35 minutes and 19 seconds ago, saying: pity that Unicode terminals doesn't support strike-through very well :)
xenoterracide wonders if the language could attempt auto importing... e.g. class Foo does Bar { # would attempt a use Bar; under the hood if it wasn't already loaded 22:47
FROGGS xenoterracide: that was discussed before...
it ended with a "hmmm, maybe" or so :o) 22:48
xenoterracide seems like one of the most useful ends to boilerplate, esp with imports being lexically scoped... (shuts up since I'm unlikely to put up) 22:49
xenoterracide is a - illegal in perl5 sub names? (just noticed a - in a sub name in p5 and realizing that I'm not sure I've ever seen a - in a sub name) 22:53
geekosaur it's illegal in sub names, yes 22:54
FROGGS ./p5 'sub foo-bar { };'
Perl5: Illegal declaration of subroutine main::foo at -e line 1.
xenoterracide huh, I wonder if having it allowed in p6 is an improvement over _ 23:04
but core p6 still uses the _ if memory serves, which means that the _ as convention shall probably remain 23:05
lue xenoterracide: not sure there's much of a convention, except if you feel like holding shift to press that key on your keyboard :) 23:08
timotimo xenoterracide: don't forget to teach panda and ufo to recognize those auto-imports for ordering the build files by dependency? :P 23:09
actually 23:21
can we just get a mode for rakudo, like a compiler flag, that inspects the code for imports?
just something a bit more robust than grepping each line for "begins with whitespace, then use or require"
would be best if it could "not run BEGIN code from the given file", but that's possibly kind of hard 23:22
lue I personally think we need more reasons before implementing implicit loading. 23:32
feels like a nightlight/dimglow/low-lux feature to me :) 23:40
xenoterracide reduction of boilerplate is a good thing, IMO, why type a module name twice if you really don't need to 23:42
note: I tend to do a lot of things in p5 that are centered around me not typing class names twice 23:43
such as load_class('Foo::Bar')->new (or now use_module because Class::Load will no longer be free Moose dep) 23:44
lue xenoterracide: I just don't see how enabling magic implicit loading for a subset of possible modules is all that helpful, esp. given the mess of loading issues I'm seeing in my head, such as: 23:48
1) If someone has explicitly use'd a module, don't load it again.
xenoterracide is that what NC or whatever p6 has is for? 23:49
wtf
% INC
lol
lue 2) If module Foo::Bar defines a class Baz, how to prevent loading Baz.pm6
xenoterracide it should check if it's already loaded, which is what % INC (or the p6 equiv ) is for 23:50
I assume there's some way of keeping track
FROGGS I dont think 1) counts, because you never load a module twice (as long as you dont request another name/auth/ver)
lue 3) Local class Bar defined in same compilation unit, but after use (class Foo is Bar { ... }; class Bar { ... }). don't load Bar.pm6
FROGGS: with implicit loading, use Foo; class Bar is Foo { } *could* try to load the module twice 23:51
FROGGS lue: not according to our module loader :o)
xenoterracide what happens if I have 2 methods that try to require Foo?
different ones
because I don't know if it's yet loaded at that point 23:52
the behavior would be the same
FROGGS xenoterracide: it loads and compiles it only once
the filename of the module is the key in a hash 23:53
lue %INC is listed in S28, but with a "maybe" attached to it.
FROGGS so if you do: require "./foo.pm"; require "././foo.pm", you would load it twice
lue FROGGS: alright, so twice-loading isn't an issue. Thanks for letting me know :) 23:54
But there's still the issue of wayward module loading. I don't like the sound of examining the entire compilation unit and everything it has access to just to see if we can try to implicitly load a module.
FROGGS for 3), I think you need to stub Bar { } anyway
lue r: class Foo is Bar { }; class Bar { }; say "alive!"; 23:55
camelia rakudo-jvm 53c60c: OUTPUT«(timeout)» 23:55
..rakudo-parrot 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/9eyt2vsFrs␤'Foo' cannot inherit from 'Bar' because it is unknown.␤Did you mean 'Bag'?␤␤at /tmp/9eyt2vsFrs:1␤------> ␤»
lue ah, OK :)
FROGGS unless if you had a "use Bar" before :o)
FROGGS but yeah, we can supply name/auth/ver to a use statement, but not to a trait... so it would not be that powerful when this feature might become important in future 23:56
lue My main point is that a very small number of modules will store a class Foo::Bar in Foo/Bar.pm6 , and that there's a high risk of some *other* module storing their stuff in Foo/Bar.pm6, and it's general bad practice to use stuff that doesn't exist and expect the compiler to fix it for you. 23:57
r: $a = 42; say $a;
camelia rakudo-jvm 53c60c: OUTPUT«(timeout)»
..rakudo-parrot 53c60c: OUTPUT«===SORRY!=== Error while compiling /tmp/ClYnGU625K␤Variable '$a' is not declared␤at /tmp/ClYnGU625K:1␤------> $a⏏ = 42; say $a;␤ expecting any of:␤ postfix␤»
lue i.e., a low-lux feature :) 23:58
FROGGS lue: I have a patch for your $a... gist.github.com/FROGGS/6f8989611659551dae1f
:o)
xenoterracide lue: I'm not convinced that's true, in p5 I believe it's generally agreed that multiple packages per file is generally a bad idea... also one could create a loaded modules hash... so if it's htere...