Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-12-01

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:05 * lue feels he should remove Exceptions from the depgraph generator. 1) They're obviously needed everywhere in src/core 2) The complete depgraph of src/core he just generated is a monster with exceptions.
00:08 armitage81 joined #perl6
00:15 masak indeed, it might be more informative to generate the thing without exceptions.
00:15 masak in a sense, they're orthogonal to the rest of the type system.
00:15 masak 'night, #perl6
00:17 sorear knight masak
00:28 whiteknight joined #perl6
00:29 sorear o/ whiteknight
00:51 ifim left #perl6
00:58 whiteknight hello sorear
01:06 cognominal joined #perl6
01:09 imarcusthis joined #perl6
01:25 whooguy joined #perl6
01:51 daniel-s__ joined #perl6
02:22 FROGGS_ joined #perl6
02:26 xilo_ joined #perl6
02:49 sivoais joined #perl6
03:06 rurban_ joined #perl6
03:07 flussence is there a FAQ for how LTM/TTIAR works, anywhere? http://www.reddit.com/r/programming/comments/142jix/10_print_chr_2055_rnd_1_goto_10_how_a_single_line/c79fdpn?context=3
03:08 jaldhar joined #perl6
03:09 noggle_ joined #perl6
03:18 xenoterracide bleh
03:19 ircmouser joined #perl6
03:21 xenoterracide anyone tried using Dist::Zilla for Perl6?
03:27 fgomez joined #perl6
03:29 xenoterracide http://privatepaste.com/f68cda11fe I could swear this worked whenever I was here last
03:31 xenoterracide http://privatepaste.com/e178c9e2b8 errors
03:38 orafu joined #perl6
03:38 tokuhiro_ joined #perl6
03:40 skids xenoterracide: well, it should not work AFAICT.  You can't override a multi signature like you can an only; it just adds another candidate, which is ambiguous with a single positional parameter.
03:49 xenoterracide oh how frustrating
03:49 xenoterracide I give up on full interface support
03:49 skids You can use the signature to accomplish it.
03:49 xenoterracide how do you figure
03:50 skids depending on how deep you need to go, either put a type restriction of ::?CLASS on the invocant, or use a where clause.
03:51 xenoterracide all I really want is to require certain signatures be provided by an implementation
03:53 ircmouser joined #perl6
03:53 skids Oh.  Not quite sure of that... I think protos are just dispatchers?
03:54 sorear I still don't like the idea of an interface role trying to dictate such implementation details
03:54 sorear I'm sure you can do it with a metaclass override
03:57 skids I suppose maybe there might be a use case in ORBA/ABI type stuff.
03:58 sorear maybe, but it's an awkward fit
04:00 Gryllida joined #perl6
04:00 tokuhiro_ joined #perl6
04:01 tokuhiro_ joined #perl6
04:05 xenoterracide sorear: I don't see it as dictating implementation details, just required interface... must provide 1 method that takes a string (or perhaps I should have said Stringy?) and another that takes an IO Handle
04:06 sorear xenoterracide: what if I provide a single method that takes either?
04:07 xenoterracide hmmm....
04:07 sorear also, roles are allowed to provide default implementations; there ought to be a default implementation of the IO version in terms of the Buf version
04:08 sorear Digesting a Str is not a well-defined operation since Perl 6 does not spec an encoding
04:08 xenoterracide idk, though I don't like the idea of doing if ( Str ) { ... } elsif ( IO ) { ... } all the time
04:08 xenoterracide that's the whole point of multi methods to me, is not doing that
04:08 sorear xenoterracide: multi dispatch in niecza is pretty slow and I'm the wrong kind of lazy, so I tend to write if chains instead of optimizing MMD
04:09 xenoterracide sorear: ah, sorry
04:10 sorear digesting a Str should start by encoding the string using UTF-EBCDIC
04:10 xenoterracide I'm using rakudo for now, though it's probably slow there too
04:11 sorear or UTF-7 with odd parity
04:11 xenoterracide UTF-7? why's that?
04:12 xenoterracide I'll be honest, Digest just looked like something interesting to work on so I kind of have no idea what I'm doing
04:12 sorear xenoterracide: snarkiness aside, the signatures should be (Buf) and (IO)
04:12 xenoterracide it is a good excuse to learn too much about unicode
04:13 sorear a deliberate feature of Perl 6 is that it almost never does implicit coercion between Buf and Str
04:13 sorear because a large category of bugs in Perl 5 come about when you lose track of whether a given string contains octets or characters
04:14 skids xenoterracid: the strategy I used in Sum:: was not to even try to get different algs to all look alike, and write roles you can mix into the algs as appropriate to the underlying alg, to present the API you want for your application.
04:15 skids the individual alg modules expect arguments optimal to what they are underneath, and doc what they expect in the manpage.
04:18 xenoterracide skids: is Sum PP ?
04:18 skids PP?
04:18 xenoterracide Pure Perl
04:19 skids In fact yes, but not in principle.
04:19 skids I do have some working Zavolaj code for libmhash, but have not comitted it yet.
04:20 skids (Some of the algs are not usable yet due to speed/memory concerns -- Sum assumes laziness that isn't quite there yet so lists tend not to pipeline like it thinks they should.)
04:22 xenoterracide skids: I was thinking of just using NativeCode and building on glibc/openssl for now
04:23 xenoterracide however the things that I'm trying to do is make it so that the client code can look the same (or close to) regardless of algorithm
04:23 xenoterracide maybe you have to pass some things to the initial constructor
04:23 xenoterracide but after that most of these things seem to do the same things
04:24 xenoterracide but I'm not an expert in this area
04:24 skids Eventually I plan to offer prefab classes with the appropraite marshalling roles mixed in that behave consistently across the algs.
04:25 xenoterracide skids: why did you call it Sum::?
04:26 rurban_ joined #perl6
04:26 skids Because it covers digests, checksums, and eventually things like rolling hashes.
04:27 xenoterracide is not at all the thing that comes to mind when I think Sum::
04:27 skids So Sum left more vernacular room.
04:29 skids it's fairly common to refer to digests/hashes as "sum"s.  i.e. sha*sum cmdline names.
04:29 xenoterracide yeah I just think math though when I think sum Hash:: would be appropriate if perl didn't use it to mean Dictionary
04:30 xenoterracide just curious
04:30 skids I avoided Hash very purposefully just because of that :-)
04:30 xenoterracide I figured
04:32 xenoterracide for all of the less than satisfactory interfaces in perl 5, I've never had any complaints about Digest, and so I figured getting that with at least a NativeCode implementation of SHA based on OpenSSL is worthy.
04:33 xenoterracide Digest is mostly an interface not an implementation though
04:34 skids I think there will be plenty of P5 coders coming in wanting a feel-alike, yes.
04:34 xenoterracide I mean if there's really a better idea I'd love to understand it
04:35 xenoterracide sorear: why can't you ask strings what encoding they are? and why isn't the default UTF-8
04:36 Psyche^ joined #perl6
04:36 sorear xenoterracide: a string doesn't have an encoding, it's just a list of integers 0-0x10FFF
04:37 sorear 10FFFF rather
04:40 skids So have you managed to tame Zavolaj in your impl yet?  I could paste you what I had to do.  It is not fast to get the data over to the C api within Zavolaj's current limitations.
04:41 xenoterracide me, no, I've not even begun to experiment
04:42 xenoterracide well with zavolaj, I've mostly been experimenting with Perl6
04:42 bluescreen100 joined #perl6
04:43 xenoterracide also why is it called Zavolaj, when it's 'use NativeCall;'
04:44 xenoterracide sorear: so will that make Unicode hard or easy in p6?
04:45 skids jnthn++ gets to name anything he writes as he sees fit :-)
04:46 sorear skids: was that to me?
04:46 sorear xenoterracide: easy
04:46 skids no.  explaining "Zavolaj"
04:46 xenoterracide skids: is what you had to do in your Sum Repo? I don't really expect anything to be /fast/ at this point
04:47 sorear skids: 20:40 < skids> So have you managed to tame Zavolaj in your impl yet?  I could  paste you what I had to do.  It is not fast to get the data over  to the C api within Zavolaj's current limitations.
04:47 skids no, I'll try to remember how to github branch, and push some semi-working files up.
04:47 sorear skids: is "your impl" = niecza?
04:47 skids Oh, no I was asking about Digest::
04:47 skids In niecza most everything I want to write blocks on Failure
04:47 xenoterracide yeah I haven't really implemented anything yet
04:48 xenoterracide I was mostly trying to find a way to make algorithms conform to an interface
04:48 xenoterracide and then I burned out
04:48 xenoterracide and played video games
04:48 xenoterracide a lot
04:49 xenoterracide and there will probably be more of that
04:49 * skids has been resisting the borderlands2 temptation all night.
04:49 xenoterracide skids: I have to play borderlands 1 first
04:49 xenoterracide I have years of back gaming to catch up on
04:50 xenoterracide starting with Mass Effect
04:55 rurban_ rakudo and nap pass their test suites with parrot/threads. Just samples which use threads do not work yet, because of nqplexpad with proxies lexicals.
05:00 skids xenoterracide: I pushed some code to branch "NativeCall" in perl6sum.  Have no idea as to whether I left it in any kind of working state.
05:01 xenoterracide skids: alright, I'll check it out
05:01 skids It's in lib/Sum/Zavolaj.pm6 and lib/Sum/MHash.pm6 The Adler.pm6 file uses it as a test case.
05:01 skids It is very ugly :-)
05:12 REPLeffect joined #perl6
05:20 raiph joined #perl6
05:21 skids rurban_++ I know it's a while off but I'm actually eagerly looking forward to spending evenings lost in rakudo threading mysteries.
05:22 rurban_ see the nqp/gh67-threads branch
05:33 felher good morning, #perl6
05:35 jaldhar joined #perl6
05:40 telex joined #perl6
05:46 fgomez joined #perl6
06:07 araujo joined #perl6
07:10 SamuraiJack joined #perl6
07:29 daniel-s__ joined #perl6
07:30 SamuraiJack_ joined #perl6
07:39 SamuraiJack__ joined #perl6
07:44 SamuraiJack joined #perl6
07:50 wamba joined #perl6
07:56 Bzek joined #perl6
08:01 replore_ joined #perl6
08:02 GlitchMr joined #perl6
08:13 FROGGS_ good morning
08:16 Kharec joined #perl6
08:27 kaare__ joined #perl6
08:29 ircmouser joined #perl6
08:43 sorear o/ FROGGS
08:43 FROGGS hi
08:43 tokuhiro_ joined #perl6
08:44 moritz \o
08:53 ircmouser joined #perl6
09:03 cognominal joined #perl6
09:36 gootle joined #perl6
09:36 imarcusthis joined #perl6
09:37 imarcusthis- joined #perl6
09:47 bapa joined #perl6
09:47 chee joined #perl6
09:47 ServerSage joined #perl6
09:47 Tene joined #perl6
09:47 bonsaikitten joined #perl6
09:47 s1n joined #perl6
09:47 sorear joined #perl6
09:47 crazedpsyc joined #perl6
09:47 ggoebel joined #perl6
09:47 tadzik joined #perl6
09:47 Hor|zon joined #perl6
09:47 quietfanatic joined #perl6
09:47 szbalint joined #perl6
09:47 smash joined #perl6
09:49 bapa joined #perl6
10:08 ircmouser joined #perl6
10:12 zby_home_ joined #perl6
10:19 cedrvint joined #perl6
10:19 cedrvint hello #perl6
10:21 cedrvint sorear: does Niecza support :bytes in regexp?
10:21 sorear no
10:22 cedrvint any roadmap about that?
10:22 * moritz doesn't think :bytes makes much sense
10:22 sorear cedrvint: it will probably be removed from the spec
10:22 moritz consider  / ^ [:bytes . ] \w /
10:23 cedrvint moritz: how could I parse binary format then?
10:23 sorear since perl 6 is encoding agnostic, it doesn't make much sense to mix :bytes and :!bytes
10:23 moritz what if the first character in $_ is a multi-byte character?
10:23 sorear rx:bytes // makes some sense though
10:23 moritz then \w would have to try to match the left-over continuation bytes, but that doesn't make any sense at character level
10:23 sorear but that's not :bytes *in* regexp :D
10:24 sorear presumably rx:bytes regexps would be unmixable with non-bytes regexps
10:24 moritz cedrvint: you could decode as latin-1, and then match against the Str
10:24 sorear and a 'use re :bytes' pragma could be used to force :bytes mode, e.g. in a grammar for binary data
10:24 * sorear ponders how viable this is
10:26 cedrvint sorear: it sounds great to me :)
10:40 sorear I wish I could find a source of motivation proportionate to the ideas
10:44 cedrvint sorear: Hachoir in Perl 6 ? https://bitbucket.org/haypo/hachoir/wiki/Home
10:45 cedrvint and reverse engineering tools in Perl 6
10:51 sorear sleep&
11:00 cognominal joined #perl6
11:02 FROGGS_ joined #perl6
11:05 Su-Shee_ joined #perl6
11:15 masak g'day, #perl6
11:19 FROGGS_ hi masak
11:21 masak yay, I got Parsec working locally! \o/
11:21 masak time to write a Parsec parser... :D
11:22 * FROGGS needs to google Parsec
11:22 masak it's a Haskell parser combinator library.
11:24 FROGGS and I guess that sounds like fun?
11:25 masak excellent Saturday recreation, yes.
11:33 masak rn: sub infix:<o o o o>($a, $b, $c, $d, $e) { say "$a took $b down to $c to $d a full $e" }; "I" o "dog" o "the vet" o "conduct" o "examination";
11:33 p6eval rakudo 0bfba1: OUTPUT«===SORRY!===␤Confused␤at /tmp/NMW9_PZyA7:1␤»
11:33 p6eval ..niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0m��Unable to parse infix:sym<o o o o> at /tmp/g4x6DAKzrc line 1:�------> [32m }; "I" o "dog" o "the vet" o "conduct" [33m�[31mo "examination";[0m�Couldn't find final 'o o o'; gave up at /tmp/g4x6DAKzrc line 1 (EOF):�------>…
11:33 FROGGS my goal for today is to get my fileserver up and running, but that's my goal weeks now :/
11:33 masak awww
11:33 replore_ joined #perl6
11:37 MayDaniel joined #perl6
11:38 masak who wants Tuesday in https://github.com/perl6/mu/blob/master/misc/perl6advent-2012/schedule ?
11:38 masak after we fill slot 4, we're good until December 12th.
11:39 am0c joined #perl6
11:41 MayDaniel_ joined #perl6
11:50 FROGGS I would if I could
11:50 moritz why can't you?
11:51 GlitchMr Perhaps if I would have ideas
11:51 moritz there are lots of ideas in the topic-brainstormin file
11:51 masak write about something Perl 6-related that you would like to tell the world about.
11:51 FROGGS because I dont know what to write and when thinking of stuff that is interesting I believe I'm not good enough for it
11:52 moritz just try it, and let us preview the post. Maybe it's good enough after all.
11:52 moritz and if you want help, just ask
11:52 moritz remeber, hybris is a virtue :-)
11:52 GlitchMr Perhaps I could try making something about panda package manager
11:53 FROGGS ;o)
11:53 GlitchMr It wasn't described before, was it?
11:53 FROGGS well, I'll think about it
11:53 moritz GlitchMr: no, just mentioned briefly, I think
11:54 spider-mario joined #perl6
11:54 FROGGS packaging is important since we just have a bunch of modules
11:55 FROGGS would be cool if more ppl start porting their stuff to Perl 6
11:58 GlitchMr I'll try making post about panda package manager and I will show it on this channel today, ok?
12:00 moritz GlitchMr: that would be great, yes
12:01 masak ++GlitchMr
12:01 GlitchMr I also would like somebody to proofread it, as I'm not native English speaker, but that after it will be done ;-)
12:04 masak oh, no problem. I volunteer to proof it.
12:05 GlitchMr Thanks
12:16 dayangkun joined #perl6
12:17 erkan joined #perl6
12:27 replore joined #perl6
12:33 moritz ++masak
12:33 cedrvint joined #perl6
12:33 cedrvint moritz: I agree with you,
12:34 cedrvint \w doesn't make sense with :bytes
12:35 cedrvint maybe :bytes would forbid such subrules (encoding related) ?
12:36 cedrvint because latin-1 encoding seems to be an error-prone workaround
12:43 Woodi hallo #
12:43 Woodi std: while( my $a = now ) {  say $a; }
12:43 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Word 'while' interpreted as 'while()' function call; please use whitespace instead of parens at /tmp/DYMX5B7zxe line 1:â�¤------> [32mwhile[33mâ��[31m( my $a = now ) {  say $a; }[0mâ�¤Unexpected block in infix position (two terms in a row…
12:44 Woodi ehmm, adding () realy need to be syntax error ?
12:48 moritz Woodi: no, it's only a warning
12:48 moritz Woodi: the syntax error is that you use two terms in a row
12:48 moritz because while() is a call to a subroutine
12:48 moritz so the block after it is misplaced
12:49 GlitchMr std: while(42); # this is fine
12:49 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0m�Undeclared routine:� 'while' used at line 1�Check failed�FAILED 00:00 41m�»
12:49 GlitchMr std: sub while {}; while(42); # this is fine
12:49 moritz std: sub while($) { }; while(42);
12:49 p6eval std a8bc48f: OUTPUT«ok 00:00 42m␤»
12:49 p6eval std a8bc48f: OUTPUT«ok 00:00 44m␤»
12:49 GlitchMr std: sub while {}; while(42) {}; # this is not
12:50 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?) at /tmp/23eFOFO1qo line 1:â�¤------> [32msub while {}; while(42) [33mâ��[31m{}; # this is not[0mâ�¤    expecting infix or meta-infixâ�¤Parse f…
12:52 Woodi but execution of script halts with: ===SORRY!=== Confused at t/some.t:1 so works like error
12:57 masak Rakudo doesn't do warnings yet.
13:03 moritz at least not compile-time warnings
13:18 masak right. I was unclear.
13:23 masak "I find the best attitude is to treat programming like demon summoning: the
13:23 masak target is at least as smart as you, must obey the letter of your commands,
13:23 masak and hates you.  Code accordingly."
13:23 masak it's from http://www.trout.me.uk/quotes.txt
13:23 masak which appears to be full of great quotes.
13:23 * moritz likes it
13:25 masak I could easily plug this into fortune and my .bashrc
13:25 * masak does it
13:28 masak heh, I also implemented fortune. :)
13:28 masak nom -e 'my $quotes = slurp("quotes.txt"); say $quotes.split(/\n\%\n/).roll'
13:29 masak hm, nom -e 'say slurp("quotes.txt").split(/\n\%\n/).roll' is slightly shorter.
13:29 tokuhiro_ joined #perl6
13:31 masak yay, it works! :)
13:37 lasse joined #perl6
13:38 masak * sri remembers autrijus crying for help on irc after he locked himself in a room at Leopold Toetsch's house :)
13:38 masak ...wow.
13:39 Su-Shee joined #perl6
13:40 replore joined #perl6
13:40 masak traces of ancient history. Leo was doing Parrot and au was doing Perl 6, apparently from within a locked room ;)
13:41 GlitchMr Asked to remove 4 spaces, but the shortest indent is 0 spaces  in block  at config:18
13:41 GlitchMr Is it compile time warning?
13:43 masak looks like something out of the .indent() method.
13:43 masak r: say "foo".indent(-4)
13:43 p6eval rakudo 0bfba1: OUTPUT«Asked to remove 4 spaces, but the shortest indent is 0 spaces  in block  at /tmp/LpGuZ3AqSd:1␤␤foo␤»
13:43 GlitchMr masak: https://gist.github.com/4182308
13:43 GlitchMr This is the code I'm getting this
13:44 GlitchMr Any idea why?
13:44 masak yeah, 'cus of line 15.
13:45 masak arguably that shouldn't warn, though.
13:45 whiteknight joined #perl6
13:45 masak (because empty lines should stay empty after indent/outdent)
13:45 masak I don't believe the spec mentions that, but I believe that's a sensible rule.
13:45 moritz it is
13:45 masak anyone disagree?
13:45 GlitchMr Just wondering, can the exception for empty lines be done?
13:46 masak I'll happily patch the spec.
13:46 masak GlitchMr: yes, I think that makes a whole lot of sense.
13:47 masak I'm just wondering if there's a target market for "indent even empty lines", meaning we should have a named parameter too. I'm provisionally leaning towards "no".
13:47 masak GlitchMr++ # discovering this
13:47 masak this is *exactly* why API design is hard.
13:47 GlitchMr Also, I've tried removing that empty line, but it still doesn't work. It seems to outdent after interpolating $ini variable.
13:47 masak someone comes and uses your function in a perfectly sensible way, and it turns out there's a case you hadn't thought of.
13:47 GlitchMr That contains new line character.
13:48 GlitchMr It's probably Rakudo bug, but still
13:48 masak $ini variable looks good to me.
13:48 masak please try to golf your warning.
13:48 GlitchMr ok
13:48 masak I'll patch the spec in the meantime.
13:49 masak r: say "    1\n\n    2".indent(*)
13:49 p6eval rakudo 0bfba1: OUTPUT«    1␤␤    2␤»
13:49 masak r: say "    1\n\n    2".indent(-4)
13:49 p6eval rakudo 0bfba1: OUTPUT«Asked to remove 4 spaces, but the shortest indent is 0 spaces  in block  at /tmp/c_rDhiU448:1␤␤1␤␤2␤»
13:49 masak yeah, this should definitely ignore empty lines.
13:49 GlitchMr Sure
13:49 GlitchMr print qq:to 'END'
13:49 GlitchMr {"TE\nST\n"}
13:49 GlitchMr END
13:49 masak there's precedent. vim ignores empty lines.
13:50 GlitchMr "TE\nST\n" is expanded before parsing heredoc
13:50 GlitchMr Causing warnings
13:50 moritz masak: vim outdents blindly as many times as you tell it to
13:50 masak GlitchMr: that's... interesting.
13:50 masak and arguably not a bug.
13:50 * masak thinks real hard
13:51 GlitchMr But sometimes I would like to interpolate multiline variables in heredoc.
13:51 masak I see a case being made for "no, the interpolation should be made after the outdenting".
13:51 masak it could even be a strong case.
13:51 masak because anything else is wildly surprising and counterintuitive.
13:51 GlitchMr Besides, isn't heredoc compile time construct
13:52 GlitchMr Or at least, it should be
13:52 masak yeah.
13:52 masak that's probably the rationale: outdenting should be compile-time, and interpolation runtime.
13:55 GlitchMr That problem also exists in Ruby
13:56 telex joined #perl6
13:57 not_gerd joined #perl6
13:57 not_gerd hello, #perl6
13:57 masak not_gerd! \o/
13:58 not_gerd FROGGS: File::Spec is broken on my Rakudo 2012.10-126-g0961b71
13:58 * not_gerd tries to use Inline::C
13:59 FROGGS not_gerd: damn it, can you give me the output?
14:00 FROGGS Inline::C won't work, there is a bug in rakudo
14:01 not_gerd FROGGS: https://gist.github.com/4182415
14:02 not_gerd hmm... so I'll have to look at NativeCall
14:03 am0c joined #perl6
14:05 moritz r: say min(1, 2, 4)
14:05 p6eval rakudo 0bfba1: OUTPUT«1␤»
14:06 FROGGS not_gerd: I'll have a look later today, I guess I can at least fix File::Spec, maybe Inline::C works too, I think its just that its impossible to use Inline::C and NativeCall together right now
14:13 moritz I think I have a fix for Str.indent
14:21 masak oh, I forgot to push my spec commit.
14:21 * masak does so
14:22 dalek specs: 749445a | masak++ | S32-setting-library/Str.pod:
14:22 dalek specs: [S32/Str] make .indent not care about empty lines
14:22 dalek specs: review: https://github.com/perl6/specs/commit/749445a6e7
14:22 masak nice article about a seemingly nice book about BASIC and labyrinths. http://www.slate.com/articles/technology/books/2012/11/computer_programming_10_print_chr_205_5_rnd_1_goto_10_from_mit_press_reviewed.html
14:24 masak here's a Perl 6 program that does the same:
14:24 masak perl6 -e 'sub MAIN($width, $height) { for ^$height { say <\\ />.roll($width).join } }' 10 10
14:25 rurban joined #perl6
14:26 masak though this is much nicer, and perhaps closer in intent to the original: say ("\x2571", "\x2572").roll($width).join
14:27 masak actually, let's just go with perl6 -e 'loop { print ("\x2571", "\x2572").roll }'
14:28 * masak starts it and stares, transfixed
14:30 felher this is kind of hypnotic ...
14:30 masak :)
14:30 * masak supplies 'loop { print <9585 9586>>>.chr.roll }' to the HN thread
14:32 felher HN ?
14:32 masak Hacker News.
14:32 masak actually, shoulda done 'loop { print <9585 9586>.roll.chr }' :)
14:32 masak http://news.ycombinator.com/item?id=4856207
14:33 felher ah, nice :)
14:34 masak 'loop { print <╱ ╲>.roll }' works too, at least if your terminal is set up right ;)
14:35 felher Seems like it is :)
14:35 spider-mario joined #perl6
14:37 pmurias joined #perl6
14:43 pmurias hi
14:44 felher o/
14:44 moritz seems I can't push to github
14:44 moritz ssh_exchange_identification: Connection closed by remote host
14:45 masak :(
14:46 dalek rakudo/nom: 8444e8d | moritz++ | src/core/Str.pm:
14:46 dalek rakudo/nom: [Str.indent] ignore empty lines for outdenting
14:46 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8444e8d17e
14:53 masak should also ignore empty lines for indenting... :)
14:53 masak basically, empty lines should just pass through .indent unchanged.
14:54 moritz r: say "a\n\nb".indent(2).perl
14:54 p6eval rakudo 0bfba1: OUTPUT«"  a\n  \n  b"␤»
15:07 spider-mario joined #perl6
15:08 pmurias moritz: your ast dumper for nqp can handle all ast nodes?
15:09 PacoAir joined #perl6
15:11 bowtie joined #perl6
15:14 replore_ joined #perl6
15:17 Wtr joined #perl6
15:24 Pleiades` joined #perl6
15:25 dalek mu: 2180627 | gerdr++ | misc/perl6advent-2012/schedule:
15:25 dalek mu: [p6advent] claim day 4
15:25 dalek mu:
15:25 dalek mu: Intends to show that Rakudo is 'fast enough' for Project Euler
15:25 dalek mu: review: https://github.com/perl6/mu/commit/2180627b19
15:26 not_gerd the article is mostly written, will probably finish later today
15:30 wamba joined #perl6
15:30 masak not_gerd++
15:31 * masak should start writing on his article for tomorrow
15:35 am0c joined #perl6
15:40 Pleiades` joined #perl6
15:46 am0c joined #perl6
16:04 felher moritz++ # first post :)
16:07 birdwindupbird joined #perl6
16:11 ingy joined #perl6
16:11 shachaf joined #perl6
16:12 gugod joined #perl6
16:15 moritz pmurias: yes, but it doesn't output all information from all node types
16:15 moritz not_gerd: please /msg me your email address so that I can invite you to the wordpress site
16:17 dalek rakudo/nom: 3ffbec7 | moritz++ | src/core/Str.pm:
16:17 dalek rakudo/nom: do not indent empty lines
16:17 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3ffbec736a
16:17 hash_table joined #perl6
16:23 masak moritz++
16:27 fgomez joined #perl6
16:29 kaare__ joined #perl6
16:32 SamuraiJack joined #perl6
16:32 not_gerd if anyone wants to take a short trip into the future, that's how my advent post will look like: https://gist.github.com/73e4f265c2c0b500b568
16:34 moritz not_gerd: since you talk about performance at the start of the post, it might make sense to include rough run times
16:35 not_gerd should all be <1s, but that's worth mentioning, yes
16:36 masak not_gerd: '(with exclusive end)' sounds a bit confusing. maybe '(excluding the right endpoint)'.
16:36 masak and I agree about benchmarks.
16:37 masak not_gerd: might be worth mentioning under problem 3 that infix:<div>, as opposed to infix:</>, preserves the original type of the number, and so rounds the integers down.
16:38 sizz joined #perl6
16:38 not_gerd ok, <1s was a bit optimistic - the slowest one took ~5s
16:38 masak "Problem 009" -- should that be "Problem 9" to be consistent with the other numbering?
16:39 not_gerd masak: yes, thanks
16:40 masak under Problem 47, I would really like to see the C code ;)
16:41 masak finished reading. that is a nice post.
16:41 masak not_gerd++
16:41 not_gerd masak: the C code needs some cleanup - that's the main thing still missing
16:42 not_gerd I'll probably add the Perl6 code as well that takes $forever
16:42 masak :)
16:42 moritz but yes, overall a nice post. not_gerd++
16:45 SamuraiJack joined #perl6
16:45 * not_gerd is building an up-to-date Parrot/NQP/Rakudo
16:50 replore_ joined #perl6
16:52 dalek roast: 912d361 | moritz++ | S32-str/indent.t:
16:52 dalek roast: Str.indent tests with empty lines
16:52 dalek roast: review: https://github.com/perl6/roast/commit/912d3616a5
16:52 * not_gerd needs to log out
16:52 not_gerd feel free to leave more comments on the gist
16:53 not_gerd bye, #perl6
16:53 not_gerd left #perl6
16:53 moritz \o
16:54 GlitchMr I'm doing a spellchecking on my perl6advent article
16:54 GlitchMr But I've found a spelling error.
16:54 GlitchMr 'Succesfully installed Config::INI'
16:54 GlitchMr It should be "Successfully".
16:55 GlitchMr But that's error in Panda
16:57 FROGGS well, fork & fix & push ;o)
16:57 dalek panda: 21ce4bf | moritz++ | lib/Panda.pm:
16:57 dalek panda: fix spelling error. GlitchMr++
16:57 dalek panda: review: https://github.com/tadzik/panda/commit/21ce4bf477
16:58 GlitchMr I was too late :-P
16:58 FROGGS hehe
17:14 fgomez joined #perl6
17:15 GlitchMr %*CUSTOM_LIB<perl> is checked before %*CUSTOM_LIB<site>? Why?
17:15 GlitchMr This makes it impossible to update core modules
17:20 dalek rakudo/nom: da6569f | moritz++ | src/core/Str.pm:
17:20 dalek rakudo/nom: fix "".indent(*)
17:20 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/da6569f400
17:21 replore joined #perl6
17:25 dalek mu: ce4e17c | (Konrad Borowski)++ | misc/perl6advent-2012/schedule:
17:25 dalek mu: Claim day 12
17:25 dalek mu: review: https://github.com/perl6/mu/commit/ce4e17c1c2
17:28 dalek roast: ec94b1d | moritz++ | S32-str/indent.t:
17:28 dalek roast: re-add rakudo skip that I accidentally removed
17:28 dalek roast: review: https://github.com/perl6/roast/commit/ec94b1d30a
17:31 GlitchMr Cannot call 'indent'; none of these signatures match:
17:31 GlitchMr :(Str : Int $steps, Mu *%_)
17:31 GlitchMr :(Str : Int $steps, Mu *%_)
17:31 GlitchMr :(Str : $steps, Mu *%_)
17:31 Wtr left #perl6
17:31 GlitchMr Huh?
17:31 GlitchMr Shouldn't the third signature match indent?
17:31 GlitchMr Even when used with Str
17:33 moritz there's a constraint which Signature.perl ignores
17:33 GlitchMr masak: https://gist.github.com/4183370
17:36 rurban I hate wordpress formatting. I tried my best at http://reiniurban.wordpress.com/ but still annoying. Don't they support markdown?
17:36 GlitchMr No
17:36 GlitchMr They don't support MarkDown
17:37 GlitchMr I just have used Markdown in my article to have some human-readable language to work with.
17:37 GlitchMr (and because I use Markdown on my blog)
17:40 moritz rurban: the best you can do is to produce HTML, and then remove newlines from the HTML
17:41 GlitchMr I don't know why Perl6advent uses Wordpress.com, but it's probably too late to change that.
17:41 moritz GlitchMr: it's not perfect, but it works and is pretty reliable
17:41 moritz and it survived links from the frontpages from slashdot, reddit and hackernews
17:42 GlitchMr Right
17:43 GlitchMr btw, moritz, what do you think about https://gist.github.com/4183370
17:44 moritz GlitchMr: needs some language polishing, but otherwise quite nice
17:45 moritz GlitchMr: maybe worth mentioning that panda can install into user's home directories
17:45 GlitchMr I know
17:45 moritz even perl 5's toolchain hasn't supported this for long
17:45 GlitchMr I'm still working on it
17:46 GlitchMr Also, I think I've mentioned that
17:46 GlitchMr But it isn't really noticeable, so I don't know
17:46 GlitchMr "Panda installs modules globally when you have write access to installation directory, locally otherwise, so you can use panda even when Perl 6 is installed globally without installing modules like local::lib you had to install in Perl 5."
17:47 moritz something like that, but add a bit of punctuation
17:47 moritz English is well suited for short sentences.
17:47 GlitchMr I will try ;-)
17:47 GlitchMr I'm really bad at English.
17:47 whooguy joined #perl6
17:48 masak GlitchMr++ # nice!
17:48 masak tadzik++ # panda looks so nice, too
17:48 GlitchMr moritz: https://gist.github.com/4183370
17:48 GlitchMr I have put a dot.
17:49 masak GlitchMr: should I send corrections here, or over privmsg?
17:49 GlitchMr I don't care, really
17:50 * masak privmsgs
17:54 noggle joined #perl6
18:10 masak so, who wants slot #13? :)
18:11 masak (only five slots left! grab them while they still last!)
18:11 GlitchMr wow, only 5 slots left
18:11 masak though slot 24 should probably be something special...
18:11 masak like a TimToady post or something.
18:11 whooguy joined #perl6
18:12 masak hi, whooguy
18:12 GlitchMr Previous year we had multi subs.
18:12 GlitchMr For 24th day
18:12 replore joined #perl6
18:13 GlitchMr Actually, I think that "Idiomatic Perl 6" was more interesting.
18:15 masak r: my $squarer3 = { my $x = shift @_; $x * $x }; say $squarer3(11)
18:15 p6eval rakudo da6569: OUTPUT«121␤»
18:15 masak nice.
18:19 cognominal joined #perl6
18:24 popl joined #perl6
18:28 RandalSchwartz joined #perl6
18:28 RandalSchwartz joined #perl6
18:38 rindolf joined #perl6
18:39 whooguy joined #perl6
18:54 am0c joined #perl6
19:01 am0c joined #perl6
19:04 raiph joined #perl6
19:15 cognominal joined #perl6
19:19 Su-Shee joined #perl6
19:24 whooguy joined #perl6
19:32 Rotwang joined #perl6
19:37 rurban joined #perl6
19:41 am0c joined #perl6
19:54 cedrvint joined #perl6
19:55 cedrvint GlitchMr: are you sure Signature.ACCEPT was included in the latest R*?
19:58 sorear good * #perl6
20:00 GlitchMr It isn't?
20:00 cedrvint I'm not sure.
20:01 * cedrvint makes some tests
20:02 dalek bench-scripts: 45e025b | GlitchMr++ | dice.pl:
20:02 dalek bench-scripts: Fix #1 by conditional roll subroutine.
20:02 dalek bench-scripts: review: https://github.com/perl6/bench-scripts/commit/45e025ba36
20:02 cedrvint star: :() ~~ :()
20:02 p6eval star 2012.10:  ( no output )
20:03 cedrvint rn: :() ~~ :()
20:03 p6eval rakudo da6569:  ( no output )
20:03 p6eval ..niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0m��Action method fakesignature not yet implemented at /tmp/BhfDGR2GkK line 1:�------> [32m:([33m�[31m) ~~ :()[0m��Action method sigterm not yet implemented at /tmp/BhfDGR2GkK line 1:�------> [32m:()[33m�[31m ~~ :()[0m��…
20:03 GlitchMr This is star 2012.10
20:03 GlitchMr Newest version is 2012.11
20:03 GlitchMr Also, finally closed that pull request that was in this repository for... two years!
20:04 cedrvint GlitchMr: how I can test Signature.ACCEPTS (my test looks wrong)?
20:05 dalek mu: f370bcf | (Konrad Borowski)++ | misc/perl6advent-2012/topic-brainstorming:
20:05 dalek mu: Claim Panda
20:05 dalek mu: review: https://github.com/perl6/mu/commit/f370bcf7ba
20:05 GlitchMr signature-signature.t
20:05 GlitchMr In roast
20:06 GlitchMr Looks like you're right
20:06 GlitchMr Fixing
20:06 cedrvint r: say :(Str) ~~ :(Str)
20:06 p6eval rakudo da6569: OUTPUT«True␤»
20:06 cedrvint r: say :() ~~ :()
20:06 p6eval rakudo da6569: OUTPUT«True␤»
20:06 cedrvint star: say :() ~~ :()
20:06 p6eval star 2012.10: OUTPUT«False␤»
20:07 cedrvint OK, "say" was missing from the test
20:07 masak folks -- December 2 advent post draft is now written.
20:07 GlitchMr star: say :(Str) ~~ :(Int)
20:07 p6eval star 2012.10: OUTPUT«False␤»
20:07 GlitchMr r: say :(Str) ~~ :(Int)
20:07 p6eval rakudo da6569: OUTPUT«False␤»
20:07 masak it can be perused over at perl6advent for those with editor privileges.
20:07 masak feel free to review and supply feedback.
20:08 masak I've set -- successfully, I hope -- auto-publishing to one minute past midnight on the 2nd.
20:09 GlitchMr Can I get editor privileges too?
20:09 dalek roast: 84c7682 | GlitchMr++ | S03-smartmatch/signature-signature.t:
20:09 dalek roast: Revert "Remove useless block.".
20:09 dalek roast:
20:09 dalek roast: I wasn't aware it was used for documentation generation.
20:09 dalek roast:
20:09 dalek roast: This reverts commit 5249f858db28764a9ee6f989782bf6a6cd319089.
20:09 dalek roast: review: https://github.com/perl6/roast/commit/84c7682665
20:10 flussence rpn: say ?&undefined-sub
20:10 p6eval niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'undefined-sub' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤â€¦
20:10 p6eval ..rakudo da6569: OUTPUT«False␤»
20:10 p6eval ..pugs: OUTPUT«␤*** No such subroutine: "&undefined-sub"␤    at /tmp/a5c4Uy3CLL line 1, column 1 - line 2, column 1␤»
20:10 flussence is rakudo right there?
20:11 GlitchMr flussence: It's known
20:11 cedrvint masak: in a way, callbacks are anonymous functions in C ;)
20:11 GlitchMr flussence: http://rakudo.org/2012/11/28/rakudo-star-2012-11-released/ - check deprecations
20:12 flussence ok, better question, how do I sanely work around things that are NYI in half of the active implementations?
20:12 cedrvint masak: sometimes you can even create the code on the fly (JIT compilers, typically)
20:12 flussence (or how do I implement workarounds that test for a sub not existing?)
20:13 * cedrvint advocates for C, just for fun ;)
20:14 flussence (i.e. I need a &fork, and all I've got is a screwdriver)
20:14 masak cedrvint: troo. and clang and gcc even give you closure semantics.
20:15 flussence oh wait, this might work
20:15 flussence rpn: say ?(try { fork })
20:15 p6eval rakudo da6569: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&fork' called (line 1)␤»
20:15 p6eval ..niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'fork' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /hom…
20:15 p6eval ..pugs: OUTPUT«␤»
20:15 flussence rpn: say ?(try { &fork })
20:15 p6eval pugs: OUTPUT«1␤»
20:15 p6eval ..niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤     'fork' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1443 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /hom…
20:15 p6eval ..rakudo da6569: OUTPUT«False␤»
20:15 dalek specs: ea745ba | root++ | S10-packages.pod:
20:15 dalek specs: Caution that prefix<::> in declarative scenarios is different
20:15 dalek specs: review: https://github.com/perl6/specs/commit/ea745ba72b
20:15 dalek specs: ea4ee96 | bri++ | S (6 files):
20:15 dalek specs: Merge branch 'update'
20:15 dalek specs: review: https://github.com/perl6/specs/commit/ea4ee9681a
20:15 dalek specs: 9bef5dc | skids++ | S (10 files):
20:15 dalek specs: Merge remote-tracking branch 'perl6'
20:15 dalek specs: review: https://github.com/perl6/specs/commit/9bef5dc57c
20:15 dalek specs: 8e6b864 | skids++ | S06-routines.pod:
20:15 dalek specs: Do not use positional params as named in code example
20:15 dalek specs: review: https://github.com/perl6/specs/commit/8e6b864cc9
20:15 dalek specs: b6a63bf | skids++ | S12-objects.pod:
20:15 dalek specs: When talking about native types, use lowercase enum in example.
20:15 dalek specs: review: https://github.com/perl6/specs/commit/b6a63bfed3
20:15 dalek specs: fc0e3bd | (Konrad Borowski)++ | S (3 files):
20:15 dalek specs: Merge pull request #10 from skids/master
20:15 dalek specs:
20:15 dalek specs: Clarify when prefix<::> can be used as in-place predeclarator
20:15 dalek specs: review: https://github.com/perl6/specs/commit/fc0e3bd5eb
20:18 am0c joined #perl6
20:19 cedrvint masak: great post!
20:19 masak \o/
20:19 flussence rpn: say ?(try eval '&fork')
20:19 p6eval rakudo da6569, niecza v22-44-g0247fe5: OUTPUT«False␤»
20:19 p6eval ..pugs: OUTPUT«␤»
20:21 cedrvint masak: one minor comment before I leave: your "surprise" would be more impressive (to me) if it is open later by a caller (foo -> bar -> make_surprise, unwind up to foo -> surprise !). I don't known how to do that actually.
20:22 cedrvint left #perl6
20:25 dalek roast: 20eeb9d | amire80++ | S32-io/IO-Socket-INET.pl:
20:25 dalek roast: Remove a temporary flag file
20:25 dalek roast:
20:25 dalek roast: Put the file name into a variable, because it's used several times.
20:25 dalek roast:
20:25 dalek roast: Added unlink after every check for file's existence. As far as
20:25 dalek roast: I understand, at that point the file is not needed any more.
20:25 dalek roast: review: https://github.com/perl6/roast/commit/20eeb9d699
20:31 rurban joined #perl6
20:43 masak cedrvint: hm.
20:46 masak r: sub foo { my $surprise = bar(); $surprise() }; sub bar { return make_surprise("Finn") }; sub make_surprise($name) { return { say "Surprise, $name!" } }; foo
20:46 p6eval rakudo da6569: OUTPUT«Surprise, Finn!␤»
20:46 masak I'm not sure I see the difference in impressiveness :)
20:46 masak maybe I'm missing the point of what you're saying.
20:54 cedrvint joined #perl6
20:58 cedrvint masak: my point was: unlike in C, unwinding the call stack doesn't clobber variables
20:58 cedrvint masak: but that's not really important here, I guess
21:00 cedrvint r: sub foo { my $surprise = bar(); $surprise() }; sub bar { my $string = 'test'; return make_surprise($string) }; sub make_surprise($name) { return { say "Surprise, $name!" } }; foo
21:00 p6eval rakudo da6569: OUTPUT«Surprise, test!␤»
21:00 cedrvint masak: $string is still "alive"
21:02 huf that's what closures do, no?
21:02 cedrvint (well, this test works in C because "test" is stored in a RO data segment)
21:04 masak I can almost see what you're getting at.
21:04 cedrvint huf: in C, bar's stackframe won't survive on C<return>, thus everything allocated in its stack could be overwritten
21:04 masak and I can also sort of see why C doesn't allow closures by default.
21:04 cedrvint masak: but I don't want to introduce noise in your post.
21:04 huf well yes, c doesnt have closures
21:05 cedrvint huf: only nested functions ;)
21:05 masak because it would necessitate an automatic memory management policy above what C already provides.
21:05 huf only as a nonstandard extension, no?
21:05 cedrvint masak: yes
21:05 cedrvint huf: you're right: its a GCC extension
21:05 huf yes, and that of course doesnt do much magic
21:05 huf since the outer function is still running, its stack is still there
21:06 cedrvint exactly
21:06 huf i'm just saying, this difference can be summed up as "blocks are also closures"
21:06 huf if i read that bit of code right
21:06 cedrvint I agree
21:07 huf how do blocks know when to self-call?
21:08 cedrvint what's self-call ?
21:08 huf well i assume a block on its own will just run
21:08 rurban joined #perl6
21:09 huf but return BLOCK seems to return a callable
21:09 pmurias yes
21:10 cedrvint huf: like C<for "OK" { .say }> ?
21:11 huf pmurias: so how does it decide who calls that callable?
21:11 cedrvint "for", "if", ... I guess
21:11 huf if a block is in void context, it runs itself?
21:14 pmurias yes
21:15 cedrvint std: my $truthiness = { "Colbert".say }; if Tree $truthiness;
21:15 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing block (apparently gobbled by undeclared routine?) at /tmp/EoFt2iA0f_ line 1:â�¤------> [32m= { "Colbert".say }; if Tree $truthiness[33mâ��[31m;[0mâ�¤    expecting any of:â�¤    desigilnameâ�¤    twigilâ�¤Undeclared name:â�¤        'Tree' used at line
21:15 p6eval ..…
21:16 pmurias huf: S03:190
21:16 cedrvint std: my $truthiness = { "Colbert".say }; if True $truthiness;
21:16 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing block at /tmp/TZ7IRnHW1A line 1:â�¤------> [32mtruthiness = { "Colbert".say }; if True [33mâ��[31m$truthiness;[0mâ�¤    expecting any of:â�¤     infix or meta-infixâ�¤    infixed functionâ�¤Parse failedâ�¤FAILED 00:00 44mâ�¤Â»
21:17 pmurias huf: it's a syntactic destinction
21:17 masak huf: an earlier advent post summarized it as "it runs if not used as an rvalue". which I guess is tantamount to "it runs if in void context".
21:19 * cedrvint doesn't have the truthiness :-/
21:20 masak cedrvint: 'if' requires braces.
21:21 masak it's not enough for the braces to be around a block stored in a variable.
21:21 masak they have to be there syntactically.
21:22 masak 'if True $truthiness' is two terms in a row. so is 'if True { ... }', of course, but it gets a special exemption, because 'if' is a syntactic form.
21:22 pmurias rakudo: my $foo=sub foo {{say "hi"}};
21:22 p6eval rakudo da6569:  ( no output )
21:22 pmurias rakudo: my $foo=sub foo {{say "hi"}};$foo();
21:22 p6eval rakudo da6569: OUTPUT«hi␤»
21:23 Targen joined #perl6
21:25 cedrvint ah, OK
21:27 armitage81 joined #perl6
21:28 armitage81 joined #perl6
21:29 masak though it's an intriguing idea to make something like 'if True $truthiness' work. feels like it should in a language like Smalltalk or Io. :)
21:30 am0c joined #perl6
21:32 cedrvint sometimes I want to write: C<my $foo = given $bar { when Real { 1 } when Str { 2 } }> but it seems I have to write:
21:33 cedrvint r: my $bar = 'test'; my $foo0 = { given $bar { when Real { 1 } when Str { 2 } } }; my $foo = $foo0();
21:33 p6eval rakudo da6569:  ( no output )
21:33 cedrvint r: my $bar = 'test'; my $foo0 = { given $bar { when Real { 1 } when Str { 2 } } }; $foo0().say;
21:33 p6eval rakudo da6569: OUTPUT«2␤»
21:34 cedrvint that is, it requires one more indirection
21:34 cedrvint am i right?
21:35 masak or use 'do'.
21:35 masak r: my $bar = 'test'; my $foo0 = do given $bar { when Real { 1 }; when Str { 2 } }; say $foo0
21:35 p6eval rakudo da6569: OUTPUT«2␤»
21:35 cedrvint masak++
21:36 masak also, I'm surprised Rakudo doesn't complain about the lack of semicolon between your 'when's.
21:36 masak that's quite possibly a bug.
21:36 masak std: given 1 { when Real { 1 } when Str { 2 } }
21:36 cedrvint std: my $bar = 'test'; my $foo0 = { given $bar { when Real { 1 } when Str { 2 } } }
21:36 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/C8ZKP99tRu line 1:â�¤------> [32mgiven 1 { when Real { 1 }[33mâ��[31m when Str { 2 } }[0mâ�¤    expecting horizontal whitespaceâ�¤Parse failedâ�¤FAILED 00:00 42mâ�¤Â»â€¦
21:36 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/bA7tZmd2b0 line 1:â�¤------> [32my $foo0 = { given $bar { when Real { 1 }[33mâ��[31m when Str { 2 } } }[0mâ�¤    expecting horizontal whitespaceâ�¤Parse failedâ�¤FAI…
21:36 * masak submits rakudobug
21:36 cedrvint don't! :)
21:37 cedrvint it would break my code ;)
21:37 masak ;)
21:37 masak sorry, I simply have to.
21:39 cedrvint n: my $bar = 'test'; my $foo0 = { given $bar { when Real { 1 } when Str { 2 } } }; $foo0().say;
21:40 p6eval niecza v22-44-g0247fe5: OUTPUT«[31m===[0mSORRY![31m===[0m��Strange text after block (missing comma, semicolon, comment marker?) at /tmp/ybbRlLlHp7 line 1:�------> [32my $foo0 = { given $bar { when Real { 1 }[33m�[31m when Str { 2 } } }; $foo0().say;[0m��Parse failed��»…
21:43 * cedrvint has to fix advent #3, then.
21:43 moritz it's likely fine when you have a newline after the }
21:44 fgomez joined #perl6
21:44 cedrvint that explains why advent #3 works with Niecza
21:44 cedrvint (before "fix")
21:52 dalek nqp: 7ce401e | rurban++ | 3rdparty/dyncall/ (3 files):
21:52 dalek nqp: fix darwin with macports libtool
21:52 dalek nqp:
21:52 dalek nqp: the gnu/macports libtool does not understand -static.
21:52 dalek nqp: Force to use darwin special /usr/bin/libtool
21:52 dalek nqp: review: https://github.com/perl6/nqp/commit/7ce401edb1
21:52 dalek nqp: 4a3fb26 | rurban++ | src/pmc/ (5 files):
21:52 dalek nqp: Mark UNUSED pmc parameters as such
21:52 dalek nqp:
21:52 dalek nqp: Fixes -Wunused-parameter warnings
21:52 dalek nqp: review: https://github.com/perl6/nqp/commit/4a3fb26d33
21:54 masak oh yes, newline works just as fine as semicolon.
21:54 masak forgot to say that.
21:56 dalek nqp/gh67-threads: 0cc73af | rurban++ | src/pmc/nqplexpad.pmc:
21:56 dalek nqp/gh67-threads: [GH #67] Use rurban/gh870-pmc_class nqp_group.h information
21:56 dalek nqp/gh67-threads:
21:56 dalek nqp/gh67-threads: pmc2c from rurban/gh870-pmc_class exports the dynpmc types, which we use to
21:56 dalek nqp/gh67-threads: check for NQPLexInfo in NQPLexPad, to discriminate for Proxy. Proxy info is read-only.
21:56 dalek nqp/gh67-threads:
21:56 dalek nqp/gh67-threads: This does not work yet
21:56 dalek nqp/gh67-threads: review: https://github.com/perl6/nqp/commit/0cc73af222
21:56 dalek nqp/gh67-threads: 25ddb12 | rurban++ | src/pmc/nqplexpad.pmc:
21:56 dalek nqp/gh67-threads: [parrot #870] rename pmc_class_ to dynpmc_class_
21:56 dalek nqp/gh67-threads: review: https://github.com/perl6/nqp/commit/25ddb1220f
21:56 dalek nqp/gh67-threads: b7d9acd | rurban++ | / (2 files):
21:56 dalek nqp/gh67-threads: add t/nqp/67-threads.t, fix .gitignore for /nqp
21:56 dalek nqp/gh67-threads: review: https://github.com/perl6/nqp/commit/b7d9acdebe
21:58 cedrvint std: if True { say '1' } if True { say '2' }
21:58 p6eval std a8bc48f: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/xdH_ezHQrr line 1:â�¤------> [32mif True { say '1' }[33mâ��[31m if True { say '2' }[0mâ�¤    expecting any of:â�¤   horizontal whitespaceâ�¤  statement_controlâ�¤Parse fa…
21:58 cedrvint r: if True { say '1' } if True { say '2' }
21:58 p6eval rakudo da6569: OUTPUT«1␤2␤»
21:59 cedrvint same problem here
21:59 moritz r: if 1 { } 2
21:59 p6eval rakudo da6569: OUTPUT«===SORRY!===␤Confused␤at /tmp/weRSw8oYDG:1␤»
21:59 moritz r: if 1 { } if 1 { }
21:59 p6eval rakudo da6569:  ( no output )
22:00 moritz r: { } if 1 { }
22:00 p6eval rakudo da6569: OUTPUT«===SORRY!===␤Confused␤at /tmp/GC2CpTgOO8:1␤»
22:00 FROGGS weird
22:02 cedrvint does it mean the semicolon isn't useful in that case ? (no possible ambiguity)
22:02 FROGGS r: if False { say '1' } if True { say '2' }
22:02 p6eval rakudo da6569: OUTPUT«2␤»
22:02 cedrvint and it could be removed from STD ?
22:02 moritz no, it's simply a bug in rakudo's parser
22:03 moritz the rule is simple: you need a semicolon between two statements, unless the first ends with }\n
22:03 moritz and rakudo sometimes allows }  without \n, and that's a bug
22:03 cedrvint it makes sense
22:04 cedrvint r: if True { say '1' }if True { say '2' }
22:04 p6eval rakudo da6569: OUTPUT«1␤2␤»
22:04 cedrvint (without space between '}' and 'if')
22:12 robins joined #perl6
22:19 masak I like the semicolon-or-newline rule a lot. I think it's one of the sanest design decisions of Perl 6.
22:23 FROGGS and it fits larry's name
22:44 lichtkind joined #perl6
22:45 lichtkind im here to dicuss possible perl 6 advent calendar topic
22:45 lichtkind because i did the re talk i suggest i take a re feature
22:46 masak 're'?
22:46 lichtkind yes i mean rx
22:47 lichtkind as in rx// or use re ....;
22:48 masak feel free.
22:57 sorear hello lichtkind
22:59 SmokeMachine joined #perl6
22:59 lichtkind hej sorear
23:29 lue hello o/
23:30 lue [backlogging] is that why lines such as " when 1 { \n <snip> \n } when 2 { \n" broke in my code?
23:31 lue r: given 1 {␤when 1 {␤say "1";␤} when 2 {␤ say "not 1";␤}␤}
23:31 p6eval rakudo da6569: OUTPUT«1␤»
23:31 lue r: given 1 {␤when 1 {␤say "1";␤} default {␤ say "not 1";␤}␤}
23:31 p6eval rakudo da6569: OUTPUT«===SORRY!===␤Unable to parse expression in block; couldn't find final '}' at line 3, near "when 1 {\ns"␤»
23:32 lue That's a bug, isn't it?
23:33 lue r: given 1 {␤when 1 {␤say "1";␤}␤ default {␤ say "not 1";␤}␤}
23:33 p6eval rakudo da6569: OUTPUT«1␤»
23:38 SmokeMachine joined #perl6
23:45 SmokeMachine joined #perl6
23:47 Chillance joined #perl6
23:53 erkan joined #perl6
23:58 _jaldhar joined #perl6

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

Perl 6 | Reference Documentation | Rakudo