Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-12-21

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:04 [Coke] Am I the only one who heard that read in the style of monty python?
00:12 lichtkind good night
00:12 kthakore good night
00:12 masak good ♞
00:13 lichtkind hope you can use this tommorrow https://gist.github.com/4341223
00:23 LordVorp joined #perl6
00:25 kthakore Hello I am trying to understand a bit of teh reasoning being Perl6 syntax.
00:25 kthakore when I use for @foo -> $bar { }
00:26 japhb_ Erg!  I am really tired of Bug #115390!
00:26 kthakore is that running as a for function?
00:26 japhb_ kthakore, -> $arg1, $arg2 { }  is a "pointy block"
00:27 japhb_ It takes arguments like a Routine, but is not quite a full Routine (it is transparent to return, for example)
00:27 japhb_ So essentially you have "for @array &function", or rather "@array.map: &function", because for is really just syntactic sugar for map
00:29 cognominal joined #perl6
00:29 TimToady that's the one syntax in Perl 6 that is allowed to have two terms in a row, by treating -> as an expression terminator
00:31 TimToady we do not (yet) allow users to tap into that syntax by mere function declaration
00:32 dalek perl6-bench: 3d37b43 | (Geoffrey Broadwell)++ | perl5/rc-man-or-boy-test:
00:32 dalek perl6-bench: Make sure perl5/rc-man-or-boy-test is run with 5.010 features enabled
00:32 dalek perl6-bench: review: https://github.com/japhb/pe​rl6-bench/commit/3d37b43c9a
00:32 dalek perl6-bench: 1a6126e | (Geoffrey Broadwell)++ | / (2 files):
00:32 dalek perl6-bench: Build Perlito as a component, and switch to 'nodejs' instead of 'node' to call node_js VM
00:32 dalek perl6-bench: review: https://github.com/japhb/pe​rl6-bench/commit/1a6126e4da
00:33 kthakore cool
00:34 kthakore oh cool
00:35 * kthakore is just reading book a lot
00:35 kthakore thanks
00:50 cognominal joined #perl6
01:03 larks joined #perl6
01:04 slayer101_ joined #perl6
01:06 cognominal joined #perl6
01:12 hypolin joined #perl6
01:14 cognominal_ joined #perl6
01:15 anuby joined #perl6
01:30 cognominal joined #perl6
01:35 cooper joined #perl6
01:35 cooper joined #perl6
01:56 skids joined #perl6
02:58 FROGGS_ joined #perl6
03:07 noggle joined #perl6
03:16 hypolin joined #perl6
03:40 arlinius joined #perl6
04:01 djanatyn joined #perl6
04:14 slayer101_ joined #perl6
04:22 jnthn joined #perl6
04:23 broquaint joined #perl6
04:23 avar joined #perl6
04:23 avar joined #perl6
04:24 bonsaikitten joined #perl6
04:26 Gothmog_ joined #perl6
04:27 bloonix joined #perl6
04:27 _sri joined #perl6
04:28 ilogger2 joined #perl6
04:28 groky joined #perl6
04:30 popl joined #perl6
04:31 mathw joined #perl6
04:32 noggle joined #perl6
04:43 * diakopter waves at jnthn waking up to go to the airport
04:51 MikeFair_ joined #perl6
05:11 benabik joined #perl6
05:16 adu joined #perl6
05:22 SamuraiJack joined #perl6
05:30 telex joined #perl6
05:37 benabik joined #perl6
05:40 rummik joined #perl6
06:26 donghongbo joined #perl6
06:45 donghongbo left #perl6
06:47 kaleem joined #perl6
07:05 sisar joined #perl6
07:08 moritz o\
07:18 sorear \o
07:22 popl ^o
07:22 * popl sucks
07:50 FROGGS_ joined #perl6
08:14 FROGGS does the Perl6::Metamodel::MultiDispatcher.vivify_for method is meant to bring the dispatcher to life? I don't get the sense of "vivify"...
08:15 FROGGS morning all you happy (still living) perl 6 hacker
08:16 brrt joined #perl6
08:17 timotimo oh, yes, what kind of world-ending was that?
08:17 brrt its not done yet
08:17 timotimo i guess the writers decided there was too much still hanging in the air
08:17 timotimo and didn't want it to be a total cliffhanger
08:21 FROGGS maybe the release is just late
08:22 timotimo well, they've had *lots* of time to prepare
08:22 timotimo a few thousand years, isn't that right?
08:24 brrt its the last time i rely on calendar writers for anything
08:29 timotimo no calendar post yet for today?
08:30 FROGGS I heard colomon had one...
08:30 FROGGS it's somewhere in the backlog
08:31 FROGGS ahh, about 10 hours ago he said he has a draft
08:33 kresike joined #perl6
08:33 kresike hello all you happy perl6 people
08:33 brrt hi kresike
08:34 kresike brrt, o/
08:34 timotimo well, there's still lots of time
08:34 Kharec joined #perl6
08:44 nuba joined #perl6
08:46 Timbus joined #perl6
08:46 sahadev joined #perl6
08:46 sivoais joined #perl6
08:46 betterworld joined #perl6
08:46 Tene joined #perl6
08:46 ashleydev joined #perl6
08:46 rjbs joined #perl6
08:46 sunnavy joined #perl6
08:58 FROGGS jnthn: you remember the trait_mod:<is> import problem if we import two of them from different modules?
08:59 FROGGS jnthn: I might know the solution and I'd like to have a comment:
08:59 FROGGS instead of importing the trait_mod to our lexpad directly, we should instead add a proto and the two trait_mods as dispatchers, right?
09:03 moritz erm, isn't the proto a dispatcher?
09:03 moritz I'd rephrase
09:03 moritz add a proto, and add the candidates from both to-be-imported trait_mod:<is> to the new proto
09:04 moritz and make sure not to add the same thing twice over two routes
09:04 moritz (not that I'm jnthn or so :-)
09:07 hoelzro morning #perl6
09:10 moritz \o hoelzro
09:13 FROGGS thanks moritz
09:14 FROGGS so I'm not on the wood way *gg*
09:15 bapa joined #perl6
09:17 moritz FROGGS: I don't think that idiom works in English :-)
09:17 moritz phenny: "Holzweg"?
09:17 phenny moritz: "Holzweg" (de to en, translate.google.com)
09:18 moritz "auf dem Holzweg sein" - "to be on the wrong track", blind alley, whatever
09:18 FROGGS was a joke actually
09:21 moritz I know, just rambling for the benefit of our non-German speakers
09:26 FROGGS r: use Test; say Test.WHO
09:26 p6eval rakudo 55dbc0: OUTPUT«("EXPORT" => EXPORT).hash␤»
09:26 FROGGS r: use Test; say Test::EXPORT.WHO
09:26 p6eval rakudo 55dbc0: OUTPUT«("ALL" => ALL, "DEFAULT" => DEFAULT).hash␤»
09:26 FROGGS r: use Test; say Test::EXPORT::ALL.WHO
09:26 p6eval rakudo 55dbc0: OUTPUT«("\&plan" => sub plan(Mu ) { ... }, "\&pass" => sub pass(Mu ) { ... }, "\&ok" => sub ok(Mu ) { ... }, "\&nok" => sub nok(Mu ) { ... }, "\&is" => sub is(Mu ) { ... }, "\&isnt" => sub isnt(Mu ) { ... }, "\&is_approx" => sub is_approx(Mu ) { ... }, "\&todo" => sub tod…
09:26 FROGGS hmmm
09:27 FROGGS moritz: is there a module/grammar installed that has multis?
09:28 FROGGS ohh, Test.plan() is a multi
09:32 bapa joined #perl6
09:41 Psyche^ joined #perl6
09:43 hoelzro how do src/stage* relate to each other in NQP? I'm guessing that stage0 is bundled with NQP, and is used to compile NQP itself into stage1?
09:45 bapa joined #perl6
09:45 moritz correct
09:45 moritz and then stage1 compiles the sources into stage2
09:45 moritz which is the compiler we install
09:46 hoelzro moritz: the same sources that stage0 compiles into stage1?
09:46 moritz hoelzro: yes, there's only one set of sources for nqp
09:46 hoelzro I figured; just checking =)
09:46 moritz and 'make bootstrap-files' copies the stage2 files into stage0
09:47 dakkar joined #perl6
09:47 hoelzro ths is probably a stupid question, but why do you have to compile stage1 into stage2, instead of just using stage1?
09:49 sdo joined #perl6
09:49 sdo happy birthday perl
09:50 moritz hoelzro: it's not stupid at all, and I'm not sure about the answer
09:50 moritz hoelzro: I think it's a kind of extra test
09:50 hoelzro I see
09:51 moritz compiling NQP itself is a better test than running the nqp tests (which aren't nearly as comprehensive as Perl 6 test suite)
09:56 moritz there could also be some bootstrap problems when not having enough stages; I'm not sure about that one though
09:57 SmokeMachine joined #perl6
09:59 hoelzro well, I think GCC does that; it uses a bootstrap compiler to build itself, and then it uses the fresh compiler to build itself once again
09:59 hoelzro probably to make sure new optimizations are present, or something
10:00 moritz GCC also has a build command which makes a binary comparison of the results of the different bootstrapping changes
10:01 moritz NQP can't do that, because it generates identifiers that have timestamps attached
10:01 hoelzro ah ha
10:01 moritz so the results will never be binary identical
10:06 bbkr__ \o/ Warszawa release
10:12 hoelzro so what exactly does "pir::compreg__Ps('QAST').post($source)" do? something like create a new QAST object and assign $source to the post attribute?
10:13 timotimo i'm trying to use jnthns optimiser transformation code, but it doesn't seem to register ntthe nqp compilr
10:13 timotimo i don't know how to work this
10:13 timotimo also my ssh is laggy like hell :|
10:13 timotimo i just perl Configure.pl --gen-nqp=the-correct-commit and it seems to have worked. then i makee'd rakudo and make installed it
10:13 timotimo what else would i have to do?
10:14 moritz hoelzro: parrot has a global registry for compilers
10:14 hoelzro so 'QAST' is a compiler object name?
10:14 moritz hoelzro: and pir::compreg__Ps($some_string) gets the compiler registered for $some_string
10:14 moritz right
10:14 moritz and then .post($source) just calls the .post method on it
10:14 hoelzro oh, ok!
10:15 moritz timotimo: that should be enough
10:15 hoelzro moritz: thanks for walking me through this =)
10:15 moritz you're welcome
10:16 timotimo oh, excuse me, i meant to say: pir::load_language__Os didn't work
10:16 timotimo it  compreg does work
10:16 fgomez joined #perl6
10:16 timotimo the argument to load_language is NQP, is that correct? or maybe it sokuld be nqp?
10:16 moritz probably same case as compreg
10:17 moritz but iirc the install paths need some adjustment for load_language to work
10:18 timotimo how it works with nqp instead of NQP,, cool!
10:18 timotimo now let's transform some QASTs :)
10:19 fhelmberger joined #perl6
10:20 timotimo i would love multiline editing in perl6 :~
10:20 timotimo i mean in the default rakudo interpreter
10:32 bowtie joined #perl6
10:33 moritz timotimo: that's a hard one to crack
10:37 rindolf joined #perl6
10:37 bbkr__ LWP::Simple fails almost every test with "could not parse headers" on latest Rakudo release
10:38 moritz last I looked, LWP::Simple fetched too little data
10:39 moritz so it tries to parse the headers, but hasn't received them all
10:39 moritz so it complains that the headers are incomplete
10:39 timotimo i've copypasted the "visit node" method from Optimizer.pm to get a feel for what the astlooks like for simple cases (code: http://sprunge.us/CfOC ) but i get a surprising error message: Error while compiling block : Can only use get_how on a SixModelObject
10:40 timotimo the lowest line on the stack trace is "in any as_post at src/stage2/QAST.nqp:2189"
10:41 arnsholt timotimo: Sounds like you somehow get a native object passed into your code
10:41 moritz which is weird, considering that the qast tree isn't changed at all
10:45 timotimo yeah, and it's nqp code, too :|
10:46 GlitchMr joined #perl6
10:49 timotimo if i put all the things into the sub itself, it works
10:49 timotimo oh, perhaps i know what i did wrong
10:49 timotimo the way the transform sub is called isn't by name
10:49 timotimo so probably relies on the order of subs in the NQPCODE below
10:56 timotimo that seems to also mean i can't call transform from within transform :(
10:57 timotimo makes it kind of hard to experiment properly without recursion - don't really want to implement my own stack. then again, i *could*
11:01 noggle_ joined #perl6
11:06 timotimo this is all less obvious than i thought it would be, but if seen as a puzzle, i guess it's kind of fun :)
11:10 timotimo r: sub any($x, $y) { say "test"; } say any(1, 2) + 5;
11:10 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/GKnFRiiSde:1â�¤------> [32msub any($x, $y) { say "test"; } [33mâ��[31msay any(1, 2) + 5;[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        statement endâ�¤     …
11:10 FROGGS it's all fun in case you make at least a tiny progress within hours... I lost the fun a bit hunting a bug for ~25 hours.... now I try again and I see clearer now
11:10 timotimo r: sub any($x, $y) { say "test"; }; say any(1, 2) + 5;
11:10 p6eval rakudo 55dbc0: OUTPUT«test␤6␤»
11:10 FROGGS r: say "hello".Int
11:10 p6eval rakudo 55dbc0: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏hello' (indicated by ⏏)␤  in method Int at src/gen/CORE.setting:10298␤  in method Int at src/gen/CORE.setting:3803␤  in block  at /tmp/Hxs3YYiRQ1:1␤␤»
11:10 FROGGS r: say "hello".Num
11:10 p6eval rakudo 55dbc0: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏hello' (indicated by ⏏)␤  in method Num at src/gen/CORE.setting:10299␤  in method Num at src/gen/CORE.setting:3804␤  in block  at /tmp/a9B7ftCPhZ:1␤␤»
11:10 FROGGS r: say "hello".Bool
11:10 p6eval rakudo 55dbc0: OUTPUT«True␤»
11:10 FROGGS r: say "hello".Bool + 1
11:11 p6eval rakudo 55dbc0: OUTPUT«2␤»
11:11 timotimo so, in the optimizer, how do i get to figure out if the call to any or | or & or all will give me a junction?
11:12 moritz I guess you need to resolve the actual candidate (if it's not done already), and see if it has a return type annotation
11:12 moritz (add one if it's missing)
11:12 kresike r: my $a = eval { say "a"; }; say $a;
11:12 p6eval rakudo 55dbc0: OUTPUT«Cannot call 'eval'; none of these signatures match:␤:(Str $code, :lang(:$lang) = { ... }, PseudoStash :context(:$context))␤␤  in block  at /tmp/d3OQZ1Eizp:1␤␤»
11:13 timotimo moritz: do you mean add it to the builtin & and | infix operators?
11:13 moritz yes
11:14 GlitchMr perl6: if False { say "Hello, world!" }
11:14 p6eval rakudo 55dbc0, niecza v24-12-g8e50362:  ( no output )
11:14 timotimo it seems like self.find_lexical can do most of the work for me in the optimiser
11:14 GlitchMr It's compile time ERROR in Java
11:15 moritz timotimo: note that the optimizer already resolves some multis
11:15 FROGGS someone should glue the java thingy to p6eval
11:16 timotimo in this case i don't want to simply inline, i'd like to rewrite the tree itself to move the junction outward
11:16 moritz I didn't say "inline", I said "resolve"
11:16 moritz well, it might inline too
11:16 moritz you can control that with the number in --optimize=1 etc.
11:17 moritz wait, does your code run before or after the rakudo optimizer?
11:24 sisar joined #perl6
11:27 timotimo i've reached the land of a thousand tunnels. also: bad reception
11:28 timotimo that's a good question. i'm not sure.
11:28 timotimo i would think after
11:32 SamuraiJack joined #perl6
11:38 Chillance joined #perl6
11:50 timotimo been able to recurse using subs in subs. got a pretty-printed graph now. it will only get more complicated now :|
11:55 moritz timotimo: have you discovered the QAST dumper already?
11:56 moritz print($qast.dump)
12:00 timotimo oooh, that's neat
12:00 timotimo but since i have to traverse it anyway, i'll keep the visit method i "built" anyway
12:01 moritz I implemented QAST::Node.dump for debugging the sink context stuff
12:04 masak g'day, #perl6.
12:05 tadzik heey masak
12:05 moritz \o
12:05 moritz masak++ # release
12:05 timotimo so, i can probably find the method infix:<|> or infix:<&> from the lexical scope easily, but even if i can figure out that the return type is Junction, i probably can't just call it at compile time, no?
12:06 timotimo but that would be necessary to programmatically turn 1 | 2 == 1 into 1 == 1 or 2 == 1
12:06 moritz if the arguments are know at compile time, you can
12:06 moritz otherwise not
12:06 timotimo oh, well that's nice :)
12:06 brrt joined #perl6
12:07 moritz "known at compile time" means you have to know their values
12:07 moritz ie won't work for   my $x = 3;   if $x == 42|5 { }
12:07 timotimo so if the & or | has only Wants and for each the compile time value is known (which is the case for my first example here), i can ... just call it?
12:07 moritz erm wait, in my example you can, yes
12:08 timotimo ah, so optimising $x & $y == 5 won't work like that?
12:08 moritz correct
12:08 timotimo ah, i can, well that's great :)
12:08 moritz for that, you'd have to identify the &infix:<&> as the one from the setting
12:08 timotimo is there an easy way to do that?
12:09 moritz and duplicate its functiality in the compiler by generating different code for that
12:09 moritz well, I can think of two ways
12:09 timotimo that's what i wanted to do, yes
12:09 moritz the first is to write a special trait, apply it to the operator, and check it from the compiler
12:09 moritz and the second is to look up the symbol in CORE::
12:10 moritz r: say &CORE::infix:<&>
12:10 p6eval rakudo 55dbc0: OUTPUT«sub+{precedence} infix:<&>(*@values) { ... }␤»
12:10 timotimo is the code to look it up the same in nqp?
12:10 timotimo nqp: say &CORE::infix:<&>
12:10 p6eval nqp: OUTPUT«Confused at line 2, near "say &CORE:"␤current instr.: 'panic' pc 13221 (src/stage2/gen/NQPHLL.pir:4682) (src/stage2/gen/NQPHLL.pm:328)␤»
12:10 timotimo right
12:10 moritz no, you have to find out what it compiles to
12:10 timotimo nqp: say(&CORE::infix:<&>)
12:11 p6eval nqp: OUTPUT«Confused at line 2, near "say(&CORE:"␤current instr.: 'panic' pc 13221 (src/stage2/gen/NQPHLL.pir:4682) (src/stage2/gen/NQPHLL.pm:328)␤»
12:11 timotimo i suppose the trait thing would be simpler.
12:11 moritz perl6 --target=past -e '&CORE::infix:<&>'
12:12 timotimo would it be enough to just do has $!is_trivial_implementation; and expose that through a getter? or is there a mechanism that's not visible to the user of the rakudo interpreter and such?
12:14 moritz doesn't even need to be an attribute
12:14 moritz it can just mix in the role { method IS_DEFAULT_IMPLEMENTATION { True } }  or so
12:14 timotimo that seems good
12:15 timotimo and then i'd look up i the object has that method and call it to find out if it returns true?
12:15 moritz and then you write  if nqp::can($code, 'IS_DEFAULT_IMPLEMENTATION') && $code.IS_DEFAULT_IMPLEMENTATION { ... }
12:15 timotimo oh, clever :)
12:23 FROGGS moritz: in order to add a despatchee to a proto I need it's code, how do I get the code from a symbol name? I'm iterating through $package.WHO...
12:24 FROGGS ... in Perl6/World.pm that is
12:24 brrt left #perl6
12:24 masak colomon++'s advent post for today isn't scheduled.
12:24 masak is that intentional?
12:24 colomon masak: I'm proof-reading it right now, will post as soon as I'm done.
12:25 masak oki nice
12:25 masak just checking :)
12:25 colomon posted
12:26 masak \o/
12:26 masak colomon++
12:26 moritz colomon++
12:26 colomon now to make improvements to the testing script.  :)
12:27 timotimo building a new rakudo/ a new setting is slow on this laptop anyway, but on battery ... oh my :|
12:27 masak anyone mind if I take https://gist.github.com/4341223 , make a draft out of it in Wordpress, and edit it heavily?
12:27 moritz FROGGS: I... think you have it already
12:28 masak it will be published under my name. if I could, I would publish it under lichtkind's name. but I can always make  "Guest post by..." banner or something.
12:28 moritz or we can just invite lichtkind to the calendar, and have him publish it
12:28 moritz (but please heavily edit it first anyway)
12:29 GlitchMr Rakudo Warszawa :-)
12:30 masak moritz: right. question is, should I do the heavy editing in a gist or in Wordpress?
12:31 masak why does "the wrong track" translate to "the wood way" in German? :)
12:31 moritz FROGGS: the .WHO is a hash. The keys are the names of the symbols, and the values are the symbols (e.g. Sub objects) themselves
12:31 moritz masak: whatever you prefer
12:31 FROGGS hmmm
12:32 masak moritz: I think I *prefer* to do it in Wordpress, because then I have visual feedback as to how the post will end up looking.
12:32 * masak makes it so
12:32 moritz masak: re Holzweg/wood way: http://de.wikipedia.org/wiki/Auf_dem_Holzweg_sein
12:32 masak excellent. thank you :)
12:33 FROGGS masak: it is about being on a track that is not built completely
12:33 masak my heavy editing starts with renaming the article... from "Parsing an IP" to "Day 22 - Parsing an IP address".
12:33 moritz or maybe IPv4 address, unless he covers IPv6 too
12:34 masak he doesn't. good point.
12:35 masak I'm confused by the reference "...relevant even in Redmond" in the beginning of the post. does this refer to any particular Microsoft product famously incorporating Perl 5 regexes?
12:35 timotimo i think i may have made "make" run an endless loop when trying to compile my change to the junction class :|
12:36 moritz what did you change? just the trait?
12:37 timotimo yes, but i think i did it wrong
12:37 moritz did you test it outside the setting first?
12:37 moritz that's how I go about such stuff
12:38 moritz i.e. write the trait in a normal .pl file, and apply it to a new operator in there
12:39 timotimo i'm doing that now. i went to the toilet in the mean time
12:39 FROGGS moar details please^^
12:39 FROGGS :P
12:39 moritz r: multi sub trait_mod:<is>(Routine $r, :$DEFAULT_IMPLEMENTATION!) { $r does role { method IS_DEFAULT_IMPLEMENTATION() { True } } }; multi f() is DEFAULT_IMPLEMENTATION { }; say &f.?IS_DEFAULT_IMPLEMENTATION
12:39 p6eval rakudo 55dbc0: OUTPUT«Nil␤»
12:40 masak I see that C# has regular expressions. maybe that's what lichtkind is referring to.
12:40 masak does VB have regular expression support? :)
12:40 moritz r: multi sub trait_mod:<is>(Routine:D $r, :$DEFAULT_IMPLEMENTATION!) { say "applying trait"; $r does role { method IS_DEFAULT_IMPLEMENTATION() { True } }; 0 }; multi f() is DEFAULT_IMPLEMENTATION { }; say &f.?IS_DEFAULT_IMPLEMENTATION
12:40 p6eval rakudo 55dbc0: OUTPUT«applying trait␤Nil␤»
12:40 tadzik I think it does
12:40 FROGGS masak: it has
12:40 tadzik (VB)
12:40 moritz did I misspell it?
12:41 moritz r: multi sub trait_mod:<is>(Routine:D $r, :$DEFAULT_IMPLEMENTATION!) { say "applying trait"; $r does role { method IS_DEFAULT_IMPLEMENTATION() { True } }; 0 }; multi f() is DEFAULT_IMPLEMENTATION { }; say &f.?IS_DEFAULT_IMPLEMENTATION
12:41 p6eval rakudo 55dbc0: OUTPUT«applying trait␤Nil␤»
12:41 moritz r: multi sub trait_mod:<is>(Routine:D $r, :$DEFAULT_IMPLEMENTATION!) { say "applying trait"; $r does role { method IS_DEFAULT_IMPLEMENTATION() { True } }; 0 }; sub f() is DEFAULT_IMPLEMENTATION { }; say &f.?IS_DEFAULT_IMPLEMENTATION
12:41 p6eval rakudo 55dbc0: OUTPUT«applying trait␤True␤»
12:41 moritz ah
12:42 moritz when it's a multi, the role is only mixed into the candidate, but &f is the proto
12:42 moritz r: multi sub trait_mod:<is>(Routine:D $r, :$DEFAULT_IMPLEMENTATION!) { say "applying trait"; $r does role { method IS_DEFAULT_IMPLEMENTATION() { True } }; 0 }; multi f() is DEFAULT_IMPLEMENTATION { }; say &f.candidates>>.?IS_DEFAULT_IMPLEMENTATION
12:42 p6eval rakudo 55dbc0: OUTPUT«applying trait␤True␤»
12:42 moritz there you go.
12:43 moritz r: proto f(Int $x) {*}; multi f($) { say 'default'  }; f 'foo'
12:43 p6eval rakudo 55dbc0: OUTPUT«default␤»
12:43 moritz bug!
12:43 * masak submits rakudobug
12:44 moritz it should check the proto signature, but doesn't
12:45 masak right.
12:45 masak draft is in place.
12:45 masak saved but not scheduled yet.
12:45 masak will start heavy editing now.
12:48 colomon masak++
12:49 * colomon just finally got around to running the (improved!) testing script on the Collatz scripts under Niecza, and discovered one of them didn't actually work there.  All fixed now, with an updated timings table.
12:59 masak did Perl 5 bring regexes to regular programming to any significant degree? surely it was in sed and ack way before that.
12:59 masak I guess Ruby can be said to have regex support *because* Perl 5 has it.
12:59 masak probably Java too, actually.
13:00 masak any other languages you know that have regex support because Perl 5 has it?
13:00 masak oh! JavaScript.
13:00 masak it even has them with the same slash-delimiter syntax.
13:00 moritz aye
13:02 GlitchMr Almost any language has regexpes because of Perl 5.
13:02 rindolf masak: I think in awk regexes are quoted as strings and used by functions (except in case of the line/rule-matchine).
13:02 GlitchMr Perl 5 made regexpes popular.
13:02 masak GlitchMr: yes, but what evidence supports that claim?
13:02 GlitchMr JavaScript specification
13:03 rindolf Java didn't get built-in regex support until JDK-1.4.0
13:03 GlitchMr http://es5.github.com/#x15.10
13:03 masak GlitchMr: I already gave JavaScript as a data point above.
13:03 masak I'm looking for more data points.
13:04 timotimo moritz, i did the trait completely diffeently, just adding a role. i guess ill better copy your code from above
13:04 GlitchMr http://docs.python.org/2/library/re.html
13:04 GlitchMr "This module provides regular expression matching operations similar to those found in Perl."
13:04 timotimo can the trait go into junction.pl?
13:04 GlitchMr Besides, almost any language with regular expressions has lookaheads (?= ) and (?! )
13:05 GlitchMr Those were first in Perl 5.
13:05 GlitchMr Similarly, (?: )
13:05 masak lichtkind: try to avoid phrasings like "that's how it's spelled now", which induces a temporal sequencing between Perl 5 and Perl 6 that does not accord with observable reality. ;)
13:05 Celelibi joined #perl6
13:05 masak GlitchMr: yes, but which languages?
13:05 moritz masak: the term PCRE attests to Perl's influence on regexes
13:05 masak Python too, good.
13:05 Chillance joined #perl6
13:06 GlitchMr Practically anything that was written after Perl had regular expressions.
13:06 masak I'm looking for indirect influences, too. which languages/technologies use PCRE, then?
13:06 FROGGS PHP
13:06 masak ooh, yes.
13:06 masak FROGGS++
13:06 GlitchMr PCRE is used in PHP and R.
13:06 moritz UNIX
13:06 moritz man 3 pcre
13:06 GlitchMr That was late addition.
13:07 GlitchMr UNIX doesn't use Perl regular expressions.
13:07 GlitchMr Besides, man 3 pcre isn't even part of UNIX
13:07 GlitchMr It's part of PCRE library
13:10 MayDaniel joined #perl6
13:10 GlitchMr If you are going to tell me that grep can use --perl-regexp option, this is GNU option, not UNIX.
13:11 masak and GNU is not UNIX ;)
13:11 moritz $ $ apt-cache rdepends libpcre3|wc -l
13:11 moritz 243
13:11 masak moritz: wow :)
13:11 moritz that's just dependencies on one particular implementation
13:12 moritz aaand I think just direct dependencies, not recursive oes
13:12 GlitchMr glitchmr@strawberry ~/Pobrane> apt-cache rdepends libpcre3 | wc -l
13:12 moritz *ones
13:12 masak lichtkind says that regex syntax is "less special", compared to the rest of the language? what does he mean? does he mean that regex syntax is more general than the main slang? because I don't think it is.
13:12 GlitchMr 246
13:12 GlitchMr Interesting
13:12 * masak takes a short walk
13:13 GlitchMr apt-cache rdepends seems to include the programs I don't have installed... makes sense.
13:13 moritz I just tried    aptitude purge libpcre3
13:13 moritz it wants to deintall 722 packages
13:13 masak :D
13:13 moritz *deinstall
13:14 moritz and that's just from the ones I have installed on my desktop
13:14 masak I think what lichtkind wanted to say was either "less special syntax compared to Perl 5's regexes" or "less special compared to all the other changes that happened between Perl 5 and Perl 6".
13:15 masak I don't know which one.
13:15 moritz I guess "more regular than the Perl 5 regexes"
13:15 masak aye.
13:15 masak going with that one.
13:16 GlitchMr https://gist.github.com/4352748
13:16 GlitchMr Remove the system!
13:17 GlitchMr That's like almost every package in my system
13:17 masak ok, so PCRE is important. I get it :)
13:18 masak so far I have Ruby, Python, Java, JavaScript, VB, and PHP among the languages.
13:18 masak still not so many.
13:18 am0c_ joined #perl6
13:18 GlitchMr Does m:P5// in Perl 6 count?
13:19 masak "Before you get scared too much..." -- so, a little bit scared is what we're aiming for here? :P
13:19 masak GlitchMr: oh, you're implying Perl 6 was inspired by Perl 5 regexes? :P
13:19 GlitchMr Also, I think that .NET should be on this list. Both VB.NET and C#.
13:19 masak yes, I guess both m:P5 and the Perl 6 regexes count, in a way.
13:19 * masak takes a short walk
13:20 moritz masak: exim, apache, ngrep, lighttpd, i3-wm, drizzle, nmap, grep, zsh # just a few popular programs that depend on libpcre3
13:21 GlitchMr GNU grep
13:21 GlitchMr The UNIX grep doesn't use PCRE
13:21 GlitchMr GNU grep depends on PCRE in only one specific case - when using --perl-regexp option.
13:21 moritz what is "The UNIX grep" exactly?
13:22 GlitchMr It's grep in UNIX
13:22 tadzik what's "UNIX"?
13:22 GlitchMr http://duckduckgo.com/?q=UNIX
13:22 moritz in which UNIX?
13:22 GlitchMr That's interesting question...
13:23 tadzik UNIX is a trademark of AT&T or something, I don't think there even is "The UNIX" which is used anywhere
13:23 moritz just like there's no "the C compiler" or "the shell" or "the food"
13:24 GlitchMr But whatever UNIX it would be, Linux is not UNIX.
13:24 moritz why not? because there's no UNIX in the name?
13:24 tadzik no, because that's what the name says :P
13:24 moritz I'd say linux is a UNIX flavor, just as gcc is a flavor of C compiler
13:24 * cedrvint thought Linux was short for "Le Unix" :)
13:25 tadzik :D
13:25 FROGGS UNIX is a brand, Unix is not
13:25 GlitchMr Linux isn't POSIX compatible.
13:25 moritz it's not?
13:25 tadzik news
13:26 moritz https://en.wikipedia.org/wiki/POSIX lists GNU/Linux als "Mostly compliant"
13:26 FROGGS BSD's and Mac OS X are Unixes, linux is not
13:26 FROGGS it's just System V compatible
13:26 moritz so, what does a system need to be to be a UNIX?
13:26 moritz erm sorry, a Unix
13:27 tadzik I think an appropriate anwser is "who cares?" :P
13:27 FROGGS it needs to have parts of the original kernel
13:27 cedrvint tadzik++
13:27 tadzik does it have cat and grep? Then it's unix enough for me
13:28 GlitchMr The problem is that Linux doesn't have cat or grep.
13:28 cedrvint no cat but a penguin
13:28 * moritz thinks we are far into trolling territory right now
13:28 tadzik yep
13:28 tadzik soon someone will start enforcing the GNU/Linux meme
13:29 GlitchMr GNU/Linux does have cat or grep. Linux doesn't.
13:29 BinGOs Gun-Oo
13:30 flussence .oO( surely you mean GNU/Linux/Xorg/Mozilla/Google/Qt/Oracle/... )
13:30 GlitchMr I don't have Google or Oracle software on my computer.
13:31 flussence I don't have GNU on my router, but it still runs Linux :)
13:31 tadzik "I see that you're using glibc? Yeah! Start calling your system differently from now on!"
13:31 cedrvint GlitchMr: as far as I know Oracle contributes to the Linux kernel (FS).
13:31 GlitchMr Or perhaps you mean Google Linux. You know, http://en.wikipedia.org/wiki​/Android_(operating_system)
13:32 GlitchMr Except Google Linux doesn't have grep. But as far I can see, it does have cat.
13:32 FROGGS I have pics of my cat on my android too
13:33 * FROGGS .oO( and fwiw my cat can grab )
13:37 arafatkamaal joined #perl6
13:38 GlitchMr Also, http://www.johndcook.com/regex.html
13:38 GlitchMr Perl regexpes in Microsoft PowerShell
13:38 FROGGS all .Net things can use regexes
13:38 FROGGS since you just have to load a specific dll, like in VB
13:39 moritz even niecza :-)
13:39 GlitchMr How can I use .NET in Niecza?
13:39 tadzik look at examples
13:39 tadzik there's Gtk tetris and other stuff there
13:40 GlitchMr Just wondering, what is the difference between MAIN.exe and Niecza.exe?
13:40 Woodi_ hey, hey :)
13:41 colomon GlitchMr: basically you just import the symbols and Niecza handles the rest.
13:41 * colomon did not know there was a MAIN.exe
13:41 GlitchMr Let's say I want to use System.Text.RegularExpressions.Regex
13:41 GlitchMr Is it possible in Niecza?
13:42 Woodi_ looks afternoon is nice after sto^H^H^Hworld-end :)
13:44 Woodi_ advocating Perl influence in grep is quite fun :)
13:44 colomon GlitchMr: seriously, look at the examples
13:45 colomon it will probably be faster for you to try it out than it would be to explain it.
13:45 GlitchMr Where can I see some examples?
13:45 colomon niecza/examples/gtk-*
13:47 GlitchMr https://github.com/sorear/niecza/​blob/master/examples/fswatcher.pl
13:47 GlitchMr Oh, that...
13:47 GlitchMr add_ is for += overloading?
13:48 colomon I don't know, that's moderately magical and it's been a long time since i looked at it.
13:49 colomon but I think it's a .NET thing, not Niecza-specific.
13:49 avar joined #perl6
13:49 avar joined #perl6
13:51 colomon yeah, .add_Changed is the same as .Changed +=
13:51 Woodi_ Plan9 probably forked 'regexp' meaning or at least is trying to make step forward from *nix world...  http://swtch.com/~rsc/regexp/regexp1.html  but mayve this link is so 2007's ?
13:52 tadzik plan9 even has its own C standard librar
13:52 GlitchMr niecza> CLR::<System.Text.RegularExpressions​.Regex,System,PublicKeyToken=b77a5c5​61934e089>.new('ab?c').Match('<ac>')
13:52 GlitchMr ac
13:52 GlitchMr Seems to work.
13:53 GlitchMr But why doing this has to be so ugly? PublicKeyToken?
13:53 FROGGS dunno, mabye its a microsoft policy
13:54 FROGGS (doing ugly stuff)
13:55 colomon GlitchMr: if you look at, say, examples/gtk-clock.pl, you'll see how to factor the code so that all the ugliness is contained and the main code looks beautiful.
13:56 GlitchMr Also, how can I use static methods, like Regex.Escape()?
13:57 shlomif joined #perl6
14:05 colomon GlitchMr: I'm not sure.
14:06 colomon might be as simple as <System.Text.RegularExpressions.Regex,Syst​em,PublicKeyToken=b77a5c561934e089>.Escape
14:07 GlitchMr Thanks.
14:07 GlitchMr It worked.
14:07 GlitchMr niecza> CLR::<System.Text.RegularExpressions.Regex,System,​PublicKeyToken=b77a5c561934e089>.Escape('[](){}')
14:07 GlitchMr \[]\(\)\{}
14:08 GlitchMr Interesting. Regex.Escape() doesn't escape ] or }.
14:09 moritz not needed in normal regexes; you only need to escape ] inside charclasses
14:10 Kharec joined #perl6
14:11 GlitchMr Too bad.
14:11 GlitchMr If it would escape ] and -, it would be useful for character classes.
14:12 GlitchMr But perhaps it's good. preg_quote() in PHP also escapes characters like =, !, <, >, :. And doesn't escape -.
14:12 GlitchMr Not surprised. It's PHP. Everything is broken.
14:16 PacoAir joined #perl6
14:23 * [Coke] enjoys a subtitled film on his day off.
14:26 [Coke] (french zombie movie)
14:28 Ulti outside of the core language is there a list of modules that are wanted for perl6?
14:28 Ulti like a list of priority ports from perl5 or something?
14:29 moritz there was an old wiki page with such a list, but I don't know where it is, and neither whether it's up to date
14:29 * masak is back, having stocked his coffers with turkey, chocolate, and stout
14:29 Ulti I'll take a google then :)
14:29 masak this should last me through Christmas :)
14:30 Ulti there is a list on github for most wanted modules
14:30 Ulti probably not going to touch SSL though ;P
14:30 dayangkun joined #perl6
14:33 masak Woodi_: I don't understand -- are you saying http://swtch.com/~rsc/regexp/regexp1.html is related to Plan9 somehow?
14:34 masak by the way, that URL has a long and proud history on this channel :)
14:35 arafatkamaal Hi masak
14:35 arafatkamaal what exactly is the difference between print and .print?
14:36 GlitchMr print is function
14:36 GlitchMr .print is method
14:36 timotimo moritz: you were suggesting to create DEFAULT_IMPLEMENTATION, but i see there's already a role "default" which has a method "default()" that just returns true
14:36 timotimo should i just use that one instead?
14:36 arafatkamaal perl6 -e 'my @a=1...10;for @a {print}'
14:36 arafatkamaal perl6 -e 'my @a=1...10;for @a {.print}'
14:36 arafatkamaal give two different outputs
14:37 FROGGS perl6: my @a=1...10;for @a {.print}
14:37 GlitchMr Unlike Perl 5, print doesn't have default implicit argument.
14:37 p6eval rakudo 55dbc0, niecza v24-12-g8e50362: OUTPUT«12345678910»
14:37 GlitchMr Use .print for that
14:37 FROGGS perl6: my @a=1...10;for @a {print}
14:37 p6eval niecza v24-12-g8e50362: OUTPUT«[31m===[0mSORRY![3​1m===[0mâ�¤â�¤Unsupported use of bare 'print'; in Perl 6 please use .print if you meant $_, or use an explicit invocant or argument at /tmp/jRsfWwoO5T line 1:â�¤------> [32mmy @a=1...10;for @a {print[33mâ��[31m}[0mâ�¤â�¤Unhandled exception: C…
14:37 p6eval ..rakudo 55dbc0:  ( no output )
14:37 FROGGS perl6: my @a=1...10;for @a { print($_) }
14:37 arafatkamaal rakudo allows print
14:37 p6eval rakudo 55dbc0, niecza v24-12-g8e50362: OUTPUT«12345678910»
14:37 arafatkamaal but prints nothing
14:37 GlitchMr arafatkamaal: NYI
14:38 arafatkamaal actually my question was something else
14:38 GlitchMr arafatkamaal: This error is Not Yet Implemented.
14:38 arafatkamaal ok
14:38 arafatkamaal actually I have a lot of Perl 5 habits
14:38 tadzik print() is probably equivalent to print('') at the moment
14:39 GlitchMr Errors are supposed to find every possible Perl 5 habit.
14:39 GlitchMr But sadly, most of those aren't yet implemented in Rakudo.
14:39 arafatkamaal I was expecting while(<FILEHANDLE>){chomp;print} to somehow work
14:39 GlitchMr Nope
14:39 GlitchMr <FILEHANDLE> is one element list.
14:40 GlitchMr Containing 'FILEHANDLE'
14:40 GlitchMr <> is new syntax for qw// (qw still works, by the way).
14:40 masak it's `for $fh.lines { .say }` nowadays :)
14:40 masak arafatkamaal: hi, btw :)
14:40 arafatkamaal :)
14:40 masak r: for lines { my $firstword = .words[0]; say $firstword.uc }
14:40 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing blockâ�¤at /tmp/tC3vGA8Ui_:1â�¤------> [32mrstword = .words[0]; say $firstword.uc }[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        method argumentsâ�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        stat…
14:40 GlitchMr std: while <FILEHANDLE> { chomp; print }
14:40 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0m�Unsupported use of bare 'chomp'; in Perl 6 please use .chomp if you meant $_, or use an explicit invocant or argument at /tmp/jQq0nUonVB line 1:�------> [32mwhile <FILEHANDLE> { chomp[33m�[31m; print }[0m�Unsupported use of bare 'pr…
14:40 masak oh right.
14:41 masak r: for lines() { my $firstword = .words[0]; say $firstword.uc }
14:41 p6eval rakudo 55dbc0: OUTPUT«LAND␤LAND␤LAND␤HEIMAT␤VOLK,␤VIELGERÜHMTES​␤VIELGERÜHMTES␤␤HEISS␤LIEGST␤EINEM␤HAST␤HOHER␤VI​ELGEPRÜFTES␤VIELGEPRÜFTES␤␤MUTIG␤FREI␤ARBEITSFRO​H␤EINIG␤VATERLAND,␤VIELGELIEBTES␤VIELGELIEBTES␤»
14:41 masak (the input is the Austrian national hymn)
14:41 masak r: for lines() { my $firstword = .words[* - 1]; say $firstword.lc }
14:41 p6eval rakudo 55dbc0: OUTPUT«strome,␤dome,␤zukunftsreich!␤söhne​,␤schöne,␤österreich,␤österreich!␤Cannot use negative index -1 on List␤  in method <anon> at src/gen/CORE.setting:10307␤  in  at src/gen/Metamodel.pm:2404␤  in any find_method_fallback at src/gen/Metamodel.pm:2392␤  in any find_met…
14:41 masak heh.
14:41 GlitchMr Cannot use negative index -1 on List
14:41 GlitchMr I guess it's empty line
14:42 arafatkamaal Any reason why implicit printing of $_ was removed from Perl 6? Eg: perl6 -e 'my @a=1...10;for @a {say}' - Doesn't really print $_ automagically?
14:42 masak r: for lines() { next unless .words; my $firstword = .words[* - 1]; say $firstword.lc }
14:42 GlitchMr Because of "␤VIELGERÜHMTES␤␤HEISS"
14:42 p6eval rakudo 55dbc0: OUTPUT«strome,␤dome,␤zukunftsreich!␤söhne,␤schö​ne,␤österreich,␤österreich!␤umstritten␤inmitten​,␤gleich.␤ahnentagen␤getragen,␤österreich,␤öste​rreich!␤zeiten,␤schreiten,␤hoffnungsreich.␤brüd​erchören,␤schwören,␤österreich,␤österreich!␤»…
14:42 GlitchMr arafatkamaal: Because it was too clever.
14:42 masak arafatkamaal: yes, there's a reason.
14:42 GlitchMr But you can use .say;
14:42 GlitchMr It's close enough.
14:42 masak arafatkamaal: we try to eliminate the cases where you have to learn a lot of "special" behavior by heart.
14:42 arafatkamaal ok
14:43 masak arafatkamaal: and some subroutines defaulting to $_ counts as that kind of special behavior.
14:43 masak as GlitchMr points out, we have the more general mechanism of doing .say instead of $_.say now.
14:43 GlitchMr Still, regular expressions default to $_ .
14:43 masak yes, but they're not subs :)
14:44 GlitchMr So you can still use .say if /word/; or something like that.
14:44 masak for loops and given statements also default to $_.
14:44 arafatkamaal perl6 -e 'my @a=1...10;for @a{.say}' doesn't work but...
14:44 hoelzro what exactly is CORE.setting? the default environment that Perl 6 programs run in?
14:44 arafatkamaal perl6 -e 'my @a=1...10;for @a {.say}' does work
14:44 masak arafatkamaal: yes, that's the next thing :)
14:44 GlitchMr arafatkamaal: Whitespace
14:44 masak arafatkamaal: we're a bit more touchy about whitespace in Perl 6.
14:44 GlitchMr $a{'b'} means key 'b' in hash $a.
14:44 masak arafatkamaal: and there are reasons for that as well.
14:45 arafatkamaal :) obviously im missing years of discussions
14:45 masak :)
14:45 GlitchMr Without doing that, omitting parenthesis would be impossible in if.
14:45 masak arafatkamaal: [] alone means array, but [] directly after something means positional indexing.
14:45 masak arafatkamaal: {} alone means block or hash, but {} directly after something means named indexing.
14:46 masak arafatkamaal: <> alone means qw list, but <> directly after something means autoquoted named indexing.
14:46 masak after a while, a pattern emerges: we care a lot about whitespace directly after terms.
14:46 GlitchMr if $a{'a'}{.say} \n { say 42 } # is .say hash element or not...
14:46 masak so Perl 6 simply cares about all of that kind of whitespace.
14:47 masak arafatkamaal: () alone means an isolated statement (not expression, surprisingly), but () dreictly after something means a function call with a parameter list.
14:47 FROGGS so if( 123 ) is a function call
14:47 masak right.
14:48 masak since we care about the whitespace after terms, we could even define infix operators that would otherwise collide with postfix operators, but don't.
14:48 arafatkamaal It was quite surprising for me to learn for @a -> $b is also a function call!
14:48 masak r: sub infix:<++>($l, $r) { $l + $r + 1 }; say 4 ++ 5
14:48 p6eval rakudo 55dbc0: OUTPUT«10␤»
14:48 masak arafatkamaal: in a sense, yes.
14:48 masak we lean quite heavily on blocks. see S04 :)
14:48 arafatkamaal is there a .for?
14:48 masak yes.
14:48 masak it's called .map :P
14:48 arafatkamaal !!!
14:49 masak literally, 'for' and '.map' use the same mechanism in Perl 6.
14:49 GlitchMr https://gist.github.com/4353237
14:49 arafatkamaal So basically it all comes down to reading specs and working out how they all make sense together
14:49 GlitchMr arafatkamaal: consider code I've pasted
14:49 masak it's just that 'for' tends to be eager by default, since it's often used in sink (=void) context. whereas .map tends to be lazy by default, since it often isn't.
14:49 GlitchMr This is one of examples why Perl 6 needs to use whitespace
14:49 masak arafatkamaal: yes, read specs, but keep coming back here and talking about it. it helps.
14:50 masak arafatkamaal: also, keep writing code to try stuff. that really helps.
14:50 arafatkamaal ok
14:50 timotimo what is "is default" used for inside rakudo? can i use it to mark infix:<&> and infix:<|> as the "default implementation"?
14:50 masak arafatkamaal: we're always very grateful when people come back with feedback. so don't be afraid you're bothering the people here with questions. we love it :)
14:50 GlitchMr timotimo: "is default" is used in case more than one multi-dispatch rule matches.
14:51 GlitchMr When used, "is default" is most important method.
14:51 GlitchMr Usually it isn't needed, as Perl 6 tries to be clever about that.
14:51 masak arafatkamaal: oh! and because we care about whitespace after terms, you can do a few cool new things inside qq strings. here, let me demonstrate.
14:51 masak r: my @array = 1, 2, 3, 4; say "The third element is @array[2], you know."
14:51 p6eval rakudo 55dbc0: OUTPUT«The third element is 3, you know.␤»
14:51 masak r: my %hash = foo => 1, bar => 2; say "Go to the bar and get %hash<bar> :)"
14:51 p6eval rakudo 55dbc0: OUTPUT«Go to the bar and get 2 :)␤»
14:51 GlitchMr Actually, this is one of those places where Perl 5 cared about whitespace.
14:52 masak r: say "You can even call &uc('functions')!"
14:52 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in double quotes; couldn't find final '"'â�¤at /tmp/tX0em_ouwH:1â�¤------> [32may "You can even call &uc('functions')!"[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        double quotesâ�¤Â»â€¦
14:52 stopbit joined #perl6
14:52 timotimo in that case, i shall create a trait DEFAULT_IMPLEMENTATION (shouted to convey this is internal magic, of course)
14:52 GlitchMr eval: my @a = 1; print "Hello, $a[0].";
14:52 buubot_backup GlitchMr: Hello, 1.1
14:52 GlitchMr eval: my @a = 1; "Hello, $a[0].";
14:52 buubot_backup GlitchMr: Hello, 1.
14:52 GlitchMr eval: my @a = 1; "Hello, $a [0].";
14:52 buubot_backup GlitchMr: Hello,  [0].
14:52 masak hm, what happened there?
14:52 masak r: say "You can even call &uc('functions')"
14:52 p6eval rakudo 55dbc0: OUTPUT«You can even call FUNCTIONS␤»
14:52 arafatkamaal yes
14:52 * masak submits rakudobug
14:54 GlitchMr I usually use {uc 'functions'} for that, it's less ugly.
14:54 masak sometimes, discussing things uncovers bugs in the implementations ;)
14:54 GlitchMr r: say "You can even call {uc 'functions
14:54 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in single quotes; couldn't find final "'"â�¤at /tmp/v5N6Zk_hCZ:1â�¤------> [32msay "You can even call {uc 'functions[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        argument listâ�¤        prefix or termâ�¤      â€¦
14:54 GlitchMr rn: say "You can even call {uc 'functions'}!"
14:54 p6eval rakudo 55dbc0, niecza v24-12-g8e50362: OUTPUT«You can even call FUNCTIONS!␤»
14:54 masak not as often as before, though.
14:54 masak GlitchMr: yes, whatever floats your goat. actually, I would probably do that too, in most cases.
14:55 masak r: my @a = 1, 2, 3; say "@a[1]!"
14:55 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in double quotes; couldn't find final '"'â�¤at /tmp/tseZolTZEq:1â�¤------> [32mmy @a = 1, 2, 3; say "@a[1]!"[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        double quotesâ�¤Â»
14:55 masak r: my @a = 1, 2, 3; say "@a!"
14:55 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in double quotes; couldn't find final '"'â�¤at /tmp/eXWz0iwRYh:1â�¤------> [32mmy @a = 1, 2, 3; say "@a!"[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        double quotesâ�¤Â»
14:59 timotimo i don't quite know what i'm doing wrong - i added a multi trait_mod:<is>(Routine:D $r, :$DEFAULT_IMPLEMENTATION!) to src/core/traits.pm and put sub infix:<|>(**@values) is DEFAULT_IMPLEMENTATION into src/core/Junction.pm, but i get Could not find sub &infix:<does> when trying to compile it :|
15:00 masak timotimo: could you nopaste your patch?
15:01 timotimo sure
15:01 timotimo http://sprunge.us/NgOc
15:01 timotimo r: say True + True + False
15:01 p6eval rakudo 55dbc0: OUTPUT«2␤»
15:02 timotimo oh, that's neat, i *am* going to be able to turn junctions involving ^ into simpler logical formulas
15:02 arafatkamaal This one is from the spec
15:02 arafatkamaal perl6 -e 'my @primesquares = (do $_ if .is-prime for 1..100) »**» 2;say @primesquares'
15:03 arafatkamaal what exactly is »**» , how do you even type that on a normal keyboard?
15:03 timotimo you can also type >>**>> if you want
15:04 timotimo it applies ** to all list items on the left and the right (kind of like a zip would), but will make the list on the right as long as needed
15:04 timotimo (because on the right side there's only one 2, but you want as many 2s as you have primes on the left)
15:04 arafatkamaal wasn't 'do' supposed to execute any block in a loop only once?
15:05 timotimo isn't that what FIRST is for?
15:05 timotimo r: { FIRST { say "first!"; } say "blubb" } for ^5;
15:05 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/XA_ir6Qago:1â�¤------> [32m{ FIRST { say "first!"; } [33mâ��[31msay "blubb" } for ^5;[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        statement endâ�¤        â€¦
15:05 timotimo r: { FIRST { say "first!"; }; say "blubb" } for ^5;
15:05 p6eval rakudo 55dbc0: OUTPUT«first!␤blubb␤blubb␤blubb␤blubb␤blubb␤»
15:07 timotimo hm, i wonder ...
15:07 arafatkamaal One last question till I get further practice
15:07 timotimo r: { say "a"; FIRST { say "first!"; };} for ^5;
15:07 p6eval rakudo 55dbc0: OUTPUT«first!␤a␤a␤a␤a␤a␤»
15:08 arafatkamaal where exactly can I read about all the .functions eg: .say, .is-prime ?
15:09 timotimo if you want to, you can look into the rakudo source, because rakudo is for the most part implemented in perl6
15:09 timotimo other than that, see the synopses i guess? http://perlcabal.org/syn/
15:10 arafatkamaal thanks
15:10 timotimo you're welcome. and have fun with perl6! :)
15:11 masak arafatkamaal: in Perl 6, 'do' simply turns a statement into an expression.
15:11 masak nothing to do with loops.
15:11 masak arafatkamaal: if you're using vim, you cn type » as Ctrl+K > >
15:12 masak arafatkamaal: if you're on Emacs, there's a wonderful plugin called LEIM with all sorts of nifty input methods.
15:12 masak (if you're on some other editor, get a better editor) :P
15:12 masak arafatkamaal: also check out http://doc.perl6.org/ -- it's not complete, but what's there is really nice.
15:13 masak moritz++
15:13 timotimo or a better keyboard layout. otherwise, most linuces come with proper Xcompose mappings
15:13 masak yeah.
15:13 masak in general, look beyond what keys you have on your keyboard, and let software remap things for you.
15:16 timotimo masak: did you catch my diff? i can't make heads nor tails of it
15:16 masak timotimo: url?
15:16 timotimo http://sprunge.us/NgOc
15:16 * masak looks
15:17 masak $r does role { method DEFAULT_IMPLEMENTATION() { True } }
15:17 masak trivially, this is where the error happens.
15:17 masak but I also don't see why.
15:18 timotimo yeah, in the other is infixes it's done the same way
15:18 timotimo i don't have to stub anything in junction.pm or something?
15:18 masak maybe it's a circularity saw problem.
15:19 masak maybe &infix:<does> isn't defined at the time you try to use it.
15:19 masak jnthn or pmichaud would know, but they're not here right now.
15:20 masak beyond that, I'm a little dismayed at putting a new traid into the setting like that. it looks like a kind of super-default, is that right?
15:20 masak I'm assuming the spec doesn't mention it?
15:20 masak is the intention to start putting DEFAULT_IMPLEMENTATION on anything in the setting from now on?
15:20 masak (because I don't think that's a very good idea)
15:20 masak what's the scope of your change? :)
15:21 timotimo i was hoping there would be a way to make it only visible internally inside rakudo
15:21 timotimo in order to rewrite simple-ish junctions in the AST into logic formulas (think $x & $y == -1|0|1) i need to make sure those & and | are the "default implementation"
15:22 masak sounds like you want AST manipulation on the level of macros, not to change the setting. YMMV.
15:23 timotimo moritz suggested an alternative, which is to lookup if the infix:<&> or what have you comes from ::CORE, but i didn't see how to do that at all
15:23 masak I like that better.
15:23 timotimo the AST would have been manipulated in the optimiser, the trait is just for the analysis
15:26 bot48 joined #perl6
15:32 kaleem joined #perl6
15:36 timotimo not having a lot of success here :P  -  i guess i should try doing something simpler instead. like add more typed exceptions or close more old bugs =_=
15:39 arafatkamaal Is there a way to know all methods inside a class?
15:40 arafatkamaal like say perl6 -e 'my %h,say %h.allmethods'
15:40 arafatkamaal should print all methods callable on %h
15:41 timotimo r: say {a=>1,b=>2).^methods
15:41 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in block; couldn't find final '}'â�¤at /tmp/eqJJZKh649:1â�¤------> [32msay {a=>1,b=>2[33mâ��[31m).^methods[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤        sta…
15:41 timotimo r: say {a=>1, b=>2}.^methods
15:41 p6eval rakudo 55dbc0: OUTPUT«new bind_key STORE_AT_KEY STORE delete push PARAMETERIZE_TYPE at_key perl elems exists iterator list keys kv values pairs invert at_key STORE_AT_KEY Capture FLATTENABLE_LIST FLATTENABLE_HASH fmt hash of Bool ACCEPTS perl elems infinite item fmt Int Num chrs Numeric…
15:42 timotimo .^ is a call to the metaclass
15:43 arafatkamaal ok
15:44 arlinius joined #perl6
15:45 skids joined #perl6
15:49 timotimo r: Hash.new.HOW.^methods
15:49 p6eval rakudo 55dbc0:  ( no output )
15:49 timotimo r: say Hash.new.HOW.^methods
15:49 p6eval rakudo 55dbc0: OUTPUT«No such method 'gist' for invocant of type 'NQPRoutine'␤  in method gist at src/gen/CORE.setting:5038␤  in sub say at src/gen/CORE.setting:7488␤  in block  at /tmp/21u807fF0G:1␤␤»
15:50 timotimo i wonder if anyone would be mad at me for implementing this ...
15:52 moritz nobody would be mad at you for implementing stuff that's missing
15:56 moritz timotimo: re infix does and circularity: that's a problem because infix:<does> is defined rather alte in the setting
15:56 moritz timotimo: but you can take a look at how infix:<does> does the mixing in, and duplicate that
15:56 moritz stuff like that is often done in the setting
16:00 kaleem joined #perl6
16:00 masak today's autopun: "How many SEO experts do you need to exchange a light bulb, lightbulb, light bulb, energy saving light bulb, blowjob, xxx, free porn"
16:01 masak (courtesy of mjd, and mst's quote collection)
16:01 FROGGS joined #perl6
16:02 moritz :-)
16:02 dpk joined #perl6
16:02 mtk joined #perl6
16:02 dpk left #perl6
16:02 Woodi_ masak: I am pretty sure that url is related to plan9 becouse Thompson algo is very related to p9 QED... I didn't know that uri have history here, however algo description looks similiar to recent jnthn++ work (which is why I posted link...)
16:03 arafatkamaal perl6 -e 'my @a=0...Inf;for @a {.say if .is-prime}'
16:03 arafatkamaal how would you rewrite this using map?
16:03 arafatkamaal not I have used Inf, so don't run evalbot on it
16:04 moritz evalbot has a protection against stuff like that
16:04 moritz anway, I'd write it as
16:04 kresike bye folks
16:04 arafatkamaal typo: note
16:04 moritz r: .say for (0..*).grep: *.is-prime
16:04 p6eval rakudo 55dbc0: OUTPUT«(timeout)»
16:04 Woodi_ btw. just found Ken Thompson patented Thompson algo what probably explains why it was so *un*adopted in last decades...
16:05 arafatkamaal but thats using grep
16:10 odoacre joined #perl6
16:12 rindolf Woodi_: which one?
16:13 rindolf masak: heh, nice joke.
16:16 masak Woodi_: there's an interesting relationship between that URL and Perl 6's LTM mechanism.
16:17 masak r: (0..Inf).map: { .say if .is-prime }
16:17 p6eval rakudo 55dbc0:  ( no output )
16:17 [Coke] I am not a fan of borat at all, and even I laughed at this: https://twitter.com/DEVOPS_BO​RAT/status/280900066682757120
16:17 masak r: eager (0..Inf).map: { .say if .is-prime }
16:17 masak arafatkamaal: like that.
16:17 p6eval rakudo 55dbc0: OUTPUT«(timeout)2â�¤3â�¤5â�¤7â�¤11â�¤13â�¤17â​�¤19â�¤23â�¤29â�¤31â�¤37â�¤41â�¤43â�¤47â�¤53â�​¤59â�¤61â�¤67â�¤71â�¤73â�¤79â�¤83â�¤89â�¤97â�¤​101â�¤103â�¤107â�¤109â�¤113â�¤127â�¤131â�¤137â​�¤139â�¤149â�¤151â�¤157â�¤163â�¤167â�¤173â�¤17​9â�¤181â�¤191â�¤193â�¤197â�¤199â�¤211â�¤223â�¤​227â�¤229â�¤233â�¤239â�¤241â�¤251â�¤257â�¤263â​�¤269â�¤271â�¤277â�¤281â�¤283â�¤293â�¤307â�¤31​1â�¤313â�¤317â�¤331â�¤337â�¤347â�¤349â�¤353â�
16:18 masak [Coke]: it's because it's funny-true :)
16:21 silug joined #perl6
16:23 thou joined #perl6
16:23 arafatkamaal Good night folks
16:23 masak arafatkamaal: 'night
16:23 [Coke] bueños sueños.
16:24 * [Coke] over ñ'd that.
16:26 * masak .oO( http://spamusement.com/index.php/comics/view/20 )
16:27 masak that website still has the ability to incapacitate me with silly laughter. :)
16:33 * hoelzro waves goodbye to productivity
16:37 masak hahaha http://spamusement.com/index.php/comics/view/117
16:44 thou joined #perl6
16:48 isBEKaml joined #perl6
16:49 masak tadzik would like this one: http://spamusement.com/index.php/comics/view/185 :)
16:51 isBEKaml hola, #perl6!
16:52 isBEKaml masak: (backloggin') I guess the Redmond reference in lichtkind's post was about powershell. They were said to be heavily inspired by perl scripting.
16:53 isBEKaml masak: and you're right about Java and ruby bringing Perl regexes to mainstream. PCRE libs played their part too.
16:54 timotimo if i want to use the nqp i just changed (but have not committed) for building my rakudo, do i have to do Configure.pl at all? or is it enough to make in nqp/ and the make in rakudo?
16:54 tadzik :D
16:55 isBEKaml I have now taken to the habit of backlogging and adding stuff. I'm not even sure if it's a good thing. :D
16:55 masak isBEKaml: it's a good thing. thanks for adding stuff.
16:55 isBEKaml tadzik: You're our meme repository! :P
16:55 tadzik am I? :)
16:56 timotimo so sad that spamusement won't make new content :(
16:56 isBEKaml tadzik: Ja.
16:56 isBEKaml masak: Danke.
16:57 masak tadzik: pandas, zubrs, rage faces. yes, you are :)
16:57 masak hm, meant żubry, of course :)
16:57 tadzik (:
17:11 xinming joined #perl6
17:13 timotimo i was going to implement a .gist for NQPRoutine, so that you can .HOW.^methods, but i have no idea what i'm doing and now i don't know how to do what i guess is correct ... which would be to return something generated with nqp::repr_box_str.
17:16 masak "so you don't move your eyeballs back and forth before you can understand it" -- heh, I understand what lichtkind means. something like "you don't need to read to the end of the regex before you know the conditions under which it should be read". :)
17:16 * masak rewrites
17:16 kaare_ joined #perl6
17:18 masak r: my $str = "1 23 456 78.9"; $str ~~ m:g/(\d+)/; say $0.^name
17:18 p6eval rakudo 55dbc0: OUTPUT«Any␤»
17:18 masak r: my $str = "1 23 456 78.9"; $str ~~ m:g/(\d+)/; say $/.^name
17:18 p6eval rakudo 55dbc0: OUTPUT«Any␤»
17:18 masak I'm... not sure I want to include this example in the blog post. it doesn't seem to work.
17:19 masak I wouldn't do m:g anyway, I'd do .comb
17:19 * masak rewrites to use .comb instead.
17:23 buubot_backup joined #perl6
17:25 masak oh, .comb shows up a few paragraphs earlier.
17:26 masak is there support in the spec that $str ~~ m:g/(\d+)/ means the same as $str.comb(/\d+/) ?
17:26 moritz r: $_ = '1 23 456 78.9'; .say for m:g/(\d+)/
17:26 p6eval rakudo 55dbc0: OUTPUT«「1」␤ 0 => 「1」␤␤「23」␤ 0 => 「23」␤␤「456」␤ 0 => 「456」␤␤「78」␤ 0 => 「78」␤␤「9」␤ 0 => 「9」␤␤»
17:26 moritz you can use that as an example
17:27 masak moritz++
17:27 masak r: $_ = '1 23 456 78.9'; .Str.say for m:g/(\d+)/
17:27 p6eval rakudo 55dbc0: OUTPUT«1␤23␤456␤78␤9␤»
17:27 masak r: $_ = '1 23 456 78.9'; say .Str for m:g/(\d+)/
17:27 p6eval rakudo 55dbc0: OUTPUT«1␤23␤456␤78␤9␤»
17:28 moritz there are two possiblities for m:g//
17:28 moritz the first is to return a List
17:28 moritz then $str ~~ m:g/.../ matches the string against the List, and (nearly) always fails the smart-match
17:29 moritz or it returns a Match
17:29 moritz which might or might not flatten, but $/ can never flatten, because it starts with a $
17:29 masak each time we get back to ~~ and m//, it seems to me that we've painted us into an unfortunate design corner there.
17:30 moritz r: .say for 'abc' ~~ /(.)(.)(.)/
17:30 p6eval rakudo 55dbc0: OUTPUT«「abc」␤ 0 => 「a」␤ 1 => 「b」␤ 2 => 「c」␤␤»
17:30 masak where we have some expectations, and the spec ends up saying "no, that simply can't work". I wonder why.
17:30 moritz r: say .Str for 'abc' ~~ /(.)(.)(.)/
17:30 p6eval rakudo 55dbc0: OUTPUT«abc␤»
17:30 moritz masak: I've blogged about that :-)
17:30 moritz lemme look up the link for you
17:30 moritz masak: http://perlgeek.de/blog-en/perl-6/​three-functions-of-smartmatch.html
17:31 moritz TimToady++ wants to fix it with his OKness proposal
17:31 masak nod, and nod.
17:32 moritz but I still think orthogonalizing matching and topicalization is the way to go
17:32 moritz though I can't provide a good solution either
17:32 masak the OKness proposal still rubs me the wrong way, for some reason. it's like we're putting dualvars on *everything*.
17:33 masak and calling the top type "Mu" feels like a small break from tradition compared to the OKness proposal.
17:33 moritz speaking of which
17:33 moritz now that we don't smart-match against Mu all the time, can we rename it to Object again?
17:34 moritz the name Mu is an FAQ, and it's wrongly huffmanized
17:35 masak \o/
17:35 masak I'm all for it.
17:36 moritz .oO( you think this is Mu today )
17:37 moritz is that an autopun?
17:37 masak r: /(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/
17:37 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unsupported use of {N,M} as general quantifier; in Perl 6 please use ** N..M (or ** N..*)â�¤at /tmp/PMGekASt8e:1â�¤------> [32m/(\d{1,3}[33mâ��[31m)\.(\d{1,3​})\.(\d{1,3})\.(\d{1,3})/[0mâ�¤Â»
17:37 masak moritz: doesn't feel so autopunny... :)
17:38 moritz masak: it doesn't, but it kinda uses the thing it mentions (or fails to mention?)
17:38 masak just a calque, I think.
17:43 masak who are Bob and Tom in lichtkind's article? someone I should know about?
17:44 timotimo isn't it normally tim and ... who was that other guy?
17:44 timotimo tim and al.
17:44 masak oh good, so it isn't just me.
17:44 * masak rewrites
17:44 timotimo (from the tv show 'home improvement')
17:46 masak aye. I've seen it.
17:46 masak not excellent TV, but kinda cute and wholesome.
17:46 timotimo i agree. it was more than good enough for me back then, but i was quite young, too
17:47 Kharec joined #perl6
17:48 masak (for a moment, I was wondering if "Bob" was another lichtkind reference to Redmond. but I don't believe there was ever a Microsoft Tom) :P
17:49 timotimo :D
17:52 moritz Bob the Visual Studio Builder assistent?
17:52 GlitchMr joined #perl6
17:53 masak :P
17:56 masak r: say .Str for "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32." ~~ m/ (\d ** 1..3) ** 4 % '.' /
17:56 p6eval rakudo 55dbc0: OUTPUT«127.0.0.1␤»
17:56 masak r: say .Str for "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32." ~~ m:g/ (\d ** 1..3) ** 4 % '.' /
17:56 p6eval rakudo 55dbc0: OUTPUT«False␤»
17:57 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say .Str for m:g/ (\d ** 1..3) ** 4 % '.' /
17:57 p6eval rakudo 55dbc0: OUTPUT«127.0.0.1␤173.194.32.32␤»
17:57 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say @().perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:57 p6eval rakudo 55dbc0: OUTPUT«().list␤().list␤»
17:57 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say @($/).perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:57 p6eval rakudo 55dbc0: OUTPUT«(Any,).list␤(Any,).list␤»
17:57 masak hm.
17:57 timotimo so is regex matching in perl6 surprisingly non-cool?
17:57 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say $/.list.perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:57 p6eval rakudo 55dbc0: OUTPUT«(Any,).list␤(Any,).list␤»
17:58 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say .list.perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:58 p6eval rakudo 55dbc0: OUTPUT«((Match.new(orig => "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32.", from => 19, to => 22, ast => Any, list => ().list, hash => EnumMap.new()), Match.new(orig => "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.…
17:58 masak ah, yes.
17:58 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say .list>>.Str.perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:58 p6eval rakudo 55dbc0: OUTPUT«("127", "0", "0", "1")␤("173", "194", "32", "32")␤»
17:58 isBEKaml timotimo: Regex is not Cool.
17:58 timotimo that would explain it!
17:58 masak r: $_ = "So, I told him, go 127.0.0.1! But he got lost and knocked on 173.194.32.32."; say .>>Str.perl for m:g/ (\d ** 1..3) ** 4 % '.' /
17:58 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confusedâ�¤at /tmp/7u2EVzmqCa:1â�¤------> [32mst and knocked on 173.194.32.32."; say .[33mâ��[31m>>Str.perl for m:g/ (\d ** 1..3) ** 4 % [0mâ�¤    expecting any of:â�¤        dotty method or postfixâ�¤Â»
17:58 timotimo why was Regex not specced to be Cool?
18:01 masak because Cool is all about the interconvertability between string, numeric and boolean values from Perl 5.
18:02 masak and a Regex isn't a string, a number, or a boolean.
18:04 isBEKaml yeah, what masak said. Cool is a mixed bag for all operations, it contains numeric, string and other stuff.
18:05 isBEKaml now that I look at Regex.pm, I see some pir stuff. I thought we got rid of them in favour of nqp? (flaky memory again, I guess :)
18:08 masak lichtkind post reviewed, rewritten, and scheduled for tomorrow.
18:08 masak feel free to log into Wordpress and review the result :)
18:10 masak "people making apocalypse jokes like there's no tomorrow" -- this is quite likely to be an autopun, however :)
18:10 masak oh dear; at this rate I'll have material for a second lightning talk... :P
18:10 isBEKaml that's going to get old real quick! :P
18:11 masak isBEKaml: autopuns have an amazing ability to renew themselves. they don't wear out so much.
18:11 masak which is odd because they all build on *exactly* the same principle.
18:11 SamuraiJack joined #perl6
18:12 * masak blames our brains
18:12 * masak heads out into the winter for the second time today
18:12 isBEKaml masak: well, I was just talking about how we pull jokes around events and all the fun is lost after they're past.
18:13 isBEKaml masak: winter in .se? must be night-long days! :D
18:14 masak isBEKaml: I swear, I haven't seen the sun for weeks. I hope it's doing some good for the rest of planet. :)
18:17 isBEKaml masak: Well, I can't say it's any good if the earth is tilted so far back. :P
18:18 * isBEKaml should stop making bad jokes
18:37 kaleem joined #perl6
18:52 Tabrenus joined #perl6
18:55 masak greetings, Tabrenus.
18:55 Tabrenus hello masak
18:56 masak are you new here? I don't recall seeing you around.
18:56 masak if so, welcome. :)
18:57 Tabrenus thanks
19:03 masak nr: say "the implementations say 'welcome, {my $name = 'Tabrenus'}', too :)"
19:03 p6eval niecza v24-12-g8e50362: OUTPUT«Potential difficulties:â�¤  $name is declared but not used at /tmp/iyrhu2OB10 line 1:â�¤------> [32m "the implementations say 'welcome, {my [33mâ��[31m$name = 'Tabrenus'}', too :)"[0mâ�¤â�¤the implementations say 'welcome, Tabrenus', too :)â�¤Â»
19:03 p6eval ..rakudo 55dbc0: OUTPUT«the implementations say 'welcome, Tabrenus', too :)␤»
19:03 * masak is not so fond of the 'declared but not used' warning :/
19:04 * diakopter neither
19:04 hoelzro is that niecza-specific?
19:05 masak hoelzro: no, it's from STD and only Niecza implements it.
19:05 FROGGS I like the C way there, emitting these warnings only if I do -Wunused
19:05 hoelzro can someone come up with a snippet of code that would result in a "Confused"
19:05 wooden joined #perl6
19:05 hoelzro FROGGS: agreed.
19:05 wooden joined #perl6
19:06 flussence r: sub infix:<_> { * }; 5_()
19:06 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confusedâ�¤at /tmp/0TCJFtVs7d:1â�¤------> [32msub infix:<_> { * }; 5[33mâ��[31m_()[0mâ�¤    expecting any of:â�¤        whitespaceâ�¤Â»
19:06 flussence useless, but does what you asked for :)
19:07 rhr joined #perl6
19:07 hoelzro hmm
19:07 hoelzro thanks!
19:17 popl joined #perl6
19:43 sahadev r: my @a = 1..5; my @b = 'a' .. 'e'; my @c = \@a, \@b; my @d = [\@a, \@b]; say "\@c[0] = @c[0], \@d[0] = @d[0]"
19:43 p6eval rakudo 55dbc0: OUTPUT«@c[0] = 1 2 3 4 5, @d[0] = 1 2 3 4 5 a b c d e␤»
19:46 tomgj Kind of a back to front question coming up.  Suppose I am specifying the API of a Perl 6 module.  A class contains "has Str $.foo is rw".  Is this best documented in the API doc as "has Str $.foo is rw"?  If one wanted to document the same API in terms of method(s), what would they be?
19:47 REPLeffect joined #perl6
19:47 tomgj "method foo() is rw returns Str" ?
19:56 fgomez joined #perl6
19:58 masak tomgj: in a sense, $.foo is a method.
20:00 slavik1 getter/setter?
20:04 timotimo so, there must be some kind of wrapping that i would need to do if i want to make a method of an NQPRoutine not only callable from perl6 code (which already seems to work), but also wrap the string I want to return so that it is a sensible object for perl6/rakudo. what could that be? repr_box_str perhaps? from looking at its signature, i couldn't figure out how to correctly call it :(
20:04 moritz nqp::p6box_s($nqp_str)
20:04 timotimo well, that was simpler than i thought :)
20:06 masak (it's as if NQP was made for this kind of thing) :P
20:07 FROGGS coincidence!
20:08 tomgj slavik1: AIUI the method created by "has" as written above returns an lvalue, so it doesn't really fit what I understand by getter/setter
20:12 tomgj masak: okay, but I'm really trying to ask about best practices for api documentation.  I was wondering whether it would be expected generally that the consumer of an api, reading the documentation, would understand the "has ..." one as meaning the "method ..." one.  But actually "method foo() is rw returns Str" is starting to look less messy now anyway, so I think I'll just stick with that.
20:13 slavik1 tomgj: Perl6 automatically generates getter/setter methods, in java you would have to write them manually. If you call $object.foo("hello"), this will set the value of $.foo to "hello", likewise, $object.foo() returns the value stored by $.foo
20:14 slavik1 has Str $.foo is rw < this talks about an attribute/member, not method. method gets generated automagically. that is my udnerstanding of how Perl6 (and Moose in Perl5) functions
20:14 masak tomgj: yes, the consensus seems to be to put things in code when you can and in documentation only if you must.
20:15 slavik1 listen to masak, his IQ has as many digits as the value of my IQ ... >.>
20:15 TimToady no, that's not how it works; you'd have to assign to $object.foo
20:15 slavik1 TimToady: so it's $object.foo = "hello";?
20:16 slavik1 wasn't away that it was changed ...
20:16 TimToady it was never the other way
20:16 slavik1 oh
20:16 diakopter rn: class A { has $.foo = $!foo; method boo { $!foo } }; say A.new.boo
20:16 p6eval rakudo 55dbc0, niecza v24-12-g8e50362: OUTPUT«Any()␤»
20:16 TimToady arguments to a method are only used to help establish the identity of the lvalue
20:17 TimToady so the signature of the "setter" is identical to the "getter"
20:17 TimToady that is, we don't distinguish setter from getter
20:17 slavik1 right
20:18 TimToady a thing either returns an lvalue or it doesn't
20:18 masak rn: class A { has $!x; has $!y; method foo($_) is rw { when 'x' { $!x }; $!y } }; given A.new { .foo('x') = 5; say .foo('x') }
20:18 p6eval rakudo 55dbc0: OUTPUT«Cannot assign to a non-container␤  in block  at /tmp/QuevMOdD2B:1␤␤»
20:18 p6eval ..niecza v24-12-g8e50362: OUTPUT«5␤»
20:18 masak niecza++
20:18 slavik1 I recall reading somewhere that the idea was that if you call $object.foo() without any args, it acts as a getter, if you give it stuff, it acts as a setter ...
20:18 TimToady in the RFCs maybe, never after that
20:18 tomgj TimToady: good.  Would you be able to confirm for me that I am correct in saying that the signature of the method generated when I write "has Str $.foo" is "method foo () returns Str is rw"
20:19 sjohnson joined #perl6
20:19 timotimo so, uh, i've tried calling p6box_s, but i'm getting "could not find sub &p6box_s". perhaps i'm working at the wrong level? i just added method gist() { p6box_s($!do); } to my knowhow NQPRoutine { ... } in src/core/NQPRoutine.pm.
20:19 TimToady there is no 'is rw' unless you put one on the "has"
20:20 fgomez joined #perl6
20:20 tomgj oh dear, I thought declaring a method rw meant it returned an lvalue.  Back to experiments / reading for a while then..
20:20 timotimo return-rw is there for you
20:20 TimToady you asked if it was equivalent to the "has", and it isn't
20:21 TimToady it would be equivalent if you put "is rw" on the "has"
20:23 tomgj ah, whoops, I missed off "is rw" from the "has" clause the most recent time I wrote it.  Thanks for confirming that with it, it is equivalent.
20:25 tomgj masak: regarding code vs documentation, the comment seems to rather gloss over the distinction between interfaces, which should be specified properly, and implementation.
20:25 masak still no takers on perl6dvent slot #24?
20:25 Kharec_ joined #perl6
20:25 slavik1 huh?
20:26 slavik1 what is that?
20:26 masak tomgj: well, I'd consider signature, return type, and names to be part of the interface.
20:26 masak tomgj: and anything inside of the method body to be part of the implementation.
20:26 telex joined #perl6
20:26 masak slavik1: it's the remaining empty slot in the Perl 6 Advent Calendar this year.
20:27 slavik1 to do what, though?
20:27 tomgj masak: sure - part of.
20:27 slavik1 I have no idea what that calendar is for ...
20:27 tomgj I think I understand what you meant better now
20:27 slavik1 :(
20:28 masak slavik1: the calendar is here: http://perl6advent.wordpress.com/
20:28 masak slavik1: it's the fourth year we're doing it, so I'm a little surprised you've missed it until now. :)
20:28 slavik1 yeah
20:28 slavik1 I haven't been followng Perl6 much in the last 4 years due to wr0k
20:29 masak *nod*
20:29 slavik1 I am not smart enough to have something cool about Perl6 :(
20:30 colomon joined #perl6
20:32 jfried joined #perl6
20:34 masak the 24th slot is usually something special. in 2009, pmichaud++ wrote about STD.pm6. in 2010, TimToady++ wrote about positive trolling.
20:36 timotimo moritz: did you read my little line about p6box_s above? this is the diff: http://sprunge.us/VgfE
20:42 moritz timotimo: nqp::p6box_s is only availble in rakudo, not in nqp
20:44 moritz and it's wrong for NQP to return Perl 6 types anyway
20:47 sahadev1 joined #perl6
20:48 timotimo oh. so i'll have to do magic in rakudo, not in nqp
20:49 moritz http://www.piumarta.com/software/maru/ # interesting
20:50 sahadev1 joined #perl6
20:51 cognominal joined #perl6
20:52 snearch joined #perl6
20:53 masak I believe I've seen Maru once before. a really nice proof-of-concept.
20:59 fgomez joined #perl6
20:59 timotimo grepping through all of perl6+nqp+parrot shows only appearances of NQPRoutine in nqp and nothing in src/Perl6/Metamodel stands out as something that would explain how NQPRoutine gets into rakudo. where should i look instead?
21:01 isBEKaml joined #perl6
21:02 sahadev1 left #perl6
21:05 moritz nqp: sub f() { }; say(f.name)
21:05 p6eval nqp: OUTPUT«Method 'name' not found for invocant of class 'NQPMu'␤current instr.: '' pc 93 ((file unknown):58) (/tmp/tBaLSZy_xE:1)␤»
21:05 moritz nqp: sub &f() { }; say(&f)
21:05 p6eval nqp: OUTPUT«Use of undeclared variable '&f' at line 2, near ")"␤current instr.: 'panic' pc 13221 (src/stage2/gen/NQPHLL.pir:4682) (src/stage2/gen/NQPHLL.pm:328)␤»
21:06 moritz timotimo: I think that subroutines and/or methods in NQP are compiled to NQPRoutine
21:06 moritz timotimo: and since the metamodel is written in NQP, you get that once you go a level more meta than you usually do
21:08 timotimo in that case i don't know how to cross the metas sufficiently to return a perl6 string from the gist method a NQPRoutine has (or rather: doesn't have yet)
21:14 moritz timotimo: the answer is probably rather magical, in terms of MOP metacircularity or so
21:14 moritz and not easily figured out
21:16 * moritz tests the qast-sink-1 branch one more time, and hopes to merge it Very Soon[tm]
21:17 timotimo OK, then i'll look for another thing to break my teeth off with
21:18 timotimo besides fixing more old bugs that are "closable with tests", what comparably simple things could i try?
21:19 moritz timotimo: I'm not sure how easy it is, but I'd love to see better recognition of illegal Null Regexes in Rakudo
21:19 moritz STD does it very well
21:19 moritz std: /a | | b/
21:19 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0m�Null pattern not allowed at /tmp/fmNpJ9Tfmg line 1:�------> [32m/a | [33m�[31m| b/[0m�Parse failed�FAILED 00:00 41m�»
21:19 moritz r: / a | | b /
21:19 p6eval rakudo 55dbc0:  ( no output )
21:19 moritz nr: / a | | b /
21:19 p6eval rakudo 55dbc0:  ( no output )
21:19 p6eval ..niecza v24-12-g8e50362: OUTPUT«[31m===[0mSORRY![31m===[0m��Null pattern not allowed at /tmp/EjTpknugZS line 1:�------> [32m/ a | [33m�[31m| b /[0m��Parse failed��»
21:20 timotimo std: / a | ( | ) | b /
21:20 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0m�Null pattern not allowed at /tmp/ukHS6BTAoN line 1:�------> [32m/ a | ( | [33m�[31m) | b /[0m�Parse failed�FAILED 00:00 41m�»
21:20 timotimo this is something that would be done in Actions.pm?
21:21 timotimo don't think it could be done in Grammar already
21:22 moritz it's done in the grammar
21:23 moritz note that grammars have the same <term> <infix> <term> structures as mainline code
21:23 moritz and two terms in a row and two operators in a row are also detected in the grammar
21:24 timotimo a | | b / <- this would be two operators in a row, right?
21:24 moritz you can "just" search STD.pm6 for "Null pattern" and "Null regex", and try to port the error detection to rakudo. Such things are often, but not always, not too hard
21:24 moritz correct
21:26 timotimo i'll see what i can do. i'll be focusing on src/Perl6/Grammar.pm::Perl6::RegexGrammar, is that right?
21:27 moritz right
21:27 moritz and possibly also on the regex grammar in NQP
21:27 * timotimo opens QRegex::P6Regex::Grammar in a split, too
21:27 moritz from which Perl6::RegexGrammar inherits
21:27 ifim joined #perl6
21:30 timotimo it seems like nqp/src/stage1/gen/NQPP6Regex.pm is the one i want to look at, is that right?
21:30 timotimo or maybe stage2?
21:30 moritz no, everything in directories with 'gen' in the name is generated
21:30 moritz src/QRegex/P6Regex/Grammar.pm iirc
21:30 moritz and src/stage* is also generated (though the .pm files are often just copies)
21:31 timotimo ah, yes
21:31 moritz .nqp, not .pm
21:31 timotimo that's about 1000 lines less than the generated one. but nothing important is missing?
21:32 moritz I guess the generated one also contains the regex compiler and actions
21:32 timotimo do you wish to get a structured exception class to go with it? (in case i get anything done in the first place ;) )
21:32 moritz there's already one for it
21:32 timotimo perfect!
21:33 moritz just not triggered often enough
21:35 timotimo er, there's only 3 relevant occurences of "Null" in STD.pm6. am i missing something?
21:36 dalek Heuristic branch merge: pushed 35 commits to rakudo/nom by moritz
21:36 flussence yay
21:36 timotimo great, moritz++ :)
21:36 flussence moritz++ # kitchen sink
21:38 Tabrenus joined #perl6
21:38 timotimo er, will i be allowed to add "invalid null pattern" errors to nqp as well? intuition says: yes
21:39 moritz yes
21:42 stevan_ joined #perl6
21:50 FROGGS boys and girls: I almost-fixed the merge-import bug!
21:51 moritz \o/
21:51 timotimo is there no alternative spelling of $¢?
21:51 FROGGS phenny: tell jnthn I have a patch that allows one to import multis from two different modules (like the trait_mod:<is>), but one thing remains open: the dump of the list of dispatchers is incomplete, even if all dispatchers work
21:51 phenny FROGGS: I'll pass that on when jnthn is around.
21:52 FROGGS thanks phenny
21:52 moritz timotimo: $/.CUSRSOR
21:52 moritz FROGGS: incomplete how?
21:52 moritz are the ones from the setting missing?
21:53 FROGGS I have Foo.pm that exports multi trait_mod:<is> ( Routine $r, :$foo!), and Bar.pm that does that with :$bar!
21:53 timotimo r: / /
21:53 p6eval rakudo 55dbc0: OUTPUT«[31m===[0mSORRY![31m===[0m�Null regex not allowed�at /tmp/JQ1osiSPjh:1�------> [32m/ /[33m�[31m<EOL>[0m�»
21:53 timotimo at least that still works in my local copy :)
21:54 FROGGS you can use both traits, but if you use a unkown trait it will just print the core ones plus bar, but not foo
21:56 FROGGS I would like to push that to a branch, and it would be just awesome if I had commit bit
21:56 * FROGGS makes puppy eyes
22:03 dalek rakudo/nom: 0199241 | jnthn++ | src/ (2 files):
22:03 dalek rakudo/nom: Make "my $a; { $a; my $a } an error.
22:03 dalek rakudo/nom:
22:03 dalek rakudo/nom: This commit doesn't break any tests and actually makes a TODO test
22:03 dalek rakudo/nom: pass. However, it's a bit close to release to include it now, so it
22:03 dalek rakudo/nom: goes in a branch for now and can be merged afterwards.
22:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0199241400
22:03 dalek rakudo/nom: 3c3f780 | moritz++ | src/ (2 files):
22:03 dalek rakudo/nom: Merge remote branch 'origin/outer-bound' into nom
22:03 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3c3f780f8b
22:03 tcpr1347 joined #perl6
22:04 skids joined #perl6
22:04 dalek rakudo/nom: c8de2eb | moritz++ | docs/ChangeLog:
22:04 dalek rakudo/nom: update ChangeLog for outer-bound branch merge
22:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/c8de2ebe5e
22:05 timotimo the next release is already going to be nice :P
22:05 moritz phenny: tell jnthn YOU MAKED BRANCH outer-bound BUT I MERGED IT KXTHXBY
22:05 phenny moritz: I'll pass that on when jnthn is around.
22:11 whiteknight joined #perl6
22:16 timotimo i'll go to bed and see if i can get anything working tomorrow. i've copied over a rule from STD to nqp, but it doesn't seem to have changed anything. i'll need to look more closely and understand more, i s'pose.
22:16 cognominal joined #perl6
22:17 colomon joined #perl6
22:38 masak 'night, #perl6
22:40 colomon \o
23:03 rindolf masak: good night.
23:19 cognominal joined #perl6
23:26 fgomez joined #perl6
23:33 rummik joined #perl6
23:35 xinming joined #perl6
23:40 cognominal joined #perl6
23:41 rurban joined #perl6
23:45 rurban left #perl6
23:47 rurban_ joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo