Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-06-12

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:16 mauke joined #perl6
00:20 fgomez joined #perl6
00:23 fgomez joined #perl6
00:42 mauke how can I access variables that may not exist? in perl5 terms, eval('$FOO') // 'default'
00:43 libertyprime joined #perl6
00:45 tadzik that ought to work in PErl 6 as well
00:45 tadzik oh, wait
00:46 tadzik why do you need that?
00:46 mauke I want to output the name/version of the implementation I'm running under
00:46 pmichaud_ rakudo doesn't implement it yet, but MY::<$a> should work someday.
00:46 tadzik that comes from $*PERL
00:46 tadzik nr: say $*PERL.perl
00:46 p6eval niecza v18-6-ge52d6c3: OUTPUT«Any␤»
00:46 p6eval ..rakudo b12854: OUTPUT«{"name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2012.05-239-gb12854a", "release-number" => "", "build-date" => "2012-06-11T21:09:36Z", "codename" => ""}}␤»
00:47 mauke yes
00:47 pmichaud_ oh, Rakudo has MY
00:47 mauke so how can I make that work in case $*PERL doesn't exist?
00:48 pmichaud_ http://gist.github.com/2913717  # looking up nonexistent variables
00:49 mauke try { " ($?PUGS_VERSION)" } // "" used to work a long time ago
00:49 pmichaud well, one can always look up a dynamic variable like $*PERL
00:50 mauke huh?
00:51 tadzik mauke: under what circumstances do you expect $*PERL to not exist?
00:51 mauke under what circumstances do you expect $?PUGS_VERSION to not exist?
00:51 pmichaud I expect $?PUGS_VERSION to not exist if running on something other than Pugs, I suppose.
00:52 pmichaud but $*PERL is defined by the Perl 6 spec, so it should exist.  (more)
00:52 pmichaud Even if it doesn't exist, it's a dynamic variable, which means that looking it up doesn't throw an exception (although trying to use the value it returns might).
00:52 mauke is $*PERL<compiler><ver> part of the spec?
00:52 pmichaud the contents of $*PERL aren't specced yet, no.
00:53 pmichaud but notice how niecza doesn't crash when requesting $*PERL -- it returns an undef
00:53 pmichaud even though it doesn't implement $*PERL yet (apparently)
00:53 pmichaud that's true for any dynamic variable (those with the '*' twigil).  Thus:
00:53 mauke I'm trying things in the rakudo repl
00:53 pmichaud nr:  my $a = $*NO_SUCH_VAR;  say "still alive";
00:53 p6eval niecza v18-6-ge52d6c3: OUTPUT«Potential difficulties:â�¤  $a is declared but not used at /tmp/oLYUxlQfN9 line 1:â�¤------> [32mmy [33mâ��[31m$a = $*NO_SUCH_VAR;  say "still alive";[0mâ�¤â�¤still aliveâ�¤Â»
00:53 p6eval ..rakudo b12854: OUTPUT«still alive␤»
00:53 mauke it throws for undefined variables but that may be the p part of the repl
00:54 pmichaud yes, that's the p part of the repl, printing the non-existent value throws the exception
00:54 pmichaud > my $x = $*NO_SUCH_VAR; 1
00:54 pmichaud 1
00:55 mauke rakudo: try { "$*WTF" } // 42
00:55 p6eval rakudo b12854:  ( no output )
00:55 mauke I get an exception here
00:55 pmichaud rakudo:  say $*NOTHING // 42;
00:55 p6eval rakudo b12854: OUTPUT«42␤»
00:55 pmichaud you don't need a "try"
00:55 mauke but "$*WTF" throws
00:56 pmichaud only if it's used
00:56 pmichaud in this case you're using it to build a string
00:56 mauke yes
00:56 pmichaud thus it throws
00:56 mauke yes
00:56 mauke so why doesn't try {} catch it?
00:56 pmichaud it did catch it
00:56 pmichaud the result was the empty string
00:57 mauke rakudo: try { "$*WTF" } ~ "."
00:57 p6eval rakudo b12854:  ( no output )
00:57 pmichaud okay, maybe not then.
00:57 pmichaud I don't know why you're trying to catch the exception.
00:57 pmichaud best to just not throw it in the first place.
00:57 mauke > try { "$*WTF" } ~ "asdf"
00:57 mauke Dynamic variable $*WTF not foundasdf
00:58 mauke pmichaud: how can I avoid throwing it?
00:58 pmichaud test it for undef before using it
00:58 pmichaud as above:    my $a = $*XXX // 42;   say $a
00:58 mauke assume I want to access $*PERL<compiler><ver>, where all components may or may not exist
00:59 pmichaud nr:  say $*PERL.defined ?? $*PERL<compiler><ver> !! "42"
00:59 p6eval niecza v18-6-ge52d6c3: OUTPUT«42␤»
00:59 p6eval ..rakudo b12854: OUTPUT«2012.05-239-gb12854a␤»
00:59 pmichaud nr:  say $*PERL<compiler><ver> // 42;   # just curious
00:59 p6eval niecza v18-6-ge52d6c3: OUTPUT«42␤»
00:59 p6eval ..rakudo b12854: OUTPUT«2012.05-239-gb12854a␤»
00:59 pmichaud ah, that works also.
01:00 adu joined #perl6
01:00 mauke rakudo: say $*PERL<compilr><ver>
01:00 p6eval rakudo b12854: OUTPUT«Any()␤»
01:00 pmichaud note the difference between   "$*FOO" and $*FOO.  The first attempts to stringify $*FOO, which throws the exception.
01:01 mauke what does try return?
01:01 pmichaud the result of executing the block.  I don't recall what it returns if an exception is thrown and caught.
01:02 adu r: say $*PERL.keys
01:02 p6eval rakudo b12854: OUTPUT«name compiler␤»
01:02 adu r: say $*PERL<name>
01:02 p6eval rakudo b12854: OUTPUT«rakudo␤»
01:02 adu n: say $*PERL<name>
01:02 p6eval niecza v18-6-ge52d6c3: OUTPUT«Any()␤»
01:03 mauke is 'Any()' perl6's way of saying "no values"?
01:03 sorear Any() is the stringification of the basic undefined value
01:03 pmichaud Any is a type object.  It's the most basic type object for most objects (i.e., things that aren't Junctions)
01:04 sorear in niecza, $*DOES_NOT_EXIST returns Any
01:04 sorear note that Perl 6 has two stringifications
01:04 sorear say stringification (.gist) tries to be useful for debugging, print stringification (.Str) for data processing
01:04 sorear n: my $x; say $x.gist; say $x.Str
01:04 p6eval niecza v18-6-ge52d6c3: OUTPUT«Any()␤Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 1262 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 268 (Mu.Str @ 15) ␤  at /tmp/ApFSKq2d3A line 1 (mainline @ 7) ␤  at /home/p6eval/niecza/lib/COR…
01:05 sorear the second warns but returns ""
01:05 sorear p6: say $*NONEXISTANT // 42;
01:05 p6eval rakudo b12854, niecza v18-6-ge52d6c3, pugs: OUTPUT«42␤»
01:05 sorear see, mauke, consistant
01:05 mauke good thing this isn't confusing at all
01:06 sorear you're right, Failure is extremely confusing
01:06 mauke what is 'quietly'?
01:06 sorear which is part of why I'm campaigning to get it removed from the spec
01:06 sorear alas, TimToady_ is extremely attached to it
01:07 mauke .oO( or bound to Failure )
01:07 sorear there is no 'quietly'.
01:07 mauke it's mentioned in S04
01:07 pmichaud quietly is a statement form, like try
01:08 pmichaud I don't think anyone implements it yet
01:08 sorear not everything which is mentioned in the synopses exists
01:09 mauke what should I read to find out what 'try' is supposed to return and what's actually implemented?
01:09 sorear 'try's return value is, I think, unspecified
01:09 sorear so don't rely on it
01:09 sorear use // insteadf
01:10 mauke instead of try?
01:10 scott_ joined #perl6
01:11 pmichaud yes, instead of try
01:11 pmichaud // checks definedness
01:11 mauke it doesn't seem like // catches exceptions
01:11 pmichaud so if $*SOMETHING returns an undef, the // will use the rhs instead
01:11 sorear r: say $*NONEXISTANT.perl
01:11 p6eval rakudo b12854: OUTPUT«Failure.new(exception => X::AdHoc.new(payload => "Dynamic variable \$*NONEXISTANT not found"))␤»
01:12 sorear mauke: $*FOO doesn't throw exceptions
01:12 mauke sorear: I'm not using $*FOO
01:12 pmichaud $*ANYTHING won't throw an exception unless you try to use its value
01:12 sorear mauke: what are you using?
01:12 mauke "$*FOO"
01:12 adu what do Perl6ites blog about?
01:12 sorear Why?
01:12 pmichaud mauke: why the quotes?
01:12 mauke pmichaud: to make it throw
01:12 pmichaud why are you making it throw?
01:13 pmichaud I mean, why is that desirable?
01:13 tadzik adu: I blog mostly about my projects
01:13 tadzik (those Perl 6 related)
01:13 tadzik people frequently blog about compiler improvements, grant statuses, hackathons etc
01:13 mauke there are several issues
01:13 adu tadzik: so I could blog about automatic semicolons in Go and how they're hard to encode into Perl6 grammars?
01:13 sorear I don't think it's desirable at all
01:13 mauke one part is me trying to get something concrete done
01:14 mauke another is me trying to understand how exactly exceptions work
01:14 pmichaud mauke: which would you like to tackle first?
01:14 sorear mauke: $*FOO in Rakudo returns a special value called a Failure
01:14 mauke the actual string I want is " ($*PERL<compiler><name> $*PERL<compiler><ver>)"
01:14 mauke sorear: yes, I got that
01:14 sorear mauke: Failures have a .Str method that throws exceptions
01:14 tadzik adu: sure
01:14 mauke sorear: it's like an error value in Haskell
01:15 pmichaud rn:  say "( {$*PERL<compiler><name> // 'unknown'} )"
01:15 sorear Once an exception is thrown, your options are extremely limited
01:15 p6eval niecza v18-6-ge52d6c3: OUTPUT«( unknown )␤»
01:15 p6eval ..rakudo b12854: OUTPUT«( rakudo )␤»
01:15 mauke except detectable
01:15 sorear So try not to call .Str on anythting that might be a Failure
01:15 tadzik adu: but I'm definitely buying you a beer if you achieve that
01:15 pmichaud rn:  say "( {$*PERL<compiler><name> // 'unknown'} {$*PERL<compiler><version> // 'unknown'} )"
01:15 p6eval niecza v18-6-ge52d6c3: OUTPUT«( unknown unknown )␤»
01:15 p6eval ..rakudo b12854: OUTPUT«( rakudo unknown )␤»
01:15 sorear Use // to replace the Failure with a sane value first
01:15 pmichaud rn:  say "( {$*PERL<compiler><name> // 'unknown'} {$*PERL<compiler><ver> // 'unknown'} )"
01:15 p6eval rakudo b12854: OUTPUT«( rakudo 2012.05-239-gb12854a )␤»
01:15 p6eval ..niecza v18-6-ge52d6c3: OUTPUT«( unknown unknown )␤»
01:15 pmichaud mauke: like that ^^
01:15 mauke pmichaud: no, not like that
01:15 sorear Or use Niecza, which refuses to implement Failures until they are replaced with something more sane
01:15 mauke pmichaud: if any part is unknown, I want to use an empty string instead
01:15 adu tadzik: well, my current solution is: https://github.com/andydude/gosemi
01:16 adu tadzik: if I can parse it without that tool, then you can buy me a beer :D
01:16 sorear r: say $*NONEX<foo> // 'bar'
01:16 p6eval rakudo b12854: OUTPUT«bar␤»
01:16 tadzik adu: oh, I thought you plan to modify the Perl 6 grammar so one doesn't have to write semicolons :)
01:17 pmichaud mauke: you want the whole string to be empty if any part is unknown?
01:17 sorear rn: say $*NONEX<foo><bar> // 'unfound' # mauke
01:17 mauke pmichaud: yes
01:17 p6eval rakudo b12854, niecza v18-6-ge52d6c3: OUTPUT«unfound␤»
01:17 adu tadzik: oh, I never thought about that, but that would be very natural once I'm able to parse Go
01:17 pmichaud rn:  say ($*PERL<compiler><name>.defined && $*PERL<compiler><ver>.defined) ?? "( $*PERL<compiler><name> $*PERL<compiler><ver> )" !! "";
01:17 p6eval rakudo b12854: OUTPUT«( rakudo 2012.05-239-gb12854a )␤»
01:17 p6eval ..niecza v18-6-ge52d6c3: OUTPUT«␤»
01:18 adu tadzik: that would be totally beer-worthy
01:18 pmichaud mauke: like that, perhaps?
01:18 mauke pmichaud: too complicated
01:18 mauke I don't want to repeat myself
01:19 mauke that is, I don't want to check preconditions when I can just make the expression throw an exception and catch that
01:19 adu tadzik: if I were to do that, would it slowly become part of the synopses?
01:19 mauke except I can't catch exceptions, apparently
01:19 sorear mauke: you can catch exceptions
01:19 tadzik adu: I highly doubt it, but it could become a module that lexically modifies the Perl 6 grammar
01:19 sorear mauke: you just can't use the return value of try.
01:19 tadzik so you could use that in your modules and it wouldn't "leak out"
01:20 sorear r: my $res; try { die 2; CATCH { default { $res = 5 }; }; }; say $res # mauke
01:20 p6eval rakudo b12854: OUTPUT«5␤»
01:20 adu tadzik: what would it be called? Syntax::AutoSemi?
01:20 tadzik adu: however you'll name it :)
01:20 mauke sorear: that's sad
01:20 pmichaud nr:  my $a = '';  try { $a = "( $*PERL<compiler><name> )"; };  say $a;
01:20 p6eval niecza v18-6-ge52d6c3: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 1262 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 268 (Mu.Str @ 15) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting…
01:20 p6eval ..rakudo b12854: OUTPUT«( rakudo )␤»
01:21 mauke that makes http://perlcabal.org/syn/Differences​.html#eval_%7B%7D_is_now_try_%7B%7D somewhat of a lie
01:21 tadzik maybe we'll have to reserve a namespace for such things. Either Syntax:: or Slang:: or something
01:21 sorear the perl 6 exception specification is an exercise in sadness and more importantly denial.
01:21 adu pmichaud: I think niecza doesn't support $*PERL
01:21 pmichaud I think niecza doesn't follow the spec there.  It should've caught that exception.
01:21 pmichaud nr:  my $a = '';  try { $a = "( $*XYZ<compiler><name> )"; };  say $a;
01:21 p6eval niecza v18-6-ge52d6c3: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 1262 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 268 (Mu.Str @ 15) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting…
01:21 p6eval ..rakudo b12854: OUTPUT«␤»
01:21 sorear pmichaud: in niecza, $*PERL returns Any.  What exception?
01:22 pmichaud oh, I was thinking that "Use of uninitialized value..." should be an exception of some sort.
01:22 sorear I just read the relevant part of the Go specification.
01:23 sorear You can't use Perl 6 grammars for this.
01:23 sorear It assumes you have a separate lexer.
01:23 adu sorear: any particular reason?
01:23 mauke oh well, https://raw.github.com/mauke​/poly.poly/master/poly.poly has working perl6 code again
01:23 sorear Well, maybe you can, but it won't be in any 'obvious' way
01:24 adu sorear: see <automatic_semicolon> in http://pastebin.com/FcAiMAU2
01:24 adu sorear: I think that should work, but it isn't working
01:25 adu sorear: then again, the rest of the grammar doesn't work with explicit semicolons, so that's not the issue
01:25 sorear Your automatic_semicolon rule is wrong because it tries to parse backwards.
01:25 adu possibly
01:25 adu sorear: how is that "wrong"?
01:25 pmichaud sorear: whatever is producing the "Use of uninitialized value..."  should've been caught by the try, I think.  Although S04 does say that try handles fatal exceptions by ignoring them... I suppose there's an argument to be made that warnings aren't fatal exceptions.
01:26 pmichaud and therefore try shouldn't catch warnings... but that would seem weird to me.
01:26 adu sorear: ultimately semi should be defined as ';' | <automatic_semicolon>
01:26 sorear adu: You need to incorporate insertion handling into the rules that parse stuff forward.
01:27 sorear adu: Well, first off, you might be looking at something like break   <EOL> <YOUAREHERE>more stuff
01:28 sorear you need to parse backward, and then once you find the letters b r e a k, check to make sure that they would have been parsed that way to begin with
01:28 sorear handling all the corner cases right is... intractible
01:29 sorear I just remembered that Perl 6 actually has a somewhat similar but more restricted semicolon insertion rule: after a line-ending } token, a semicolon may be omitted
01:29 sorear handled in <.curlycheck>
01:29 sorear the important thing here is that it works by setting a flag in @*MEMOS at the time the } is parsed
01:29 sorear it does *not* use <?after
01:30 pmichaud ...and it only assumes a semicolon if a statement could terminate at that spot.
01:30 sorear std: / [\n | $$ | $] ] /
01:30 p6eval std f179a1b: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse regex; couldn't find final '/' at /tmp/hfDBoeJ5J1 line 1:â�¤------> [32m/ [\n | $$ | $] [33mâ��[31m] /[0mâ�¤    expecting any of:â�¤     quantifierâ�¤     regex atomâ�¤Parse failedâ�¤FAILED 00:00 41mâ�¤Â»
01:30 sorear std: $]
01:30 p6eval std f179a1b: OUTPUT«Use of uninitialized value $x in pattern match (m//) at STD.pm line 66577.�Use of uninitialized value $x in concatenation (.) or string at STD.pm line 66616.�[31m===[0mSORRY![31m===[0m�Unsupported use of $] variable; in Perl 6 please use $*PERL_VERSION at /tmp/mQ…
01:31 sorear oh, yeah
01:31 sorear you need to use something like the <cut> logic
01:44 adu sorear: but it could use ?before, theoretically speaking
01:46 adu sorear: omg, I didn't even see that, that $] might be interpreted as a variable, I thought it would be interpreted as end-of-text
01:47 adu should I rewrite that as [ \n | $$ | $ ] ?
01:50 sorear adu: no, but it's not needed
01:51 sorear $$ already means [ <?before \n> | $ ]
01:51 adu \n matches EOF?
01:51 adu oh
01:51 adu I didn't realize that
01:55 ingy_ joined #perl6
01:55 ingy_ hola
01:56 * ingy_ is an ingy imposter
01:56 mauke is that like (?=\n)|\z in perl5?
01:56 tadzik hello ingy-with-a-tail
01:56 ingy_ :)
01:56 ingy_ just showing someone irssi with screen/tmux
01:56 ingy_ o/
01:56 tadzik ooh, who was talking about Middle-endian ARM?
02:06 pmichaud rn: say "hello\n" ~~ / o . $$/
02:06 p6eval niecza v18-6-ge52d6c3: OUTPUT«Match()␤»
02:06 p6eval ..rakudo b12854: OUTPUT«#<failed match>␤»
02:06 pmichaud hmmm.
02:13 colomon Middle-endian?!
02:15 colomon sorear: ping?
02:16 tadzik colomon: that's also called "switchable endianess"
02:17 tadzik madness
02:17 colomon tadzik: ah.  when I looked just now, wikipedia implied it was mixed endianess, which is just as mad or madder, but in a different.
02:17 tadzik ahye
02:18 colomon *way
02:19 sorear mauke: it's more like (?m:$)
02:19 sorear colomon: pong
02:19 colomon sorear: I tried the MP3 tag stuff in Niecza for the first time in ages, and it's behaving weirdly now.  Or perhaps I've just found an old weirdness I never noticed?
02:20 colomon Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object
02:20 colomon It seems to happen when I'm trying to look at a file which doesn't actually have MP3 tags.
02:24 colomon sorear: I'm calling CLR::("TagLib.File,$TAGLIB").Create($filename), and if I call .Tag on the result of that, it doesn't trigger an "unless" test.
02:24 colomon ditto for $file.Tag.JoinedPerformers
02:24 colomon but $file.Tag.JoinedPerformers ~~ m/\S/ get me that error.
02:29 sorear odd, maybe related to serialization changes
02:30 sorear perhaps seeing a --debug backtrace would help
02:32 tokuhiro_ joined #perl6
02:34 xinming joined #perl6
02:34 fgomez joined #perl6
02:35 libertyprime joined #perl6
02:37 libertyprime joined #perl6
02:40 libertyprime joined #perl6
02:43 colomon sorear: https://gist.github.com/2914052 is the best I've gotten so far.  Sorry for slow response, got sidetracked, and now need to head to bed.  (PS The code does appear to still work in general, it's just this one particular case which is giving me fits.)
02:44 pupoque joined #perl6
02:44 colomon afk # will read any response in the morning...
02:53 sorear OH
02:55 benabik M G?
03:17 TimToady joined #perl6
03:18 libertyprime joined #perl6
03:27 xinming joined #perl6
03:34 alester joined #perl6
03:42 masak good morning, meatbrains.
03:43 phenny masak: 29 May 01:55Z <diakopter> tell masak RT 112870 is magically fixed. r: multi sub infix:<~eq>(Str $a, Str $b) { uc($a) eq uc($b) }; say 'Foo' ~eq 'foo'
03:43 phenny masak: 29 May 02:31Z <diakopter> tell masak also RT 111418
03:43 phenny masak: 29 May 02:52Z <diakopter> tell masak RT 102690 is a dupe of 112578
03:43 phenny masak: 29 May 02:54Z <diakopter> tell masak RT 113398 is a dupe of 111956
03:43 phenny Further messages sent privately
03:43 masak phenny: thanks. I have a feeling most of these are now old hat. but still nice.
03:43 tadzik lol it's masak!
03:43 sorear maaasaak
03:44 masak \o/
03:46 masak thanks everyone for reporting the link typo in my last blog post. I have been unable to fix while away from my setup. I will fix it now.
03:46 masak also, I'm going to srsly dig into improving the software around the blog :) have some ideas.
03:47 masak I'm about 10 days backlogged.
03:49 tadzik so you were actually home yesterday, and been backlogging since then? :)
03:49 jaldhar joined #perl6
03:50 adu joined #perl6
03:55 pmichaud masak! \o/
03:56 * pmichaud is very happy that masak++ has returned.
03:57 adu sorear: parsing, in general, is intractible :)
03:58 mauke look on my works, ye mighty, and despair: https://raw.github.com/mauke​/poly.poly/master/poly.poly
04:00 masak pmichaud! \o/
04:00 jaldhar joined #perl6
04:00 pmichaud masak: so, is it like very very early morning where you are now?
04:00 masak tadzik: I was actually home yesterday, and collapsed into a tired pulp at 8 o'clock. been backlogging on and off during flights.
04:01 masak pmichaud: yeah, but I have an excuse. tadzik++ here doesn't :P
04:01 pmichaud heh
04:01 pmichaud well, I'll be up at 04h00 localtime tomorrow as well to catch my 06h00 flight.
04:01 masak ooh
04:01 pmichaud I guess that means I'll have an excuse too.
04:01 masak bon voyage
04:01 masak witherever
04:02 pmichaud departing for yapc::na (madison, wi)
04:02 masak whitherever*
04:02 masak ooh, YAPC::NA -- the YAPC that US-centric US citicens call "YAPC" ;)
04:02 masak citizens*
04:03 masak my typing is not up to scratch, clearly
04:03 masak fingers I am disappoint
04:03 pmichaud oh, sometimes we refer to it by "The Yet Another Perl Conference", too.  :-)
04:04 masak dreadful.
04:04 pmichaud did you have a good trip?
04:04 masak it... went up to eleven.
04:04 masak so, yes.
04:04 pmichaud for 1..11 { +1 }
04:04 * sorear is irritated that ey dropped the ball on YAPC::NA trip plann ing
04:05 tadzik my excuse is insomnia
04:05 pmichaud masak: outstanding... those are the best sorts of trips
04:05 tadzik and it's 6:05 here
04:07 tadzik mauke: awesome :)
04:09 * masak enchants mauke with his magic tab completion wand
05:08 simcop2387 joined #perl6
05:15 masak rn: say <Mon Tues Wednes Thurs Fri Satur Sun>[$_ % *], "day May $_" for 1..10
05:15 p6eval rakudo b12854, niecza v18-6-ge52d6c3: OUTPUT«Tuesday May 1␤Wednesday May 2␤Thursday May 3␤Friday May 4␤Saturday May 5␤Sunday May 6␤Monday May 7␤Tuesday May 8␤Wednesday May 9␤Thursday May 10␤»
05:15 masak I haven't seen anyone use the [$_ % *] trick before.
05:21 masak rn: say <_ Mon Tues Wednes Thurs Fri Satur Sun>[(my $d = Date.new("2012-05-$_")).day-of-week], "day May $d.day-of-month()" for "01".."10"
05:21 p6eval rakudo b12854: OUTPUT«Tuesday May 1␤Wednesday May 2␤Thursday May 3␤Friday May 4␤Saturday May 5␤Sunday May 6␤Monday May 7␤Tuesday May 8␤Wednesday May 9␤Thursday May 10␤»
05:21 p6eval ..niecza v18-6-ge52d6c3: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared name:â�¤ 'Date' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1401 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /home/p6…
05:21 masak almost as short, and fewer assumptions.
05:29 pmichaud r: say <A B C>[$_ % *] for 1..10
05:29 p6eval rakudo b12854: OUTPUT«B␤C␤A␤B␤C␤A␤B␤C␤A␤B␤»
05:29 pmichaud oh that's clev-er!
05:29 pmichaud masak++
05:29 * masak beams
05:30 pmichaud ot
05:30 pmichaud oops
05:30 pmichaud it's fun to see how many times this language surprises me.
05:31 pupoque joined #perl6
05:33 adu I can't track this bug
05:33 sorear masak: possibly up your alley, I've been spending a lot of time lately on http://www.math.uconn.edu/~kconrad/blurbs/ - abstract algebra at a fairly reasonable explicitness tradeoff point
05:34 masak sorear: ooh -- many thanks
05:34 masak sorear: will keep this around for when other things settle down.
05:34 adu omg, I think I found the bug
05:34 adu rel_op:sym«<=» is not matching '<='
05:35 kaleem joined #perl6
05:35 masak fun thing, disconnecting for two weeks and then reconnecting. at least if you're a person who more or less lives on the Internet. don't try this at home.
05:35 adu why?
05:35 adu rel_op:sym<!=> matches '!=' fine
05:35 pmichaud adu: gist?
05:36 masak adu: are you able to show this using p6eval?
05:36 moritz \o
05:36 adu http://pastebin.com/raw.php?i=FcAiMAU2
05:36 masak preferably with a minimally long program?
05:36 masak moritz! \o/
05:36 moritz masak is back!
05:36 * masak runs up and hugs moritz
05:36 masak hiiii!
05:36 masak :D
05:36 moritz hug pile!
05:37 * sorear leaps on it!!
05:37 masak oof.
05:38 moritz masak: how were yuour vacations?
05:38 masak I've been trying to find words to describe the vacation.
05:39 masak I've settled on "it went up to 11".
05:39 bonsaikitten masak: did that two years ago, it's quite fun to disconnect
05:40 masak beautiful scenery, excellent food, lots of exercise, and no shortage of general and specific happiness.
05:40 * moritz doesn't know that phrase but decides it sounds quite positive
05:40 adu pmichaud: masak: yes
05:40 masak moritz: http://en.wikipedia.org/wiki/This_Is_Spinal_Tap http://en.wikipedia.org/wiki/Up_to_eleven
05:40 adu r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op {*}; token rel_op:sym<!=> { <sym> }; }; say binop.parse('!=')
05:40 p6eval rakudo b12854: OUTPUT«q[!=]␤ rel_op => q[!=]␤  sym => q[!=]␤␤»
05:40 adu (showing success)
05:40 bonsaikitten masak: where did you go to?
05:40 adu r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op {*}; token rel_op:sym«<=» { <sym> }; }; say binop.parse('<=')
05:40 p6eval rakudo b12854: OUTPUT«#<failed match>␤»
05:40 pmichaud "This one goes to 11."
05:40 adu (showing failure)
05:41 masak bonsaikitten: http://en.wikipedia.org/wiki/Jiuzhaigou_Valley
05:42 bonsaikitten nice. how did you choose it?
05:42 masak I had heard from reliable sources that it's one of the most beautiful places in China.
05:43 bonsaikitten fair enough. good choice :)
05:43 bonsaikitten I'm having enough fun in Shanghai, but exploring the rest of China is definitely on my todo list
05:44 masak oh, didn't do 上海 this time around.
05:44 * sorear wonders how fluent masak is in the local language
05:44 masak it seems like a happening city.
05:44 sorear hey, I can almost read that
05:44 pmichaud adu: that's.... interesting.
05:45 adu pmichaud: interesting?
05:45 sorear .oO( Chinese Netherlands )
05:45 pmichaud r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op {*}; token rel_op:sym«!=» { <sym> }; }; say binop.parse('!=');
05:45 p6eval rakudo b12854: OUTPUT«#<failed match>␤»
05:45 masak sorear: I... can order food. I can go down to reception, and say "my room card doesn't work, and I don't know why". I can follow most conversations having to do with food or hotels.
05:45 pmichaud looks like it's a problem with the « » angles
05:46 sorear masak: ookey you're way better than me
05:46 bonsaikitten I still haven't reached that level yet
05:46 adu pmichaud: I thought that < > and « » were implemented the same way
05:46 bonsaikitten but shanghai is too international to force me to learn
05:46 * sorear can't even follow Japanese conversations 80% of the time
05:46 masak sorear: my weakest point is the tones. they're hard to get right for a non-native, even a careful one like me.
05:46 pmichaud adu: well.... so did I, which is why it's "interesting".  :-)
05:47 bonsaikitten masak: and they differ a lot depending on region ... so whatever you learned is "wrong" for the other 80% of the country
05:49 masak bonsaikitten: not just the tones. what people usually refer to as "dialects" in China are more usefully thought of as different languages in the same-ish family.
05:49 bonsaikitten masak: yes, but even if they try to speak mandarin it's very different
05:49 bonsaikitten "beijing pirate dialect" ;)
05:49 bonsaikitten they make everything sound like aaarrrrrrrr
05:50 masak :D
05:50 masak never made that connection before :P
05:52 pmichaud r: my grammar binop { proto token rel_op {*}; my $x = token rel_op:sym«!=» { <sym> };  say $x; }
05:52 p6eval rakudo b12854: OUTPUT«rel_op:sym«!=»␤»
05:52 pmichaud ...that's the problem.  The regex engine expects those «'s to be converted to single angles.
05:52 * masak submits rakudobug
05:52 masak aaaaaaah.
05:53 masak it's good to be back!
05:54 pmichaud in Actions.pm
05:54 pmichaud { if $<deflongname> { %*RX<name> := $<deflongname>[0].Str } }
05:54 pmichaud is likely the culprit.
05:55 pmichaud It needs to normalize the name of protoregex candidates.
05:57 fridim_ joined #perl6
05:57 adu hmm
05:57 pmichaud adu: in the meantime, you can do
05:58 adu :sym('!=')?
05:58 pmichaud r: my grammar binop { rule TOP { <rel_op> }; proto token rel_op {*}; token rel_op:sym<le> { '<=' }; }; say binop.parse('<=');
05:58 p6eval rakudo b12854: OUTPUT«q[<=]␤ rel_op => q[<=]␤␤»
05:59 adu oh ok, that works
05:59 adu thanks pmichaud++
05:59 pmichaud sym<op> is a convenience, it's not required to parse 'op'
06:00 adu but it appears to be idiomatic
06:00 pmichaud yes, it's idiomatic
06:00 moritz btw I consider the module-trace branch to be ready for merging
06:01 moritz more backtraces. masak++ will be sooo happy :-)
06:01 masak https://rt.perl.org/rt3/Tic​ket/Display.html?id=113590
06:01 masak moritz: it's not really that I dislike backtraces. it's just that I'm really fond of brief descriptions of what's wrong.
06:02 pmichaud nqp gets the :sym«op» correct by manipulating the value coming back from <deflongname>.
06:02 pmichaud rephrase:  by manipulating the .ast value of $<deflongname>
06:02 masak I'm a terminal window junkie. if the text jumps up two lines, there's no mental disconnect. if the text jumps up two screens, I have to scroll to find my bearings again.
06:02 pmichaud oh, Rakudo does the same, but the Actions.pm line doesn't use it.
06:02 masak scrolling to find out what went wrong in a program is a crappy default.
06:03 adu pmichaud: YEY it works for now
06:04 pmichaud I think I can quickly fix Rakudo's regex declarator tomorrow.  (Too late/too tired for me to reliably do it tonight.)
06:05 pmichaud adu++ # found an imporant bug
06:05 masak adu++
06:05 adu :D
06:05 * pmichaud takes ticket #113590
06:05 adu I've been staring at all my parsings for hours
06:05 adu I'm glad it was worth it
06:05 masak it almost always is.
06:06 moritz masak: https://gist.github.com/2911966
06:06 masak the skill is going from "I notice that I am confused" to "ah, that's what's wrong" in as short time as possible.
06:06 masak that takes training.
06:06 adu masak: indeed
06:06 pmichaud adu++ golfed it down nicely, t hough.
06:06 pmichaud *though
06:06 masak but "ah, that's what's wrong" is almost always connected to learning something new.
06:06 masak pmichaud: yes. I'm impressed.
06:06 masak adu++
06:07 moritz masak: the scond half is what that branch now produces
06:07 moritz for X::Comp errors while compiling dependent modules
06:07 masak moritz: nice.
06:07 pmichaud moritz: if there are no regressions I'm fine with the branch merge whenever you are :)
06:07 masak moritz: both those look like you wrote them by hand, though.
06:07 masak moritz: there are no line numbers...?
06:07 pmichaud I haven't looked at the branch details but I trust you on that one :)
06:08 moritz masak: the line numbers are after the colon
06:08 pmichaud okay, if I'm to get any sleep before getting up for airport I best go now.  Catch you all tomorrow sometime.
06:09 fhelmberger joined #perl6
06:09 masak moritz: ah, so they are.
06:09 moritz masak: https://gist.github.com/2911966 updated with what the branch produces now
06:10 masak from module mA file lib/mA.pm:2
06:10 masak I wonder if that shouldn't be
06:10 masak from module mA (lib/mA.pm:2)
06:10 masak instead.
06:11 moritz right, might be more consise
06:11 moritz and easy to do (it's all in Perl 6 :-)
06:11 masak \o/
06:11 moritz anyway, I'll spectest and merge the branch first
06:11 masak ++moritz
06:11 moritz we can then tweak it further in mom
06:11 masak aye.
06:11 masak it's all just a DAG of commits :P
06:12 wtw joined #perl6
06:14 moritz and I'm rather fond of that :-)
06:14 moritz masak: you might also be happy about https://github.com/perl6/doc/
06:14 masak whee
06:15 eiro hello
06:15 masak heiro! \o/
06:15 masak moritz: yes, that looks like a reincarnation of the u4x idea.
06:15 masak something like that is very much needed.
06:16 moritz masak: except that this time there's a bin/p6doc right from the start
06:16 masak aye.
06:16 masak very good.
06:16 moritz p6doce Str.split
06:16 moritz s/e//
06:16 moritz anyway, just as u4x it will need some other contributors to keep me motivated in the long run
06:17 moritz masak: I've also stolen some docs from u4x
06:17 eiro i saw an innosetup script somewhere: is there a built installer for windows ?
06:17 masak moritz: excellent.
06:17 masak moritz: about helping/motivation, I'll see what I can do.
06:17 moritz masak: oh, and I've started an ufo branch
06:17 masak moritz: I have an idea what might help: throwing this up on the web.
06:18 masak moritz: i.e. release-early-release-often, and everyone can always see how complete the docs are.
06:18 moritz masak: which writes much less "smart" makefiles, and declares dependencies betwenn modules
06:18 moritz masak: yes, that's part of my plan
06:18 masak moritz: ok. I'll review it when I have time.
06:18 masak moritz: oh, ok. great.
06:18 masak moritz: I think that's important for motivation. not just a frivolous extra.
06:18 masak as open/transparent as possible.
06:18 masak that's what makes many other components of perl6.org work.
06:27 sorear phenny: tell colomon try adding a null check to line 761 of NieczaCLR.cs, you know the drill by now, and see if that helps
06:27 phenny sorear: I'll pass that on when colomon is around.
06:27 sorear phenny: tell colomon s/761/791/, in master HEAD
06:27 phenny sorear: I'll pass that on when colomon is around.
06:29 moritz masak: re http://irclog.perlgeek.de/​perl6/2012-06-12#i_5714547  it's been in SVG::Plot since 2009 or 2010 :-)
06:30 moritz :style("fill:{ @.colors[$d % *]}; stroke: none"),
06:30 masak moritz++ :)
06:31 masak moritz: if I ever need a fiendishly clever arch-enemy, I'll think of you.
06:31 * moritz loughed out loud
06:31 dalek rakudo/nom: 1b00e64 | moritz++ | src/Perl6/ModuleLoader.pm:
06:31 dalek rakudo/nom: note end of module loading in debug mode
06:31 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/1b00e6425e
06:31 dalek rakudo/nom: 339771a | moritz++ | src/ (2 files):
06:31 dalek rakudo/nom: start to trace module loading in a dynamic variable
06:32 moritz bye dalek
06:32 dalek joined #perl6
06:36 * moritz ticks off item 5) from http://irclog.perlgeek.de/​perl6/2012-06-08#i_5699614
06:36 brrt joined #perl6
06:37 masak ooh, a "what to hack on next" list. :)
06:37 masak I'll make one too.
06:37 masak (1) QAST, to the point that Rakudo runs it
06:37 masak (2) macros D2 (currently blocking on (1))
06:37 masak (3) my blogging software
06:38 masak oddly, (3) is what bubbled up during the vacation. I had a number of design ideas.
06:41 masak &
06:47 diakopter masak: yes, those tickets were handled by moritz & me
06:49 kresike joined #perl6
06:49 kresike hello all you happy perl6 people
06:49 diakopter hi kresike
06:49 kresike hi diakopter
07:03 DarthGandalf joined #perl6
07:03 domidumont joined #perl6
07:03 sorear helllo kresike
07:04 DarthGandalf joined #perl6
07:09 fglock joined #perl6
07:13 kresike hello sorear o/
07:15 masak hi kresike
07:15 masak diakopter++ moritz++
07:15 sorear o/ masak returns
07:16 masak with breakfast!
07:16 grondilu joined #perl6
07:17 grondilu Am I the only one who has problems compiling rakudo?
07:17 adu hmm
07:17 kresike hello masak o/
07:19 adu I found another oddity, probably not a bug
07:19 adu r: my grammar G { rule TOP { ^ <bin_op> $ }; rule bin_op { <rel_op> | '||' }; proto token rel_op {*}; token rel_op:sym<or> { '|' }; }; say G.parse('||')
07:19 p6eval rakudo de7240: OUTPUT«#<failed match>␤»
07:20 adu n: my grammar G { rule TOP { ^ <bin_op> $ }; rule bin_op { <rel_op> | '||' }; proto token rel_op {*}; token rel_op:sym<or> { '|' }; }; say G.parse('||')
07:20 p6eval niecza v18-6-ge52d6c3: OUTPUT«Match()␤»
07:23 sorear adu: what if you make bin_op a token?
07:25 adu huh, that makes it parse
07:25 adu interesting
07:26 sorear the implicit whitespace in a rule disables LTM and the backtrack prevention in a rule prevents $ from doing what you expect
07:26 sorear I think whitespace is actually supposed to be ignored in that case but apparently neither does it rightr
07:29 drbean joined #perl6
07:30 dalek niecza/non-bootstrap: 49b8f85 | sorear++ | / (3 files):
07:30 dalek niecza/non-bootstrap: Actions: fiddle a bit, make it compile
07:30 dalek niecza/non-bootstrap: review: https://github.com/sorear/niecza/commit/49b8f8543d
07:31 sivoais joined #perl6
07:38 sivoais joined #perl6
07:41 usvm joined #perl6
07:45 sivoais joined #perl6
07:49 fglock eiro: ping
07:51 sorear sleep&
07:51 dalek niecza/non-bootstrap: 0b585f5 | sorear++ | lib/Actions.cs:
07:51 dalek niecza/non-bootstrap: Actions pt 2
07:51 dalek niecza/non-bootstrap: review: https://github.com/sorear/niecza/commit/0b585f5d14
07:51 jfried joined #perl6
07:52 * masak .oO( Part II... action! )
07:52 sivoais joined #perl6
07:59 moritz masak: on your what-to-hack-on list I'm missing (4) contribute lots of documentation  :-)
08:00 masak I'll make an effort to reintegrate this item into the set of my active desires.
08:00 adu so asian
08:01 masak I'm afraid I can't distribute rw privs to that list, as it's a master copy.
08:01 masak master copies should only have one actor making changes to them, otherwise there will be unpleasant contention problems.
08:03 sivoais joined #perl6
08:10 sivoais joined #perl6
08:18 sivoais joined #perl6
08:41 uvm joined #perl6
08:47 uvm left #perl6
08:47 adu I did it!
08:52 dalek rakudo/nom: 684fd2c | moritz++ | src/core/Exception.pm:
08:52 dalek rakudo/nom: tweak module backtrace, masak++
08:52 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/684fd2c6dc
08:56 dakkar joined #perl6
09:03 fglock joined #perl6
09:07 crab2313 joined #perl6
09:23 birdwindupbird joined #perl6
09:35 espadrine_ left #perl6
09:41 cognominal joined #perl6
09:46 daxim joined #perl6
09:48 moritz r: say +"foo"
09:48 p6eval rakudo 684fd2: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏foo' (indicated by ⏏)␤  in method gist at src/gen/CORE.setting:9441␤  in sub say at src/gen/CORE.setting:6972␤  in block <anon> at /tmp/wFQ2DV5sxG:1␤␤»
09:49 moritz r: say (+"foo").perl
09:49 p6eval rakudo 684fd2: OUTPUT«Failure.new(exception => X::Str::Numeric.new(source => "foo", pos => 0, reason => "base-10 number must begin with valid digits or '.'"))␤»
09:55 masak that is so cool.
09:56 daxim does rakudo have integration for gettext, either the original lib or an api work-alike?
09:57 masak not to my knowledge.
09:58 masak but it should be entirely possible using zavolaj.
10:02 arnsholt With a small caveat on the Zavolaj part, but yes. If the C interface doesn't rely too much on digging stuff out of structs, it should work
10:05 masak arnsholt++ # great work in this area
10:06 arnsholt Thanks. I should get back to getting strings in structs working at some point
10:06 arnsholt That's one of the major missing features I think
10:22 Woodi -daxim-: parrot check for gettext during Configure... so maybe api is exposed somehow...
10:24 masak good point.
10:25 Woodi btw. why Parrot check for OpenGL is very secret to me :) (atm)
10:30 JimmyZ joined #perl6
10:33 moritz lunsj&
10:35 masak apparently a Norwegian lunch. :)
10:39 Guest76914 joined #perl6
10:48 sergot joined #perl6
10:48 fridim_ joined #perl6
11:01 BaggioKwok joined #perl6
11:01 colomon phenny: tell sorear Your fix suggestion appears to work.  (Spectesting now, but the spectest probably never touches it, right?)  Thank you!
11:01 phenny colomon: I'll pass that on when sorear is around.
11:01 phenny colomon: 06:27Z <sorear> tell colomon try adding a null check to line 761 of NieczaCLR.cs, you know the drill by now, and see if that helps
11:01 phenny colomon: 06:27Z <sorear> tell colomon s/761/791/, in master HEAD
11:06 sergot joined #perl6
11:06 masak oh btw. I fixed le typo in http://strangelyconsistent.org/blog/mac​ros-progress-report-quantum-yak-shaving
11:07 masak I have a nice three-stage CQRS design for my blog engine, that I'm eager to implement.
11:10 masak here: https://gist.github.com/2916947
11:12 masak &
11:23 dalek niecza: a660099 | (Solomon Foster)++ | lib/NieczaCLR.cs:
11:23 dalek niecza: Handle null strings returned from CLR using sorear++'s suggestion.
11:23 dalek niecza: review: https://github.com/sorear/niecza/commit/a6600997b1
11:32 BaggioKwok joined #perl6
11:35 erkan joined #perl6
11:35 erkan joined #perl6
11:40 tokuhiro_ joined #perl6
11:57 fridim_ joined #perl6
12:04 brrt joined #perl6
12:05 birdwindupbird joined #perl6
12:14 tyatpi joined #perl6
12:18 cognominal_ joined #perl6
12:31 cognominal_ joined #perl6
12:35 [Coke] woodi; I think because depending on the version of opengl, the bindings are different.
12:37 pmichaud [Coke]: Good morning! o/
12:37 moritz good am, pm
12:37 [Coke] ho, pmichaud
12:37 [Coke] que tal?
12:38 * [Coke] checks out perl5 bleed and tests it.
12:39 * pmichaud is currently en route to yapc::na -- sitting in an airplane in Kansas City.
12:39 pmichaud pmichaud@plum:~/p6/nqp$ git pull
12:39 pmichaud Already up-to-date.
12:40 pmichaud Should've known.... everything's up to date in Kansas City.  :-P
12:50 pmichaud about to take off again... bbl
12:52 bluescreen10 joined #perl6
12:52 [Coke] ~~
12:54 PacoAir joined #perl6
12:56 jimmy1980 joined #perl6
13:09 Psyche^ joined #perl6
13:20 tyatpi joined #perl6
13:25 thou joined #perl6
13:29 felher This may be kind of obvious, but i'd like to make it explicit that .Int, .Rat and .Num fail (just like Real) if the Numeric isn't equivalent to a Real. Any objections? https://paste.lugons.org/show/2145/
13:30 moritz no objection from me
13:31 moritz though you could go even further and define an exception type with which it fails
13:32 skids joined #perl6
13:34 felher moritz: Yeah, good point. X::Numeric::Real for all of those? Or X::Numeric::Int, X::Numeric::Num X::Numeric::Real, X::Numeric::Rat?
13:36 xuusheng joined #perl6
13:36 moritz felher: first we should think about which cases can actually fail
13:36 felher moritz: all of them i guess. If you have complex numeric, it can not be converted to any of those.
13:36 moritz I see one failure mode where a Numeric (like, a Complex) cannot be converted to something Real (Real, Int, Num, Rat)
13:37 moritz that failure mode deserves one exception type (maybe with the coercion target as an attribute)
13:38 moritz then there is coercion to Rat, which might not succeed with the desired accuracy. What does that do? fail? or just return a not-so-accurte Rat?
13:39 moritz anyway, I'd say X::Numeric::Real would be a good error for the first case
13:41 felher moritz: okay :)
13:42 moritz extra points of providing a rakudo patch :-)
13:42 felher Btw: i think coercion to rat should fail if not possible within specified accuracy. Otherwise, where is the difference to not specifying a accuracy at all?
13:43 moritz the accuracy goal determines how hard the conversion routine tries
13:43 felher moritz: Yeah, i'll look at it. But it may take a day. I have a lecture in 20 Minutes and a movie evening afterwards :)
13:43 moritz sure, no hurry
13:43 moritz but I agree with the general sentiment
13:44 mtk joined #perl6
13:45 felher :)
13:45 * felher -> afk
13:48 dalek roast: 385370f | moritz++ | S32-exceptions/misc.t:
13:48 dalek roast: label and unfudge test for RT #113408, and remove nearly identical second test
13:48 dalek roast: review: https://github.com/perl6/roast/commit/385370f4f5
13:49 bloonix joined #perl6
13:58 sftp joined #perl6
14:00 cognominal___ joined #perl6
14:02 snearch joined #perl6
14:07 cognominal joined #perl6
14:08 sudokode joined #perl6
14:09 JimmyZ joined #perl6
14:36 crab2313 joined #perl6
14:41 * masak doesn't think pmichaud is in Kansas anymore :P
14:47 zhutingting joined #perl6
14:52 * TimToady doesn't think Kansas City is in Kansas anymore, except for the bits that are...
14:53 [Coke] ... tools are now working that were not. what the frak did I do to make it work!? aigh.
14:54 diakopter ABC?
14:58 [Coke] diakopter: to me? no, java work stuff.
14:59 diakopter heisenjava
15:16 adu joined #perl6
15:17 nwc10 joined #perl6
15:31 diakopter anyone know of a reliable/easy way to detect windows vs. unix in NQP?
15:38 masak diakopter: does this help? http://stackoverflow.com/a/8666442
15:40 cognominal_ joined #perl6
15:45 brrt joined #perl6
15:53 kaare_ joined #perl6
15:54 zhutingting joined #perl6
15:57 raiph joined #perl6
15:57 tktmb joined #perl6
15:58 tktmb left #perl6
15:59 sirrobert joined #perl6
15:59 sirrobert How do I change the way an object presents itself in string context?
16:00 flussence define a method Str() in it
16:05 sirrobert hm... didn't work.  I did method Str() { return "foo"; } but $obj.say; didn't change.
16:06 sirrobert ohh... say() doesn't put it into string context.
16:06 sirrobert say $obj ~ ""; worked, but $obj.say didn't.
16:07 mikemol joined #perl6
16:08 harmil r: class A { method Str() { "Strish" }; method say() { "sayish" } }; my $a = A.new(); say $a;
16:08 p6eval rakudo 684fd2: OUTPUT«A.new()␤»
16:08 harmil yep
16:08 tadzik class A is Cool { method Str() { "Strish" }; method say() { "sayish" } }; my $a = A.new(); say $a;
16:08 tadzik r: class A is Cool { method Str() { "Strish" }; method say() { "sayish" } }; my $a = A.new(); say $a;
16:08 p6eval rakudo 684fd2: OUTPUT«A.new()␤»
16:08 tadzik r: class A { method Stringy() { "Strish" }; method say() { "sayish" } }; my $a = A.new(); say $a;
16:08 p6eval rakudo 684fd2: OUTPUT«A.new()␤»
16:08 tadzik meh
16:09 sirrobert Not sure what just happened =)  Does "r:" cause the perl6eval bot to eval the code?
16:09 jnthn gitst
16:09 jnthn er
16:09 jnthn gist
16:09 jnthn Not Str
16:09 jnthn say calls .gist
16:09 sirrobert huh
16:09 harmil yeah, jnthn, was just seeing that
16:10 jnthn evening btw :)
16:10 tadzik gosh, evening already :)
16:10 harmil heya
16:10 harmil r: class A { method gist() { "gistish" }; method Str() { "Strish" }; method say() { "sayish" } }; my $a = A.new(); say $a;
16:10 p6eval rakudo 684fd2: OUTPUT«gistish␤»
16:10 harmil there ya go
16:10 jnthn tadzik: Yeah...and I'm exhausted already. :S
16:10 tadzik me too, and I haven't really started yet :/
16:10 tadzik an OpenGL project before me, and the exam tomorrow
16:10 tadzik and then I'm mostly free
16:11 * jnthn has been teaching all day so at least has an excuse :)
16:11 raiph o/ p6
16:11 tadzik but I feel like half myself already
16:13 raiph what's the current p6 story, if any, on the implicit type / module (mebbe setting too?) version conflict discussed in http://stackoverflow.com/questions/10875588/are-​all-haskell-packages-compatible-with-each-other
16:16 masak raiph: it's all a bit handwavy still, but check out S11 about modules and versioning.
16:16 masak there's been thought put into exactly those things.
16:16 raiph specifically, the "subtle" issue mentioned in the answer that starts "You have the same problem in Haskell" and which answer has the comment "Fortunately the problem you describe manifests at compile-time; ghc won't build a module that tries to implicitly convert between different package-versions of data."
16:17 masak the general rule of thumb is that 'use'-ing a module is a local action, and different versions of the same module can co-exist on a system and be loaded in the same program through different 'use' paths.
16:17 masak theoretically. this is all unimplemented.
16:17 masak the underlying architecture is a bit heavyweight for Perl, in my opinion.
16:18 masak specifically, I think/hope we will never resort to storing our modules (or module metadata) in a database somewhere, just because that's the only way to make things truly platform independent.
16:19 kresike bye all
16:20 harmil sqlite in core? ;)
16:21 masak something like that.
16:21 harmil Speaking of, has anyone started working on an ORM?
16:22 harmil I think the current state of datastructures would make it a bit of a pain, but that hasn't stopped people in other areas ;)
16:25 raiph masak: thx 4 yr answers
16:27 masak yr wlcm.
16:28 sirrobert One more weird thing about say/gist/Str...
16:28 harmil I wonder if the right solution for an ORM in Perl 6 might be a mini-language. That's kind of what things like sqlalchemy in Python try to create
16:28 moritz well, there are several part to an ORM
16:28 harmil true
16:28 sirrobert r: class A { method gist () {return self}; }; say A.new();
16:28 p6eval rakudo 684fd2: OUTPUT«A<-1502235178>␤»
16:28 sirrobert r: class B { method gist () {return self}; method Str() {return "foo"};}; say B.new();
16:28 p6eval rakudo 684fd2: OUTPUT«foo␤»
16:28 moritz one should note that Perl 6 has representation polymorphism
16:29 moritz so one yould create a   class SomeFoo is repr(MyDb) { ... }
16:29 Celelibi joined #perl6
16:29 cognominal_ joined #perl6
16:30 harmil I've been working with sqlalchemy recently and it often does things like <someexpression>.filter(orm_table_def.coldef == 1).first()
16:30 harmil and that seems like it's a long walk around the park to get what a mini-language could get you instantly
16:32 sirrobert Any idea why "self" would be different depending on whether Str() was defined?
16:33 masak sirrobert: the default .Str method gives what you see above with the A<-1502235178>
16:34 harmil gist is supposed to return something say can cope with. It will get back an object that still isn't a string.. .I think maybe then it tries .Str on the result?
16:34 sirrobert But if say uses .gist, why would it be different depending on whether Str is defined?
16:34 sirrobert or does .gist use .Str internally?
16:35 harmil because you've defined a gist that returns self… so say gets back a thing that it still can't cope with. I'm assuming there's a fallback invoked.
16:35 masak .gist uses .Str by default.
16:35 sirrobert Ok, maybe I mean to ask:  Where can I read what .gist is doing? =)
16:35 harmil no, masak, he's re-defining it
16:36 masak harmil: he's redefining .Str
16:36 colomon joined #perl6
16:36 sirrobert both .gist and .Str
16:36 harmil I thought he defined both in the example
16:36 harmil here's what's going on:
16:36 masak oh! right.
16:36 harmil IO.say is doing : $*OUT.print(nqp::shift($args).gist) while $args;
16:36 harmil print is saying "the heck is a B.self?!" and calling .Str on it
16:36 benabik joined #perl6
16:37 sirrobert ah
16:38 harmil I … think. That gets into the boundary layer between Rakudo and Parrot where my knowledge goes quickly to 0
16:39 harmil What's really happening, I think, is IO.print is calling Parrot's print and that does … magic … that eventually asks the Perl object to stringify? Guessing wildly
16:39 sirrobert What's the point of .gist in general?
16:39 sirrobert or, rather, why move say from Str to gist?
16:40 harmil I think the idea is that say should print something that's intelligible for the user while generic .Str might do something more correct, but less user friendly?
16:40 sirrobert ok
16:40 masak say() is supposed to stringify things with .gist
16:40 harmil yeah, he's asky why, and why not .Str
16:40 sirrobert masak:  that makes sense; but it implies that there's a difference between the strings
16:41 sirrobert trying to figure out the intended difference
16:41 raiph masak: i've now reread s11 fairly carefully, especially the versions section. i don't see anything, even handwavey, that i recognize as relating to the conflicting type versions issue mentioned in that haskell Q+A. any more thoughts?
16:41 sirrobert .gist strings are used to _____________, whereas .Str strings are used to __________________.
16:42 benabik .gist is designed to be useful for programmers.
16:42 harmil .gitst strings are used to produce say output, whereas .Str strings are used to stringify objects.
16:42 sirrobert heh
16:42 masak raiph: S11:345 was what I was thinking of.
16:42 masak raiph: I confess to not having read the stackoverflow question too carefully.
16:42 sirrobert harmil:  that just shunts the question off to somewhere else ;)
16:43 sirrobert benabik:  hmm, ok.  I'll have to think about the utility of that
16:43 harmil If it bothers, you, you can just "method gist() { self.Str } ; method Str() { "get off my lawn, you kids!" }" in all your classess....
16:44 sirrobert It doesn't bother me, I just don't get it yet =)
16:44 harmil I understand, I was just taking the opportunity to be as funny as 4 hours of sleep allows
16:45 sirrobert heh
16:47 sorear colomon: afaik spectest doesn't touch the CLR interop, yeah
16:47 phenny sorear: 11:01Z <colomon> tell sorear Your fix suggestion appears to work.  (Spectesting now, but the spectest probably never touches it, right?)  Thank you!
16:49 raiph masak: "a subtle surprise: When you refer *indirectly* ... to a type ... it might be resolved to [one version of that type] at one place and [another version of that type] in another, and the two can't be unified." (my *emphasis*)
16:49 not_gerd joined #perl6
16:50 masak raiph: that, or something very much like it, actually happened to me.
16:50 masak well, it was a kind of namespace pollution, anyway.
16:52 raiph masak: did the compiler u used help u spot yr problem? if it didn't, do u think it reasonable that it could be supposed, one day, to do so?
16:54 raiph masak: (i'm assuming that what happened to you was similar enough to the specific issue of type versions and implicit types to be basically the same problem)
16:54 masak I might have this documented in an old blog post.
16:56 [Coke] I haven't seen this one in a while: http://xkcd.com/312/
16:58 [Coke] Str, gist... don't forget perl.
16:59 masak raiph: yes, here: http://strangelyconsistent.org/blog/week-4-​of-webpm-web-apps-the-first-hesitant-steps -- paragraph starting with "A strange thing happened though,"
16:59 fridim_ joined #perl6
16:59 raiph masak: thx. reading.
17:00 not_gerd sirrobert: what [Coke] said - gist is there to produce useful information about an object without going into implementation details like .perl does
17:00 not_gerd r: class Dog { has $.name; has $.owner; method Str { $!name }; method gist { "$!name (owner: $!owner)" } }; my $grendel = Dog.new(:name("Grendel"), :owner("Kate")); .say for ~$grendel, $grendel, $grendel.perl
17:00 p6eval rakudo 684fd2: OUTPUT«Grendel␤Grendel (owner: Kate)␤Dog.new(name => "Grendel", owner => "Kate")␤»
17:01 masak not_gerd++
17:01 masak .perl is there to produce Perl code describing the object.
17:01 masak .gist is there to describe the object without being bound by it being valid Perl code.
17:02 raiph masak: ok. aiui, that's where you import a name ("map") without immediately realizing the impact.
17:02 masak right.
17:02 masak well,
17:03 masak not exactly.
17:03 masak the damage was made in a module that was unrelated to the importing of the name 'map'.
17:03 masak like, it was in a different path down the tree of 'use' relationships.
17:04 sirrobert masak:  that distinction helps.  .gist as a sort of semi-technical gloss of the object.
17:04 masak right.
17:10 cognominal joined #perl6
17:15 raiph masak: ok. can u think of a way the p6 language and/or a p6 compiler could have better helped you to avoid or spot that problem?
17:16 masak it's not supposed to happen in a correctly implemented Perl 6 compiler.
17:17 masak given modules A, B, C -- A uses B and C -- anything that A imports from B is supposed to not disturb the meanings of names in C.
17:31 masak because importing happens into lexical scopes, and C is not lexically nested inside A.
17:31 masak (in the general case)
17:35 jnthn Rakudo does separate compilation. Did you find a leak?
17:35 masak no, this was years ago.
17:35 masak April 2009.
17:35 jnthn Oh. Years ago Rakudo screwed up separate compilation. :)
17:35 jnthn Stuff. It improves.
17:36 masak jnthn: I remember you and pmichaud discussing it on the subsequent YAPC::EU.
17:36 jnthn Yeah. It took 6model's arrival to get the whole thing right though.
17:37 * jnthn goes to find something to eat
17:42 sirrobert Where can I read something like a tutorial for grammars?
17:46 harmil good question
17:48 masak perl6/book.
17:48 masak also, moritz' blog.
17:48 sirrobert thanks
17:48 masak I'm too tired to URL you -- others may be able to.
17:48 crab2313 https://github.com/perl6/specs
17:48 masak the spec is not a tutorial ;)
17:49 sirrobert heh
17:49 crab2313 https://github.com/perl6/book
17:49 masak crab2313++
17:50 masak crab2313: curious question about your nick: are the digits an autoincr ID of some sort? are there 2312 other crabs somewhere?
17:50 moritz there are also some grammar posts on the perl 6 advent calendar
17:51 masak oh, indeed.
17:52 harmil Also, don't underestimate the power of a concrete example.
17:52 harmil sirrobert: see JSON::Tiny
17:54 crab2313 masak: means nothing. In fact, I'm not a native English speaker. Just for fun :)
17:55 masak crab2313: oh, ok.
17:55 masak crab2313: what's your native tongue?
17:55 crab2313 masak: Chinese
17:55 spider-mario joined #perl6
17:56 masak crab2313: 我刚刚从中国回来。
17:56 crab2313 masak: 好巧
17:57 masak ah... Cantonese?
17:58 crab2313 不是
17:58 masak the 巧 made me assume so. not used to seeing it.
17:59 nwc10 left #perl6
17:59 crab2313 巧 => coincidence
18:00 masak oh!
18:00 adu joined #perl6
18:00 masak and here I just assumed it was an interjection, like 啊
18:00 * masak puts his assuming unit on hold
18:04 Chillance joined #perl6
18:07 masak crab2313: 你知道九寨沟吗?
18:08 * masak 访问了
18:08 cognominal_ joined #perl6
18:09 adu 讲英语!
18:09 masak sorry if any of this is insultingly wrong. I'm GT-assisted in most of the 汉语 I attempt on-channel.
18:11 masak adu: yes, because we should all choose the language with the most native speakers in the worl... oh wait :P
18:12 [Coke] GT?
18:12 [Coke] oh.
18:12 masak Google Translate.
18:12 masak phenny: en zh "You are too, aren't you?"?
18:12 phenny masak: "你也有同感,不是吗?" (en to zh, translate.google.com)
18:13 masak :D
18:13 masak phenny: "同感"?
18:13 phenny masak: "Same feeling" (zh-CN to en, translate.google.com)
18:13 masak aww
18:19 crab2313 masak: I know it.
18:19 masak been there?
18:20 crab2313 masak: haven't
18:21 masak I can recommend it.
18:23 crab2313 I agree with you :)
18:28 _ilbot joined #perl6
18:28 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: http://irc.perl6.org/ | UTF-8 is our friend!
18:28 moritz the IRC logs are currently being hammered with requests
18:29 adu are they from here?
18:29 moritz the IPS are all in the 2001:da8:2000:2192::XXXX subnet
18:29 adu IPv6?
18:30 adu maybe they're from China
18:32 sorear moritz: user-agents?  any interesting headers?
18:33 thou joined #perl6
18:33 moritz sorear: "Mozilla/5.0"
18:34 moritz adu: that's what whois says. South China University of Technology, Guangzhou, Guangdong 510641, China
18:34 sorear moritz: hack the script to throw up a question page
18:34 moritz ok, subnet disallowed in .htaccess, back to business as usual
18:35 moritz sorear: not worth the effort. Chances are that nobody ever looks at it
18:35 adu oh, btw, the Go parser is comming along nicely
18:36 moritz the fact that they use multiple source IPs indicates that it's malicious
18:36 alvis```` joined #perl6
18:36 adu the grammar is now able to parse this file: http://golang.org/src/pkg/bufio/bufio.go
18:37 adu I should start writing unit tests, I suppose
18:39 am0c joined #perl6
18:39 cognominal joined #perl6
18:41 masak never too early to start writing unit tests.
18:42 sorear I am sort of curious why someone would _maliciously_ attack perlgeek.de
18:42 sorear rather than, oh, a distributed spider running slightly out of control
18:43 moritz hm, good point
18:43 TimToady perhaps they're trying to route around "damage"
18:44 masak I now have first-hand experience with that kind of "damage".
18:44 masak a terribly odd sensation.
18:44 moritz the hamemring has stopped.
18:45 harmil Sorry, was I not supposed to be sending my Windows backups to that machine? ;-)
18:47 moritz your windows backup knows how to crawl sites?
18:47 jnthn Probably just how to crawl. :)
18:47 moritz :-)
18:54 fridim_ joined #perl6
18:55 adu masak: what kind of damage?
18:55 masak adu: have you tried accessing Youtube or Twitter lately?
18:55 adu youtube yes, twitter no
18:56 masak do you access Youtube, hm, directly? or through a proxy?
18:56 spider-mario adu : where could I find the code of your Go parser, please? :)
18:56 adu hmm I'll post the latest, just a sec, it's not online yet
18:56 spider-mario oh, ok
18:57 adu http://pastebin.com/raw.php?i=W297Nn8m
18:57 birdwindupbird joined #perl6
18:58 spider-mario thanks
18:59 not_gerd left #perl6
19:06 harmil adu: I always find myself going back over my grammars looking tokens that I can condense via proto. Looks like your go example could use some of that. But that's pretty nice!
19:06 adu harmil: thanks :)
19:06 harmil Is that a pretty straight transliteration of the Go spec?
19:07 adu mostly, automatic_semicolon is definitely the most hacking part, it doesn't work right now, so I've been preprocessing Go source with this tool I wrote: https://github.com/andydude/gosemi
19:08 harmil go semi! go semi!
19:08 harmil sorry, couldn't help it
19:08 adu there are some instances where the order of productions is different from the gospec, but that's to be expected
19:09 adu another instance where I might have to hack around Perl6 is binary_op, which is causing me some headaches
19:09 sorear masak: hmm, are you sure adu is in China now?
19:09 adu I'm not in China
19:09 harmil Nice. I'm not go-savvy, so it just looks like someone did a pass of cleanup on some C++ to me ;-)
19:10 adu I'm in DC
19:10 TimToady well, that's a foreign country...
19:11 adu well, near DC
19:11 adu in Maryland
19:11 harmil Only when it comes to the right to real representation in the Congres, TimToady ;-)
19:12 adu everyone has those license plates
19:12 TimToady masak: is there a bug report for lines() not reading from the keyboard without a ^D?
19:12 PerlJam adu: what part of maryland?
19:12 sorear adu: so your geoip record was not far off
19:12 masak TimToady: yes.
19:12 adu PerlJam: Silver Spring
19:12 masak TimToady: it's something laziness-related.
19:13 TimToady adu, ah, my son used to live in Silver Spring when at UM
19:13 adu TimToady: I went to UM, for a time
19:13 PerlJam adu: a couple of my coworkers are there now visiting NOAA  (NOS CO-OPS actually)
19:13 adu a friend of mine works at NOAA
19:14 masak TimToady: https://rt.perl.org/rt3/Tic​ket/Display.html?id=113100
19:14 TimToady though so, just want to make sure
19:14 sorear TimToady: reminds me I was touring JPL on Sat... saw no conclusive evidence of you though.
19:14 TimToady *ght
19:14 masak adu: oh, my mistake. it was bonsaikitten who was in 上海
19:15 TimToady sorear: well, haven't been there for more than 20 years...
19:16 adu harmil: but if I can get automatic_semicolon and binary_op working well, that's probably when I'll give the Go grammar a permanent home on github
19:17 harmil sounds reasonable
19:17 TimToady sorear: otoh, if you saw any radar images of Venus from Magellan, you could count it as evidence :)
19:18 harmil Are you trying to tell us something about your origins? I knew it!
19:19 sorear TimToady has a long and vaguely illustrious past
19:19 adu masak: I grew up in Japan, so I'm familiar with kanji/han characters, if that's where your assumption came from
19:19 TimToady *illustriously vague
19:20 adu TimToady must be from Mars
19:20 adu er, I mean Venus
19:21 harmil all(Mars, Venus, Earth)
19:21 vlixes joined #perl6
19:21 adu .u 👽
19:21 phenny U+1F47D (No name found)
19:22 TimToady well, I'm from none(Mars, Venus, Earth) really, since I never left any of them
19:22 adu TimToady is a transplanetary life form?
19:23 DarthGandalf joined #perl6
19:24 harmil I think he's suggesting intraplanetary, but I always confuse those.
19:24 TimToady 僕はうる星やつらですよ!
19:25 masak phenny: " 僕はうる星やつらですよ!"?
19:25 phenny masak: "For me I can Urusei Yatsura !" (ja to en, translate.google.com)
19:25 masak is that a crude translation of "I can see Uranus from here!"?
19:25 TimToady no, it's a pun on Obnoxious Aliens
19:25 masak oh :P
19:26 TimToady or "People of Planet Uru"
19:26 harmil The gist/Str conversation from before is still rattling around in my head. Something bothers me about it.
19:27 harmil I have to go to a meeting, but I'll try to formulate what it is that bothers me.
19:27 adu a better translation would be: "You know, I'm Urusei Yatsura!"
19:27 TimToady I'm an Uruse Yatsura is more like what I was thinking
19:27 TimToady *sei
19:28 TimToady you can't drop articles in English much...
19:29 adu or "~ dontchyaknow" if you're from Minnesota
19:30 sorear TimToady: I didn't find an L., can you say anything about Stephen D. Wall ? http://www2.jpl.nasa.gov/magellan/guide13.html
19:30 masak 'night, #perl6
19:31 PerlJam sorear: you don't have the appropriate security clearance to know that TimToady worked at JPL except that he tells you so  ;)
19:33 sorear PerlJam: I know TimToady worked at JPL because the Perl 1.0 release announcement was sent from his work emial.
19:34 PerlJam He probably worked in a SCIF and we're lucky that Perl survived the security protocols for letting email out.
19:35 TimToady sorear: no relation that I know of.  And I wasn't directly on Magellan, but on a project called SFOC (Space Flight Operations Center) that was first used for Magellan ground data systems
19:35 TimToady furthermore, I was a contractor from Telos, so I didn't really exist :)
19:36 sorear I thought SFOC was just one of the buildings
19:36 TimToady that's the SFOF
19:36 TimToady ...Facility
19:36 moritz ot really existing seems to be a good tactic in big organizations
19:37 TimToady if they showed you the "dark room", I did an unauthorized CPU swap in there the night before Magellan launched
19:37 TimToady I don't know if they would have launched with only a single working SMC
19:38 Layla joined #perl6
19:38 TimToady anyway, the SFOC project has been renamed several times since then, I suspect
19:38 PerlJam moritz: it's probably enough that you don't show up on budget reports and such.
19:39 quietfanatic joined #perl6
19:39 TimToady it was supposed to be the first generic ground data system; all the previous ones were written from scratch for each spacecraft
19:39 MayDaniel joined #perl6
19:39 TimToady after SFOC, they rewrote the generic system for each spacecraft instead :)
19:40 quietfanatic Incidentally, you can't say "I'm an Urusei yatsura" because the 'ra' suffix indicates plurality.
19:40 TimToady sure, I can say it, it's just wrong
19:40 quietfanatic ...right
19:41 sorear o/ quietfanatic
19:41 quietfanatic hello sorear
19:42 * sorear would like to be from Earth someday
19:43 * moritz generally finds the earth a nice and enjoyable planet
19:44 Layla hello.. long time no see.. i just came to spy on you.. am from the moon ^_^
19:44 tadzik hello Layla :)
19:45 Layla tadzik: :D
19:45 jnthn o/ Layla :)
19:46 jnthn Welcome back :)
19:46 Layla jnthn: :) hiii sorry for being away so long.. live can be a real (bad thing) sometimes.. !
19:48 jnthn Aww...sorry to hear that there's been bad things.
19:48 jnthn Hope life is a real better thing now :)
19:48 Layla what doesn't kill us make us stronger, am too strong now xD
19:48 cognominal_ joined #perl6
19:52 Layla I like it here.. it looks like a place that doesn't age or change (heaven?) :P nice community, funny jokes, and some sweet language evolving meanwhile and has a logo of a butterfly! hehehe :)
19:53 TimToady nr: LINE: for lines() { next LINE if /z/; .say }
19:53 p6eval niecza v18-7-ga660099: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmitten,␤Hast seit frühen A…
19:53 p6eval ..rakudo 684fd2: OUTPUT«===SORRY!===␤Confused␤at /tmp/hHVj_3PLpv:1␤»
19:54 TimToady n: LINE: for lines() { next LINE if /L/; .say }
19:54 p6eval niecza v18-7-ga660099: OUTPUT«Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmitten,␤einem starken Herzen gleich.␤Hast seit frühen Ahnentagen␤vielgeprüftes Österreich…
19:55 * sorear offers hugs to Layla.
19:55 rhr joined #perl6
19:55 jnthn #perl6 being a nice place does, happily, seem to be an unchanging feature. :)
19:56 Layla sorear: free hugs yahoo :D but no thanks :P
20:02 hottman joined #perl6
20:03 Layla joined #perl6
20:03 hottman left #perl6
20:03 BlueT_ joined #perl6
20:03 MayDaniel joined #perl6
20:09 quietfanatic No matter how many times I look in the spec, I can't find any description of how parser actions work.
20:12 PerlJam quietfanatic: When the grammar rule has completed its parse, it calls the same named method on the actions object.  And that method does whatever it wants.
20:14 quietfanatic But what does the action method take as arguments?
20:14 quietfanatic The match object?
20:14 PerlJam quietfanatic: aye
20:14 quietfanatic ah
20:14 quietfanatic and is it supposed to return anything?
20:15 PerlJam it can.  Usually you manipulate the AST with make() though
20:15 PerlJam (well, "make" )
20:15 quietfanatic okay.  I forgot about make()
20:15 quietfanatic thanks
20:18 sorear quietfanatic: afaik any return value from the action is ignored
20:18 [Coke] "timtoady has a long ... past"... that's code for "he's old", yah? :)
20:19 PerlJam [Coke]: the older I get, the younger he seems  ;)
20:23 quietfanatic p6: 'abc' ~~ /a ** b/
20:23 p6eval niecza v18-7-ga660099: OUTPUT«Potential difficulties:â�¤  Unsupported use of atom ** b as separator; nowadays please use atom+ % b at /tmp/HI3qSzIL5q line 1:â�¤------> [32m'abc' ~~ /a ** b[33mâ��[31m/[0mâ�¤â�¤Â»
20:23 p6eval ..pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤    unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.​13.20120203/blib6/pugs/perl5/lib';␤    eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** Can't locate P…
20:23 p6eval ..rakudo 684fd2: OUTPUT«===SORRY!===␤Quantifier quantifies nothing at line 2, near " b/"␤»
20:23 sorear [Coke]: yes and no
20:23 quietfanatic %, huh?
20:23 PerlJam aye
20:24 ggoebel joined #perl6
20:24 thou joined #perl6
20:25 quietfanatic I guess that makes sense to be able to use it with either + or *
20:27 quietfanatic Oh, I just realized that prefix:<|> is reminiscent of the [head|tail] construct of some functional langs
20:27 quietfanatic now it makes much more sense.
20:28 adu quietfanatic: I've had trouble with that too
20:28 adu I've been learning Perl6 for about a month now
20:28 quietfanatic ...not like [head|tail] made much sense itself
20:29 quietfanatic *not that
20:29 adu and the most informative things I've learned is from dumping the match object
20:29 quietfanatic Ah, yes, the match object is quite interesting
20:29 quietfanatic kinda both a hash and an array
20:29 quietfanatic and a string
20:31 adu r: my grammar G { rule TOP { <number> }; token number { <digit>* }; }; say G.parse("1")
20:31 p6eval rakudo 684fd2: OUTPUT«q[1]␤ number => q[1]␤  digit => q[1]␤␤»
20:31 adu quite interesting, yes
20:31 adu quietfanatic: have you seen my go grammar?
20:31 quietfanatic I have not.
20:31 quietfanatic for the go language?
20:31 adu yes
20:32 adu http://pastebin.com/raw.php?i=W297Nn8m
20:32 adu https://github.com/andydude/gosemi
20:32 adu it currently requires explicit semicolons
20:32 adu I hope to fix that
20:33 quietfanatic That's pretty neat
20:34 * [Coke] sighs, as pastebin is blocked here.
20:35 adu [Coke]: can you access github?
20:35 quietfanatic I don't think implicit semicolons should be that hard, but it depends on how they're specced.
20:35 adu http://golang.org/ref/spec#Semicolons
20:35 adu you can see my <automatic_semicolon> rule for how I was thinking of doing it
20:36 quietfanatic Oh, it just uses a heuristic
20:36 quietfanatic sounds like you can do that with a lookbehind assertion.
20:36 adu maybe, we'll see
20:36 quietfanatic or maybe it's more complicated than that
20:37 quietfanatic right, it requires examining what you've already parsed to the left
20:37 quietfanatic well, I dunno.
20:37 adu everyone seems to think it's impossible, which is why I want to do it
20:38 adu I was thinking of making multiple versions of every production, like <int_lit>, <before_semi_int_lit>, but I don't want to
20:38 quietfanatic there should be a shorter way...
20:38 adu indeed
20:38 TimToady they're just methods, and you can do other things than just match stuff
20:39 adu like set globals $EXPECTING_SEMICOLON = True?
20:39 quietfanatic right, I was thinking of setting a stateful variable after parsing each token that can terminate a line
20:39 TimToady well, globals stink, but that's the idea
20:39 quietfanatic but then you have to unset it
20:39 adu right
20:39 TimToady a dynamic variable would be more appropriate, or a memo array like STD uses
20:40 quietfanatic can you attach something to the match object in the token and examine it in the statement rule?
20:40 quietfanatic *token rule
20:41 sorear adu: I told you yesterday it was possible.  <?after> is the wrong approach, though.
20:41 adu s/impossible/intractible/
20:42 quietfanatic or you might not even have to set anything when oarsing the token
20:42 quietfanatic if when you encounter a newline, you open up the match object for the last-matched thing and walk down it until you find the right token
20:43 adu <{ $TerminatingToken || fail }>?
20:43 quietfanatic of course, then you have to make sure you always descend into the right-most match object.
20:44 TimToady STD just sets a memo on the parse position, and then it doesn't matter how you get there
20:44 quietfanatic you can do that?
20:44 TimToady see curlycheck in STD.pm6
20:44 TimToady that's how it makes ; optional after line-ending }
20:44 TimToady this is basically the same problem
20:45 quietfanatic of course, storing an array equal in length to the parsed string takes a lot of memory
20:45 TimToady only more general than just after }
20:45 quietfanatic unless it's really a hash :)
20:45 TimToady you could use a bitmap
20:45 adu yeah, I've been looking at STD.pm6, but I don't see how to apply it to my problem
20:46 sorear I am sorely tempted to spend the next hour writing a full Go grammar to prove to the world that my way will work and adu's won't
20:46 quietfanatic And Perl 6 lets you manipulate packed bits these days?
20:46 TimToady well, if that's the first step to a Go backend for niecza, I'm all for it :)
20:46 TimToady quietfanatic: almost
20:47 TimToady you can fake it with a buffer, or a large Int
20:47 quietfanatic 'almost' sounds very familiar... :)
20:47 TimToady but we don't quite have my bit @array; yet
20:47 TimToady I think rakudo is pretty close with its existing native types though
20:47 adu sorear: if you could explain it to me, maybe I can do it for you
20:47 quietfanatic that's good news.
20:48 TimToady bit arrays will be much nicer than vec()
20:48 TimToady in my radical lookup program I was just hacking on, I used a Buf to fake a vec()
20:48 TimToady but I have to do my own div 8, % 8 processing
20:48 adu TimToady: oo sounds useful
20:49 TimToady adu: it's very useful if you're willing to learn my names for several thousand radicaloids :)
20:49 adu heh
20:50 quietfanatic now that native types are (almost) working, maybe I shall start remaking Link::C
20:51 sorear oo, I like radicaloids
20:52 TimToady for instance, if I see 感, I can look it up as 'rad unison Heart' or as 'rad halberd barmouth Heart' or various other breakdowns
20:52 TimToady and it spits out a line like: 611f 13感Heart.b unison.t kan=+feeling
20:53 TimToady the actual breakdown of "unison" is TheDog and mouth though
20:53 TimToady 620c 06戌halberd.o toebar.l hbar.c halberd.r fifth.o hbar.i inu=dog +TheDog /Zt11th
20:54 quietfanatic 'The' because it's a constellation
20:54 TimToady nodnod
20:54 TimToady though none of the others need The
20:54 TimToady TheDog gets it because dog and Dog are both taken
20:54 TimToady but boar, firehorse, Hare, etc get away without it
20:55 quietfanatic because they're all the same as their earhtly counterparts?
20:55 TimToady well, not always
20:55 TimToady but I try to use lower/uppercase to good advantage when possible
20:55 quietfanatic or because you're relying on capitalization to differentiate
20:55 quietfanatic ah
20:58 adu TimToady: what are you using for your radical data?
20:59 adu I found https://github.com/kawabata/kanji-database-ids to be quite useful
21:00 quietfanatic I believe he's making his own database.
21:00 adu ok
21:02 TimToady well, originally based on existing databases, but that was years ago
21:03 TimToady at the moment I'm going through all the Extension B characters classifying them
21:03 TimToady done with everything up to about 15 strokes so far
21:04 TimToady but pretty much any combination of forms you can think of, somebody has used somewhere...
21:05 TimToady here's a cool one: 𦮙
21:06 TimToady you might have to visit the ir clogs to see it
21:06 adu my client is unicode ready
21:06 MayDaniel joined #perl6
21:07 libertyp1ime joined #perl6
21:07 adu and I have a s**tload of fonts installed
21:07 TimToady I think the max stroke count is 𪚥
21:07 TimToady 4.dragons, in my database
21:07 adu ryu! my favorite
21:07 sorear hey, I found an ambiguity in the go spec
21:07 sorear break /*
21:07 adu sorear: do tell
21:07 sorear */ continiue
21:08 sorear is a semicolon inserted at the end of the first line?
21:08 sorear (how does the go compiler handle this case?  I don't have it installed atm)
21:08 adu sorear: I'll check
21:09 TimToady I know how STD handles those things (hint: there's a unv rule that matches anything "unvertical", including comments with embedded whitespace)
21:09 quietfanatic so STD would not like that
21:10 adu sorear: yes, gc compiles that to be equivalent to break;
21:10 TimToady STD would not insert a semicolon if you say {...} #'( comment with \n ) stuff, unless stuff is just \h* $$
21:10 adu not even a warning that continue is dead code
21:11 quietfanatic wait, it doesn't even see the continue?
21:11 quietfanatic or it just won't reach it
21:11 libertyprime joined #perl6
21:13 adu http://pastebin.com/raw.php?i=d2Y67Maf
21:13 TimToady nr: do { say "HERE" } #`( a comment with ␤ in it ) # another comment allowed here though
21:13 p6eval rakudo 684fd2: OUTPUT«HERE␤»
21:13 p6eval ..niecza v18-7-ga660099: OUTPUT«[31m===[0mSORRY![31m===[0m��(Possible runaway string from line 1 to line 2)�Strange text after block (missing comma, semicolon, comment marker?) at /tmp/1x4ri0QyPl line 1:�------> [32mdo { say "HERE" }[33m�[31m #`( a comment with [0m��Parse failed��…
21:13 adu that compiles fine
21:14 TimToady ooh, nieczabug
21:14 TimToady std: do { say "HERE" } #`( a comment with ␤ in it ) # another comment allowed here though
21:14 p6eval std f179a1b: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤(Possible runaway string from line 1 to line 2)â�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/r4JBYmAY4l line 1:â�¤------> [32mdo { say "HERE" }[33mâ��[31m #`( a comment with [0mâ�¤    expecting statement mo…
21:14 TimToady or STDbug
21:14 PerlJam rakduo++  :)
21:14 TimToady std: do { say "HERE" } #`( a comment with ␤ in it ) 42 # s/b TTIAR
21:14 p6eval std f179a1b: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤(Possible runaway string from line 1 to line 2)â�¤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/PsKy5ff2Ki line 1:â�¤------> [32mdo { say "HERE" }[33mâ��[31m #`( a comment with [0mâ�¤    expecting any of:â�¤     esc…
21:14 PerlJam er, rakudo++
21:14 adu sorear: it's not ambiguous: http://golang.org/ref/spec#Comments
21:14 TimToady nr: do { say "HERE" } #`( a comment with ␤ in it ) 42 # s/b TTIAR
21:14 p6eval rakudo 684fd2: OUTPUT«===SORRY!===␤Confused␤at /tmp/RZoKOrwmXZ:1␤»
21:14 p6eval ..niecza v18-7-ga660099: OUTPUT«[31m===[0mSORRY![31m===[0m��(Possible runaway string from line 1 to line 2)�Strange text after block (missing comma, semicolon, comment marker?) at /tmp/EBApbeEVA6 line 1:�------> [32mdo { say "HERE" }[33m�[31m #`( a comment with [0m��Parse failed��…
21:15 adu sorear: a block comment acts like a newline iff it contains a newline
21:15 kurahaupo joined #perl6
21:22 TimToady std: do { say "HERE" } #`( a comment with ␤ in it )
21:22 p6eval std f179a1b: OUTPUT«ok 00:00 41m␤»
21:25 TimToady yeah, unv currently only allows one comment...what idiot wrote that rule?
21:25 libertyprime joined #perl6
21:28 dalek std: 30385f8 | larry++ | STD.pm6:
21:28 dalek std: unv should allow multiple comments
21:28 dalek std: review: https://github.com/perl6/std/commit/30385f8c9d
21:28 TimToady fixed :)
21:29 PerlJam I wonder how rakudo is coping.  It's unv only allows for one comment too
21:29 kurahaupo left #perl6
21:31 TimToady it looks like ws does an effective <.unv>*
21:36 sorear adu: https://gist.github.com/2920292
21:39 sorear completely untested, and rather a pile of crocks
21:39 adu sorear: fascinating
21:40 adu I will disect it, and learn what I can from it
21:40 adu ADDSEMI?
21:42 sorear put :my @*ADDSEMI in your TOP rule
21:42 sorear it's basically a thread-local variable, but needs to be declared somewhere in the call stack
21:44 sorear also, it seems the .cursor stuff is niecza-only as written
21:45 sorear there's probably a rakudo equivalent, dunno what offhand
21:50 adu sorear: your grammer is very interesting
21:53 TimToady perl6: $_ = "XXXX"; if s/YYY/ZZZ/ { say "Naughty" } else { say "Nice" }
21:54 p6eval rakudo 684fd2, pugs: OUTPUT«Naughty␤»
21:54 p6eval ..niecza v18-7-ga660099: OUTPUT«Nice␤»
21:54 TimToady my rad program uses the boolean result of s/// all the time, sigh
21:56 Gesh joined #perl6
21:59 TimToady maybe I can figure out some way to trick niecza into doing vec emulation...
22:00 kurahaupo joined #perl6
22:02 TimToady reg &
22:21 vmspb joined #perl6
22:30 pupoque left #perl6
22:39 whiteknight joined #perl6
22:52 pmichaud good evening, #perl6
22:53 jnthn o/ pmichaud
22:53 jnthn pmichaud: Dunno if you saw, but the BE issue is resolved :)
22:53 pmichaud I saw -- excellent!
22:53 jnthn (Big Endian. Not British English. :P)
22:55 jnthn When's your talk?
22:55 * jnthn wonders if he might catch it on the live stream...
22:56 jnthn Though, probably not given I'm gonna be country hopping in the next couple of days...
23:03 Helios` joined #perl6
23:10 pmichaud omg the wireless here is .... awful
23:10 * pmichaud temporarily connects via his phone
23:10 jnthn :S
23:11 jnthn Wireless can be cranky.
23:12 pmichaud my presentations are on thursday and friday
23:13 pmichaud thursday at 22h30 utc
23:13 pmichaud friday at 20h30 utc
23:13 pmichaud both in Pyle 313
23:14 pmichaud lightning talk sometime 23h50-0h50 utc
23:14 jnthn Hm, will likely be doing a train journey on a wifi-equipped train during that Friday one.
23:15 pmichaud no, wait, that's not right
23:15 pmichaud I'm off by a couple of hours
23:15 jnthn Oh, but wait...BST rather than UTC...
23:15 pmichaud lightning talk 21h50-0h50
23:15 pmichaud (utc)
23:15 pmichaud friday at 18h30
23:16 pmichaud thursday at 20h30
23:16 pmichaud that's better
23:16 jnthn Ah, those are trickier...will keep 'em in mind.
23:17 pmichaud okay, I need to head off to the arrival dinner -- will bbl
23:17 jnthn Enjoy :)
23:28 vmspb left #perl6
23:36 alvis joined #perl6
23:47 tyatpi joined #perl6

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

Perl 6 | Reference Documentation | Rakudo