Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-08-07

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:13 lucas_ joined #perl6
00:16 Alias joined #perl6
00:28 sorear rt.perl.org is now being used to report try.rakudo.org problems?
00:46 kid51 sorear:  All I know is that if I file a bug via rakudobug@perl.org, it ends up at rt.perl.org
00:47 kid51 If I am working my way through the Using Perl 6 book draft downloaded from github, where is the best place to post questions/comments about the book itself?
00:47 plobsing joined #perl6
00:51 snarkyboojum kid51: here or #perl6book perhaps
00:58 envi^home joined #perl6
00:59 LaVolta joined #perl6
01:03 kid51 snarkyboojum:  And people will pick it up from backscroll?  (I don't expect to spend very much time here myself.)
01:04 kid51 i.e., posting here would be better than email to some address?
01:04 kid51 (p. 6 of the book lists various email addresses, but none specifically for the book)
01:09 Exodist in perl6 grammars/regexes non-word_alpha_underscore characters are considered meta... what does it do if a character that is not a word character and has no meaning as a meta character is used in a pattern?
01:23 Intensity joined #perl6
01:23 rurban joined #perl6
01:23 avuserow Exodist: those characters are reserved, so it's just an invalid pattern, as I remember
01:25 Exodist http://perlcabal.org/syn/S​05.html#Nothing_is_illegal
01:25 Exodist that title seems to imply otherwise, but I will read it againto make sure I did not gloss over it
01:26 avuserow that statement does not mean that everything is legal
01:26 avuserow it means that having a regex of "nothing" (e.g. //) is invalid
01:31 Exodist std: my $x = "a"; $x ~~ m/⎋/;
01:31 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Bogus term at /tmp/EO3wpJyVg2 line 1:␤------> [32mmy $x = "a"; $x ~~ m/[33m⏏[31m⎋/;[0m␤Undeclared routine:␤   'm' used at line 1␤Parse failed␤FAILED 00:01 117m␤»
01:31 Exodist star: my $x = "a"; $x ~~ m/⎋/;
01:31 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "$x ~~ m/\u238b/"␤»
01:31 lue joined #perl6
01:32 Exodist star: my $x = "a"; say "blah" if $x ~~ /⎋/;
01:32 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:32 Exodist star: my $x = "a"; say "blah" if $x ~~ /\⎋/;
01:32 p6eval star 2010.07:  ( no output )
01:32 Exodist star: my $x = "a"; say "blah" unless $x ~~ /\⎋/;
01:32 p6eval star 2010.07: OUTPUT«blah␤»
01:33 Exodist star: my $x = "a"; say "blah" unless $x ~~ /⎋/;
01:33 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "unless $x "␤»
01:33 Exodist star: my $x = "a"; say "blah" unless $x ~~ /枉/;
01:33 p6eval star 2010.07: OUTPUT«blah␤»
01:34 Exodist ok, so unescaped non-word unicode is errer, escaped is fine, unescaped word char works fine.
01:34 avuserow *nod* and escaped word char that doesn't mean anything should also error.
01:35 Exodist star: my $x = "a"; say "blah" unless $x ~~ /\枉/;
01:35 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "unless $x "␤»
01:35 Exodist hmm, indeed
01:36 avuserow rakudo: my $x = "a"; say "blah" unless $x ~~ /\c/;
01:36 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Unrecognized \c character at line 22, near "/;"␤»
01:36 avuserow rakudo: my $x = "a"; say "blah" unless $x ~~ /\d/;
01:36 p6eval rakudo 0e5edb: OUTPUT«blah␤»
01:36 avuserow bleh, can't remember which [a-zA-Z] ones are not meaningful :)
01:36 avuserow rakudo: my $x = "a"; say "blah" unless $x ~~ /\y/;
01:36 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Confused at line 22, near "unless $x "␤»
01:38 Exodist star: token metachar:sym<⎋> { \w }; my $x = "a"; say "blah" if $x ~~ /⎋/;
01:38 p6eval star 2010.07: OUTPUT«Useless declaration of has-scoped token in a module; add our or my to install it in the lexpad or namespace␤===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:38 Exodist star: my token metachar:sym<⎋> { \w }; my $x = "a"; say "blah" if $x ~~ /⎋/;
01:38 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:38 Exodist I must be doing that wrong.. I am trying to define it as a meta...
01:39 avuserow star: my token metachar:sym<⎋> { \w }; my $x = "a"; say "blah" if $x ~~ /⎋/;
01:40 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:40 avuserow star: my token metachar:sym<⎋> { 'a' }; my $x = "a"; say "blah" if $x ~~ /⎋/;
01:40 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:40 avuserow star: my token metachar:<⎋> { 'a' }; my $x = "a"; say "blah" if $x ~~ /⎋/;
01:40 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "if $x ~~ /"␤»
01:40 avuserow looks like a case of not implemented?
01:40 sorear Exodist: You can't define metachars, sorry
01:40 sorear avuserow: it's not even in the spec
01:41 Exodist http://perlcabal.org/syn/S05.html#Grammars
01:41 Exodist er, I mean: http://perlcabal.org/syn/S0​5.html#Syntactic_categories
01:42 Exodist sorear, am I misinterpreting the spec?
01:42 Exodist or is that example of a metachar declaration an illusion :-)
01:42 sorear Exodist: if you search the rest of the spec, you won't find a definition of "augment slang" concrete enough to be implementable
01:42 leprevost joined #perl6
01:43 sorear there is a lot of pie-in-the-sky speculation mixed in with the hard spec
01:48 skyheights joined #perl6
01:51 aya1 joined #perl6
01:51 aya1 Hmm is there for perl6 some xml parser? like xml simple? module from 5 return invoke error :(
01:57 literal you're turning to Perl 6 because you couldn't figure out how to use some Perl 5 XML parser?
01:58 aya1 nope i'm know how use but it return error, one sec i'm give you more info
01:58 aya1 $!response = XML::Simple.new().XMLin($response);
01:58 aya1 return me error Null PMC access in invoke()
01:58 aya1 I'm look around and found so in perl6 this is a bug
01:58 aya1 it why i'm seek for perl6 xml parser :)
01:59 skyheights Has anyone successfully 'use MiniDBI;' with mysql yet? I'm getting a "The native library 'libmysqlclient' required for 'mysql_affected_rows' could not be located" error from NativeCall.pm6.
01:59 Exodist were you trying to use a perl5 xml parser in perl6?
01:59 Exodist aya1, ^
01:59 aya1 becouse perl6 have only xml writer module
01:59 aya1 not parser
01:59 Exodist perl5 modules do not work in perl6
02:00 aya1 Exodist work, but as i'm look not all
02:00 tylercurtis exodist: I expect aya1 was using Blizkost.
02:00 aya1 if you use :from<perl5>
02:00 aya1 tylercurtis yup exactly
02:00 aya1 perl6 not have some important modules to me like hmac
02:01 tylercurtis aya1: does the xml module at http://github.com/krunen/xml/ work?
02:01 masonkramer joined #perl6
02:01 aya1 one sec i'm look
02:09 aya1 tylercurtis it with err :(
02:10 aya1 whan you use it
02:10 drbean joined #perl6
02:22 aya1 in perl6 have some dump feature?
02:22 aya1 for fast debug
02:24 sorear .perl method
02:24 aya1 ok
02:24 sorear also, you're probably using blizkost wrong.. it is NOT at all user friendly
02:25 aya1 yup i'm know so it not at all user friendly :)
02:25 aya1 It just in usage of XML simple return error :) in standart usage
02:30 molaf joined #perl6
02:33 aya1 sorear, is there a way make v5 array to v6 ?
02:33 aya1 XML::Parser return array but whan i'm try use it it get too invoke err
02:41 sorear you need to do the indexing in Perl 5 code
02:41 sorear eval('$array[0]', :lang<perl5>)
02:41 aya1 aha let me try :)
02:41 sorear for efficiency it would be better to do the eval once, and construct a sub
02:42 sorear my $indget = eval('sub { $_[0][$_[1]] }', :lang<perl5>);
02:42 sorear $indget($array, 5);
02:42 aya1 :) trying now
02:47 Exodist whats blizkost?
02:53 LaVolta Exodist:  Blizkost - enables some Perl 5 modules to be used from within Rakudo Perl 6
02:54 Exodist yeah, sorry, I looked it up just after asking, should not have asked.
02:58 sorear one of my older projects.  absolutely horrible
03:33 risou joined #perl6
03:40 Alias joined #perl6
03:42 aya joined #perl6
03:43 aya sorear sorry i'm reconnect
03:43 aya Your method not work normally :(
03:43 aya in eval it return but if i'm need hash or array from eval v5 to v6, it still same trouble :(
03:43 aya but anyway thanks :)
03:43 sorear timbunce is using arrays from v5 in v6
03:44 aya how? :)
03:44 aya one sec i'm show you mine code
03:44 sorear look at dbdi
03:44 aya my $indget = eval('sub {($r) = @_;$re=XML::Simple->new()->XMLin($r); return $re;}', :lang<perl5>);
03:44 aya my $x=$indget($response);
03:44 aya print $x.{'test2'};
03:45 dalek niecza: fb6d136 | sorear++ |  (4 files):
03:45 dalek niecza: Remove old LValue/Variable split
03:45 dalek niecza: This also gets rid of two stage binding.  It seemed like a good idea at the
03:45 dalek niecza: time.
03:45 dalek niecza: review: http://github.com/sorear/niecza/commit/f​b6d13695f06f4bd347c2a474b191dda01101f8e
03:45 dalek niecza: abf6908 | sorear++ |  (2 files):
03:45 dalek niecza: Prototype Any!butWHENCE, basic tests, add ::=
03:45 dalek niecza: review: http://github.com/sorear/niecza/commit/a​bf690843ae18f8362480c6045aae3c106d2dc66
03:45 dalek niecza: 1bdc9f1 | sorear++ | Kernel.cs:
03:45 dalek niecza: Implement binding cases of autovivification
03:45 dalek niecza: review: http://github.com/sorear/niecza/commit/1​bdc9f161bc4738cc741bfb1d2767c317aada4c1
03:45 dalek niecza: 74c8460 | sorear++ |  (5 files):
03:45 dalek niecza: Implement assignment autovivification; fold autoviv into main code
03:45 dalek niecza: review: http://github.com/sorear/niecza/commit/7​4c8460a710bf33a1057b3e9dab90f8000ec1e04
03:45 sorear aya: you NEED to move the $x.{'test2'} part into perl5
03:46 sorear not just the part that makes the hash
03:55 mberends joined #perl6
04:02 _jaldhar_ joined #perl6
04:05 mberends phenny, tell masak you're sleeping in late! Proposed meeting point at about 8am: http://maps.yahoo.com/#mvt=m&amp;lat=43.723617&lon=10.398282&zoom=​17&q1=43.723601%2C10.398518
04:05 phenny mberends: I'll pass that on when masak is around.
04:06 mberends now back to bed ;)
04:08 ashleydev joined #perl6
04:09 sorear uh oh, what are masak and mberends going to do...
04:14 redicaps joined #perl6
04:26 macroron joined #perl6
04:41 redicaps left #perl6
04:56 saaki joined #perl6
05:17 desertm4x joined #perl6
05:22 alester joined #perl6
05:23 sorear ok.  now I have @array[5] working in niecza, more generally autovivification
05:23 sorear next: hashes
05:24 sorear after that: roles?  regex subrule calls?
05:25 LaVolta joined #perl6
05:29 dalek niecza: 8c9188f | sorear++ |  (2 files):
05:29 dalek niecza: Start prototyping postcircumfix:<[ ]>, implement <> word splitting
05:29 dalek niecza: review: http://github.com/sorear/niecza/commit/8​c9188fb42cbeeee5da456baf8034dacb021f3bf
05:29 dalek niecza: ed4b778 | sorear++ |  (2 files):
05:29 dalek niecza: Implement calls of postcircumfix operators
05:29 dalek niecza: review: http://github.com/sorear/niecza/commit/e​d4b77863429f4a679bbe94b2fbd14376b3dcf03
05:29 dalek niecza: 45b736d | sorear++ |  (2 files):
05:29 dalek niecza: Implement proper autovivifying array access
05:29 dalek niecza: review: http://github.com/sorear/niecza/commit/4​5b736dd4b6d43dce64830da8cf1c146b1784380
05:29 dalek niecza: 5593309 | sorear++ |  (3 files):
05:29 dalek niecza: Array autovivification goes live
05:29 dalek niecza: review: http://github.com/sorear/niecza/commit/5​5933094f951da7c51fbd21ea9a6faf8f0a521eb
05:34 hanekomu joined #perl6
05:39 frooh rakudo: sub foo { return 1, 2 }; bar($x, $y) { say "$x $y" }; bar(foo());
05:39 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Confused at line 22, near "bar($x, $y"␤»
05:39 frooh rakudo: sub foo { return 1, 2 }; sub bar($x, $y) { say "$x $y" }; bar(|foo());
05:39 p6eval rakudo 0e5edb: OUTPUT«1 2␤»
05:39 frooh rakudo: sub foo { return 1, 2 }; sub bar($x, $y) { say "$x $y" }; bar(foo());
05:39 p6eval rakudo 0e5edb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in 'bar' at line 22:/tmp/Sfndhwz46r␤  in main program body at line 22:/tmp/Sfndhwz46r␤»
05:39 frooh rakudo: sub foo { return |1, 2 }; sub bar($x, $y) { say "$x $y" }; bar(foo());
05:39 p6eval rakudo 0e5edb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in 'bar' at line 22:/tmp/GWPKCPMrd8␤  in main program body at line 22:/tmp/GWPKCPMrd8␤»
05:39 melte rakudo: sub foo { return 1, 2 }; sub bar($x, $y) { say "$x >> $y" }; bar(|foo());
05:39 frooh hm.
05:39 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Unsupported use of >> to do right shift; in Perl 6 please use +> or ~> at line 22, near "$y\" }; bar"␤»
05:40 melte keke
05:40 frooh I wish there were a way to "pre-explode" arguments
05:40 frooh what's our term for that?
05:40 frooh that is, what | does
05:41 rcfox Junction?
05:41 frooh no
05:41 frooh prefix |
05:41 frooh not infix |
05:42 * rcfox shrugs.
05:42 rcfox sub foo { return (1, 2) }; sub bar($x, $y) { say "$x $y" }; bar(foo());
05:42 * frooh scratches ear
05:42 rcfox rakudo: sub foo { return (1, 2) }; sub bar($x, $y) { say "$x $y" }; bar(foo());
05:43 p6eval rakudo 0e5edb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in 'bar' at line 22:/tmp/VGus57Ezxr␤  in main program body at line 22:/tmp/VGus57Ezxr␤»
05:43 frooh rcfox: you forgot the |
05:43 frooh rakudo: sub foo { return 1, 2 }; sub bar($x, $y) { say "$x $y" }; bar(|foo());
05:43 p6eval rakudo 0e5edb: OUTPUT«1 2␤»
05:44 rcfox Oh.
05:46 rcfox rakudo: sub foo { return 1, 2 }; say |foo().WHAT;
05:46 p6eval rakudo 0e5edb: OUTPUT«␤»
05:46 rcfox rakudo: sub foo { return 1, 2 }; say (|foo()).WHAT;
05:46 p6eval rakudo 0e5edb: OUTPUT«Capture()␤»
05:49 NiiHiiL joined #perl6
05:49 frooh hmm
05:50 frooh rakudo: sub foo { return (|1, 2) }; sub bar($x, $y) { say "$x $y" }; bar(foo());
05:50 p6eval rakudo 0e5edb: OUTPUT«Not enough positional parameters passed; got 1 but expected 2␤  in 'bar' at line 22:/tmp/secJqrZJkK␤  in main program body at line 22:/tmp/secJqrZJkK␤»
05:50 mberends joined #perl6
05:51 mberends \o going to Firenze (Florence)
05:52 masak joined #perl6
05:52 masak morning, #perl6!
05:52 phenny masak: 04:05Z <mberends> tell masak you're sleeping in late! Proposed meeting point at about 8am: http://maps.yahoo.com/#mvt=m&amp;lat=43.723617&lon=10.398282&zoom=​17&q1=43.723601%2C10.398518
05:52 masak :)
05:53 newbie_ joined #perl6
05:54 frooh star: my @f; say 1 if @f; say 2;
05:54 p6eval star 2010.07: OUTPUT«2␤»
05:56 frooh hmm
05:56 frooh anyone know if heredocs are supposed to work yet?
05:58 [particle] not yet
05:58 masak they're implementable now, though.
06:01 frooh hm
06:02 frooh rakudo: say qq(yo);
06:02 p6eval rakudo 0e5edb: OUTPUT«Could not find sub &yo␤  in main program body at line 22:/tmp/Gi0_rznCdL␤»
06:02 frooh rakudo: say qq<yo[C>);
06:02 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Confused at line 22, near ");"␤»
06:02 frooh rakudo: say qq<yo>;
06:02 p6eval rakudo 0e5edb: OUTPUT«yo␤»
06:11 sorear niecza: say q:to(EOF);␤Hello␤EOF␤
06:11 p6eval niecza d274387: OUTPUT«[31m===[0mSORRY![31m===[0m␤(Possible runaway string from line 1)␤Couldn't find terminator ; at /tmp/rgKbCfY7Fq line 3 (EOF):␤------> [32mEOF[33m⏏[31m<EOL>[0m␤Undeclared name:␤     'EOF' used at line 1␤Parse failed␤»
06:11 sorear niecza: say q:to[EOF];␤Hello␤EOF␤
06:11 p6eval niecza d274387: OUTPUT«MAIN.cs(26,55): error CS1502: The best overloaded method match for `Niecza.IP6.Invoke(Niecza.Frame, Niecza.LValue[], System.Collections.Generic.Dict​ionary<string,Niecza.LValue>)' has some invalid arguments␤/home/p6eval/niecza/Kernel.dll (Location of the symbol related to
06:11 p6eval ..previous e…
06:11 sorear oh *nice*
06:11 sorear wait.
06:11 sorear I have tests for this.
06:12 sorear niecza: say Q:to/EOF/;␤Hello␤EOF␤
06:13 p6eval niecza d274387: OUTPUT«MAIN.cs(26,55): error CS1502: The best overloaded method match for `Niecza.IP6.Invoke(Niecza.Frame, Niecza.LValue[], System.Collections.Generic.Dict​ionary<string,Niecza.LValue>)' has some invalid arguments␤/home/p6eval/niecza/Kernel.dll (Location of the symbol related to
06:13 p6eval ..previous e…
06:14 sorear um?  it works locally
06:17 frooh rakudo: sub foo { say 1 }; foo(); ::foo(); main::foo();
06:17 p6eval rakudo 0e5edb: OUTPUT«1␤Can not find sub ::foo␤  in main program body at line 1␤»
06:17 frooh rakudo: sub foo { say 1 }; foo();  main::foo();
06:17 p6eval rakudo 0e5edb: OUTPUT«1␤Can not find sub main::foo␤  in main program body at line 1␤»
06:17 frooh rakudo: sub foo { say 1 }; foo();
06:17 p6eval rakudo 0e5edb: OUTPUT«1␤»
06:17 sorear there is no main
06:17 frooh rakudo: sub foo { say 1 }; eval 'foo()';
06:17 p6eval rakudo 0e5edb: OUTPUT«1␤»
06:18 frooh is there a way to do that w/o eval?
06:18 sorear do what
06:18 frooh run a function given a string
06:18 frooh in p5 I'd do main->can('foo')->();
06:18 frooh or __PACKAGE__->can ...
06:18 sorear in p6 subs are not methods
06:19 frooh yes I know this
06:19 sorear if you want a method, use a method
06:19 frooh I don't want a method
06:19 frooh I want to run a sub given a strong
06:19 frooh string*
06:19 frooh I'm just telling you HOW I did it before
06:19 frooh and note:
06:19 frooh that is *not* a method
06:19 sorear considering that subs go into the lexpad, that's not going to be easy
06:19 frooh main isn't the invocant
06:19 sorear I suggest rethinking your design
06:19 frooh ok
06:19 frooh tell me how to reduce this code:
06:20 sorear a sub, declared ordinarily, cannot be called by name without eval
06:20 am0c joined #perl6
06:20 sorear moritz_: ping
06:21 frooh http://paste.scsys.co.uk/47707
06:21 * frooh dislikes the eval hammer
06:22 wamba joined #perl6
06:22 sorear for &Dlog-trace, &Dlog-error, &Dlog-warn, &Dlog-info, &Dlog-trace -> &fun {
06:22 sorear my @foo = fun sub ...
06:22 * sorear dislikes the strings hammer
06:23 frooh well
06:23 frooh note that they should match with a string lower on
06:23 frooh Dlog-trace prints [trace]
06:23 frooh etc
06:23 frooh but if that will work I can hack it together
06:24 sorear then loop over a bunch of pairs
06:25 frooh that's what I'm doing now
06:25 sorear rakudo: sub Dlog-trace { }; say (:&Dlog-trace).perl
06:25 p6eval rakudo 0e5edb: OUTPUT«"Dlog-trace" => { ... }␤»
06:25 sorear you may find this syntax usefulk
06:25 frooh wait...
06:25 frooh what is that?
06:25 frooh :&?
06:26 frooh the name of the method?
06:26 sorear :$var is short for :var($var)
06:26 frooh oh nice
06:26 frooh hadn't seen that
06:27 sorear rakudo: sub foo { 1 }; sub bar { 2 }; for { :&foo, :&bar }.kv -> $key, &fun { say "$key: { fun }" } # I wonder if this will work
06:27 p6eval rakudo 0e5edb: OUTPUT«foo: 1␤bar: 2␤»
06:29 sorear rakudo: sub foo { 1 }; sub bar { 2 }; for ( :&foo, :&bar )>>.kv -> $key, &fun { say "$key: { fun }" } # I wonder if this will work
06:29 p6eval rakudo 0e5edb: OUTPUT«foo: 1␤bar: 2␤»
06:34 frooh http://paste.scsys.co.uk/47708 <-- ideas?
06:36 snearch joined #perl6
06:44 sorear frooh: the sub is lexically scoped, so it doesn't escape the eval
06:44 sorear try
06:46 sorear also, the $old_ stuff is completely wrong
06:46 sorear $_ is my-scoped now
06:46 sorear http://gist.github.com/512527
06:46 frooh sorear: erm
06:46 frooh hm
06:47 frooh star: $_ =
06:47 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "$_ ="␤»
06:48 frooh star: $_ = "frew"; sub bar { say $_; $_ = "baaz"; } say $_; bar; say $_;
06:48 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub bar { "␤»
06:48 frooh star: $_ = "frew"; sub bar() { say $_; $_ = "baaz"; } say $_; bar; say $_;
06:48 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub bar() "␤»
06:48 frooh star: sub bar() { say $_; $_ = "baaz"; } $_ = "frew"; say $_; bar; say $_;
06:49 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub bar() "␤»
06:49 frooh rakudo: sub bar { say $_; $_ = "baaz"; } $_ = "frew"; say $_; bar; say $_;
06:49 sorear need ; after }
06:49 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Confused at line 22, near "sub bar { "␤»
06:49 sorear ; or \n
06:49 frooh rakudo: sub bar { say $_; $_ = "baaz"; }; $_ = "frew"; say $_; bar; say $_;
06:49 p6eval rakudo 0e5edb: OUTPUT«frew␤frew␤baaz␤»
06:49 frooh yeah, that's NOT dynamic scoping, which is what I'm after
06:49 frooh I want it to automatically change back after the sub runs
06:49 frooh like local does (called temp in p6)
06:49 PerlJam frooh: you want temp
06:50 PerlJam which is NYI
06:50 frooh NYI
06:50 frooh I know
06:50 sorear frooh: but it's not visible to the sub!
06:50 frooh we had this discussion a week ago :-)
06:50 frooh sorear: yes it is
06:50 frooh it works
06:50 frooh I have tests
06:50 PerlJam frooh: so ... you've had a week to develop temp   :)
06:50 sorear make a test case then
06:50 frooh PerlJam: hah
06:50 sorear because it's absolutely not supposed to
06:51 frooh I have a test case :-)
06:51 sorear or I'll do it
06:51 frooh but I'm not showing anyone
06:51 frooh because I want it to work :D
06:51 PerlJam frooh--
06:51 frooh :-P
06:51 frooh karma frooh
06:51 frooh is the bot dead?
06:52 frooh sorear: so we don't get a misc global in p6 huh?
06:52 sorear the bot which responded to karma was never on this channel
06:52 gfx joined #perl6
06:52 frooh orly?
06:52 frooh did not know
06:52 sorear we had a bot which responded to buubot: karma, and a bot which responded to @karma
06:52 sorear the latter was banned years ago, the former is unreliable
06:53 frooh weird.
06:53 frooh so no $_ then?
06:53 Tene what do you mean "no $_"?
06:53 frooh no misc global
06:53 sorear $_ exists, it's just lexical
06:53 Tene $_ should not be global, no.
06:54 frooh is there a global?
06:54 Tene If you want a global, make a package-scoped var.
06:54 frooh heh
06:54 Tene just like always
06:55 frooh Dlog-debug { "data_structure_of_the_week: $Log::Contextual::GLOBAL" }, $ds # <-- bummer
06:55 frooh Dlog-debug { "data_structure_of_the_week: $_" }, $ds # <-- better
06:55 frooh :D
06:56 Tene my $x = $Log::Contextual::GLOBAL
06:56 sorear Dlog-debug { "data_structure_of_the_week: $ds" } # <-- better still
06:57 frooh rakudo: my $ds = <foo bar baz>; say "lolz! $ds";
06:57 p6eval rakudo 0e5edb: OUTPUT«lolz! foo bar baz␤»
06:57 frooh rakudo: my $ds = (foo => bar); say "lolz! $ds";
06:57 p6eval rakudo 0e5edb: OUTPUT«Could not find sub &bar␤  in main program body at line 22:/tmp/GlAB5wAlx_␤»
06:57 frooh rakudo: my %ds = ('foo' => 'bar'); say "lolz! %ds";
06:57 p6eval rakudo 0e5edb: OUTPUT«lolz! %ds␤»
06:57 frooh ?
06:58 Tene % does not interpolate in ""
06:58 sorear rakudo: my %ds = ('foo' => 'bar'); say "lolz! %ds{}"
06:58 Tene rakudo: my %ds = ('foo' => 'bar'); say "lolz! {%ds}";
06:58 p6eval rakudo 0e5edb: OUTPUT«lolz! bar␤»
06:58 p6eval rakudo 0e5edb: OUTPUT«lolz! foo  bar␤␤»
06:58 Lasse_ I’ve been playing with Perl6. I don’t understand sigils. Why must I differentiate between e.g. hashes and arrays? Reading the specs I see no motivation I understand. Sigils may be compiler friendly, but how do they help me? And is this a forum for questions like this?
06:58 frooh sorear: so when you said : $ds was better, did you have an idea on how to do that, because that doesn't seem to be working at all
06:59 sorear frooh: According to p6eval it works fine.
06:59 Tene Lasse_: arrays with an @ sigil behave differently in various contexts.  Interpolate in lists, for example.
06:59 Tene consider:
06:59 sorear Lasse_: my @foo; is shorter than my $foo = Array.new();  Both work.
06:59 frooh sorear: you saw my code, it's not supposed to print out "foo  bar" it's supposed to print out "{ foo => 'bar' }"
07:00 Tene rakudo: my $a = (1..5); for $a -> $i { say "i: " $i.perl };
07:00 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
07:00 sorear rakudo: my %ds = ('foo' => 'bar'); say "lolz! %ds.perl"
07:00 Tene rakudo: my @a = (1..5); for @a -> $i { say "i: " $i.perl };
07:00 p6eval rakudo 0e5edb: OUTPUT«lolz! %ds.perl␤»
07:00 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
07:00 sorear rakudo: my %ds = ('foo' => 'bar'); say "lolz! {%ds.perl}"
07:00 p6eval rakudo 0e5edb: OUTPUT«lolz! {"foo" => "bar"}␤»
07:00 Tene rakudo: my $a = (1..5); for $a -> $i { say "i: " ~ $i.perl };
07:00 Tene rakudo: my @a = (1..5); for @a -> $i { say "i: " ~ $i.perl };
07:00 p6eval rakudo 0e5edb: OUTPUT«i: 1..5␤»
07:00 p6eval rakudo 0e5edb: OUTPUT«i: 1␤i: 2␤i: 3␤i: 4␤i: 5␤»
07:01 frooh Tene: I know the user can do that
07:01 frooh but the idea here is to do it for them
07:01 Tene Lasse_: when it's $a, it's a single item that happens to be an array.  When it's @a, it's a collection.
07:02 Tene frooh: why not pass it as an argument to the block?  Then users can just use placeholder vars.
07:02 Tene Dlog-debug { "foo: $^x" }, $ds;
07:02 frooh Tene: I'm ok with that, but the reason we don't do that now is that the args are what's passed to the funciton
07:02 frooh so
07:03 Tene frooh: I don't actually have any context at all for what you're trying to do here, or what Dlog-debug is, etc.
07:03 frooh Dlog-debug { "foo: $^x, $^y" }, 1, 2;
07:03 frooh Tene: I realize that :-)
07:03 frooh if you're curious the p5 version is search.cpan.org/perldoc?Log::Contextual
07:03 frooh I'm porting it to p6 to see what's different, what p6 is like, etc
07:03 * Tene nods.
07:03 Tene frooh: you could use a named placeholder.
07:04 Tene $:whatever
07:04 frooh Tene: see, the problem is that then theres a lot more boilerplate
07:04 frooh Dlog-debug sub (:$ds) { "foo: $^x, $^y" }, 1, 2;
07:04 frooh :-(
07:04 Tene uh... what?
07:05 Tene no.
07:05 sorear what?
07:05 sorear no.
07:05 frooh what?
07:05 frooh no.
07:05 Tene Dlog-debug { "foo: $^x, $^y, $:whatever" }
07:05 Tene 1, 2
07:05 frooh oh right
07:05 frooh I clearly forgot about the introspection
07:05 Tene You actually *can't* have both a signature and placeholders.
07:05 frooh ok
07:05 sorear rakudo: sub Dlog-debug($bl, *@args) { say $bl.(|@args); @args; }; Dlog-debug { "foo: $^x, $^y" }, 1, 2;
07:06 frooh I like this idea the bst
07:06 p6eval rakudo 0e5edb: OUTPUT«foo: 1, 2␤»
07:06 sorear rakudo: sub Dlog-debug($bl, *@args) { say $bl.(|@args); @args; }; Dlog-debug { "foo: $_" }, 5;
07:06 p6eval rakudo 0e5edb: OUTPUT«foo: 5␤»
07:06 frooh so...
07:06 sorear that looks like what p5 Log::Contextual is doing
07:07 frooh well
07:07 frooh close
07:07 frooh $_ == Dumper(@args_
07:07 frooh and @_ == @args
07:07 sorear rakudo: sub Dlog-debug($bl, *@args) { say $bl.(|(@args>>.perl)); @args; }; Dlog-debug { "foo: $_" }, "x";
07:07 p6eval rakudo 0e5edb: OUTPUT«foo: "x"␤»
07:07 Tene frooh: so maybe something like: $bl.(|@args, :args(@args.perl))
07:07 sorear that better?
07:07 Tene then use $^args in the block
07:08 pmichaud good morning, #perl6
07:08 frooh Tene: yeah, I'll tweak the name probably, but yeah, I like that
07:08 frooh pmichaud: hah, good morning
07:08 Tene pmichaud: morning.
07:09 sorear hmm, at_key is in Any-list.pm
07:09 Tene rakudo: $_ = "a"; sub foo { print $_; $_="b"; }; print $_; foo(); print $_;
07:09 p6eval rakudo 0e5edb: OUTPUT«aab»
07:10 Tene pmichaud: looks like rakudo has some problems with scoping of $_;
07:10 sorear Tene: I think what's happening is that Rakudo is generating an automatic my $_ at the UNIT level
07:12 Lasse_ Thanks, I still do not see the good of sigils, but I'm new to perl maybe I just have practice more. Anyway Perl6 is great, but hard, it's so many new constructs (for me) I have to master.
07:12 sorear good morning pmichaud
07:13 pmichaud yes, it definitely looks like a problem with $_
07:14 pmichaud there are tickets filed?
07:14 Tene Lasse_: $ variables act as single items, where @ variables are treated as collections at the language level.
07:14 Tene pmichaud: No.  I'm just stopping by, and saw someone feed that to p6eval.
07:14 Tene Could probably use tests.
07:17 pmichaud hmmmm. for some reason, sub { ... }  doesn't think it's a return.
07:18 pmichaud *routine
07:19 miso joined #perl6
07:20 miso evalbot usage: 'perl6: say 3;'
07:20 miso perl6: say 3;
07:20 p6eval pugs, rakudo 0e5edb: OUTPUT«3␤»
07:24 janosik joined #perl6
07:33 janosik left #perl6
07:46 M_o_C joined #perl6
07:50 Su-Shee joined #perl6
07:54 sjohnson perl hackers of the midnight hour
07:54 sjohnson well.. my time :)
07:55 LaVolta rakudo: my $str = "'test'"; $str ~~ s/'//g; $str.perl.say;
07:55 p6eval rakudo 0e5edb: OUTPUT«===SORRY!===␤Confused at line 22, near "$str ~~ s/"␤»
07:57 LaVolta rakudo: my $str = "'test'"; $str.substr(1, -2).perl.say;
07:57 p6eval rakudo 0e5edb: OUTPUT«"tes"␤»
07:58 LaVolta rakudo: my $str = "'test'"; $str.substr(1, -1).perl.say;
07:58 p6eval rakudo 0e5edb: OUTPUT«"test"␤»
08:00 risou joined #perl6
08:03 sorear with the infrastructure for arrays, hashes were a cake walk
08:03 sorear now in
08:03 sorear and now over 200 tests
08:03 sjohnson hi
08:03 sorear (my $foo; $foo<bar> hashes that is; the % sigil is NYI)
08:06 sjohnson sorear: what are your thoughts about no printf in p6?  is it on purpose?
08:07 sjohnson i kinda like busting out that technology every now and then, and was surprised to see only sprintf on rakudo star
08:08 dalek niecza: 8a0b8ba | sorear++ |  (2 files):
08:08 dalek niecza: Prototype hash access and autovivification
08:08 dalek niecza: review: http://github.com/sorear/niecza/commit/8​a0b8ba71bd448044e119a11f8f53d68871d3b5d
08:08 dalek niecza: 0e24f40 | sorear++ |  (2 files):
08:08 dalek niecza: Implement $foo<bar> subscripting form
08:08 dalek niecza: review: http://github.com/sorear/niecza/commit/0​e24f40259aa0402e143c3edefa6cecfa393c2dd
08:08 dalek niecza: 5cb73b8 | sorear++ |  (3 files):
08:08 dalek niecza: Hashes go live
08:08 dalek niecza: review: http://github.com/sorear/niecza/commit/5​cb73b84aed56f2a7aa1227abff860def75a0ba7
08:08 LaVolta sjohnson:  no printf?
08:10 LaVolta star: printf("%x", 16);
08:11 p6eval star 2010.07: OUTPUT«10»
08:11 sorear fmt and say together are as short as printf
08:11 LaVolta there is...
08:11 sjohnson wow.  it wasn't working earlier
08:11 sjohnson could be me though
08:11 sjohnson could be i was too fancy
08:11 sjohnson star: "let the %s times roll".printf(<good>)
08:11 p6eval star 2010.07: OUTPUT«Method 'printf' not found for invocant of class 'Str'␤  in main program body at line 22:/tmp/qaFB8XhrBo␤»
08:11 sjohnson thats what kind of threw me for a loop.  why wouldn't that work?
08:12 sjohnson star: "let the %s times roll".sprintf(<good>).say
08:12 p6eval star 2010.07: OUTPUT«let the good times roll␤»
08:12 Tene say "let the %s times roll.fmt('good')
08:12 sjohnson say "let the %s times roll".fmt('good')
08:12 Tene Oops, got that backwards.
08:12 sjohnson and double quote :)
08:12 sorear sjohnson: why do you keep trying to call printf as a method?
08:12 Tene rakudo: say 'good'.fmt('let the %s times roll')
08:12 p6eval rakudo 0e5edb: OUTPUT«let the good times roll␤»
08:12 sjohnson sorear: i thought you could be flexible like that, since it works with sprintf
08:13 Tene Perl 6 used to have unification and fallback between methods and subs, but not anymore.
08:13 Tene not for quite a while.
08:13 Tene sjohnson: afaik, there's no printf method in the spec.  You could add it if you like.
08:14 Tene or submit a patch, or whatever.
08:14 sjohnson would that be to pugs or rakudo
08:14 sjohnson seems that pugs is the one
08:14 sjohnson as far as commit access goes etc
08:14 sorear sjohnson: printf is an I/O operation, it is a method on IO
08:14 sjohnson never really knew the answer to that question
08:14 sorear rakudo: $*OUT.printf('%x', 17)
08:14 p6eval rakudo 0e5edb: OUTPUT«11»
08:14 sjohnson Tene: has there ever been any disagreements on p6 specs?  i wouldn't mind adding a couple things.. but they might be too radical
08:15 Tene perl6: "foo".say;
08:15 p6eval pugs, rakudo 0e5edb: OUTPUT«foo␤»
08:15 sorear sjohnson: if it's radical, talk to somebody first
08:15 Tene sjohnson: the specs are kept in the pugs repo.  There certainly have been disagreements, but there are also parts of the spec that have received far too little attention.
08:16 sorear TimToady, pmichaud, jnthn, colomon, maybe me
08:16 Tene sorear: strings have .print and .say methods, that just forward to $*OUT
08:16 sjohnson i've mentioned a few of them to mr. Toady but only got an answer half the time.  maybe too many questions
08:16 Tene so IMO .printf method wouldn't be too out of place.
08:17 pmichaud with .printf I'd also wonder which one is the format string :-)
08:17 pmichaud *always
08:17 Tene sjohnson: He's been slowly working on an answer to a question of mine for months. :)
08:17 sorear sjohnson: toady is bad ADD, you need to chase him down and extract his undivided attention for a few minutes if you want him to do anything useful
08:17 sjohnson interesitng.  ok well here's one idea i had
08:18 pmichaud welllllll.... sometimes the question requires a lot more thought than can be given by a quick+simple answer
08:18 pmichaud especially if the notion is a bit radical
08:18 sjohnson for given when, i was thinking of an opposite to the word "when", that would be "when not".  much like if/unless statements
08:18 sjohnson i had a good idea for it, but i forgot it.  i guess "aint" would be too slang :)
08:19 sorear these days I handle radical stuff by just implementing it in niecza without asking anybody first
08:19 pmichaud sjohnson: we've discussed the possibility many times here.
08:19 sjohnson pmichaud: interesting.  what were the verdicts / general consensus?
08:19 pmichaud sjohnson: the standard answer at the moment is that it should be   when none(...) { ... }
08:19 snarkyboojum when't :P
08:19 sorear I treat the nonexistant, ambiguous and nonsensical parts of the spec as a License to Make Stuff Up
08:20 sjohnson haha
08:20 sorear niecza: say $?ORIG
08:20 p6eval niecza d274387: OUTPUT«MAIN.cs(24,55): error CS1502: The best overloaded method match for `Niecza.IP6.Invoke(Niecza.Frame, Niecza.LValue[], System.Collections.Generic.Dict​ionary<string,Niecza.LValue>)' has some invalid arguments␤/home/p6eval/niecza/Kernel.dll (Location of the symbol related to
08:20 p6eval ..previous e…
08:20 sorear ok.
08:21 sorear moritz_: your niecza autobuilder is still broken
08:21 moritz_ good morning
08:21 snarkyboojum hehe.. I like how he does that
08:21 sorear maybe I should get my own evalbot, that way when it becomes useless I won't have anyone to blame
08:21 sjohnson another idea i thought that diakopter seemed to be interested in was... if (defined(%somebighonkingvar{<key>}) { $x = $what_is_defined }
08:21 sjohnson not sure how hard that would be to do.
08:22 sorear that's already in the spec
08:22 sjohnson they stole my idea!
08:22 sorear %somebighonkingvar<key> andthen -> $x { ... }
08:23 moritz_ nieca: say $?ORIG
08:23 moritz_ niecza: say $?ORIG
08:23 sjohnson wow
08:23 Tene sjohnson: iirc, I've used "when't" as an example for lexical grammar modifications.
08:23 p6eval niecza 5cb73b8: OUTPUT«say $?ORIG␤␤»
08:23 sjohnson thats awesome
08:23 sorear moritz_: is there anything I can do to make the autobuilder more effective?
08:24 moritz_ sorear: I have no idea what's wrong... the script does
08:24 moritz_ cd ~/niecza/
08:24 moritz_ git pull
08:24 moritz_ xbuild
08:25 sorear Does the script log anywhere?
08:25 moritz_ and the log shows that the git pull is executed
08:25 moritz_ but the xbuild doesn't produce any output
08:25 sorear not even the banner?
08:26 moritz_ nothiing in the log
08:26 sjohnson Tene: i had a good idea but can't remember it.  *sad face*.  oh well.  all the words that are good sound like poor grammar without their appos'.   cant, isnt, aint, whent.. :(
08:27 sjohnson maybe it wasn't that good ;)
08:27 sorear sjohnson: ' is legal in identififiers now
08:27 sjohnson we'll i'll be
08:27 sjohnson learn something (about p6) everyday
08:27 sorear moritz_: but when you run it normally in the same root directory, it's fine?
08:28 moritz_ yes
08:28 oha joined #perl6
08:29 sorear is the script running in a screen, or redirected </dev/null >log?
08:29 moritz_ h, it doesn't capture STDERR
08:29 moritz_ my bad
08:37 pmurias joined #perl6
08:38 am0c joined #perl6
08:42 sorear hello pmurias
08:43 * sorear settles on "regex improvements"
08:43 pmurias sorear: hi
08:43 phenny pmurias: 06 Aug 18:41Z <sorear> tell pmurias SOREAR
08:46 jfried joined #perl6
08:51 pmurias sorear: made you a comaintainer of all my modules
08:55 pmurias ruoso: hi
08:57 sorear ok.
08:58 sorear I'll see about keeping the cpan STD to follow pugsstd
08:58 sorear (which takes away the main reason not to use cpan STD in niecza)
08:59 tadzik joined #perl6
08:59 tadzik morning #perl6
08:59 pmurias sorear: if you want to switch to using SVN revision as version numbers feel free to try that
09:01 risou_ joined #perl6
09:05 Guest23195 joined #perl6
09:10 tadzik moritz_: http://github.com/moritz/perlgeek.de/commit/c​0cf8f893933f7ba1b34336924f2bf74f6eb4e3d#L0R35 -- Friday
09:11 pmichaud one of the reasons for preferring    when none(...)   to something like "when't"  is that the same pattern would be used in signatures
09:11 pmichaud sub foo($x where none(Int)) { ... }
09:16 Tene obviously we just need "wheren't" too. :P
09:16 Tene Oh!  'nt should be meta.
09:16 Tene replace 'unless' with "ifn't"
09:16 pmichaud is that why TimToady is always missing the "n't" key
09:17 tadzik nice idea for Perl 7
09:17 avar sorear: You're using a lisp-like language to implement the guts: http://github.com/sorear/niecza/commit/5​5933094f951da7c51fbd21ea9a6faf8f0a521eb ?
09:17 sorear that reminds me, I still haven't implemented metaoperators
09:18 sorear avar: yes
09:18 oha pmichaud, i'm still confused on :i and alternations in regex
09:18 sorear avar: it's really more like s-expression POST literals than a separate language, though
09:18 oha say 'X' if 'bar' ~~ /:i FOO || BAR/; # matches
09:19 sorear avar: it bypasses most of the compiler and feeds nodes directly into the code gen
09:19 oha say 'Y' if 'Y' ~~ /:i || FOO || BAR/; # also matches (but nothing)
09:19 pmichaud oha: it's possible I misremembered :-(
09:19 avar sorear: neat-o, so it's a simple AST for p6?
09:19 avar hrm, ast syntax
09:19 oha pmichaud, you were clear based on what i've asked, the problem is i did the wrong question :)
09:20 lue joined #perl6
09:20 oha apart the fact that i expected that :i is higher prec then || (but i could be wrong)
09:20 sorear avar: it's lower level than that
09:21 sorear avar: I also have an AST for p6, but I don't need literals for that since I can just write p6 directly
09:21 oha if the X test is correct then i feel the Y test should fail, isn't it?
09:22 pmichaud oha: (re-reading spec)
09:22 sorear :i is higher prec than ||
09:22 oha sorear, then the X example above must fail
09:22 sorear according to STD.pm6
09:23 pmichaud oha: okay, I must've misinterpreted something earlier
09:23 pmichaud S05 has
09:23 pmichaud m/:s alignment '=' [:i left|right|cent[er|re]] /
09:23 pmichaud so, I'd think that
09:23 sorear it's also possible std is being buggy here
09:24 TimToady it's possible that adverbs are misplaced currently by STD
09:24 pmichaud / :i || FOO || Bar/   should be the same as   /:i FOO || BAR /
09:24 sorear STD interprets :i as a funky metacharacter
09:24 sorear it groups like ^
09:24 sorear Perl 5 handled adverbs as a special thing that binds to the inside of groups
09:25 sorear S05 is harkening back to (?i:  )  in that
09:25 sorear while STD is evoking more of the consistant { use ignore_case; } form
09:25 oha then i should consider [:i A|B] similar to [i [A|B]]
09:26 oha but then, i expected that [:i |B] would be the same as [:i [|B]] but it isnt
09:26 sorear we could always say that an adverb with no space before it binds to the grouper, but with space it's free floating
09:27 pmichaud oha: I suspect there's a bug.
09:27 sorear oha: the inconsistency is clearly a bug
09:27 pmichaud sorear: there were *long* discussions about modifiers many years ago.
09:27 pmichaud (and how they interact with whitespace)
09:27 sorear pmichaud: 5? 10? 15? 20? 25?
09:27 pmichaud sorear: closer to 5
09:27 pmichaud definitely closer to 5 than to 0 :-)
09:27 TimToady the intent was that :i scope itself to the (rest of the) surrounding [] or (), but STD doesn't parse it right
09:28 TimToady or rather, scopes the semantics incorrectly
09:28 desertm4x joined #perl6
09:28 oha TimToady, that means that [ A :i B | C ] will match C case insensitive rite?
09:28 pmichaud what about    /  abc | def | ;i ghi | jkl ] ?
09:28 pmichaud what about    /  abc | def | ;i ghi | jkl ] /?
09:28 pmichaud *:i
09:29 TimToady I can see where people would then make opposite mistake
09:29 pmichaud oha: [ A :i B | C ]   would act like   [A [:i B | C]]
09:29 sorear ...reakky>
09:29 TimToady so perhaps we could constrain it somehow
09:29 pmichaud constrain +1
09:29 oha pmichaud, oh!!!
09:30 pmichaud one of the problems we had with modifiers in the past was handling whitespace around them (especially under :sigspace/rule)
09:30 rokoteko rakudo: my @list = <a b a c d>; { my $previous; my @uniq = gather for @list { $previous = take $_; next if $_ === $previous; $previous = take $_ }; @uniq.perl.say }  # trying to follow the S04 gather+take uniq example.
09:30 p6eval rakudo 0e5edb: OUTPUT«["a", "b", "a", "c", "d"]␤»
09:30 sorear pmichaud: duh, unspace.
09:30 rokoteko what goes wrong there?
09:30 TimToady but I need to look at the usage of, say, :my and :dba before we decide how to constrain it
09:31 sorear :my currently has very funky scoping
09:31 sorear std: / :my $frog = 2; /; $frog++
09:31 TimToady and some things could change to fake rules if they really need atom scoping
09:31 p6eval std 31912: OUTPUT«ok 00:01 117m␤»
09:32 TimToady std: "foo $(my $bar) $baz"; $bar++
09:32 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $baz is not predeclared at /tmp/mRRD3TF65b line 1:␤------> [32m"foo $(my $bar) $baz[33m⏏[31m"; $bar++[0m␤Check failed␤FAILED 00:01 115m␤»
09:32 TimToady std: "foo $(my $bar) baz"; $bar++
09:32 p6eval std 31912: OUTPUT«ok 00:01 115m␤»
09:33 sorear $() ?
09:33 TimToady std: "foo @(my $bar) baz"; $bar++
09:33 p6eval std 31912: OUTPUT«ok 00:01 115m␤»
09:33 TimToady std: "foo %(my $bar) baz"; $bar++
09:33 p6eval std 31912: OUTPUT«ok 00:01 115m␤»
09:35 TimToady right now the scoping rules for my are very simple; it responds only to curlies and comp unit boundaries
09:35 sorear should babble treat curlies specially?
09:35 pmichaud oha: you've stumbled upon a place where we need some spec improvement.  :)
09:36 sorear std: qq{ foo $(my $bar) baz }; $bar++
09:36 p6eval std 31912: OUTPUT«ok 00:01 115m␤»
09:36 dalek rakudo: 6ebba85 | pmichaud++ | src/Perl6/ (2 files):
09:36 dalek rakudo: Fix handling of $_ scoping in routines (broke due to $*IN_DECL change in
09:36 dalek rakudo: grammar).
09:36 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6​ebba85137cbda35840bb8c3ae21867acb5d7d67
09:36 TimToady s/curlies/non-quote curlies/
09:36 oha pmichaud, happy to have helped in some ways, if i may do something lemme know!
09:37 TiMBuS i meant to ask yesterday: how do you submit a new rakudo patch? I recall you don't like git pull requests
09:37 pmichaud oha: could you file a rakudo bug ticket for the :i problems you're seeing (so we don't forget to fix rakudo, std, and the spec?)
09:37 pmichaud oha: mail to rakudobug@perl.org :-)
09:37 oha pmichaud, sure
09:38 oha i'll write as i expected to be, so you can correct cauz i fear i still do not understood exactly how :i is supposed to be :)
09:39 pmichaud oha: that's all we need :)
09:39 pmichaud (and is exactly what we need)
09:39 oha yup
09:39 pmichaud TiMBuS: create a diff and mailto rakudobug@perl.org with [PATCH] in the subject
09:40 pmichaud (I think there's "how to submit a patch" in the README :)
09:41 avar Or a pull request ?
09:41 TiMBuS i never like mailing the rt and i dont know why.
09:42 pmichaud so far we haven't been able to make pull requests on github work well.
09:43 sorear Where do you draw the line between "Needs a CLA" and "Doesn't"?
09:43 pmichaud the fork queue is very unfriendly to reviewing and applying pull requests
09:43 pmichaud sorear: commit bits to Rakudo compiler require CLA
09:43 pmichaud that's pretty much the line.
09:44 TiMBuS pmichaud, that's a pity, because if they were better then git could be used more to its potential
09:44 pmichaud TiMBuS: sure, I agree.
09:44 pmichaud also, github's fork queue doesn't lend itself to sending comments on proposed patches
09:44 pmichaud i.e., if I want to say "this patch is close but we also need ...."  there's not a good public mechanism for it
09:44 pmichaud so, we stick with RT for now
09:45 * oha submitted #77064
09:46 TiMBuS bug github about it! they're always looking for new features to put them ahead of gitorious
09:46 pmichaud TiMBuS: that's a reasonable idea.  I think others have proposed similar already, though.
09:48 sorear pmichaud: How closely does Rakudo track STD.pm6 these days?
09:48 pmichaud sorear: as closely as we can, always (more)
09:49 pmichaud sometimes STD.pm6 gets refactors that take a little while for us to catch up in Rakudo
09:49 pmichaud sometimes STD.pm6 makes assumptions that work for parsing but not necessarily for codegen
09:49 avar pmichaud: You don't need to use the fork queue if you use pull requests. Those requests are just "get xyz from URL". You can then pull that over git, send suggestions over e-mail etc.
09:49 * avar uses github, but not the fork queue thingy
09:50 pmichaud avar: it's much easier (for me at least) if the requests are already in an email thread, though
09:50 pmichaud if I send suggestions back to a single person (the submitter), that's not nearly as helpful as having it go to a forum
09:51 sorear pmichaud: hmm, hopefully I can help in the latter
09:51 pmichaud sorear: sure, you've already helped there I suspect
09:51 sorear niecza is currently committed to using STD.pm6
09:51 pmichaud sorear: that's also why I always talk about "convergence with STD.pm6" as opposed to "adoption of STD.pm6".  Sometimes Rakudo comes up with ideas that are worthy for STD.pm6 :-)
09:51 sorear any changes it requires will be made upstream
09:52 sorear :)
09:52 pmichaud (I'm still proud of <O(...)>  :-)
09:52 pmichaud avar: perhaps we could get github to send pull requests to RT, though :)
09:52 pmichaud s/send/forward/
09:54 sorear Are block-regexes subject to placeholder variables?
09:54 sorear my regex foo {:i $^a }
09:54 meppl joined #perl6
09:55 avar pmichaud: What I'm saying is that you can have people do that. I.e. push to their fork and /then/ send a request to RT. That gives you ease of applying a patch series, at least.
09:55 avar But meh, I don't care. Just saying, there's ways to work around github's default suckery.
09:55 pmichaud avar: sure; but not everyone keeps a fork on github to do their work.
09:56 pmichaud but yes, I understand the point.
09:59 sorear .u U+E001
09:59 phenny sorear: Sorry, no results
09:59 sorear .u E001
09:59 phenny U+E001 (No name found)
09:59 sorear apparently, vim thinks that this is c + /
10:01 moritz_ std: my Regex foo {:i $^a }
10:01 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Multiple prefix constraints not yet supported at /tmp/O_aB4Q_ApT line 1:␤------> [32mmy Regex [33m⏏[31mfoo {:i $^a }[0m␤Malformed my at /tmp/O_aB4Q_ApT line 1:␤------> [32mmy Regex [33m⏏[31mfoo {:i $^a }[0m␤    expecting any of:␤
10:01 p6eval ..multi_declara…
10:01 moritz_ std: my regex foo {:i $^a }
10:01 p6eval std 31912: OUTPUT«ok 00:02 116m␤»
10:02 plol joined #perl6
10:03 risou joined #perl6
10:04 Trashlord joined #perl6
10:16 KenGuru joined #perl6
10:20 whiteknight joined #perl6
10:30 kda joined #perl6
10:38 lue joined #perl6
10:40 briang joined #perl6
10:42 moritz_ rakudo: sub abc($x, $y, $_, $z) { say "$x $y $_ $z"; };   abc(1,2,3,4);
10:42 p6eval rakudo 0e5edb: OUTPUT«2 3 1 4␤»
10:43 sorear niecza now has grammars
10:44 * sorear out.
10:45 Grrrr joined #perl6
10:47 KenGuru 2(sorear2): woohaa
10:47 pmurias joined #perl6
10:48 dalek niecza: fc986c6 | sorear++ |  (2 files):
10:48 dalek niecza: Unbitrot regexes and put them under the new workflow
10:48 dalek niecza: review: http://github.com/sorear/niecza/commit/f​c986c66c01f7bd25ccb8fcb5308c7190f59019e
10:48 dalek niecza: e74a2d3 | sorear++ |  (5 files):
10:48 dalek niecza: Refactor handling of Regex/Sub split, prototype regex blocks
10:48 dalek niecza: review: http://github.com/sorear/niecza/commit/e​74a2d301bbcf709aff8f2abbb4c7f4dea443087
10:48 dalek niecza: 5313337 | sorear++ |  (3 files):
10:48 dalek niecza: implement grammars properly
10:48 dalek niecza: review: http://github.com/sorear/niecza/commit/5​313337236c30fd4e658b88a6249a33b1d496f6d
10:48 dalek niecza: 8f98e61 | sorear++ |  (3 files):
10:48 dalek niecza: Regexes and grammars are now live
10:48 dalek niecza: review: http://github.com/sorear/niecza/commit/8​f98e6143b461e5f91e9105a01de93d0acb34c7d
10:52 KenGuru will have to setup the dependencis to try it out
10:56 pmichaud moritz_: I found the bug... spectesting it now.
10:56 pmichaud (the $_ bug)
10:57 gfldex and i was so happy that there was only one bug left :)
10:58 moritz_ gfldex: the one bug is "Rakudo doesn't implement Perl 6.0.0 corrrectly yet"
10:58 gfldex :D
11:02 risou_ joined #perl6
11:04 rbaumer joined #perl6
11:04 Grrrr joined #perl6
11:06 TiMBuS moritz_, related to the autovivifying bug you dug up yesterday. should Any implement .push() and mutate to an array? or should push convert an uninit'd Any to an array/list
11:06 TiMBuS or both?
11:07 TiMBuS rakudo: my $a; push $a, 1;
11:07 moritz_ TiMBuS: I don't know. pmichaud is the one who knows
11:07 p6eval rakudo 6ebba8: OUTPUT«Method '!fill' not found for invocant of class ''␤  in 'List::push' at line 2609:CORE.setting␤  in main program body at line 22:/tmp/jJS9JxqcBP␤»
11:11 pmichaud Any implements .push.
11:11 pmichaud but you have to check for definedness, too.
11:11 azert0x joined #perl6
11:11 pmichaud If defined, then nextsame.
11:15 moritz_ FYI, I'll be gone for the rest of the day
11:15 dalek rakudo: e569d66 | pmichaud++ | src/Perl6/Compiler/Signature.pm:
11:15 dalek rakudo: Remove "$_ is always first argument" from Perl6/Compiler/Signature.pm, fixing RT
11:15 dalek rakudo: #77054.
11:15 dalek rakudo: I'm not entirely certain why it was being put as the first argument in the first
11:15 dalek rakudo: place,
11:15 dalek rakudo: but all of the spectests pass without it (and we now resolve the RT ticket).
11:15 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/e​569d660013035f506131d89749da962ca46bd9c
11:15 moritz_ ciao
11:16 snarkyboojum čao
11:18 KenGuru 2(sorear2): will perl 5.12 work as dependency as well?
11:19 x3nU is there Getopt for perl6?
11:19 sorear yes
11:19 sorear I use 5.12.0
11:19 tadzik x3nU: there is MAIN sub
11:20 sorear Getopt will exist
11:20 sorear it might already
11:23 KenGuru which perl5 distribution do you recommend
11:28 thebird joined #perl6
11:29 Tene x3nU: generally you just want to put a signature on a MAIN sub instead of using something like getopt.
11:30 Tene x3nU: you can have type constraints, you get a usage message automatically, etc.
11:30 Tene sub MAIN(Int $x, Str $y, :$message, *@files) { ... }
11:30 Tene rakudo: sub MAIN(Int $x, Str $y, :$message, *@files) { ... }
11:30 p6eval rakudo 6ebba8: OUTPUT«Usage:␤/tmp/wAXecrrwup [--message=value-of-message] x y files [more [...]]␤»
11:31 Tene x3nU: you can even do multi subs for MAIN
11:32 Tene rakudo: multi sub MAIN($file, :$msg!) { ... }; multi sub MAIN($x, $y, *@foo) { ... }
11:32 p6eval rakudo 6ebba8: OUTPUT«Usage:␤/tmp/tKqVzjhNj0 --msg=value-of-msg file␤or␤/tmp/tKqVzjhNj0 x y foo [more [...]]␤»
11:34 x3nU thanks guys
11:34 Tene x3nU: if you actually want real getopt-style, Parrot has a getopt library, but it's awkward to use from Rakudo.
11:35 araujo joined #perl6
11:38 araujo joined #perl6
11:41 molaf joined #perl6
11:43 aya joined #perl6
11:45 patrickas joined #perl6
11:49 pmichaud well, time for me to head out
11:50 pmichaud see you all whenever I get home and online again
11:50 pmichaud afk # travel
11:51 Ken-Guru joined #perl6
11:51 szbalint see you :)
11:52 szbalint heh. I can actually say that IRL!
12:06 zby_home joined #perl6
12:09 patrickas has there been any known regression with building rakudo master? I am getting some errors when doing perl ./Configure --gen-parrot on win32 (but it could be something I messed up in   my setup)
12:10 patrickas s/Configure/Configure.pl/
12:10 macroron joined #perl6
12:16 aya argh, is there way covert hash from v5 to v6 :((
12:16 tadzik you can serialize it, to JSON or something
12:17 aya hm think it get work?
12:17 tadzik why not?
12:17 aya it just return invoke err if i'm use it in v6
12:17 tadzik How about just Data::Dumping it and evaling in 6?
12:18 aya already 1 sec show
12:18 aya my $indget = eval('sub {($r) = @_;$re=XML::Simple->new()->XMLin($r); return $re;}', :lang<perl5>);
12:18 aya my $x=$indget($response);
12:18 aya print $x.{'test2'};
12:18 aya But after eval returned same v5 hash :-D
12:19 aya :) Possible eval to get some value in hash, but it not comfort
12:19 tadzik ew
12:19 tadzik I don't get it
12:19 tadzik gimme a sec
12:20 aya sure :)
12:20 aya i'm explain a bit to easy get
12:20 snarkyboojum aya: didn't sorear already explain that you need to do the hash lookup in perl 5 for this to work via blitzkost? http://irclog.perlgeek.de/​perl6/2010-08-07#i_2673175
12:21 snarkyboojum blizkost even :)
12:21 tadzik aya: no need to eval even
12:21 aya 1) Make in var eval function with Simple XML construction($indget)
12:21 aya 2) Execute this function with xml stirng($response)
12:21 aya snarkyboojum :) i'm know, i'm can move $x.{'test2'} part to eval
12:21 tadzik aya: http://wklej.org/id/373774/
12:22 tadzik seems to work fine for me
12:22 aya But it be very uncomfort
12:22 aya To get each value throught eval
12:22 aya So it not correct way :)
12:22 snarkyboojum why not "correct"? because it's not easy to use? :D
12:23 aya tadzik - in this case yup, you need get hash from v5 code or method, in this all key
12:23 tadzik aya: no, you can print it with Data::Dump(er)
12:24 aya snarkyboojum, becouse it not KISS :) and i'm think a lite crazy heal head throught broke leg
12:24 tadzik as I did in re.pl
12:24 snarkyboojum aya: have you checked out http://github.com/timbunce/DBDI/commit/1​550bc4084b66e5b75f89235322157dc76fd65d5 ?
12:24 aya tadzik :) 1 min
12:25 snarkyboojum aya: not saying it's the "best" way, just that it's the way it works currently - but I don't understand the details to be honest
12:27 aya snarkyboojum 10 min i'm look :)
12:27 aya tadzik, it not normally output in usage, whan you use not dump
12:27 aya also pel6 methods not work on v5 blizkost
12:28 tadzik aya: So 1) what do you have and 2) what do you want to have?
12:28 tadzik I fail to understand your problem
12:29 aya tadzik:
12:29 aya 1) I'm have hash or array returned from v5 module, throught XML simple
12:29 aya 2) I'm need convert it to v6 hash or array, becouse v6 provide err if you try use this hash
12:30 tadzik aya: why can't You use XML module from Perl 6?
12:30 tadzik * for
12:30 aya tadzik perl6 have only writer module, i'm not find parser module
12:31 tadzik aya: how about http://github.com/krunen/xml/ ?
12:31 aya it not work, code with err, yesterday i'm already try it
12:31 tadzik hmm
12:31 snarkyboojum I can't get that module to make/test either
12:32 aya in this all thing :) it like strings from v5, but for this pplz from channel help me
12:33 aya snarkyboojum: hmm looked in code, not sure hod dbdi help me get hash :)
12:33 aya maybe i'm miss some? :)
12:34 KenGuru joined #perl6
12:36 snarkyboojum aya: not sure - haven't played with it, but thought it might provide inspiration :)
12:37 aya :) nope
12:37 aya tadzik: just try this code to catch problem:
12:37 aya my $r = '<test><test2>2</test2></test>';
12:37 aya my $x = XML::Simple.new().XMLin($r);
12:37 aya print $x.{'test2'};
12:38 tadzik I see
12:39 aya :) catch it?
12:39 tadzik I did $x<test>, but same effect
12:39 aya In this all trouble, only method to get values from $x is eval, but it so uncomfort :(
12:40 tadzik it'd be nice to fix the XML module
12:42 snarkyboojum aya: what is line 109 doing of the github commit doing?
12:42 aya one sec
12:42 tadzik what is <.ident> in grammars?
12:44 aya snarkyboojum, it like same as before :) eval to get values from array / hash
12:44 arnsholt It's like <ident> except it doesn't create an entry in $/
12:44 snarkyboojum yeah, but installing a sub to do it or something right?
12:45 snarkyboojum aya: so this is a way to do it, you just don't like it? :)
12:45 aya yup as i'm in 1st example
12:45 tadzik oh, arnsholt, I wanted something about one of Your modules yesterday
12:45 aya I'm not like method to get values, like if in big list
12:45 aya It not native :) and not good :)
12:45 arnsholt tadzik: Hopefully one of the ones I'm willing to acknowledge having perpetrated =)
12:45 snarkyboojum aya: isn't this a limitation in the blizkost implementation though?
12:45 arnsholt What did you need?
12:46 tadzik arnsholt: I think it was failing tests for Algorithm::Viterbi, let me check once again
12:46 aya snarkyboojum: maybe :) but for strings have solution, so i'm hope to hashes too :)
12:46 tadzik yep
12:46 tadzik arnsholt: http://wklej.org/id/373797/
12:46 MAK__ joined #perl6
12:47 MAK__ hi
12:47 MAK__ Not sure whether to ask this question on #parrot or here
12:47 tadzik MAK__: go on, in the worst case we will redirect You :)
12:47 snarkyboojum aya: my understanding is that this isn't supported yet as per sorear's comment earlier, but good luck
12:48 MAK__ Im trying to put a set of print statments in the src/Perl6/Compiler.pir and check how the execution flows
12:48 aya snarkyboojum :) but there must be some methods to typecast :) like for string ~
12:48 MAK__ but when i put a simple say statement and rebuild it ...  the build fails
12:48 snarkyboojum aya: sounds like an improvement would be needed to blizkost, in which case, patch away :)
12:49 aya snarkyboojum i'm mean in v6 :)
12:49 arnsholt tadzik: Thanks! I've been thinking of making sure Viterbi works with a recent Rakudo but haven't gotten around to it yet
12:49 arnsholt I'll get on it
12:49 MAK__ any idea whats going wrong
12:49 tadzik arnsholt: nice, thanks
12:50 tadzik MAK__: are you sure the code is valid PIR?
12:51 MAK__ I just added a say "from inside main" inside the main function in Compiler.pir
12:51 snarkyboojum aya: but what are you casting from exactly... a perl 5 hash - that would need to be supported from within blizkost from my limited understanding
12:52 tadzik afk for a while
12:52 snarkyboojum perhaps not ;)
12:52 snarkyboojum in which case I apologise if I've confused the issue
12:52 snarkyboojum bbl
12:54 teeeeeeeeeeeeeee joined #perl6
12:55 MAK__ http://gist.github.com/512785
12:55 _jaldhar_ joined #perl6
12:56 aya snarkyboojum :) need just type cast method :) like see: if return v5 string to v6
12:56 aya 1) ~$string work,
12:56 aya 2) but other methods like .Str not work :)
12:56 MAK__ isn't the say statement a valid pir statement?
12:57 snarkyboojum aya: unless jnthn or sorear are here to answer your question I can only suggest perusing and understanding the blizkost source
12:58 TiMBuS MAK__, that's odd, it looks valid.
12:59 TiMBuS it also compiles for me
12:59 MAK__ :(
13:00 MAK__ the very same thing?
13:00 TiMBuS well i have one more space on my indentation
13:00 TiMBuS lol
13:02 aya snarkyboojum: or write recursive method to parse array :-D a bit crazy but may work
13:02 TiMBuS yeah i dont get it. have you modified something else?
13:03 MAK__ just checked the current rakudo snapshot and built it, thats it  ... nothing else
13:03 risou joined #perl6
13:04 TiMBuS um.. =/
13:04 sorear KenGuru: Distribution?  I just downloaded the .tar.gz from perl.org and used that
13:04 TiMBuS can you gist the `git diff` ?
13:04 MAK__ ok
13:05 arnsholt tadzik: Fixed. I had a workaround from when Rakduo didn't do autovivification, and removing that fixed the problem
13:05 arnsholt tadzik++
13:05 MAK__ http://gist.github.com/512792
13:09 aya hmmm probably better write crazy oldschool preg match parser :)
13:09 aya :-D
13:09 TiMBuS MAK__, must be a parrot error?
13:10 TiMBuS or does it compile without the patch
13:10 MAK__ Shall i ask it there?
13:10 MAK__ it compiles without the change
13:10 kid51 joined #perl6
13:10 TiMBuS ok then. im stumped
13:11 TiMBuS #parrot might know then
13:12 kid51 Are there recommended .vim plugin/indent/syntax files for Perl 6?
13:13 KenGuru i'm on windows. will use strawberry
13:13 TiMBuS oh hey i got the error after applying your patch MAK__
13:13 TiMBuS KenGuru, good choice
13:14 MAK__ k
13:18 snarkyboojum kid51: there's http://github.com/petdance/vim-perl
13:20 MAK__ #parrot is on freenode right?
13:20 snarkyboojum irc.perl.org afaik
13:28 azert0x joined #perl6
13:47 thebird joined #perl6
13:48 sorear rakudo: grammar G { token TOP { <.a> }; token a { <b> }; token b { x }; }; G.parse("x").perl.say
13:48 p6eval rakudo 6ebba8: OUTPUT«Match.new(␤ # WARNING: this is not working perl code␤ # and for debugging purposes only␤ from => 0,␤ orig => "x",␤ to   => 1,␤)␤»
13:48 sorear viv generates a b capture for that
13:48 sorear which is right?
13:49 isBEKaml joined #perl6
13:49 kda left #perl6
13:50 LaVolta joined #perl6
13:52 isBEKaml OHHAI,#perl6! :)
13:52 isBEKaml YAPC went well? :)
13:55 jasonmay joined #perl6
13:55 lithos joined #perl6
14:00 lithos rakudo: my @a = 1, 2, 3; @a[*+0] = 4; say ~@a;
14:00 p6eval rakudo 6ebba8: OUTPUT«1 2 3 4␤»
14:00 lithos rakudo: my @a = 1, 2, 3; @a[*] = 4; say ~@a;
14:00 p6eval rakudo 6ebba8: OUTPUT«Can't take numeric value for object of type Whatever␤  in 'Any::Numeric' at line 1351:CORE.setting␤  in 'infix:<<>' at line 6573:CORE.setting␤  in 'Any::postcircumfix:<[ ]>' at line 1665:CORE.setting␤  in main program body at line 1␤»
14:01 lithos hello #perl6! is @a[*] supposed to work for indexing the one-past-last element of an array?
14:02 sorear no
14:02 TimToady * means all the indexes
14:03 sorear TimToady: Do you know why <.ws> never seems to produce 'comment' captures?
14:03 TimToady so it should mean @a[0,1,2] = 4
14:03 lithos ah, thanks
14:03 TimToady because the . throws it away?
14:04 lithos rakudo: my @a = 1, 2, 3; @a[*] = (4, 5, 6); say ~@a;
14:04 sorear in simpler cases, <.foo> causes all of foo's captures to be flattened into the current
14:04 p6eval rakudo 6ebba8: OUTPUT«Can't take numeric value for object of type Whatever␤  in 'Any::Numeric' at line 1351:CORE.setting␤  in 'infix:<<>' at line 6573:CORE.setting␤  in 'Any::postcircumfix:<[ ]>' at line 1665:CORE.setting␤  in main program body at line 1␤»
14:04 sorear I take it this is a bug?
14:05 risou_ joined #perl6
14:11 LaVolta anyone interested in criticizing my first perl 6 script? :)
14:11 aya lol writing parser is fun :-D
14:11 sorear LaVolta: yes
14:12 LaVolta ok, it's here: http://github.com/horus/El​gmeo/blob/master/elgmeo.p6
14:12 TimToady no, <.foo> always throws away foo's captures
14:12 LaVolta very ugly
14:14 szbalint rakudo: my (:$odd, :$even) := (1..10).classify({ $_ % 2 ?? "odd" !! "even" })
14:14 p6eval rakudo 6ebba8: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'infix:<:=>' at line 1␤  in main program body at line 22:/tmp/xBfGD6uM90␤»
14:14 sorear doesn't look too awful to me
14:15 thebird joined #perl6
14:15 LaVolta sorear:  I guess it is awful in some ways :-P
14:15 LaVolta originally intended to write a omegle chat client
14:15 LaVolta but failed, nobody seems to have patience to wait my response
14:16 LaVolta and there's a Perl 5 version, i think the speed's faster :)
14:17 * lithos submitted #77072 [BUG] @a[*] does not work as slice of all indexes
14:20 sorear grammar Test1; token TOP { <.ws> }; token ws { <.unv>* }; token unv { <comment> }; token comment { '#' }
14:20 sorear this is the minimal example
14:20 sorear a very, very distilled version of STD.pm6's whitespace rule
14:20 sorear matching a single # it produces no captures
14:20 sorear if the * is removed from token ws, this changes
14:21 sorear and a 'comment' capture is produced
14:22 ashleydev joined #perl6
14:24 Su-Shee left #perl6
14:26 lithos am I doing something wrong here? I would expect to get a WhateverCode:
14:27 lithos rakudo: (map {$_+1}, *).WHAT
14:27 p6eval rakudo 6ebba8:  ( no output )
14:27 lithos hm, locally I get "List()"
14:27 sorear WhateverCode generation is syntactic
14:30 * lithos has much to learn
14:31 alester joined #perl6
14:33 MAK__ joined #perl6
14:40 aya sorear you have 5 minutes? :)
14:45 lithos left #perl6
14:46 sorear sorry, I can't help well with blizkost
14:46 aya not with it :)
14:47 aya i'm writed oldscool regexp parser :)
14:47 aya just 2 things annoynig me :-D
14:47 mathw o/
14:48 tadzik \o
14:49 _jaldhar_ joined #perl6
14:55 jferrero joined #perl6
15:02 mjk joined #perl6
15:04 risou joined #perl6
15:12 araujo joined #perl6
15:38 aya hmm in perl6 changed regex rules
15:38 aya ?
15:39 alester joined #perl6
15:40 tadzik yep, they're not like in Perl 5
15:40 aya :( bad
15:40 soupdragon joined #perl6
15:42 am0c joined #perl6
15:45 aya crazy logic :( not allow backslash < character
15:45 aya than how implement it o_O
15:45 sorear TimToady, I'll let you take this one
15:47 jasonmay is there extensive doc anywhere on the perl6 MOP?
15:48 TiMBuS saying/typing 'uninitialized Any' is a mouthful (handful?). but I'm not allowed to say undef. is there a term for it?
15:48 sorear jasonmay: The perl6 MOP is not yet defined in a cross-implementation way
15:48 jasonmay sorear: ah
15:48 sorear TiMBuS: undefined object
15:49 sorear TiMBuS: or just undef
15:49 sorear undef is no longer a single keyword, but it still exists as a concept
15:49 TimToady aya: I have no idea what you're talking about with backslash and <
15:49 aya TimToady
15:49 sorear jasonmay: though, really, if you're interested in MOPs you came a bit too soon.  The talented MOP people all jumped ship after Moose was forked
15:50 aya try this $xml~~m/\<.+?\>/)
15:50 TiMBuS Thanks sorear! I'm terrible at terminology
15:50 aya it not allow backslash before < or > sybmol but how to pass it :(
15:50 TimToady that looks fine to me
15:51 TimToady std: $xml~~m/\<.+?\>/
15:51 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable $xml is not predeclared at /tmp/yCO_Tx6Lg6 line 1:␤------> [32m$xml[33m⏏[31m~~m/\<.+?\>/[0m␤Check failed␤FAILED 00:01 116m␤»
15:51 aya hm strange
15:51 aya for me nope
15:51 TimToady std: '<foo>' ~~ m/ \< .+? \> /
15:51 p6eval std 31912: OUTPUT«ok 00:01 115m␤»
15:51 TimToady rakudo: say '<foo>' ~~ m/ \< .+? \> /
15:51 p6eval rakudo 6ebba8: OUTPUT«<foo>␤»
15:51 TimToady works fine
15:51 aya hm strange
15:52 TimToady you trying to do it from the command line, maybe?
15:52 aya maybe
15:52 TimToady could be shell interference then
15:52 aya :)
15:57 oha i felt free to submit another issue about aliasing and lazy map on rakudobug: #77074
15:58 oha i've already wrote it here, but i didn't submitted the bug by the time being
15:59 TiMBuS why the heck is my font on rt so huge?
15:59 TiMBuS am i meant to set it smaller somewhere
15:59 TimToady dinner & # and likely not internet upon return...
16:01 aya crazy new rules :(
16:01 aya if("hello"~~m:i/Hello/) {
16:01 aya print 'hello';
16:01 aya }
16:01 aya >Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 25
16:01 aya lol :-D and crazy new documentation
16:04 jasonmay I see minutes from june 30 about work on the parrot metamodel... is MOP stuff a part of that?
16:05 jasonmay oh "metamodel for parrot objects" ... looks like yes :)
16:05 risou_ joined #perl6
16:06 redicaps joined #perl6
16:11 hanekomu_ joined #perl6
16:12 aya how use the modifers in perl6 ?
16:12 aya as in documentation it just not work
16:12 aya m:i return always err and m:ignorecase too just return err
16:13 sorear aya: you need to put a space between if and (
16:13 sorear alteratively, remove the parens entirely
16:13 aya same Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 25
16:14 aya whan i'm use modifer it return me always it
16:14 sorear You put the space in the wrong place.
16:14 aya if not use all passed
16:14 sorear Also, modifiers aren't implemented in rakudo.
16:14 sorear jasonmay: yeah jnthn's work is directed towards getting a sane MOP developed for Perl 6/Rakudo
16:14 aya oh, so regex in v6 not work?
16:14 aya at all?
16:14 aya with modifers
16:15 sorear "at all" in English is a superlative, it shouldn't be used with restrictions
16:15 sorear but yes
16:16 aya is there some method in this case use v5 regex with modifers and syntax of v5?
16:16 aya Sorry my English is not native :)
16:18 redicaps left #perl6
16:18 tylercurtis joined #perl6
16:18 sorear making mistakes is nothing to apologize for
16:18 sorear it's how we learn
16:18 aya :)
16:18 aya sorear: say plz there is in rakudo have way to use v5 regex ?
16:18 TiMBuS modifiers work inside the regex, i think
16:19 aya TiMBuS too tryed as in doc :( too no luck
16:19 TiMBuS rakudo: say 'test' ~~ /:i[TeSt]/
16:19 p6eval rakudo 6ebba8: OUTPUT«test␤»
16:21 aya if ( "hello"~~m/:i:g:ii Hello/ ) {
16:21 aya analog to /sig in v5
16:21 aya Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 25
16:21 aya rakudo: say 'test' ~~ /:i:g[TeSt]/
16:21 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:22 sorear use .comb
16:22 aya sorear: where?
16:22 aya :)
16:22 tylercurtis rakudo: say 'test' ~~ /:i :g TeSt/
16:22 TiMBuS say 'test' ~~ /:g[test]/
16:22 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:22 frettled sorear: otherwise, it might get hairy ;)
16:22 TiMBuS ah
16:22 TiMBuS rakudo: say 'test' ~~ /:g[test]/
16:22 aya :)
16:22 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:22 TiMBuS :g nyi
16:23 aya or :P5
16:23 aya or :Perl5
16:23 aya as in doc :) too not work
16:23 aya rakudo: say 'test' ~~ /:ii[test]/
16:23 p6eval rakudo 6ebba8: OUTPUT«␤»
16:24 aya rakudo: say 'test' ~~ /:s[test]/
16:24 p6eval rakudo 6ebba8: OUTPUT«test␤»
16:24 TiMBuS i know someone had :ii working yesterday, on their local copy
16:24 aya :ii work, :g now work
16:24 aya rakudo: say 'test' ~~ /:P5[test]/
16:24 aya and :P5
16:24 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:24 aya rakudo: say 'test' ~~ /:Perl5[test]/
16:24 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:26 aya rakudo: say 'test' ~~ /:i:ii[TeSt]
16:26 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:26 aya rakudo: say 'test' ~~ /:is[TeSt]
16:26 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:26 aya rakudo: say 'test' ~~ /:i :s[TeSt]
16:26 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:26 aya and look like more than 1 too not work :(
16:31 TiMBuS rakudo: say 'test' ~~ /:i[:s[TeSt]]/
16:31 p6eval rakudo 6ebba8: OUTPUT«test␤»
16:31 TiMBuS feels like using perl 5 again
16:35 aya TiMBuS yup but if more than 1 modifer not work :( and P5 modifer too
16:35 aya crazy
16:35 aya rakudo: say 'test' ~~ /:s[:s[TeSt]]/
16:35 p6eval rakudo 6ebba8: OUTPUT«␤»
16:36 aya rakudo: say 'test' ~~ /:i[:s[:g[TeSt]]]/
16:36 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:36 aya argh
16:37 tylercurtis rakudo: say 'test' ~~ /:i :s[TeSt] /
16:37 p6eval rakudo 6ebba8: OUTPUT«test␤»
16:37 aya rakudo: say 'test' ~~ /:i :s :g[TeSt]
16:37 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:38 aya rakudo: say 'test' ~~ /:i :s :g [TeSt]
16:38 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:38 tylercurtis aya: you're leaving off the terminator of your regex.
16:38 tylercurtis rakudo: say 'test' ~~ /:i :g :s[TeSt] /
16:38 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:38 aya rakudo: say 'test' ~~ /:i :s :P5 [TeSt]
16:38 tylercurtis although :g doesn't appear to work.
16:38 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:38 aya yup
16:38 aya and P5
16:38 aya rakudo: say 'test' ~~ /:i :s :Perl5 [TeSt]
16:38 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:38 aya and Perl5 too
16:39 tylercurtis aya: you're not terminating your regexes. /:i :s :P5 TeSt/
16:39 tylercurtis rakudo: say 'test' ~~ /:i :s :P5 TeSt/
16:39 p6eval rakudo 6ebba8: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'test'"␤»
16:39 aya :)
16:39 tylercurtis Although it doesn't work. :)
16:39 aya i'm try diff variations
16:39 aya yup
16:40 aya so with xml parse on regex in this case too no luck :(
16:45 tylercurtis std: say 'test' ~~ /:i :P5 TeSt/
16:45 p6eval std 31912: OUTPUT«Can't locate object method "p5sigil" via package "STD::P5::Regex::_X_Ssendargs" at STD_P5.pm line 27526.␤FAILED 00:02 130m␤»
16:46 aya :)
16:46 tylercurtis aya: I suspect at least part of the reason :P5 isn't implemented is that parsing a Perl 5 regex implies parsing Perl 5 code... Which is not exactly the easiest project.
16:46 aya :)
16:46 GeneralMaximus joined #perl6
16:46 aya lol rewrite in this case to v6 mine regexp be crazy "m/\<(.+?)(\s.*?)?\>(.+?)\<\/\1\>/sig"
16:46 aya :)
16:49 tylercurtis aya: How does that handle processing instructions, CDATA blocks, and doctypes?
16:49 aya it simple variant :) i'm no need all
16:49 aya only attributes and tags :)
16:55 tylercurtis rakudo: '<foo bar="five"></foo>' ~~  / '<' $<tag>=.+? [<.ws> $<attributes>=.*?]? '>' .*? '</' $<tag> '>' /; say 'success' if $/; say $<tag>; say $<attributes>;
16:55 p6eval rakudo 6ebba8: OUTPUT«success␤foo␤bar="five"␤»
16:56 tylercurtis aya: ^^ not a perfect solution by any means, but it's pretty much what your P5 regex does.
16:57 aya let me play with it :-D thanks a lot ^_^
16:58 tylercurtis rakudo: '<foo bar="five">fish</foo>' ~~  / '<' $<tag>=.+? [<.ws> $<attributes>=.*?]? '>' $<content>=.*? '</' $<tag> '>' /; say 'success' if $/; say $<tag>; say $<attributes>; say $<content>
16:58 p6eval rakudo 6ebba8: OUTPUT«success␤foo␤bar="five"␤fish␤»
16:58 tylercurtis Slightly improved with a named capture for the tag's content.
16:58 aya :)
17:01 tylercurtis actually, that <.ws> might need to be \s+, since ws does a zero-width match on word boundaries.
17:01 tylercurtis So, for more exotic tag names, it mightn't work.
17:06 risou joined #perl6
17:08 aya tylercurtis strange :( it loops eternal
17:08 aya while( $xml ~~  m/ '<' $<tag>=.+? [<.ws> $<attributes>=.*?]? '>' $<content>=.*? '</' $<tag> '>' /) {
17:09 aya on same iteration
17:09 pugssvn r31920 | radus++ | [t/spec] added test for RT 77072 @a[*] does not work as slice of all indexes
17:09 tylercurtis Are you doing anything to change the $xml variable?
17:10 aya one sec i'm paste mine v5 parser
17:11 aya tylercurtis: it v5 http://pastebin.com/4vEQ5EST
17:11 aya i'm trying now port it to v6, just for v5 write faster :) so i'm make v5 version
17:12 aya v6 now without recursion
17:12 aya loops only on while
17:12 darkop joined #perl6
17:12 tylercurtis Oh. That's because the V6 version wasn't global.
17:13 aya oh lol yeah
17:13 aya :-D
17:14 newbie_ joined #perl6
17:15 newbie_ rakudo??
17:15 newbie_ rakudo?
17:21 aya tylercurtis: hmm replace in v6 work same method?
17:22 tylercurtis aya: What do you mean?
17:22 aya $t ~~ s/$s+/$d/; ?
17:22 aya reokace regexp :)
17:22 aya replace :)
17:23 aya sorry type err
17:27 tylercurtis Yeah.
17:27 aya so same way
17:31 pugssvn r31921 | radus++ | [t/spec] Added test for RT 77010 use hypers with local scoped user defined operators.
17:34 isBEKaml joined #perl6
17:35 __rnddim__ joined #perl6
17:38 crazed left #perl6
17:39 darkop joined #perl6
17:41 masak joined #perl6
17:41 masak ahoy!
17:42 ashleydev joined #perl6
17:47 synth joined #perl6
17:48 GeneralMaximus left #perl6
17:53 tylercurtis locally:
17:53 tylercurtis > my @array = 1..5
17:53 tylercurtis 1 2 3 4 5
17:53 tylercurtis > @array[*-1]
17:53 tylercurtis 5
17:53 masak yes...?
17:55 tylercurtis wow.... I need to check that things are unimplemented before I start implementing them apparently...
17:55 masak "Rakudo: more implemented than you'd think"
17:57 isBEKaml rakudo: my @a=1...5; @a[*].perl.say;
17:57 p6eval rakudo 6ebba8: OUTPUT«Can't take numeric value for object of type Whatever␤  in 'Any::Numeric' at line 1351:CORE.setting␤  in 'infix:<<>' at line 6573:CORE.setting␤  in 'Any::postcircumfix:<[ ]>' at line 1665:CORE.setting␤  in main program body at line 1␤»
17:57 isBEKaml I didn't do any numeric ops, I could just say @a.perl.say, but the error looks LTA to me. :|
17:58 fod joined #perl6
17:58 tylercurtis isBEKaml: it's because @foo[*] is NYI.
17:58 masak according to S09, @array[*] equals @array[0 .. *]
17:58 tylercurtis I think.
17:58 masak tylercurtis: yes.
17:58 isBEKaml rakudo: my @a=1..5; @a[*+1].perl.say; # so is this
17:58 p6eval rakudo 6ebba8: OUTPUT«Any␤»
17:58 tylercurtis That's correct, I think.
17:58 isBEKaml masak: yes, I just read about a[*] :)
17:59 isBEKaml tylercurtis: I'm thinking a[*+1] can't be used, since that would mean we are looking for values beyond the list's last position.
18:00 tylercurtis isBEKaml: so? You can do my @array = 1..5; @array[20]
18:00 masak isBEKaml: or writing to a value there.
18:00 masak there are definitely use cases for @a[* + 1]
18:01 isBEKaml I'm sure we can do assignment since we are dealing with mutable variables here, my question was more about access. I think we could do more than just tossing "Any" blandly. :)
18:02 alester joined #perl6
18:02 masak sure. we toss the type object of the .of value of the array :)
18:02 masak i.e. Int for 'my Int @a'
18:03 [synth] joined #perl6
18:03 isBEKaml masak: my Int @a is NYI?
18:03 isBEKaml rakudo: my Int @a=1..5;
18:03 p6eval rakudo 6ebba8:  ( no output )
18:04 isBEKaml rakudo: my Int @a=1..5; @a.perl.say
18:04 masak rakudo: my Int @a; push @a, "foo"
18:04 p6eval rakudo 6ebba8: OUTPUT«[1, 2, 3, 4, 5]␤»
18:04 p6eval rakudo 6ebba8:  ( no output )
18:04 masak huh.
18:04 isBEKaml :)
18:04 isBEKaml It ate it. :)
18:04 masak it doesn't error locally either.
18:04 masak so yah, probably NYI.
18:08 risou joined #perl6
18:08 isBEKaml rakudo: my @a = 1,,23,,4,5,6,,,,7; @a.perl.say; (+@a).perl.say
18:08 p6eval rakudo 6ebba8: OUTPUT«[1, 23, 4, 5, 6, 7]␤6␤»
18:09 masak std: my @a = 1,,23,,4,5,6,,,,7;
18:09 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix , instead at /tmp/EyvLacUE4g line 1:␤------> [32mmy @a = 1,[33m⏏[31m,23,,4,5,6,,,,7;[0m␤Parse failed␤FAILED 00:01 116m␤»
18:09 isBEKaml :)
18:10 isBEKaml masak: I think this is already known?
18:10 masak it is.
18:11 jaldhar joined #perl6
18:17 pmichaud rakudo:  for <a b>.kv -> $k, $_ { .perl.say }
18:18 p6eval rakudo 6ebba8: OUTPUT«0␤1␤»
18:18 masak heh. just made my first hotel reservation through booking.com :) this sponsoring thing really works!
18:18 masak pmichaud: that's wrong, right?
18:19 pmichaud evalbot is wrong, yes.  it's working locally, though.
18:19 pmichaud I'm wondering why evalbot is out of date
18:19 pmichaud github has  e569d66   as the latest version
18:20 jferrero rakudo: my @a = 1 .. 12; say [+] @a
18:20 p6eval rakudo 6ebba8: OUTPUT«78␤»
18:20 pmichaud pmichaud@plum:~/rakudo$ ./perl6
18:20 pmichaud > my @a = 1,2,3; say @a[*];
18:20 pmichaud 123
18:20 pmichaud > my @a = 1,2,3; @a[*] = 4,5,6;  say @a[*]
18:20 pmichaud 456
18:20 pmichaud >
18:21 jferrero rakudo: my @a = 1,,23,,4,5,6,,,,7; say @a.perl; say [+] @a
18:21 p6eval rakudo 6ebba8: OUTPUT«[1, 23, 4, 5, 6, 7]␤46␤»
18:22 * tylercurtis needs to pick more obscure features to try to implement.
18:23 masak tylercurtis: or just find a bet bug on RT to fix. many open tickets are not obscure at all.
18:23 leprevost joined #perl6
18:24 pmichaud I'll start marking tickets with [LHF] again
18:24 pmichaud I'm looking forward to be home to review the RT queue :)
18:24 tylercurtis masak: I meant "obscure" more in the sense of something that hasn't just had a ticket submitted in the last day or two.
18:27 tylercurtis pmichaud: what does [LHF] mean?
18:27 pmichaud "low hanging fruit"
18:27 pmichaud tickets that I think are likely for others to be able to resolve quickly
18:28 araujo joined #perl6
18:29 pmichaud for example:  http://rt.perl.org/rt3/Public/Sea​rch/Simple.html?q=perl6+lhf+open
18:31 pmichaud looks like 57790 can be closed with just a test of some sort.
18:32 pmichaud (I'm unable to push tests from my machine atm)
18:34 masak food &
18:40 kid51 joined #perl6
18:40 dalek rakudo: fca2d32 | pmichaud++ | src/core/Any-list.pm:
18:40 dalek rakudo: Fix Whatever in .[*] and .{*} .   Fixes RT #77072.
18:40 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f​ca2d3265f6e138611d86ed977cd201fe56bb7c0
18:41 pmichaud afk, food
18:43 ashleydev joined #perl6
18:48 jferrero joined #perl6
18:53 desertm4x joined #perl6
18:57 plobsing joined #perl6
19:06 cono joined #perl6
19:06 Casan joined #perl6
19:13 aya lol dies on recursion :-D
19:13 * aya think so for normal usage rakudo very very draft
19:21 aya :-D lol now it start recursion without any call
19:21 * aya think so rakudo self think what to do, and not listen coder
19:24 alester joined #perl6
19:28 __rnddim__ joined #perl6
19:38 tylercurtis aya: what problem are you having?
19:39 aya :-D i'm catch fine bug with recursion, but it already solved. If use in while vars getted from regexp it drops in recursion for eternal :)
19:40 plol joined #perl6
19:41 aya It get me lot of laught :-D and many other lite and not light things
19:42 aya like not creation of vars on fly, or always passing var as reference in other case it be RO and etc :)
19:42 aya Not comfortable things :)
19:42 lue hello o/
19:42 s1n joined #perl6
19:44 masak joined #perl6
19:44 * masak just had a very enjoyable vindaloo
19:45 lue .oO(today is a good day I think for raising questions about module-related P6 things.)
19:46 lue hai masak o/
19:46 aya tylercurtis :) and with regexp bit trobules :) in v5 ? means non greedy, rakudo just ignore it :)
19:46 masak hellue!
19:46 lue 1)  Can I avoid having UFO compile my P6 modules to PIR?
19:46 masak sure.
19:46 sjohnson masak: hi!
19:46 masak just don't use ufo :)
19:46 masak sjohnson! \o/
19:47 sjohnson rakudo star seems to be a big deal
19:47 lue main reason I don't want it to is because I'm writing P6 modules, not Parrot modules :)
19:47 sjohnson i'm starting to think p6 christmas release is getting pretty soon
19:47 tylercurtis aya: rakudo doesn't just ignore ?.
19:47 masak lue: do you want ufo for the test target? or is there some other reason you're wanting ufo without wanting to build to PIR?
19:47 masak lue: I'm writing p6 modules too, but I want the startup speedup that building to PIR provides.
19:47 aya tylercurtis: remember query that you give me :) m/ '<' $<tag>=.+? [<.ws> $<attributes>=.*?]? '>' $<content>=.*? '</' $<tag> '>' /
19:48 tylercurtis aya: yes.
19:48 aya you have on content .*? in perl 5 it means non greedy :)
19:48 tylercurtis In Perl 6, it also means non-greedy.
19:49 masak a good term for 'non-greedy' is 'frugal'. it's used by STD.pm6.
19:49 aya in this all fun :)
19:49 lue I was just looking at it, and I don't want to compile to PIR, so I won't use ufo. No big deal.
19:49 masak (because technically, non-backtracking is non-greedy too) :)
19:49 masak lue: another happy non-customer. :P
19:49 aya tylercurtis: if launch 1 times on xml '<test>asdf</test><test>asdf2</test>
19:49 aya it comes fine :)
19:50 aya But :) if you get it in value, pass it to recursion and try execute, it ignore it
19:50 aya and not split by tag :)
19:50 ashleydev joined #perl6
19:50 tylercurtis aya: can you provide an example of the code you're running and what output it's giving?
19:50 masak (as a nopaste)
19:51 aya yup :) 5 sec i'm post to pastebin
19:51 aya it a bit dirty :)
19:51 frettled masak o/ — happy?
19:51 lue 2)  Why, for module A::B, do people tend to store it as lib/A/B.pm and then in B.pm declare something like  class A::B;  ? Is there any reason other than `just because' ?
19:52 lue [ I'm likely being thick here :) ]
19:52 masak frettled: yes. now I'm seating for two reasons. :)
19:52 frettled masak: oooh?
19:52 masak frettled: (1) Italian evening temperature, (2) just nommed vindaloo
19:52 frettled masak: aha!
19:52 tylercurtis lue: because Rakudo doesn't understand nested module definitions properly, IIRC.
19:53 masak lue: it seems a very reasonable way to do things from my perspective. what about it don't you like?
19:53 aya tylercurtis: http://pastebin.com/erDVWRxx
19:53 aya It commented where is problem :)
19:53 aya Basically it must work exact same, cos code on value is inside parent tag
19:53 tylercurtis lue: Or, if you are asking why A::B maps to A/B.pm, it's just how Perl 6(and 5, iirc) turns module names in "use" into paths.
19:54 frettled masak: I'm settling for a really warm Norwegian evening temperature (≈ 19-20 °C), a liter of choc milkshake, followed by a nommy summer drink.  Cheers for happiness!
19:54 aya But it work not as appears.
19:54 aya But if you launch same but not in recursion it still work fine :)
19:54 lue I think it's just me not wanting to have people type stuff like  Temporal::Julian.new [if it were a class]. Since I know A::B means A/B.pm, this seems... weird to me.
19:54 lue I get the oddest feeling I'm confusing myself here :)
19:54 masak frettled: yes, cheers!
19:54 * masak clinks glasses with frettled
19:54 tylercurtis What does \$ mean in a signature?
19:55 frettled lue: are you thinking that it should perhaps be: class B; and class Julian;?
19:55 shade_ joined #perl6
19:55 aya tylercurtis: it question to me? :)
19:55 frettled lue: chances are, that if you're feeling confused, you are confused.
19:55 tylercurtis rakudo: say :(\$foo).perl;
19:55 p6eval rakudo 6ebba8: OUTPUT«:(Mu \|$foo)␤»
19:55 briang left #perl6
19:55 frettled (Confusius say)
19:55 aya tylercurtis is pass by reference :)
19:56 frettled except that we don't have references except for ;)
19:56 tylercurtis aya: Nope. That's a parcel binding.
19:56 aya strange, in v5 it be passing by reference, in v6 if i'm not wrong too
19:57 aya give me a minute i'm paste origin v5 code
19:57 aya so you can see
19:57 masak aya: you're wrong. :)
19:57 masak references as you know them don't exist in Perl 6.
19:57 * frettled didn't mean to imply that «;)» is a reference
19:57 masak frettled: I'm not sure what you meant to imply. is there a significant empty string in there?
19:58 frettled masak: nopes.
19:58 tylercurtis rakudo: sub foo ($s is rw) { $s = 5; }; my $a = 4; say $a; foo $a; say $a;
19:59 p6eval rakudo 6ebba8: OUTPUT«4␤5␤»
19:59 lue I've been looking at various modules at modules.perl6.org and it's always done this way. It doesn't help my already muddy understanding of the module system.
19:59 frettled masak: But it makes a bit of sense to say that parcels are similar to references, and perhaps a bit of confusion could be avoided if we said that «well, we don't call them references, because they do much more than references, but they are that, too» — unless I'm mistaken about how they work, that is.
19:59 masak lue: it's how it's done in Perl.
19:59 aya tylercurtis: http://pastebin.com/KPEHrEGu v5 origin
19:59 masak lue: what would you like to do instead?
20:00 lue [If it's similar enough, maybe a P5 `guide' to how modules work would help]  Please remember I have no prior experience in Perl. This A::B stuff is new to me. :)
20:00 masak frettled: s/parcels/captures/?
20:00 frettled masak: er, yes, neat typo there
20:00 frettled …wish I could blame the alcohol
20:01 masak lue: the basic principle is that in Foo/Bar.pm, you expect to find a type called Foo::Bar.
20:01 masak lue: and maybe some other stuff too, but that's usually not exported.
20:02 aya masak: hm strange i'm think exist :( maybe i'm wrong
20:02 masak aya: you're wrong. :)
20:02 aya but few things in v6 really annoing, maybe it helpfully but annoyng
20:03 tylercurtis masak: that's not always the case, though. For example, there's no NativeCall type(that I'm aware of) in NativeCall.pm[6?] in Zavolaj.
20:03 aya if comape v6 with ruby, ruby more fast and comfort to type :)
20:03 masak aya: I disagree. but you're free to have that opinion.
20:03 lue I think it's that    lib/A/B.pm    containing a declaration    (class|module|package) A::B {    is not how I would set it up, and the fact that "everybody's doing it" makes it seem like it has to be done this way.
20:03 frettled Of course, «Perl 6» is six characters, «Ruby» is merely four.  Perl 6 is therefore a 50% improvement over Ruby, but at a minor cost.  ;)
20:04 aya masak: i'm not mean so v6 bad :-D it have a lot of good features
20:04 masak tylercurtis: rightright. it's just a first approximation of a rule.
20:04 masak lue: everybody's doing it because the system works, and people like it.
20:04 aya masak: but many things in v6 annoying like defenition of rw or ro vars in each function and etc
20:05 masak aya: you don't need to define ro.
20:05 masak just write nothing after the variable. very easy.
20:05 aya masak: but always need to define rw :)
20:05 masak yes.
20:05 masak that's because you shouldn't. :)
20:05 masak we're activaly discouraging you from doing that.
20:05 masak making you type a little extra as a punishment if you do.
20:05 aya and this too big annoying thing :)
20:05 aya :-D for my case
20:05 masak aya: I'm glad you think that.
20:06 aya better is make some switcher
20:06 masak aya: stop writing 'is rw' and the problem is solved.
20:06 masak you'll be happier, too.
20:06 masak "some switcher"?
20:06 aya Like in v5 you can define vars on fly without "my"
20:06 frettled aha
20:06 aya Or use strict and do always with my
20:06 aya switcher :) to choise :)
20:06 * lue continues to weaken Perl 6 community practices by questioning them :)
20:07 frettled aya: consider P6 as having «use strict» as a standard
20:07 masak aya: consider using strict as a default.
20:07 masak really.
20:07 aya frettled: i'm know :) i'm mean isn't it good have a switcer?
20:07 * frettled is still trying to teach colleagues to stop using ampersands in front of subroutine calls.
20:07 tylercurtis aya: eventually, a non-strict mode will be implemented that will be indicated by a bare "v6;" at the beginning of the script.
20:07 aya Many switchers to many things :)
20:07 tylercurtis Or at least, that's planned.
20:07 aya :)
20:07 frettled aya: you mean something that lets you turn on and off such features on demand?
20:08 frettled aya: I believe the better English term for that might be «(feature) toggle»
20:08 aya frettled: yup :) some kind off :) sory if i'm explain bad :)
20:08 tylercurtis That method of indicating strict is because a bare literal in sink context at the start of the file should give a warning in non-strict mode.
20:08 frettled aya: no problem, as long as we can talk about it to figure out what we mean to say, a bit of misunderstanding is perfectly fine!
20:09 aya frettled: yup toggle :) Like toggle for "IF" loop, cos whan i'm first time use it, i'm just not come crazy, becouse need add space below {
20:09 aya frettled: or strict thing :) or rw thing :) many other things :)
20:09 masak aya: you could use the word 'pragma' instain 'switcher'.
20:09 aya If it be toggle it Off or On it be really comfortable :)
20:09 aya masak: thanks ;)
20:09 masak aya: did I explain adequately why it's a good thing to have explicit 'is rw'?
20:10 masak aya: it's because of the optimizer. and because of clean code.
20:10 aya masak: yup i'm know why it need :) but sometimes it annoing :)
20:10 tylercurtis aya: I'm going to try writing up a more Perl 6-y version of your original Perl 5 script. although I won't go all out and write an XML grammar(although that's the straight-forward Perl 6 way to do it).
20:10 frettled aya: Considering how Perl 6 works in general, I think it would cause major problems to disable strict mode, much more so than in Perl 5.
20:10 masak aya: I don't find it that annoying. but tastes differ.
20:10 aya masak: it like type casting, it good in some cases, but in most cases enought be auto type cast like in Php :)
20:11 aya tylercurtis: thanks :) it can be bad writed :-D i'm know v5 just a week :-D
20:11 masak aya: right. but you can't auto-'is rw' anyway.
20:11 frettled aya: and in most cases, types are automatically cast
20:11 masak aya: 'is readonly' (the default) and 'is rw' have different effects on the code.
20:11 frettled yup, and «is rw» isn't exactly a type
20:11 aya masak: it just what i'm mean :) so if be toggle be more comfort :)
20:12 aya frettled: it just as example :) not exact to v6 :)
20:12 twik joined #perl6
20:12 masak aya: ok. there's really nothing to stop you from writing a pragma that does that. 'use rw-params' or something.
20:12 frettled I think this is a matter of fundamental OO philosophy.
20:12 masak aya: I wouldn't recommend such a pragma, but it's perfectly culturally acceptable.
20:12 masak frettled: it has some relation to OO? I don't see it. :)
20:12 frettled In some languages, you go the exact other way: nothing is private unless you specifically say so.
20:13 frettled masak: oh, yes, it's a principle of object encapsulation(? — my terminology is a bit iffy these days)
20:13 aya masak: some things need be crazy :) i'm get smoke and tell you a lite story about Php :-D about 1 crazy thing :)
20:14 masak frettled: are we still talking about routine parameters and 'is rw'?
20:15 frettled masak: yup, I'm just trying to use a slightly different perspective
20:15 masak aya: smoke by all means, but do you have to tell stories about PHP? :P
20:15 frettled I guess I could've started babbling about call by value, call by reference, and call by name.
20:15 masak we know PHP is crazy already. that's why we're doing Perl. :)
20:16 frettled masak: yup!
20:16 aya masak: :-D it crazy but comfort :)
20:16 masak frettled: I'm very eager to see how all these pieces fit together for you. they don't for me. :)
20:16 aya masak: see, once times i need parse xml in php to array
20:17 aya masak: i'm just like arrays, more comfort work with it :) in php it get just few strings, open string, parse by sax, get level of node and pass by reference to recursion (sorry if explain bad) :)
20:17 masak s/i'm just like/I just like/
20:18 masak I'm with you so far.
20:18 aya masak: and crazy thing is in method, arrays in Php same for hashes and not hashes, and sax return level always :)
20:18 masak I like your English. it's brutal but completely understanable.
20:18 masak s/stan/stand/
20:19 aya masak: later i'm try reproduce it in python :) it be really hell, cos hashes and not hashes have different methods, and no xml parser like sax with level idention, some who write xml parser to python not think so it be useful know current level :)
20:19 aya masak: in this all sugar :) crazy + crazy, but gives sometimes awesome results :)
20:20 masak I'm glad that story had a happy end.
20:20 aya masak: it why i'm very love ruby too :) it have same access to associative array and standart array :)
20:21 aya sometimes it more comfortable :) maybe not so good to read but comfortable :)
20:21 masak "same access"?
20:21 aya same way to access
20:21 masak you're talking about a[] for both?
20:21 aya yup :)
20:21 masak ok.
20:22 masak I don't like that, so we'll have to disagree on that one.
20:22 aya many pplz many opinions :)
20:22 aya it why i'm like switchers and toggles in this case :)
20:22 masak see beginning of http://use.perl.org/~masak/journal/40431 for why I like it. :)
20:22 masak aya: Perl 6 will be very customizable. you will be able to make it as crazy as you like.
20:23 aya masak: be good :-D
20:23 * masak tries
20:23 tylercurtis aya: a question: what is $parent in your parse_xml sub? I don't see any declaration of it ever.
20:24 tylercurtis nevermind
20:24 tylercurtis forget about sigil variance
20:24 tylercurtis s/forget/forgot/, rather
20:24 aya masak: yup i'm like perl sigil to types :) but sometimes be better if have one method to access :) let make it more easy to write :0
20:24 aya tylercurtis: v5 just have small bug, on array length :) but nevermind it :) just to notice :)
20:25 frettled masak: Well, in OOP, some languages have only read-only accessors for variables/methods, and does not allow implicit modification/masking of those variables/methods.  P6's default behaviour of immutable (unless «is rw») parameters to subroutines is similar to that behaviour, avoiding several problems that you might get with other call-by-value and call-by-reference schemes.
20:25 masak frettled: ok, granted. different systems, but same underlying optimisation/security/cleanness concerns.
20:25 masak frettled++ # thinking laterally
20:26 frettled I do try, occasionally. :D
20:26 * aya comes get coffe
20:29 * aya back
20:29 aya masak: i'm just can have this opinion becouse i'm like from OOP as it exist now only 10% of features :-D
20:30 frettled BTW, call by name can be pretty cool.  I think the example in Wikipedia for the ∑ function in Simula can be slightly confusing, but it might illustrate the idea to those not familiar with it (http://en.wikipedia.org/wiki/Simula#Call_by_name).  Perl 6 has closures, so we don't really care, do we?
20:30 aya masak: or maybe becouse i'm have a rule, not use code if you not know how it work :-D
20:31 masak aya: I like that rule.
20:31 masak aya: but I didn't understand what you said before that.
20:31 masak aya: (also, every time you've said "i'm" so far, you really mean "I". please start writing the latter and I'll be slightly less confused.) :)
20:31 aya masak: OOP, i'm not like 90% of as it exist now :) All interfaces in OOP abstract etc, it looks like shield from fool :)
20:32 aya oh :) sorry i'm just think so i'm is right whan you talk about self :-D
20:32 masak aya: well congrats. Perl 6 has neither interfaces or abstract classes.
20:32 frettled aya: ah, so basically, you think most of OOP is about protecting the programmers from themselves?
20:32 aya masak: and it good :-D
20:32 aya frettled: Yes :) Absolutelly right :) Many no needable things
20:32 * frettled dislikes some of Java's, ahem, features.
20:33 frettled I guess that comes from learning OOP from Simula and LPC (Lars Pensjö's C)
20:33 aya frettled: I just remember dolphin code, it be awesome crazy :-D So many inheritance for light actions
20:33 masak Java is good for making bland software by big teams of replaceable coders.
20:34 * aya very very like php documentation :-D perl need some like it, current perl docs is crazy really
20:34 frettled masak: even better, my previous employer had a tool called Genova, which autogenerated code from — among other things — UML.
20:34 masak frettled: :(
20:34 frettled aya: oh, yes, the PHP documentation is nice, when it's correct, clear and understandable.  But the best part is probably the user comments.
20:35 frettled masak: nono, _smile_, it's good.  It means you can focus on more important things than trivial code.
20:35 aya frettled: aha :) comments and examples, and glossary good :) and most good is function search throught url :)
20:35 frettled You don't need to bother with creating the stupid classes and accessor methods for your data structures.
20:35 frettled aya: yup
20:35 masak frettled: oh.
20:35 * masak produces a forced smile
20:35 aya frettled: even better docs than i'm see in my life :-D
20:35 frettled heh
20:36 aya :)
20:36 frettled masak: do you enjoy coding the stuff that the computer could make for you? :)
20:37 mberends joined #perl6
20:37 masak frettled: that's a trick question. why am I using a language in which the code solving my problem is so repetetive as to need autogenerating?
20:38 frettled masak: quite
20:38 frettled masak: but that's how _a lot_ of programming is done, regardless of language, be it Perl or Java, PHP or Ruby, Python or C.
20:39 masak I'm not saying it's wrong...
20:39 frettled Mind you, this programming tool dates back to the eighties.
20:39 masak I'm asking why :)
20:39 masak this wasn't the Lisp dream we had back then.
20:39 masak what happened? where did we take a wrong turn?
20:40 frettled masak: it solved problems, and I suppose it still does, even when the company hiring your services insists that you use Java to «better integrate with existing services»
20:40 frettled Oh, no, we didn't take _a_ wrong turn.  We took many wrong turns, and several right ones, too.
20:40 masak code generation is just capy/pasting of code, by a robot.
20:40 orafu joined #perl6
20:40 frettled It's a bit more sophisticated than that.
20:41 masak oh, ok. fairynuff.
20:41 frettled Considering large software projects, you might be dealing with a great deal of ORM (object-role modeling) or similar techniques to organize your data.
20:41 frettled That would be sensible to do in some sort of tool.
20:42 * masak sighs
20:42 masak I'd sure like to learn more about this.
20:42 frettled If that tool, while you model, also generated the code for classes/objects, accessor methods, etc., plus the relevant database tables and relations, you save a great deal of work.
20:42 frettled …and that's what it does.
20:43 frettled The principle is simple, but putting it into real, working, mostly bug-free code is not entirely trivial.
20:43 masak nod.
20:44 * aya dream, so perl 6 be a framework to build language, with many features to toggle off and on :-D
20:44 frettled :)
20:44 aya lol :)
20:44 frettled use MONKEY_TYPING; # Engage inifinite monkeys
20:44 aya frettled: :-D some like this :)
20:44 tylercurtis frettled: even better would be if your programming language code could be written such that it concisely did all that. Say, by just writing a class definition with "is orm" or "(:metaclass persistent-metaclass)".
20:45 aya but really :) so many languages, so many goodies, but ... in diffrenet langs :)
20:45 aya some good in one, some good in next, some good in third :)
20:45 frettled tylercurtis: that would be pretty cool :)  If we were discussing on comp.lang.lisp during the late nineties, I bet some boffin would say «I have code for that».
20:45 tylercurtis frettled: http://common-lisp.net/project/elephant/
20:45 frettled Slightly unrelated, but recommended reading: http://the-programmers-stone.com/the-orig​inal-talks/day-1-thinking-about-thinking/
20:46 masak tylercurtis: class Employee does Persistence { ... }
20:46 masak tylercurtis: or something like that.
20:46 frettled tylercurtis: heh
20:46 tylercurtis masak: Can a role do enough magic to make that happen?
20:47 * frettled idles for a while, possibly until Monday.  :D
20:47 masak frettled: that is a good article. I read it once, I think.
20:47 frettled Thanks for a stimulating hour!
20:47 aya :)
20:47 masak tylercurtis: I'm pretty sure it can. if not, a trait probably can.
20:48 masak frettled: thank you!
20:48 * masak sleeps
20:50 * aya come to smoke
20:54 tylercurtis aya: http://gist.github.com/513192
20:54 aya one sec
20:55 aya lol awesome :) give me 10 min to execute :)
20:55 aya Also say please your contacts :) so i'm add big thank to this part of code :)
20:56 aya like "Big Thank to tylercurtis from <contact here>, to rewrite xml parser from v5 code to v6" :)
20:58 Juerd joined #perl6
20:58 tylercurtis Just "tylercurtis from #perl6" would be fine.
20:59 aya okay :)
21:00 aya #Big Thank to tylercurtis from #perl6 channel on (irc.freenode.net), to rewrite code from v5 to v6  :)
21:00 aya lol
21:00 aya tylercurtis: oh you found how use global :)
21:03 tylercurtis Indeed. m:g// didn't seem to work, and even if it does, it confuses my emacs. :)
21:03 aya :) but :global work :)
21:05 tylercurtis :g works, too, if you use .match instead of ~~.
21:05 aya my error be in 3 things :)
21:05 aya 1) i'm use old v5 methods on v6, there is all absolute difference :) need forgot use v5 construtcionts
21:05 aya 2) i'm use wrong defenition in function, instead of use default assing throught %parent = {} i'm use just {}, it make me on wrong way
21:05 aya 3) i'm miss how use :global :-D need use .matchh instead of ~~ :) it be mine critical error :)
21:10 * aya comes to complete perl6 API class :)
21:11 * aya happy
21:17 mantovani joined #perl6
21:18 aya tylercurtis: maybe you can submit it for perl6 modules? If someone seeking for it like me :)
21:19 araujo joined #perl6
21:20 tylercurtis aya: I'm hoping to get around to writing a serious XML parser (following the spec to the letter) sometime soon. If I do that, I'll release that as a module.
21:20 aya oh :) good idea :)
21:20 Guest23195 left #perl6
21:24 aya uff API done :-D lol v6 version now too fine :) Thank again tylercurtis :)
21:26 allbery_b joined #perl6
21:27 tylercurtis aya: glad to help.
21:27 aya :)
21:28 aya now need just write crazy variant of API to Javascript :-D but it easy task :-D
21:28 dju joined #perl6
21:32 dju joined #perl6
21:33 __rnddim__ joined #perl6
21:34 trek1s joined #perl6
21:38 Trashlord joined #perl6
21:44 ashleydev joined #perl6
22:24 hanekomu joined #perl6
22:34 sorear Given a Match object, is there any way to find out what grammar it came from in Perl 6?
22:35 xomas joined #perl6
22:51 mjk joined #perl6
22:56 skyheights joined #perl6
23:12 rcfox rakudo: say ~(Match.new.^methods);
23:12 p6eval rakudo 6ebba8: OUTPUT«Method 'methods' not found for invocant of class 'P6metaclass'␤  in main program body at line 22:/tmp/hVe7am4sLb␤»
23:13 rcfox :o
23:23 drbean joined #perl6
23:29 sorear rakudo: say ~(('x' ~~ m/x/).^methods(:local))
23:29 p6eval rakudo 6ebba8: OUTPUT«defined perl of Str list at_key hash at_pos caps ast new chunks Bool␤»
23:29 sorear rakudo: say ~(('x' ~~ m/x/).^parents(:local))
23:29 p6eval rakudo 6ebba8: OUTPUT«Regex::Match() Cool()␤»
23:30 moritz_ Regex::Match is a Rakudo/NQP-rx hack
23:38 melte joined #perl6
23:58 melte joined #perl6
23:59 Psyche^ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo