Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-11-22

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:00 diakopter TimToady: do you see any downside to emulating the compile-time for each block instead of the whole tree at once?
00:00 diakopter thoe more I think about it, the more it seems ok to me.
00:02 dalek left #perl6
00:03 quietfanatic I want a way to find the class of a method.
00:03 dalek joined #perl6
00:03 quietfanatic I mean, the class a method belongs to.
00:03 lisppaste3 Wolfman2000 pasted "Inputs 41, 97, 17, "Hi!" (no quotes) for this RSA code gives 003200330032. I suspect I made a mistake here." at http://paste.lisp.org/display/90873
00:04 quietfanatic Is this possible?
00:06 middayc_ joined #perl6
00:07 quietfanatic If so, it will simplify Events to a large degree.
00:20 TimToady diakopter: what do you mean by 'emulating'?
00:22 diakopter I mean, evaluating
00:23 synth joined #perl6
00:24 middayc__ joined #perl6
00:25 japhb Is there a perl6doc that is A) working, B) reasonably quick, and C) up to date with the spec?
00:30 TimToady diakopter: I still don't understand what you mean.  most compile-time evaluation must happen immediately at BEGIN time
00:31 Wolfman2000 rakudo: my Str $fin; $fin = 'AFB'; say $fin;
00:31 TimToady trait handlers run the moment they're recognized and modify they're declarand immediately
00:32 p6eval rakudo 7347ec: AFB␤
00:32 TimToady *their
00:32 Wolfman2000 ...I wonder why I'm getting AFBStr() instead of that
00:33 justatheory joined #perl6
00:35 quietfanatic TimToady: Does a method know what class it's in, ot does that constrain them too much?
00:36 colomon surely self.WHAT would do the job?
00:36 quietfanatic *or
00:36 quietfanatic No, I mean given the method as an object, not the code inside the method.
00:37 colomon oh
00:38 TimToady no, a method is just a sub that happens to have a reference installed into a metaclass, and could in fact be installed in several at once
00:38 TimToady like a Unix inode
00:38 quietfanatic I see
00:39 TimToady which is also what allows a method to be exported as a multi
00:40 quietfanatic What I need is basically a way, given a method, to find all the objects it would be called on.
00:40 quietfanatic The problem is, that 'would' is not so well defined anymore.
00:41 TimToady your brain must be in upside-down
00:41 TimToady you keep wanting to follow references backwards :)
00:42 quietfanatic Yes well, events are backwards like that.
00:42 quietfanatic You kinda have to think upside-down in order to implement them.
00:42 TimToady events usually require a registry of handlers somewhere
00:42 quietfanatic I have that
00:42 quietfanatic I also need a registry of objects.
00:43 TimToady or you think you do
00:43 quietfanatic Simply put, if a routine is like a GOTO then an event is like a COME FROM.
00:43 quietfanatic Or a registry of classes that have their registry of objects.
00:43 quietfanatic Each object needs to respond to events individually.
00:44 quietfanatic And most events only affect one object.
00:44 quietfanatic I also don't want to register a pile of handlers every time an object is created.
00:46 TimToady you want the system to do it for you :P
00:46 quietfanatic I want to do as few operations when an object is created as possible.
00:47 quietfanatic Ideally, just one push onto an object registry.
00:47 TimToady yes, well, then events are going to be slow, unless you have a Content Addressable Memory sitting around as a co-processor
00:48 quietfanatic I understood the first half of that :)
00:48 TimToady but you're basically asking for magic from the system
00:48 quietfanatic No it doesn't have to be like that.
00:49 TimToady there aren't that many approaches to inverting data
00:49 quietfanatic Each object in a given class will have exactly the same event handlers, so I should only have to register the handlers for the class.
00:49 quietfanatic and register the object once for the class
00:49 quietfanatic That will be everything required.
00:49 eternaleye joined #perl6
00:50 TimToady so you need classes that also keep a collection, but what about subtypes?
00:50 quietfanatic you mean subsets, or inheriting classes?
00:50 TimToady inheriting
00:50 quietfanatic Inheritance is tricky, yes
00:51 quietfanatic Or more specifically, inheritance isn't tricky; it's overriding that's tricky.
00:52 eternaleye joined #perl6
00:52 middayc joined #perl6
00:53 quietfanatic One possible approach is to copy all the event handlers from the parents to the children when they are declared.
00:54 quietfanatic and check events only for the immediate instances of each class
00:54 TimToady sounds more like role composition than inheritance
00:54 TimToady since roles pull in methods but flatten them at composition time
00:54 quietfanatic Oh they do?
00:54 quietfanatic Hmm
00:55 quietfanatic But
00:55 quietfanatic It should ideally work for both role composition and class inheritance.
00:56 yahooooo joined #perl6
00:57 quietfanatic so if class A does role X, and class B is A, then does the role X get flattened into B as well?
00:57 TimToady well...we've talked about maybe if you "do" a class it takes a snapshot of it and makes an anonymous role
00:57 TimToady or maybe there's some other way to thread your inheritance through your role structure
00:57 quietfanatic In that case roles and classes would be pretty much the same.
00:57 TimToady I believe it's specced that a role can supply an 'isa'
00:57 quietfanatic Yes...
00:58 TimToady it imposes an immutability constraint, yes
00:58 quietfanatic what imposes an immutablitiy constraint on what?
00:58 TimToady classes are mutable, roles are not
00:59 quietfanatic oh
00:59 TimToady which is why deriving a role from a class would have to snapshot it
01:00 TimToady but snapshot is what you're doing if you 'copy methods down'
01:01 TimToady you wouldn't know to copy down methods that are monkey-typed in to the parent class
01:01 TimToady the parent would have to push them
01:01 TimToady which implies every class has to register with its parent
01:02 TimToady also, copy-down might not work with private attributes
01:02 quietfanatic That's the other approach
01:02 TimToady infrastructure for a parent class might be out-of-place in a child class
01:03 quietfanatic How do you mean?
01:03 TimToady suppose a parent method refers to $!foo, the child class will potentially have its own $!foo that is separate
01:04 TimToady in that sense, a method kinda knows which class its in somehow
01:04 quietfanatic Not necessarily
01:04 quietfanatic it could just have a reference to the...wait
01:05 quietfanatic the attribute $!foo is seperate for all instances of both classes
01:05 quietfanatic Oh wait you mean
01:05 quietfanatic if the parent has $!foo and the child has $!foo each object has two seperate $!foos?
01:06 TimToady yes
01:06 quietfanatic In which case the parent method refers to the parent-defined $!foo...
01:06 quietfanatic But then what if you copy that method into another class?
01:07 TimToady well, depending on the implementation, it might or might not get confused
01:07 quietfanatic does it use that class's $!foo?
01:07 TimToady unspecced either way, so erroneous
01:07 quietfanatic Hmm
01:07 TimToady or at least non-portable
01:07 quietfanatic But there's no way of knowing what's in the body of a method when you copy it
01:08 TimToady indeed
01:08 quietfanatic in which case copying methods around is almost always a bad idea
01:09 TimToady well, if $!foo magically knows the original class, then it would just be a form of delegation, like calling nextsame
01:09 quietfanatic in which case methods may as well know what class/role they belong to.
01:09 quietfanatic I guess so
01:10 TimToady yes, basically class-of-origin needs to be part of the key under which a $!foo is stored
01:10 TimToady a trick people use in Perl 5, btw
01:10 quietfanatic Yeah
01:10 TimToady $self->{__PACKAGE__ . 'key'} or some such
01:10 TimToady though that's assuming named classes
01:10 quietfanatic Then the method doesn't know where it's from after all, it's the variable that knows
01:11 * colomon wishes pmichaud would lock down the Iterator interface he wants to use so they could start being implemented...
01:11 TimToady would be more like .WHAT.WHICH
01:11 TimToady er, no, that's dynamic
01:11 TimToady well, $?CLASS should be WHICHish
01:12 Wolfman2000 rakudo: my $dec = "00650097"; say ($dec.comb(/<xdigit>**4/).map: {chr(:16($_))} ).join('');
01:12 p6eval rakudo 7347ec: e—␤
01:12 TimToady well, maybe the internal call knows it
01:12 Wolfman2000 ...I don't think that's supposed to be the answer.
01:13 quietfanatic Wolfman2000: That looks right to me
01:13 Wolfman2000 ...got it fixed on Feather. original problem: needed a space between : and { by map
01:20 * Wolfman2000 is finally understanding some of the power of map
01:21 nihiliad joined #perl6
01:22 Wolfman2000 I forgot: is there a fast method to convert from integer values to hex?
01:23 Wolfman2000 rakudo: say ord(65);
01:23 p6eval rakudo 7347ec: 54␤
01:23 Wolfman2000 rakudo: say ord(32);
01:23 p6eval rakudo 7347ec: 51␤
01:23 Wolfman2000 not what I'm thinking...
01:23 jaldhar joined #perl6
01:24 * Wolfman2000 needs dinner.
01:24 diakopter rakudo: BEGIN { a() }; sub a() { say 4 } # does this work?
01:24 p6eval rakudo 7347ec: Could not find non-existent sub a␤in Main (file src/gen_setting.pm, line 324)␤
01:28 ashizawa joined #perl6
01:29 diakopter nqp: a(); sub c() { our sub a() { say(4) } }
01:29 p6eval nqp: 4␤
01:29 diakopter sigh.
01:35 nihiliad joined #perl6
01:36 TimToady yeah, that shouldn't work
01:38 cotto Well, the language isn't called "Exactly the Same As Perl 6". ;)
01:38 diakopter nqp: a(); { our sub a() { say(4) } }
01:38 p6eval nqp: 4␤
01:38 diakopter std: a(); sub c() { our sub a() { say(4) } }
01:38 p6eval std 29167: ok 00:01 105m␤
01:39 TimToady oh, wait, I thought that was ng:
01:39 TimToady it's okay for nqp
01:39 TimToady std should know better though
01:39 diakopter should it? that seems much farther up the impl ladder
01:39 TimToady obviously looking in the package for 'a'
01:40 TimToady but multi dispatch only looks in lexical scopes these days
01:41 TimToady so does only dispatch :)
01:46 jaldhar joined #perl6
01:49 ng_feed rakudo-ng: colomon++
01:49 ng_feed rakudo-ng: Rework Range and RangeIterator to properly handle Ranges which exclude their ends and non-numeric Ranges.
01:51 TimToady ng: a(); { our sub a() { say(4) } }
01:51 p6eval ng 071cdd: 4␤
01:51 TimToady well, same problem
01:51 TimToady calling package subs is a hard habit to break :)
01:52 TimToady maybe one could argue it's okay as a last resort, maybe
01:53 TimToady ng: a(); { our sub a() { say(4) } }; my sub a() { say(-1) }
01:53 p6eval ng 071cdd: -1␤
01:53 TimToady that's good
01:56 _eMaX_1 joined #perl6
01:56 Jedai joined #perl6
01:56 estrai joined #perl6
02:02 diakopter ng: a(); { our sub a() { say(4) } }; my sub a() { say(-1) }; my sub a() { say(6) };
02:02 p6eval ng 071cdd: -1␤
02:03 nihiliad joined #perl6
02:03 colomon Would it make sense to have a Test.pm function that took an Iterator and a list and checked that the Iterator's output matched the list?
02:04 * colomon is struggling to figure out how to test Iterators without a pinned down standard for them, and this seemed like it might abstract the trouble issues out of the test code.
02:05 TimToady std: a(); { our sub a() { say(4) } }; my sub a() { say(-1) }; my sub a() { say(6) };
02:05 p6eval std 29167: [31m===[0mSORRY![31m===[0m␤Illegal redeclaration of routine 'a' (from line 1) at /tmp/LEQOF88TwA line 1:␤------> [32m4) } }; my sub a() { say(-1) }; my sub a[33m⏏[31m() { say(6) };[0m␤    expecting new name to be defined␤FAILED 00:01 107m␤
02:06 TimToady colomon: foo() ~~ (1,2,3) should do that
02:07 TimToady list smartmatches are supposed to match the whole thing
02:07 colomon TimToady: That's smart matching an iterator against a list?
02:07 colomon afk for sec, got to prep bottle
02:08 TimToady if listify any iterator, it should iterate it into a list
02:10 colomon hmm... so the answer is Perl 6 does this automatically for you.
02:11 colomon and the problem is I don't think that's implemented yet in ng.   :|
02:11 diakopter rakudo: a(); { our sub a() { say(4) } }; my &a = sub { say(-1) };
02:11 p6eval rakudo 7347ec: 4␤
02:11 TimToady can you say $iterator.list?
02:12 colomon For sure no, since I wrote the iterator and there was nothing for it to derive from.
02:12 colomon Should an iterator have a .list method?
02:12 colomon (and should a Range have a .list method?)
02:12 TimToady dunno
02:14 TimToady I didn't write that part :)
02:14 colomon I thought it all sprung fully formed from your head?
02:14 colomon ;)
02:15 TimToady that was Athena, not Perl
02:15 colomon And I suppose you claim you are not Zeus?
02:17 TimToady well, if I get struck by a lightening bolt, you'll know :)
02:17 TimToady *lightning
02:19 orafu joined #perl6
02:26 eternaleye A bolt from the blue turns TimToady's har white!
02:26 eternaleye *hair
02:30 Rolo joined #perl6
02:32 Avada joined #perl6
02:33 orafu joined #perl6
02:33 _eMaX_1 joined #perl6
02:33 Jedai joined #perl6
02:33 estrai joined #perl6
02:34 japhb nqp: class Foo { method foo () { $method := "bar"; self.$method(); };  method bar { say("Hello from method bar"); } }; my $o := Foo.new; $o.foo;
02:34 p6eval nqp: Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'parrot;Regex;Cursor;FAILGOAL' pc 1630 (src/Regex/Cursor-builtins.pir:179)␤
02:34 japhb pmichaud: How do I do that ^ ?  I need to be able to call a method via a computed name ...
02:37 diakopter it's not JavaScript (where you could do self[$method]()).. you'd need eval, I think.
02:38 diakopter you need a 'my ' before $method, and '()' after 'method bar'
02:38 diakopter also no self.$method, afaik
02:38 TiMBuS joined #perl6
02:39 Tene japhb: you should be able ot introspect the class, pull the method out of it, and invoke that as a method.
02:39 Tene japhb: $obj.^methods, iirc
02:42 japhb Tene, I need to do it in NQP.  Which means P6object would have to support that.
02:42 * japhb will go spelunking for that in a bit
02:43 japhb diakopter, I'm trying to avoid eval, as I'm not entirely sure of the semantics WRT to 'self' through an eval, but I'll keep that in mind as a backup.
02:44 Tene japhb: .^methods == .WHAT.methods or .HOW.methods or something, so you can use that if nqp doesn't support the .^foo syntax
02:45 japhb Tene, OK, thanks, that gives me a couple more places to look.
02:46 japhb I have to go AFK to get kids to bed, but any other ideas appreciated -- I'll backlog.
02:48 cognominal joined #perl6
02:48 bluescreen joined #perl6
02:48 wolverian joined #perl6
02:48 pnate joined #perl6
02:48 stepnem joined #perl6
02:48 p6eval joined #perl6
02:48 jjore joined #perl6
02:50 lisppaste3 colomon pasted "colomon's wishlist for ng" at http://paste.lisp.org/display/90881
02:51 colomon Just in case pmichaud or jnthn feel like working miracles overnight....  :)
02:52 rfordinal3643 joined #perl6
02:54 eternaleye japhb: $obj."$methodname"
02:55 Wolfman2000 Back from dinner.
02:55 Wolfman2000 colomon: You aren't offended that I am probably not able to pull off those miracles, right?
02:57 colomon Wolfman2000: I know that I can't.  Doubt there are even as many as ten people out there who could...
02:57 colomon Time for bed.
02:59 wolverian joined #perl6
03:00 eternaleye joined #perl6
03:01 stepnem joined #perl6
03:01 eternaleye Tene: $obj.^method is $obj.HOW.method( $obj )
03:01 eternaleye And .^methods gives a List of Methods IIRC
03:02 Wolfman2000 ...and the rakudo bot is down
03:02 Wolfman2000 eternaleye: Would you know off hand of a built-in function to convert decimal to hex, or is that something I have to do manually?
03:02 Tene Wolfman2000: the .fmt method
03:03 Tene rakudo: say 14.fmt("%x");
03:03 rfordinal joined #perl6
03:03 Wolfman2000 Tene: rakudo is down
03:03 Tene ;_;
03:03 eternaleye Wolfman2000: Is this p6 or p5?
03:03 Wolfman2000 p6
03:03 eternaleye Ah
03:03 cognominal joined #perl6
03:03 bluescreen joined #perl6
03:03 pnate joined #perl6
03:03 p6eval joined #perl6
03:03 jjore joined #perl6
03:04 eternaleye wait, what?
03:04 eternaleye Did p6eval get voiced before the netplit ended, when it wasn't here?
03:05 Wolfman2000 ...not on my screen.
03:05 Tene rakudo: say 14.fmt("%x");
03:05 eternaleye Quassel--
03:06 Tene rakudo: say "wtf... why is p6eval not responding?"
03:06 eternaleye Wolfman2000: Also, when I disconnected a bit ago, that was due to Postgres dying completely. Don't know it it was a segfault or what.
03:06 eternaleye *if
03:07 eternaleye nqp: say( 1 )
03:07 eternaleye Hm, so it's all languages
03:08 orafu joined #perl6
03:08 _eMaX_1 joined #perl6
03:08 Jedai joined #perl6
03:08 estrai joined #perl6
03:08 elmex joined #perl6
03:10 p6eval rakudo 7347ec: e␤
03:10 p6eval rakudo 7347ec: wtf... why is p6eval not responding?␤
03:10 p6eval nqp: 1␤
03:10 eternaleye Epic lag is epic
03:10 Wolfman2000 I had the same lag.
03:11 Wolfman2000 rakudo: say "Hi!";
03:11 p6eval rakudo 7347ec: Hi!␤
03:11 Wolfman2000 ...yeah, shouldn't take 7 seconds to say hi
03:11 facsimile joined #perl6
03:11 eternaleye Wolfman2000: It took 5 _minutes_ to follow Tene's instructions
03:12 Tene rakudo: say 15.fmt("%x");
03:12 p6eval rakudo 7347ec: f␤
03:12 Wolfman2000 Tene: thanks for confirming
03:13 * Wolfman2000 is cleaning up some of his rsa.pl code for his class presentation on Cryptography Monday.
03:16 lisppaste3 Wolfman2000 pasted "Is there a better way than using the range iterator?" at http://paste.lisp.org/display/90882
03:21 frew_ joined #perl6
03:35 nihiliad joined #perl6
03:46 Wolfman2000 rakudo: say 5 % 2|3;
03:46 p6eval rakudo 7347ec: any(1, 3)␤
03:46 Wolfman2000 ...wasn't what I was after
03:47 Wolfman2000 then again, maybe it is
03:47 Wolfman2000 rakudo: say "true" if 5 % 2|3;
03:47 p6eval rakudo 7347ec: true␤
03:47 Wolfman2000 rakudo: say "true" if 8 % 2|3;
03:47 p6eval rakudo 7347ec: true␤
03:47 Wolfman2000 rakudo: say "true" if 8 % 2&3;
03:47 p6eval rakudo 7347ec:  ( no output )
03:47 Wolfman2000 rakudo: say "true" if 7 % 2&3;
03:47 p6eval rakudo 7347ec: true␤
03:47 Wolfman2000 rakudo: say "true" if 9 % 2&3;
03:47 p6eval rakudo 7347ec: true␤
03:48 quietfanatic rakudo: multi infix:<=> (Str $a, Str $b) {...}; my $x = 4
03:48 p6eval rakudo 7347ec:  ( no output )
03:49 quietfanatic rakudo: multi infix:<=> (Str $a, Str $b) {...}; my $x = 4; say $x
03:49 p6eval rakudo 7347ec:  ( no output )
03:49 quietfanatic That's a segfault actually
03:50 Wolfman2000 quietfanatic: were you able to view my recent pastebin? I'm curious if my loop can be reduced further.
03:51 quietfanatic Wolfman2000: You may be able to do it with an infix operator and the [infix] hyperop
03:51 quietfanatic if $n is known ahead of time
03:51 Wolfman2000 $n is known ahead of time
03:53 quietfanatic *metaop
03:54 Wolfman2000 quietfanatic: are you saying I would have to make my own multi sub infix?
03:54 quietfanatic you could put it inside you modpow sub
03:54 Wolfman2000 ...seems like little point of a custom infix inside a sub if it's only used once
03:55 TimToady it would let you write [*%] $base xx $exp
03:55 quietfanatic Yえあh
03:55 quietfanatic er
03:55 Wolfman2000 check your language settings there
03:55 quietfanatic I mean yeah
03:55 TimToady input method,  rather
03:56 Wolfman2000 that too
03:56 quietfanatic somebody made my right-alt key do that...
03:56 quietfanatic When I try to implement it Rakudo NPAs though
03:57 Wolfman2000 TimToady: how would a custom infix operator make my code smaller/faster? I'm not seeing how.
03:58 TimToady however, the fastest way might be ($res *= $base) %= $mod for ^$exp
03:59 quietfanatic You don't even have to preset $res to 1 because *= will do that for you
04:00 quietfanatic rakudo: say ((my $res *= 2) %= 100) for ^10
04:00 p6eval rakudo 7347ec: 2␤2␤2␤2␤2␤2␤2␤2␤2␤2␤
04:00 quietfanatic rakudo: say ((my $res *= 2) %= 100 for ^10)
04:00 p6eval rakudo 7347ec:  ( no output )
04:01 quietfanatic rakudo: my $res; say (($res *= 2) %= 100 for ^10)
04:01 p6eval rakudo 7347ec:  ( no output )
04:01 quietfanatic Oh I guess 'for' isn;t returning what I expect
04:01 quietfanatic rakudo: my $res; ($res *= 2) %= 100 for ^10; say $res
04:01 p6eval rakudo 7347ec: 24␤
04:02 quietfanatic There.  1024 % 100
04:02 quietfanatic rakudo: (my $res *= 2) %= 100 for ^10; say $res
04:02 p6eval rakudo 7347ec: Lexical '$res' not found␤in Main (file src/gen_setting.pm, line 324)␤
04:02 Wolfman2000 rakudo: my $res; ($res *= 2) %= 100 for 1..10; say $res
04:02 p6eval rakudo 7347ec: 24␤
04:03 Wolfman2000 I guess ^10 is a prefix operator meaning 1 .. 10
04:03 quietfanatic Actually it's 0..9 but nobody's counting :)
04:03 Wolfman2000 The only thing I'm unsure of...why must $res be prefixed by my outside of the ()?
04:03 Wolfman2000 At best, we've got a two liner
04:03 quietfanatic Implied block for the for?
04:04 TimToady make the parameter 'is copy' and use that
04:04 zaslon loljnthnhazblogged! jnthn++ 'Failure()<0xb77e0098>': Failure()<0xb77d3924>
04:04 quietfanatic I was gonna say that :|
04:05 Wolfman2000 TimToady: the only problem is that $res is not even a parameter
04:05 TimToady base is
04:05 TimToady use that var :)
04:05 quietfanatic wait that doesn't work
04:05 quietfanatic ($base *= $base) squares it every time
04:05 quietfanatic You need to keep the original $base too
04:06 Wolfman2000 I ended up running my code with the proposed ideas. It did not take
04:06 zaslon loljnthnhazblogged! jnthn++ 'Progress and minor frustration': http://use.perl.org/~JonathanWor​thington/journal/39917?from=rss
04:08 quietfanatic If your $n is a power of two you ought to be able to say "my uint32 $res; $res *= $base for ^$exp", but rakudo doesn't support native types like that
04:08 quietfanatic (replaceing 32 with whatever your size is
04:09 TimToady well int declarations would be very fast all around if rakudo supported native types
04:09 quietfanatic I mean a power of two power of two.
04:09 zaslon lolmasakhazblogged! masak++ 'Failure()<0xb77fa7f8>': Failure()<0xb77f7e04>
04:09 TimToady someday
04:10 TimToady why is zaslon going nuts?
04:10 Wolfman2000 joined #perl6
04:11 kst` joined #perl6
04:11 Wolfman2000 quietfanatic: In case my last message didn't get through, the suggested code did not work for me.
04:11 quietfanatic gives more ++es all around?
04:11 quietfanatic Wolfman2000: I see.  You mean the *= %= one?
04:11 Wolfman2000 Yeah
04:11 quietfanatic the 'is copy' one (which shuldn't work)?
04:12 TimToady it worked here on the channel
04:12 quietfanatic erk!
04:12 TimToady oh, yeah, that one won't work
04:12 Wolfman2000 joined #perl6
04:12 Wolfman2000 ...I got killed. How did I revive?
04:12 * Wolfman2000 doesn't recall casting Auto-life
04:12 quietfanatic Wolfman2000: the 'is copy' one (which shouldn't work)?
04:12 Wolfman2000 quietfanatic: give the example again please. I don't recall trying is copy yet
04:12 quietfanatic Wolfman2000: it said something about 'nick collision' when you were killed
04:12 TimToady yes, I was hallucinating
04:13 quietfanatic Well don't try it cause it doesn't work!
04:13 quietfanatic rakudo: my $res; ($res *= 2) %= 100 for ^10; say $res
04:13 Wolfman2000 The only one I recall trying was return ($res *= $base) %= $n for ^$exp;
04:13 p6eval rakudo 7347ec: 24␤
04:13 drbean joined #perl6
04:13 quietfanatic ^ That one works
04:13 quietfanatic I dunno
04:14 quietfanatic Maybe you weren't returning $res?
04:14 Exodist joined #perl6
04:14 Wolfman2000 quietfanatic: doesn't seem to want to return what I'm asking it to
04:15 quietfanatic Wolfman2000: Yeah that doesn't work.  You have to add a third statement 'return $res'
04:15 zaslon lolmasakhazblogged! masak++ 'November 21 2009 -- you mean the media distort the truth?': http://use.perl.org/~masak/journal/39926?from=rss
04:15 quietfanatic That has the 'return' inside the 'for' there
04:15 Wolfman2000 ...so it's basically the same as the loop version. Guess there's no avoiding the loop.
04:16 quietfanatic yeah.  for is always a loop
04:16 Wolfman2000 yeah, re-adding the return statement did it
04:17 TimToady the infix form would let you loop using xx
04:17 TimToady but it's still a loop
04:17 Wolfman2000 may as well keep what I have.
04:17 TimToady what you had originally is very readable :)
04:18 TimToady an FP folk would probably use recursion though :)
04:18 Wolfman2000 TimToady: Considering how this cryptography project is going to involve a new language for practically all of them, may as well impress them with some funny, slightly hard to understand code. :P
04:19 * Wolfman2000 has a caesar cipher, prime identifier, and simple rsa code implemented now...unsure about going for sha/md
04:19 quietfanatic rakudo: multi modpow ($a, 1) {$a}; multi modpow($a, $b) {modpow($a, $b-1) * $a % 100}; say modpow(2, 10);
04:19 p6eval rakudo 7347ec: 24␤
04:19 quietfanatic Like that
04:20 Wolfman2000 ...you can specify constants as parameters?
04:20 quietfanatic That's actually quite succint.  Only two lines
04:20 quietfanatic Yeah you can.
04:20 quietfanatic Can't introspect them though
04:20 quietfanatic (yet)
04:20 * Wolfman2000 wishes he knew what introspecting was.
04:20 quietfanatic rakudo: say :(3).perl
04:20 p6eval rakudo 7347ec: :(Int ::TYPE_CAPTURE20 where all({ ... }))␤
04:20 quietfanatic blech!
04:21 quietfanatic introspecting means...uh...looking at the insides or something
04:21 quietfanatic You notice I can't find a '3' anywhere inside that blechy expression.
04:22 quietfanatic I think I'll report that as a bug
04:23 quietfanatic ...not that anyone reads my bug reports
04:24 zaslon loljnthnhazblogged! jnthn++ 'Failure()<0xb5ed2774>': Failure()<0xb5ebcf00>
04:24 Wolfman2000 jnthn: looks like you failed to blog
04:25 TimToady rakudo: my $n = 100; sub modpow($base,$exp) { sub infix:<*%>($res,$base) { $res * $base % $n }; [*%] 1,$base xx $exp }; say modpow(2,10)
04:25 p6eval rakudo 7347ec: 24␤
04:25 TimToady Wolfman2000: ^^^
04:26 TimToady also, zaslon is going nuts somehow and reporting old blogs
04:26 Wolfman2000 quietfanatic--: maximum recursion depth exceeded
04:26 quietfanatic Hoh come one!
04:26 Wolfman2000 quietfanatic: You never knew how big $n could be
04:26 quietfanatic Haskell wouldn't have complained!
04:27 zaslon lolmasakhazblogged! masak++ 'Failure()<0xb78428cc>': Failure()<0xb7837f6c>
04:27 was kicked by TimToady: TimToady
04:28 Wolfman2000 The only thing I really don't recall...what's the xx operator?
04:28 quietfanatic list replication
04:28 quietfanatic rakudo: .say for 3 xx 5
04:28 p6eval rakudo 7347ec: 3␤3␤3␤3␤3␤
04:28 quietfanatic contrast with
04:28 quietfanatic rakudo: .say for 3 x
04:28 p6eval rakudo 7347ec: Confused at line 2, near "x"␤in Main (file <unknown>, line <unknown>)␤
04:28 quietfanatic rakudo: .say for 3 x 5
04:28 p6eval rakudo 7347ec: 33333␤
04:29 Wolfman2000 ...not every day that one of the founders of the language assists someone like this.
04:30 Wolfman2000 TimToady++: Thanks for the insight.
04:30 quietfanatic TimToady: Your modpow above will blow up if given $exp = 0
04:30 quietfanatic rakudo: my $n = 100; sub modpow($base,$exp) { sub infix:<*%>($res,$base) { $res * $base % $n }; [*%] 1,$base xx $exp }; say modpow(2,0)
04:30 p6eval rakudo 7347ec: 1␤
04:30 quietfanatic !!!
04:30 Wolfman2000 quietfanatic: is that the blow up you mean?
04:30 quietfanatic I guess not
04:31 quietfanatic rakudo: sub infix:<*%>($res,$base) { $res * $base % $n }; [*%] 1
04:31 p6eval rakudo 7347ec: Symbol '$n' not predeclared in infix:*% (/tmp/rQ5aW4kRFh:2)␤in Main (file <unknown>, line <unknown>)␤
04:31 quietfanatic rakudo: sub infix:<*%>($res,$base) { $res * $base % 100 }; [*%] 1
04:31 p6eval rakudo 7347ec: Method '!flatten' not found for invocant of class 'Int'␤in Main (file src/gen_setting.pm, line 324)␤
04:31 quietfanatic rakudo: sub infix:<*%>($res,$base) { $res * $base % 100 }; [*%] (1)
04:31 p6eval rakudo 7347ec: Method '!flatten' not found for invocant of class 'Int'␤in Main (file src/gen_setting.pm, line 324)␤
04:31 quietfanatic rakudo: sub infix:<*%>($res,$base) { $res * $base % 100 }; [*%] [1]
04:31 p6eval rakudo 7347ec:  ( no output )
04:31 quietfanatic rakudo: sub infix:<*%>($res,$base) { $res * $base % 100 }; say [*%] [1]
04:31 p6eval rakudo 7347ec: 1␤
04:32 quietfanatic I just don't understand what's going on here
04:32 Wolfman2000 Perl 6 has magic
04:32 quietfanatic shouldn't it say "not enough positionals given"?
04:33 quietfanatic rakudo: sub infix:<?> ($a, $b) {say $a.WHAT; say $b.WHAT}; [?] 1
04:33 p6eval rakudo 7347ec: Method '!flatten' not found for invocant of class 'Int'␤in Main (file src/gen_setting.pm, line 324)␤
04:33 quietfanatic rakudo: sub infix:<?> ($a, $b) {say $a.WHAT; say $b.WHAT}; [?] [1]
04:33 p6eval rakudo 7347ec:  ( no output )
04:33 quietfanatic rakudo: sub infix:<?> ($a, $b) {say $a.WHAT; say $b.WHAT}; [?] 1,
04:33 p6eval rakudo 7347ec: No result object␤in Main (file <unknown>, line <unknown>)␤
04:33 quietfanatic just getting all sorts of weird here
04:33 quietfanatic I give up.
04:34 Wolfman2000 ...even when I can't contribute to the core Perl 6 code, I can still help...or at least give ideas.
04:39 gfx joined #perl6
04:39 pmichaud good evening, all
04:40 Wolfman2000 evening
04:42 Exodist joined #perl6
04:47 envi^home joined #perl6
04:47 TimToady howdy
04:49 mlaks joined #perl6
04:56 qp_pq joined #perl6
04:56 qp_pq you bastards, you turned the first name Dijkstra into a verb lol
04:57 qp_pq just saw masak's talk.pdf
05:00 qp_pq like "dijkstrifying" :))
05:01 japhb Any word containing five consecutive consonants ought to get a free pass to be any part of speech it wants.  :-)
05:01 TimToady that's not her first name.  It's Barbara.
05:05 kaare joined #perl6
05:05 Nex6 joined #perl6
05:06 qp_pq TimToady: ?!? who ?
05:11 astrojp left #perl6
05:13 TimToady Barbara, Ken Dijkstra's wife
05:14 japhb Where is the syntax for calling subs and methods by computed name discussed in the synopses?  I'm failing in attempting to search ...
05:21 qp_pq who is Ken Dijkstra ?
05:26 beggars joined #perl6
05:36 c9s joined #perl6
05:44 Avada joined #perl6
05:57 Avada joined #perl6
06:01 orafu joined #perl6
06:11 orafu joined #perl6
06:21 orafu joined #perl6
06:21 carlin joined #perl6
06:43 JeffreyKegler joined #perl6
06:44 envi^home joined #perl6
06:44 cognominal joined #perl6
06:44 bluescreen joined #perl6
06:44 pnate joined #perl6
06:44 p6eval joined #perl6
06:44 jjore joined #perl6
06:46 TimToady Barbie's husband...
06:48 TimToady but people are always confusing them with the other Ken and Barbie... :)
06:49 meppl joined #perl6
06:50 JeffreyKegler left #perl6
06:55 justatheory joined #perl6
07:12 diakopter nqp: Foo::bar(); { module Foo { our sub bar() { say(77) } } }
07:12 p6eval nqp: 77␤
07:12 diakopter sigh.
07:12 diakopter double sigh.
07:12 diakopter triple sigh.
07:13 jrockway joined #perl6
07:13 diakopter out of the frying pan, into the center of the earth.
07:14 diakopter nqp: Foo::bar(); sub blah() { module Foo { our sub bar() { say(88) } } }
07:14 p6eval nqp: 88␤
07:15 diakopter how the blanket can that behavior be mimicked?
07:18 diakopter pugs: Foo::bar(); sub blah() { module Foo { our sub bar() { say(88) } } }
07:18 p6eval pugs: 88␤
07:19 diakopter I give up.
07:19 snearch joined #perl6
07:24 diakopter nqp: Foo::bar(); sub blah() { module Foo { our sub bar() { say(88) } } }; sub blah2() { module Foo { our sub bar() { say(99) } } };
07:24 p6eval nqp: 99␤
07:24 diakopter pugs: Foo::bar(); sub blah() { module Foo { our sub bar() { say(88) } } }; sub blah2() { module Foo { our sub bar() { say(99) } } };
07:24 p6eval pugs: 99␤
07:33 cotto Should that even compile?
07:34 diakopter std: Foo::bar; sub blah() { my $b := 2; module Foo { our sub bar() { say($b) } } }; sub blah2() { my $b := 4; module Foo { our sub bar() { say($b.WHERE) } } };
07:34 p6eval std 29167: [31m===[0mSORRY![31m===[0m␤Illegal redeclaration of symbol 'GLOBAL::<Foo>' (from line 1) at /tmp/x5mXWVKies line 1:␤------> [32m }; sub blah2() { my $b := 4; module Foo[33m⏏[31m { our sub bar() { say($b.WHERE) } } };[0m␤Undeclared name:␤        'Foo::bar' used at line 1␤FAILED
07:34 p6eval ..00:01 107m␤
07:34 diakopter whatever compile means, no
07:35 diakopter but why a module can be declared inside a sub escapes me
07:39 diakopter perl -e 'Foo::a(); sub b { package Foo; our sub a { print(44) } }; sub c { package Foo; our sub a { print(55) } };'
07:39 diakopter 55
07:39 diakopter whatever.  :[
07:57 orafu joined #perl6
08:12 drbean_ joined #perl6
08:13 Exodist joined #perl6
08:14 Su-Shee joined #perl6
08:14 Su-Shee good morning
08:17 cls_bsd joined #perl6
08:19 cotto_w0rk joined #perl6
08:34 am0c joined #perl6
08:36 Woodi good morning
08:40 Exodist joined #perl6
08:40 diakopter http://perl6.pastebin.com/f1b671708   prototype-object inheritance/derivation in Perl
08:52 cls_bsd m/win 30
08:57 BinGOs joined #perl6
09:00 diakopter yeah
09:04 desertm4x joined #perl6
09:25 Exodist joined #perl6
09:41 drbean joined #perl6
09:56 ng_feed rakudo-ng: pmichaud++
09:56 ng_feed rakudo-ng: Merge branch 'ng' of git@github.com:rakudo/rakudo into ng
09:56 ng_feed rakudo-ng: pmichaud++
09:56 ng_feed rakudo-ng: Add [eval].  May still want a little bit of testing, but should
09:57 cotto joined #perl6
10:18 snearch joined #perl6
10:19 Guest37418 joined #perl6
10:21 desertm4x_ joined #perl6
10:53 bryan[c1] joined #perl6
11:15 Wolfman2000 *yawn* Morning...I'm up too early.
11:30 rgrau` joined #perl6
11:30 mikehh joined #perl6
11:47 colomon eval \o/
11:55 jayeola joined #perl6
11:55 * jnthn wondes how many tests that may win us back
11:57 jeremiah joined #perl6
11:57 jnthn lolitsjeremiah
11:58 jeremiah OH HAI!
11:58 jeremiah or OH HAIS since we're in Latvia
11:59 Wolfman2000 ...how many countries are we in?
12:01 jnthn Most of the time, only one at any point in time, though I was once in three simultaneously.
12:02 Wolfman2000 ...leg on one, other leg on one, butt on third?
12:02 jnthn Something like that. :-)
12:02 Wolfman2000 very strange
12:03 Wolfman2000 The master branch of rakudo hasn't been updated for a few days. :(
12:03 colomon jnthn: four tests in rat.t thanks to eval!
12:03 Wolfman2000 I know ng is loved by everyone, but...oh well.
12:04 colomon Wolfman2000: until pmichaud checked in eval this morning, no one but me had updated ng in days, either....
12:05 cotto_working joined #perl6
12:05 Wolfman2000 eval...right: execute arbitrary code.
12:05 jnthn colomon: You aren't no one! :-)
12:07 colomon jnthn: but you guys are the big guns, and I'm just hanging about trying to show you can indeed write some of the core classes in pure p6.
12:07 jnthn I'm very happy that they're being written in Perl 6.
12:08 colomon me too, I think that's very importat
12:08 Wolfman2000 colomon: what else are the core classes being written in?
12:08 jnthn Wolfman2000: Some bits get done in PIR. But the less of that we have, the better, overall.
12:08 Wolfman2000 ...right, the PIR assembly language.
12:08 jnthn Yeah. But there's more to it than just writing in PIR
12:08 Wolfman2000 I recall seeing some of that in some of the Operator type files
12:09 jnthn e.g. we wrap Parrot sub PMCs up into Pelr 6 code objects.
12:09 jnthn Introspection tends not to work out so well on Parrot subs.
12:11 Wolfman2000 Right...not always easy to introspect multi sub infix:<+>($a, $b)
12:14 jnthn Well, that should have been resolved in master now, IIRC
12:14 jnthn But yes, other examples certainly have problems.
12:19 cotto_work joined #perl6
12:21 rfordinal left #perl6
12:28 zloyrusskiy joined #perl6
13:07 ashizawa_ joined #perl6
13:16 jaldhar joined #perl6
13:17 mjk joined #perl6
13:18 colomon jnthn: do we not have substr yet in ng?  (I'm checking out int.t to see where we stand with it.)
13:20 colomon ng: say substr("hello", 0, 2);
13:20 p6eval ng 7ab131: Confused at line 1, near "say substr"␤current instr.: 'perl6;HLL;Grammar;panic' pc 519 (src/stage0/HLL-s0.pir:336)␤
13:21 colomon ng: say "hello".substr(0, 2);
13:21 p6eval ng 7ab131: Method 'substr' not found for invocant of class 'Perl6Str'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
13:22 colomon ng: say "hello".lcfirst
13:22 p6eval ng 7ab131: Method 'substr' not found for invocant of class 'Perl6Str'␤current instr.: 'perl6;Any;lcfirst' pc 181609 (src/gen/core.pir:0)␤
13:23 colomon Ug.  So we've got a lot less string than it appears in ng, since about half of the defined functions depend on substr, which isn't defined.
13:25 Wolfman2000 colomon: If it matters, I found .sub 'substr' on master/src/builtins/any-str.pir
13:25 Wolfman2000 Perhaps you can just copy that?
13:26 colomon Hmmm...
13:28 colomon ng: say "hello".WHAT
13:28 p6eval ng 7ab131: Str()␤
13:29 colomon It definitely looks tantalizingly possible...
13:30 colomon particularly because it appears that there's only one thing in there that really needs to be in PIR.
13:31 pmichaud good morning, #perl6
13:32 colomon Just the person I was hoping to see!
13:33 colomon If I have   $S1 = substr $S0, start, len  in PIR, how do I do that as one of those fancy pir::XXXX__ calls?
13:33 colomon (and thank you for eval!)
13:34 pmichaud I think that pir::substr($str, $start, $len) works.
13:34 pmichaud if not, then it'd be    pir::substr__PPii
13:34 colomon ng: say pir::substr("hello", 0, 2);
13:34 p6eval ng 7ab131: he␤
13:34 colomon \o/
13:35 pmichaud in general, it's pir::opcode(...args...)
13:35 pmichaud but sometimes the compilers don't know the argument types to use for the opcode, so we have to be explicit
13:35 jnthn summon masak
13:36 pmichaud thus __PPii   would say "return a PMC, first arg is a PMC, second arg is an integer register or integer constant, third arg is a integer register or integer constant"
13:36 * jeremiah waves magic wand to summon masak
13:36 masak joined #perl6
13:36 pmichaud so, did eval() win us many tests?  does it actually work?  ;-)
13:36 Su-Shee "accio" is the charm to summon something ;)
13:36 * masak feels groggy
13:36 masak was I summoned or something?
13:37 jeremiah lolitsmasak!
13:37 masak lol!
13:37 masak I can haz math algebra parser.
13:38 colomon pmichaud: it won us four rat.t tests, but we still need to get Num.Rat working to get the entire file passing.
13:38 pmichaud colomon: does that mean that eval actually works?  ;-)
13:38 pmichaud wow.
13:39 pmichaud It took me far longer to write than it should've (parrot--) and when I was getting near the end I wasn't fully awake :-|
13:40 jnthn :-/
13:40 jnthn pmichaud: Yes, it was "fun" enough the first time.
13:40 jnthn pmichaud: Looks cleanish now, from glancing over the patch, though. :)
13:40 colomon pmichaud: I've only tested it on strings which were Rats so far, but it seems to work well there.  :)
13:40 pmichaud well, at least this time it's moved the lexicals logic into the components where they belong
13:41 colomon That's really all anyone ever wanted, isn't it?  The ability to eval Rats?
13:41 colomon :)
13:41 masak what's this Japanese Twitterer saying? http://twitter.com/tokuhirom/status/5944222957
13:41 pmichaud colomon: that's all it's really good for.
13:41 jnthn Yes, it's good to push them into a place where this will work between other HLLs.
13:41 masak finally, I can eval my Rats.
13:42 masak jnthn: Rats generally burrow holes in the walls between HLLs.
13:42 colomon One day we'll be able to eval FatRats...
13:42 jnthn And our Cat.
13:42 pmichaud not only that, but it actually follows contexts instead of subs, which is equally important (since a Parrot sub object might not be able to reference the correct outer context)
13:42 masak oh noes! FatRats!
13:44 mikehh joined #perl6
13:44 masak oh 猫!
13:44 colomon Any objections to my trying to translate the old master substr into a new, mostly p6 ng substr?
13:44 masak joined #perl6
13:44 jnthn colomon: None from me.
13:45 pmichaud +1
13:49 colomon how do you say optional parameter with specifying a default?  I seem to recall there is a ? involved.
13:49 pmichaud sub foo($req, $opt?) { ... }
13:49 pmichaud oh, *with* a default
13:49 Juerd Implicit defaults ROCK, pmichaud :)
13:49 pmichaud sub foo($req, $opt = 'default') { ... }
13:49 Juerd They make coding so much easier :D
13:50 colomon s/with/without/ actually!
13:50 colomon so pmichaud++ had it right the first time.
13:50 pmichaud oh, *without* a default
13:50 colomon danke!
13:50 pmichaud sub foo($req, $opt?) { ... }   # :D
13:50 Juerd Wow, pmichaud has dwimnwis-powers :)
13:51 pmichaud note that because of the mis-asked question, the ":D" smiley is now a required part of the syntax :D
13:51 colomon Juerd: I'm not at all surprised.  :)
13:51 * Juerd remembers when the postfix question mark was introduced for this, and was happy about the decision :)
13:52 Juerd Also, the ! for required nameds
13:52 colomon ng: say "hello".chars
13:52 p6eval ng 7ab131: Method 'chars' not found for invocant of class 'Perl6Str'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
13:52 colomon ng: say "hello".codes
13:52 p6eval ng 7ab131: Method 'codes' not found for invocant of class 'Perl6Str'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
13:53 masak yes, the current syntax for parameters and arguments is a clear improvement on the original apocalyptic one.
13:54 Juerd S03 says that !< doesn't have a shortcut, but isn't that just >=?
13:54 colomon rakudo: say "hello".chars
13:54 p6eval rakudo 7347ec: 5␤
13:55 Wolfman2000 colomon++: glad I was able to give you an idea for substr. I have to get going now, however...apparently I (got conned?|agreed) to help sub for a sunday school class today
13:55 masak Juerd: yes.
13:55 colomon Wolfman2000++ # for pointing me in the right direction.
13:57 colomon rakudo: say substr("hello", 2, -1);
13:57 p6eval rakudo 7347ec: ll␤
13:58 colomon Oh, I see.
13:58 colomon gotos, they are fun.
13:59 masak Juerd: though I don't consider >= to be the shortcut of !< -- it's not shorter, for one.
14:03 pmichaud hugme tweet rakudoperl  rakudo-ng has a working 'eval' again
14:03 * hugme hugs pmichaud; tweet delivered
14:03 colomon Is .chars correct for getting the number of characters in a string in p6?
14:05 Whiteknight joined #perl6
14:06 Su-Shee works with my version.
14:07 jnthn colomon: yes
14:07 colomon apparently I need to implement that, too.
14:07 colomon :)
14:07 dalek nqp-rx: 23bb989 | pmichaud++ |  (3 files):
14:07 dalek nqp-rx: Add $obj."method"(...) syntax.
14:07 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/2​3bb989c13fcf4ab59c29d8fdabc13d253466e7b
14:07 dalek nqp-rx: 9f7db2e | pmichaud++ | src/stage0/ (3 files):
14:07 dalek nqp-rx: Update bootstrap.
14:07 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/9​f7db2e9f20f69d58c9f6325ec3ca60612f62381
14:07 colomon pir::chars(self) doesn't seem to do it.
14:08 colomon pir::chars__IP(self) ?
14:09 colomon Nope.
14:09 colomon help?
14:11 jnthn nqp: my $x = "lolvodka"; say pir::chars__IS($x);
14:11 p6eval nqp: Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " \"lolvodka"␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
14:11 jnthn nqp: my $x := "lolvodka"; say pir::chars__IS($x);
14:11 p6eval nqp: Confused at line 1, near "say pir::c"␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
14:11 jnthn gha
14:11 jnthn nqp: my $x := "lolvodka"; say(pir::chars__IS($x));
14:11 p6eval nqp: error:imcc:syntax error, unexpected IREG, expecting '(' ('$I17')␤   in file 'EVAL_1' line 12␤Could not find non-existent sub chars␤current instr.: '_block11' pc 0 (EVAL_1:6)␤
14:11 jnthn *sigh*
14:11 jnthn checking the Parrot docs.
14:12 colomon danke.
14:13 jnthn nqp: my $x := "lolvodka"; say(pir::length__IS($x));
14:13 p6eval nqp: 8␤
14:13 jnthn =item B<length>(out INT, in STR)
14:13 jnthn Calculate the length (in characters) of string $2 and return as integer $1.
14:13 jnthn If $2 is NULL or zero length, zero is returned.
14:13 jnthn And for .bytes its bytelength
14:14 colomon right!  jnthn++
14:14 colomon I should have checked the old any-str.pir to see how chars was defined.
14:15 colomon \o/
14:15 colomon is export doesn't work yet?
14:16 jnthn colomon: I thought it did...
14:16 jnthn ng: say uc("wtf")
14:17 p6eval ng 7ab131: WTF␤
14:17 jnthn Otherwise that'd not work.
14:17 colomon So did I, but .substr works and substr doesn't.
14:17 colomon huh.
14:17 jnthn And it's marked "is export"? Hmm.
14:17 colomon tell you what.  I'll check in what I've got, and we can puzzle it out together.  :)
14:17 jnthn :-)
14:19 payload joined #perl6
14:19 ng_feed rakudo-ng: colomon++
14:19 ng_feed rakudo-ng: Add chars and substr.
14:20 pmichaud +        my $len = $given_len || self.chars;
14:20 pmichaud needs to be
14:20 pmichaud $given_len // self.chars
14:21 pmichaud (since 0 is a valid length)
14:22 colomon okay, changed locally.
14:22 colomon I suppose, since I have chars working now, that could just be $given_len = self.chars for the argument?
14:23 pmichaud probably
14:23 colomon Though I think I might like it better this way.
14:23 pmichaud although the arg name should perhaps match the spec ($length)
14:24 masak` joined #perl6
14:24 facsimile joined #perl6
14:25 colomon given_len becomes length, okay.  :)
14:25 pmichaud (building now to see if I can find out why 'is export' isn't working)
14:25 colomon k
14:25 arthur-_ joined #perl6
14:25 colomon it does work for chars, I see.
14:26 pmichaud I wonder if there's another substr already defined somewhere that is causing problems.
14:26 ng_feed rakudo-ng: colomon++
14:26 ng_feed rakudo-ng: Change $given_len to $length to match the spec.
14:26 ng_feed rakudo-ng: colomon++
14:26 ng_feed rakudo-ng: Change || to // as per pmichaud.
14:27 pmichaud don't see one.
14:27 colomon has is export been tested with more than one argument, or default arguments?
14:27 pmichaud ...shouldn't make a difference, really.
14:27 colomon (seeing as how uc and chars work, but substr doesn't....)
14:28 pmichaud that could indeed be the difference, but it shouldn't be :)
14:28 colomon :)
14:29 pmichaud aha
14:29 jnthn I'm guessing substr is in Any?
14:30 pmichaud looks like ng is parsing the "sub"
14:30 pmichaud i.e., it's parsing as   sub str(...)
14:30 jnthn !!
14:30 pmichaud we had this problem in master also :)
14:31 jnthn ng: substr("lol", 1, 1)
14:31 p6eval ng 7ab131: Confused at line 1, near "substr(\"lo"␤current instr.: 'perl6;HLL;Grammar;panic' pc 519 (src/stage0/HLL-s0.pir:336)␤
14:31 colomon ?????????
14:31 jnthn oh, it's a parse error!
14:31 pmurias joined #perl6
14:31 colomon ooooooooo
14:31 pmichaud fixing.
14:33 ejs joined #perl6
14:34 snearch joined #perl6
14:35 JimmyZ joined #perl6
14:38 colomon ng: "24".Int
14:38 p6eval ng 7ab131: Method 'Int' not found for invocant of class 'Perl6Str'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
14:39 pmichaud pushed.
14:40 ng_feed rakudo-ng: pmichaud++
14:40 ng_feed rakudo-ng: Avoid initial "sub", "method", "submethod" as being declarations.
14:41 jnthn pmichaud: We'd not need that after full LTM?
14:41 jnthn (just noticing std lacks it)
14:45 colomon oh bother, we don't have index yet either.
14:48 jnthn nqp: my $x := "lolvodka"; say(pir::index__ISS($x, "l"));
14:48 p6eval nqp: 0␤
14:48 jnthn nqp: my $x := "lolvodka"; say(pir::index__ISS($x, "v"));
14:48 p6eval nqp: 3␤
14:49 jnthn :-)
14:49 pmichaud jnthn: full LTM should alleviate that, yes.
14:51 colomon jnthn: ooo, short and simple implementation, then, eh?
14:52 jnthn colomon: looks like it ;_)
14:52 rindolf joined #perl6
14:52 jnthn pmichaud: OK, cool.
14:53 masak` rindolf: hi!
14:53 colomon is there an easy way of checking to see what test files now work (unexpectedly) in ng?
14:53 rindolf Hi masak`
14:53 rindolf masak`: what's up?
14:53 colomon I think working substr just bought us a bunch.
14:53 colomon (but not substr.t, of course... ;)
14:54 masak rindolf: in the lobby of a hotel in Riga, hacking away with jnthn++ and jeremiah++.
14:54 masak life is good :)
14:54 masak rindolf: how're you?
14:54 rindolf masak: we have a Tel Aviv Open Source Club meeting today.
14:54 rindolf An hour or so from now.
14:54 rindolf It's a Welcome-to-FOSS meeting.
14:55 masak \o/
14:55 rindolf No one came to the previous meeting.
14:55 jnthn colomon: I thought it may...uc.t for example.
14:55 rindolf Except for the lecturer and me.
14:55 colomon ucfirst.t and lcfirst.t for sure.
14:55 rindolf And his friend from the university.
14:55 colomon uc.t doesn't work on my box, no iciu
14:55 masak oh, bummer.
14:55 rindolf This time it was better publicised.
14:55 jnthn colomon: oh. I can check that tomorrow when at home.
14:55 rindolf But it's a different meeting.
14:56 rindolf Maybe we'll do a re-run of the previous meeting in two weeks or so.
14:56 pmichaud I'll be attempting spectests shortly :)
14:57 jnthn How epic is our fail? :-)
14:58 pmichaud don't know yet.  :-)
14:58 pmichaud but hopefully much less epic by the end of today...?  ;-)
14:58 jnthn pmichaud: I've been pondering metamodel stuff some more today.
14:58 jnthn pmichaud: Want to put back role composition in a Good Way.
14:59 jnthn Been reading Moose source to figure out their model
14:59 jnthn Learned a few things.
14:59 pmichaud jnthn: +1
15:00 jnthn Will do something somewhat along those lines, but with 6isms. :-)
15:00 jnthn And probably a bit simpler protocol for now.
15:00 rindolf masak: BTW, have you meet Peteris Krumins (IRL) during the Baltic Perl Workshop?
15:03 nihiliad joined #perl6
15:07 masak` joined #perl6
15:07 Psyche^ joined #perl6
15:19 colomon rakudo: index("hello", "");
15:19 p6eval rakudo 7347ec:  ( no output )
15:19 colomon rakudo: say index("hello", "");
15:19 p6eval rakudo 7347ec: 0␤
15:21 jnthn colomon: Hmm...that looks...odd.
15:21 colomon ng: say min(2, 4);
15:21 p6eval ng a9956f: Could not find non-existent sub &min␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
15:22 jnthn rakudo: say index("hello", "k")
15:22 p6eval rakudo 7347ec: Substring 'k' not found in 'hello'␤␤
15:22 jnthn rakudo: index("hello", "k")
15:22 p6eval rakudo 7347ec:  ( no output )
15:22 jnthn oh, i'ts a fail, not a die. Good.
15:22 jnthn So above is right too I guess. :-)
15:22 colomon clues on how to handle fails in ng would be good, too.  :)
15:23 colomon (for me, I mean.)
15:25 colomon SHouldn't it be pir::index__ISSi  ?
15:25 jnthn Why the i on the end?
15:25 colomon int $pos paramete
15:25 colomon r
15:25 jnthn ISS = returns an int, takes two strings.
15:25 jnthn oh
15:25 jnthn maybe there's another variant of the op that does that too
15:26 jnthn may work then
15:26 colomon pos = index s, substring, pos
15:26 colomon is the code in the old Any-str.pir
15:27 jnthn ah, then yes
15:30 colomon btw, the old code appears to be somewhat broken?
15:30 colomon at least, it's got two labels which are never used, one of which appears to be an error condition which is not checked.
15:30 jnthn That's quite possible.
15:30 colomon unless "fail:" is a magic label...
15:30 jnthn Don't bring the brokenness into ng ;-)
15:30 jnthn No, it's not.
15:31 colomon any advice on doing
15:31 colomon .tailcall '!FAIL'("Substring '", substring, "' not found in '", s, "'")
15:31 colomon in perl 6 and ng?
15:33 jnthn fail("Substring '$foo' not found in '$s'");
15:34 colomon Is that what gets the "non-existant sub &fail called" message?  ;)
15:36 jnthn colomon: Yes. ;-)
15:37 colomon then it must be right.  :)
15:38 jnthn Well, it won't fail.
15:39 colomon say index("hello", "v")
15:39 colomon Could not find non-existent sub &fail
15:39 colomon \o/
15:41 iblechbot joined #perl6
15:44 jnthn ng: sub foo { return 42 }; say foo
15:44 p6eval ng a9956f: sh: ./perl6: No such file or directory␤
15:44 jnthn aww
15:44 jnthn ng: sub foo { return 42 }; say foo
15:44 p6eval ng a9956f: sh: ./perl6: No such file or directory␤
15:44 jnthn EINPATIENT
15:45 jnthn ng: sub foo { return 42 }; say foo
15:45 p6eval ng a9956f: sh: ./perl6: No such file or directory␤
15:46 ng_feed rakudo-ng: colomon++
15:46 ng_feed rakudo-ng: Port of index from PIR into (mostly) p6.
15:46 jnthn Yay, Perl 6!
15:47 jnthn ng: sub foo { return 42 }; say foo
15:47 p6eval ng a9956f: 42␤
15:47 jnthn ah, we haz some return
15:47 jnthn So maybe fail ain't so hard now.
15:47 colomon bother.
15:47 colomon first the test wouldn't run because of substr.
15:48 colomon then it wouldn't run because of index
15:48 colomon now it won't run because of fail.
15:49 colomon rakudo: say index("hello", "k");
15:49 p6eval rakudo 7347ec: Substring 'k' not found in 'hello'␤␤
15:49 colomon or is that it?
15:49 lisppaste3 colomon pasted "The test that's giving me trouble" at http://paste.lisp.org/display/90898
15:50 colomon does fail equal undef or something?
15:52 dalek nqp-rx: da4d6f4 | pmichaud++ | src/ (2 files):
15:52 dalek nqp-rx: Refactor regex creation a bit.
15:52 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/d​a4d6f4aa955bb8613e5303a366b9f9d74133e43
15:52 dalek nqp-rx: c4b8abd | pmichaud++ | src/stage0/ (3 files):
15:52 dalek nqp-rx: Update bootstraps.
15:52 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/c​4b8abdb12ab4163bc954c0db284aecaeacec8e7
15:52 jnthn colomon: It returns a failure, which is undefined, yes.
15:53 colomon makes sense.
15:55 colomon any idea how hard it would be to implement fail?
15:56 jnthn colomon: Probably needs to be done in PIR, but the existing one may be food enough.
15:56 jnthn rakudo: Failure
15:56 p6eval rakudo 7347ec:  ( no output )
15:57 ejs joined #perl6
15:57 colomon shouldn't we have eval_dies_ok by now?
15:57 colomon (messing around with other tests because I'm clueless on fail...)
15:58 jnthn yeah
15:58 jnthn well
15:58 jnthn we have eval
15:58 jnthn maybe Test.pm needs updating?
15:58 jnthn Now that eval works?
15:58 jnthn http://github.com/rakudo/rakudo/bl​ob/master/src/builtins/control.pir # for how fail was done before.
15:58 colomon you stuck a die line in there.  should I just delete it?
15:59 colomon that seems naive...
15:59 colomon (deleting the die only, I mean.)
16:00 facsimile joined #perl6
16:01 jnthn remove the die and uncomment the proclaim call I ugess.
16:01 jnthn dobut the regex line can yet be removed.
16:06 am0c joined #perl6
16:07 cognominal jnthn++   # your blog helps so much to understand about rakudo(-ng)?
16:07 cognominal I meant rakudo[-ng]?
16:08 colomon jnthn: have to remove the regex in the proclaim line as well, right?
16:08 jnthn colomon: ah, probably, yeah.
16:09 jnthn colomon: we don't have those back in just yet
16:09 jnthn colomon: comment out the original I guess, and put in the simpler one.
16:11 colomon already done here.  :)
16:11 jnthn Nice :-)
16:11 colomon I'm trying length.t, and I love the first message:
16:11 colomon Str.length properly not implemented
16:12 colomon All right, I'll check in Test.pm
16:13 ng_feed rakudo-ng: colomon++
16:13 ng_feed rakudo-ng: Turn eval_dies_ok back on.
16:14 jan_ joined #perl6
16:14 am0c joined #perl6
16:17 colomon Ack.  It really is frustrating that every fix probably fixes dozens of tests, but we can't count them because something else in the test file fails.
16:17 ng_feed rakudo-ng: colomon++
16:17 ng_feed rakudo-ng: Turn lcfirst.t and ucfirst.t back on.
16:18 jnthn colomon: Aye.
16:18 jnthn colomon: That's my experience on ng too.
16:19 KyleHa joined #perl6
16:30 ng_feed rakudo-ng: KyleHa++
16:30 ng_feed rakudo-ng: Add some more passing test files
16:31 masak` I make the prediction that this interconnectedness of things is worst in the core, where y'all are hacking now. and that it'll get better as those things are in place.
16:32 pmichaud I'm doing regexes now
16:33 * jnthn cheers on pmichaud
16:33 colomon masak-prime?!  Quick, jnthn, does he have a goatee?
16:34 colomon KyleHa++  # getting more tests on line, yay!
16:35 KyleHa *bow*
16:35 colomon That picked us up 50-some tests in the spectest!
16:35 pmichaud I'm predicting that we'll move ng to master before the end of Nov.
16:35 jnthn colomon: He's bearded, but not quite to the degree I am. :-)
16:35 colomon pmichaud: woah.
16:36 jnthn pmichaud: Whoa...I'd better get busy! ;-)
16:36 pmichaud jnthn: that makes two of us :)
16:36 jnthn Quick...bring beer!
16:37 jnthn Hey, akshually...I'm sat with a bar like 15 seconds walk away.
16:37 colomon I promise to continue making small improvements to the code while rocking my sleeping son.
16:38 jnthn colomon++
16:38 colomon Probably some while I'm watching him run around and chew on things, too, like this morning.  :)
16:41 * colomon can't concentrate enough watching the boy to get real $work done, but very small-scale hacking with lots of spectests is no problem.
16:47 jnthn nom time!
17:10 pmichaud ugh, trying to follow all of the block/signature logic is really.... difficult.  :(
17:20 dj_goku joined #perl6
17:21 pmichaud jnthn: ping
17:23 moritz_ re
17:28 diakopter left #perl6
17:29 pmichaud jnthn: unping -- I think I found the issue.
17:35 lichtkind joined #perl6
17:38 payload joined #perl6
17:48 moritz_ ng: class A { }; class A { }; say "alive"
17:48 p6eval ng ebaea1: Class A already registered!␤␤current instr.: 'perl6;ClassHOW;new' pc 2339 (src/builtins/ClassHOW.pir:65)␤
17:48 moritz_ ng: use Test; plan 1; eval_dies_ok 'class A { }; class A { }';
17:48 p6eval ng ebaea1: 1..1␤not ok 1 - ␤# Looks like you failed 1 tests of 1␤
17:48 moritz_ some eval_dies_ok doesn't seem to work
17:49 moritz_ ng: eval ''; say $!.defined
17:49 p6eval ng ebaea1: Method 'defined' not found for invocant of class 'Undef'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
17:49 moritz_ ng: eval ''; say defined($!)
17:49 p6eval ng ebaea1: 0␤
17:49 moritz_ ng: eval '++'; say defined($!)
17:49 p6eval ng ebaea1: Confused at line 1, near "++"␤current instr.: 'perl6;HLL;Grammar;panic' pc 519 (src/stage0/HLL-s0.pir:336)␤
17:50 moritz_ ng: my $x = eval '++'; say defined($!)
17:50 p6eval ng ebaea1: Confused at line 1, near "++"␤current instr.: 'perl6;HLL;Grammar;panic' pc 519 (src/stage0/HLL-s0.pir:336)␤
17:50 moritz_ ng: my $x = try { eval '++' }; say defined($!)
17:50 p6eval ng ebaea1: Null PMC access in can()␤current instr.: 'perl6;Perl6Object;!STORE' pc 1953 (src/builtins/Object.pir:383)␤
17:50 moritz_ this looks all so wrong to me
17:50 moritz_ pmichaud: see above (if not yet known)
17:53 colomon moritz_: for sure ng's eval_dies_ok does not check for Null PMC, I had to comment that part out this morning because of the regexes.
17:55 moritz_ colomon: that's not what's wrong
17:55 moritz_ (and that check could also be done with index())
17:55 colomon hey, good idea!
17:55 moritz_ colomon: the real problem is that 1) errors propagate through eval '', even though they shouldn't
17:55 moritz_ 2) empty $! is not a Perl 6 type, and thus doesn't response to .defined
17:56 moritz_ 3) try { eval '++' } seems to return a Null PMC access
17:57 moritz_ s/access$//
17:59 moritz_ t/spec/S06-signature/optional.t
17:59 moritz_ passes in ng
17:59 moritz_ but since it uses eval_dies_ok I'm reluctant to add it back in
18:00 moritz_ ng: sub wrong ($a?, $b) { }
18:00 p6eval ng ebaea1:  ( no output )
18:00 moritz_ ng: sub wrong ($a?, $b) { }; say 'alive'
18:00 p6eval ng ebaea1: alive␤
18:00 moritz_ ng: say(1, , 2)
18:00 p6eval ng ebaea1: 12␤
18:01 moritz_ std: say(1, , 2)
18:01 p6eval std 29167: [31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix , instead at /tmp/Q8N5rdvauk line 1:␤------> [32msay(1, ,[33m⏏[31m 2)[0m␤FAILED 00:02 107m␤
18:03 moritz_ over the weekend I had two ideas for potential changes to Perl 6
18:03 moritz_ the first one is rather straight forward:
18:03 moritz_ @list.sort($code) does a Schwartzian Transform if $code has arity (or count) 1
18:04 moritz_ that could be extended
18:04 moritz_ if $code returns something Positional
18:04 moritz_ the comparison could be made by the first item first
18:04 moritz_ if two first items are equal on the second item
18:04 moritz_ and so on
18:05 moritz_ don't know if it might be overkill, but it might be handy in some cases
18:05 moritz_ the second idea is a bit weird
18:05 moritz_ I thought that it's a bit ugly to have so many methods defined in class Any
18:06 moritz_ so user defined classes have more than hundred methods by default
18:06 colomon oh, actually index won't work for Null PMC detection until fail is implemented.
18:06 moritz_ so what about adding a second class near the root of our type hierarchy
18:06 moritz_ and user defined classes inherit from that class by default
18:06 colomon (or rather, it will work great for detecting null pmcs, but fail utterly at detecting their absence.)
18:07 pmichaud I think we already have the $code does Positional feature, don't we?
18:07 moritz_ pmichaud: do we? that's news to me
18:07 pmichaud our Array multi method sort( @values: Ordering @by )
18:08 moritz_ (second root class) and if you want to write a class that acts like a builtin type, you make it inherit Any
18:08 moritz_ I'm not yet sure if the details work out
18:09 moritz_ or maybe there could be a role that all the builtin objects do
18:09 moritz_ let's call it Base
18:09 moritz_ so Num ~~ Base, Code ~~ Base etc.
18:09 moritz_ and then for '24'.sin to work, there's a method sin in role Base
18:10 * moritz_ kinda likes that idea
18:11 Wolfman2000 Back from giving my sunday school lesson and having lunch. ...seems like I unexpectedly caused some more development in the ng branch.
18:11 pmichaud 17:55 <moritz_> 2) empty $! is not a Perl 6 type, and thus doesn't response to .defined
18:11 pmichaud for this we just need to fix !FAIL
18:12 pmichaud for that we probably should figure out how Failure works
18:15 moritz_ that sounds LTT (Less Than Trivial)
18:16 colomon moritz_: which is exactly why I'm happy to sit back and like pmichaud and jnthn sort it out.
18:18 ejs joined #perl6
18:18 pugs_svn r29168 | moritz++ | [t/spec] test for Nil() coercion ans the sink statement prefix
18:18 pugs_svn r29169 | moritz++ | [t/spec] prefix + calls .Numeric, ~ calls .Stringy (see r28502, r28502)
18:18 pugs_svn r29170 | moritz++ | [t/spec] tests for prefix:<~>/.Stringy vs .Str
18:19 Wolfman2000 rakudo: multi sub infix:<^>(Num $x, Num $y) { return $x ** $y; }; say "10^2 = {10^2}";
18:19 p6eval rakudo 7347ec: push_pmc() not implemented in class 'Sub'␤in Main (file <unknown>, line <unknown>)␤
18:19 Wolfman2000 std: multi sub infix:<^>(Num $x, Num $y) { return $x ** $y; }; say "10^2 = {10^2}";
18:19 p6eval std 29167: ok 00:01 110m␤
18:19 Wolfman2000 ...sure, std likes it
18:20 colomon Isn't infix ^ already in there somewhere, with a different meaning?
18:20 moritz_ Wolfman2000: that's the (LTA) error you get when overloading operators that aren't in the setting yet
18:20 colomon rakudo: say 4 ^ 10
18:20 p6eval rakudo 7347ec: one(4, 10)␤
18:20 moritz_ colomon: it is (junction)
18:20 colomon has it been moved to the setting yet?
18:20 moritz_ apparently not
18:20 Wolfman2000 apparently not
18:22 colomon ng: say 4 ^ 10
18:22 p6eval ng ebaea1: Confused at line 1, near "say 4 ^ 10"␤current instr.: 'perl6;HLL;Grammar;panic' pc 519 (src/stage0/HLL-s0.pir:336)␤
18:23 colomon infix:<^> isn't implemented at all in ng yet.  :)
18:23 Wolfman2000 Since ng is apparently the new upcoming master, I'll just wait for it to show up as the master before I try to figure out the PIR for it
18:31 * Wolfman2000 could still probably use a PIR tutorial.
18:32 moritz_ there's a book
18:32 Wolfman2000 free?
18:32 moritz_ yes
18:32 moritz_ in the parrot repo somewhere
18:32 moritz_ you can also buy a hard copy
18:33 Wolfman2000 I have the parrot repo: I required it for compiling rakudo
18:33 moritz_ http://docs.parrot.org/parrot/latest/html/ scroll down to "PIR book"
18:33 Wolfman2000 nice
18:55 pugs_svn r29171 | moritz++ | [t/spec] more Str -> Stringy changes
18:56 pugs_svn r29172 | moritz++ | [t/spec] typo in fudg
18:56 moritz_ moritz--
18:56 moritz_ more typos
19:00 colomon What's Stringy?
19:01 pmichaud it's the "stringification" method, I think.
19:01 pmichaud (haven't read the updated spec yet)
19:01 moritz_ the abstract role that Str and Buf implement
19:01 moritz_ and prefix:<~> converts to anything that's Stringy
19:02 colomon Is it actually implemented anywhere yet?
19:02 pmichaud nafaik
19:02 pmichaud it's really new
19:02 pmichaud like <7 days
19:02 moritz_ it's implemented in the test suite :-)
19:03 moritz_ at least partially
19:03 revdiablo joined #perl6
19:04 Nex6 joined #perl6
19:05 moritz_ phenny: tell qp_pq thanks for your suggestion, but I consider working code to be better than pseudo-code (and working code is also pseudo code simulatneously)
19:05 phenny moritz_: I'll pass that on when qp_pq is around.
19:06 moritz_ phenny: tell qp_pq also pseudo code can be used for explaining algorithms, but the goal of the book is to teach Perl 6, not abstract concepts
19:06 phenny moritz_: I'll pass that on when qp_pq is around.
19:09 synth joined #perl6
19:11 masak joined #perl6
19:12 s1n pmichaud: ping
19:14 snearch joined #perl6
19:15 jnthn pmichaud: pong....if you've still issues.
19:15 snearch_ joined #perl6
19:16 moritz_ masak: should I add gge to hugme?
19:16 masak moritz_: yes, please. :)
19:19 hugme joined #perl6
19:19 moritz_ hugme: list projects
19:19 hugme moritz_: I know about book, gge, hugme, json, november, nqp-rx, perl6-examples, proto, svg-matchdumper, svg-plot, temporal-flux-perl6syn, tufte, web
19:19 IOOIIIOIIO joined #perl6
19:20 masak hugme: add mberends to gge
19:20 * hugme hugs mberends. Welcome to gge!
19:20 moritz_ masak: just curious - why did you port PGE and not NQP-RX?
19:21 masak moritz_: when I started porting PGE, nqp-rx didn't exist. :)
19:21 moritz_ that's a good point :-)
19:21 jnthn A long-held sekrit. ;-)
19:21 masak moritz_: besides, though I know that nqp-rx is way cooler, I'm still fascinated by PGE. :)
19:21 masak yep. I started this in early September, I think.
19:21 moritz_ hugme: add moritz to gge
19:21 * hugme hugs moritz. Welcome to gge!
19:21 jnthn Wow!
19:21 * masak checks the git log
19:22 * moritz_ doesn't plan contributing right now, but wants to save him the trouble of changing the git URL later on
19:22 masak moritz_++ # good reason :)
19:23 * moritz_ tries the 03-optable.t to see how glacial it really is
19:24 IOOIIIOIIO noob question: is rakudo known to SEGV on fedora12, or have I broken something?
19:24 moritz_ IOOIIIOIIO: what do you do to get it segfaulting?
19:24 IOOIIIOIIO perl6 -e 'say "hello"'
19:25 moritz_ that... shouldn't segfault
19:25 IOOIIIOIIO or pretty much anything really
19:25 masak ouch.
19:25 moritz_ IOOIIIOIIO: is that a rakudo you built yourself?
19:25 masak IOOIIIOIIO: tell us a bit about your Rakudo and Parrot versions.
19:25 moritz_ IOOIIIOIIO: or installed from rpm?
19:25 IOOIIIOIIO no, I just installed the rpm
19:25 pnu joined #perl6
19:26 moritz_ IOOIIIOIIO: then you should open a bug in the fedora bug tracker
19:26 IOOIIIOIIO it's upgraded from fedora11 via yum, so something might be a little crooked in the libs
19:26 moritz_ well, that's the task of a package manager to take care things aren't that screwed up
19:27 IOOIIIOIIO rpms are rakudo-0.0.2009.09_1.6.0-2.fc12.i686, parrot-1.6.0-1.fc12.i686
19:28 IOOIIIOIIO yeah, I'll bug the fedora folks. Or maybe I'll just build it from source.
19:28 moritz_ IOOIIIOIIO: even if you build from souce you should tell the fedora folks
19:29 moritz_ 62.24user 0.49system 1:57.33elapsed 53%CPU for 03-optable.t in gge
19:29 IOOIIIOIIO yeah, I will, but building from source will let me play with perl6 sooner :-)
19:30 IOOIIIOIIO and I might get to find out what's broken along the way...
19:30 moritz_ IOOIIIOIIO++ # good attitude
19:30 IOOIIIOIIO yeah, well it might be my fault :-)
19:35 masak IOOIIIOIIO: when I don't check myself, I have the opposite approach: "haha, I'm going to find this bug in Rakudo/Parrot"... those are often the times when it turns out to be my fault. :P
19:41 mikehh_ joined #perl6
19:42 synth joined #perl6
19:47 synth joined #perl6
19:53 riffraff joined #perl6
20:03 zaslon joined #perl6
20:03 zaslon lolmasakhazblogged! masak++ 'What you can do with GGE::OPTable that you couldn't without': http://use.perl.org/~masak/journal/39929?from=rss
20:03 masak zaslon: you are one slow cookie. :)
20:03 zaslon Sorry, I don't understand that command
20:03 moritz_ mask++
20:04 IOOIIIOIIO ho hum. Just built my own rakudo, and it works just fine. Not that it proves much. I'll be off to fedora-bugs and see if anyone else has seen the problem.
20:04 IOOIIIOIIO or maybe I'll play with perl6 first :-)
20:04 masak IOOIIIOIIO: fall for the temptation! :)
20:05 masak IOOIIIOIIO: as long as it doesn't prevent you from going to fedora-bugs.
20:06 carlin joined #perl6
20:10 spinclad_ joined #perl6
20:11 mikehh__ joined #perl6
20:15 ng_feed rakudo-ng: (jnthn)++
20:15 ng_feed rakudo-ng: Fill out metamodel details somewhat. No doubt this will need and get tweaks and additions, but it'll serve as a first cut.
20:16 jnthn I'll implement the above spec in the next couple of days. We can fill out and go from there. :-)
20:18 mathw yay
20:18 moritz_ YaY, something nobody reads :-)
20:19 mikehh__ joined #perl6
20:19 mathw wow
20:19 mathw github formats pod
20:19 mathw github++
20:19 jnthn moritz_: That's fine, less complaints. ;-)
20:20 mathw fewer :P
20:20 jnthn mathw: Nah, somebody will half complain, surely.
20:20 mathw hmm
20:21 jnthn It's entirely possible if I really screwed it up that the complaints will be continuous.
20:21 masak now I know why most of the Rakudo people are working on ng; it's much nicer to run the spectests there...
20:21 mathw masak: I suspect it's not just that
20:22 masak mathw: oh, it is. believe me. :)
20:23 mathw jnthn: I assume that Attribute figures out if it's private or not, and thus if it needs to install accessor methods, by looking for the ! or . in its name?
20:24 jnthn No
20:24 moritz_ jnthn++ # meta model
20:24 jnthn By whether accessor is set to true.
20:24 jnthn In the call to .new
20:24 jnthn All attributes are $!foo under the hood.
20:25 jnthn But the Attribute is responsible for generating the accessor if that is true.
20:25 mathw Then how?
20:25 mathw argh
20:25 mathw sorry
20:25 mathw I had massive lag
20:25 mathw I'm an idiot, :accessor is right there in the spec
20:26 jnthn Yeah, you should make less mistakes like that. :-P
20:26 masak (making less mistakes)++
20:26 mathw I guess I'm not really awake
20:28 jnthn You got fewer sleep than needed last night?
20:28 mathw no I've just not been running on a full tank for a while
20:29 mathw and I'm back to work tomorrow, I think that's the main reason
20:29 mathw I don't want to go back, and I've just been moping around today
20:29 jnthn Aww. :-(
20:29 mathw I've had two weeks off
20:30 mathw and I've been interviewing for a job that's much better, so it's not the best situation
20:30 masak joined #perl6
20:30 mathw ah well
20:30 mikehh joined #perl6
20:30 mathw I shall survive it :)
20:30 jnthn Hope the interviews land you somewhere better.
20:30 mathw I have stocked up on chocolate
20:30 jnthn \o/
20:30 mathw so far it's promising :)
20:30 jnthn Cool :-)
20:30 mathw just got the last round to go
20:30 ng_feed rakudo-ng: masak++
20:30 ng_feed rakudo-ng: Added infix:<!~~>.
20:30 mathw where they pay for me to go visit them
20:31 mathw masak++
20:31 mathw masak: although... does it work? :P
20:31 masak mathw: for me, it does.
20:31 mathw that'll do
20:31 masak mathw: I exercised it really well before I pushed.
20:31 mathw you're much meaner to Perl 6 than I am
20:32 jnthn masak ran all the spectests. He told me so.
20:32 jnthn ;-)
20:32 mathw :)
20:32 masak all of them! several times!
20:32 mathw I'm sorry my ambitions to do useful things for Rakudo didn't pan out, but those job interviews were distracting (and unexpected)
20:32 mathw But I'm glad masak is
20:32 masak mathw: ...distracting and unexpected? :)
20:33 moritz_ so how did they go?
20:33 mathw masak: yes
20:33 masak mathw: boo!
20:33 mathw moritz_: actually they were quite fun
20:33 masak :P
20:33 jnthn mathw: That's fine - it sounds like a long-term win for you if it all works out. :-)
20:33 mathw Damn well should be
20:34 diakopter joined #perl6
20:34 mathw :D
20:34 mathw Just as long as they don't keep me waiting too long for their decision
20:35 * moritz_ hasn't reached the interviews stage yet
20:35 mathw moritz_: are you looking?
20:35 moritz_ mathw: yep. Finishing my Diploma in mid December
20:35 mathw aaah
20:35 mathw good luck!
20:36 moritz_ thanks
20:36 mathw I wasn't looking, but they said hey, want to talk to us about a groovy job?
20:36 masak what happens on (0..Inf).pick ?
20:36 mathw So I did self.think for about pi seconds
20:36 mathw and said yes
20:36 moritz_ masak: I don't think there's a meaningful answer to that
20:36 mathw masak: hmm
20:37 jnthn Wasn't that a bit irrational?
20:37 masak mathw++
20:37 mathw jnthn: when has rationality anything to do with it? :P
20:37 masak moritz_: no, me neither.
20:37 masak moritz_: but what happens?
20:37 mathw masak: I would say, it might return a number, or it might sit there forever until your stack explodes
20:38 moritz_ masak: fail("I can't make up my mind how to pick something from an infinite list")
20:38 mathw moritz_: that would be a sensible approach, I think
20:38 moritz_ s/list/range/
20:38 mathw it could do oh look it's an infinite list
20:38 jnthn mathw: It was a bad joke about pi :-P
20:38 mathw rand(Inf)
20:38 mathw jnthn: I know :)
20:38 jnthn :-P
20:39 moritz_ I'm sure jnthn didn't want to pi()ss off anybody :-)
20:39 mathw actually I thought about it for a little longer than that
20:39 mathw including checking to make sure it was genuine
20:39 mathw one does get job spam
20:40 jnthn Yeah
20:40 jnthn I get loads, but thankfully lots of it is crazy obvious.
20:40 masak rakudo: say rand() * Inf
20:40 mathw yeah
20:40 p6eval rakudo 7347ec: maximum recursion depth exceeded␤in Main (file <unknown>, line <unknown>)␤
20:40 jnthn "Want to work from home?" - I already do...
20:40 jnthn :-)
20:40 mathw the genuine stuff is properly written
20:40 mathw heh
20:40 masak o.O
20:40 * masak submits rakudobug
20:40 mathw also, I find 'earn as much as £5 an hour' to be quite offputting
20:40 jnthn ng: say rand() * Inf
20:40 p6eval ng ebaea1: too many arguments passed - 0 params expected␤current instr.: '&die' pc 7545 (src/builtins/control.pir:18)␤
20:40 mathw I earned £5 an hour when I was 17
20:41 moritz_ mathw: but you didn't pay taxes back then :-)
20:41 mathw true
20:41 mathw scowl scowl mutter mumble
20:42 moritz_ somebody offered me a telecomute jobs at the OTRS developers
20:43 mathw I'm not sure I'd lik ethat
20:43 mathw the option to work from home sometimes is nice
20:43 mathw but there's something good about going to an office and being with everyone in the same room to discuss
20:44 moritz_ aye
20:44 moritz_ and separating $work from $home
20:44 mathw yes, which is something I'm quite bad at
20:45 mikehh_ joined #perl6
20:48 masak pmichaud: ping
20:48 jnthn pmichaud: ur doin it rong!
20:48 jnthn ;-)
20:51 jnthn rakudo: my $x = Any.new; say $x.perl
20:51 p6eval rakudo 7347ec: Any.new()␤
20:51 jnthn o: my $x = Any.new; say $x.perlng
20:51 jnthn ng: my $x = Any.new; say $x.perl
20:51 p6eval ng 218aee: Method 'Iterator' not found for invocant of class 'Any'␤current instr.: 'perl6;Perl6Object;' pc -1 ((unknown file):-1)␤
20:53 mathw hmm
20:54 mathw jnthn: looking at the source code, there's method perl in Any-list.pm, and it assumes it can call map on self
20:55 mathw and renders like it's a list
20:55 mathw hmm
20:56 mathw I guess it can call map, because that's also defined in Any-list
20:56 mathw but map is presumably not working properly in this case
20:56 mathw why is map defined in Any?
20:56 mathw I don't understand this
20:57 masak` joined #perl6
20:57 moritz_ mathw: so that you can doo <foo bar>.map and <foo>.map
20:58 moritz_ mathw: even though <foo> returns a Str, not a List
20:58 mathw it does?? hmm
20:58 mathw why
20:58 mathw it should be a one-element list, shouldn't it
20:58 mathw although it seems things have been arranged so that you can treat it that way
20:59 jnthn masak++ and I agree that .perl for List being in Any is wrong. map does belong there, however.
21:00 moritz_ agreed
21:00 mathw so what should .perl in Any do?
21:00 masak fixing it now.
21:00 moritz_ mathw: nothing
21:00 moritz_ mathw: there's a .perl in Object, iirc
21:00 masak mathw: not be in Any-list
21:00 mathw I guess it simply cannot know
21:00 moritz_ which should be the default .perl returning $type.new(%attribs.perl)
21:00 mathw you need to be something that knows it's a list to start doing listy things in .perl
21:01 astrojp joined #perl6
21:03 jnthn mathw: Right, thus why it almost certainly belongs in List.
21:03 mathw mmm
21:04 mathw and we don't seem to have a List.pm
21:05 masak I'm on it.
21:06 masak and learning more about ng in the process. :)
21:06 * mathw is too
21:06 mathw RACE!
21:06 mathw although I've got to update parrot first
21:07 masak mathw: good luck, punk.
21:07 ng_feed rakudo-ng: masak++
21:07 ng_feed rakudo-ng: moved .perl from Any-list to List
21:07 mathw pfft
21:07 mathw having commit access is cheating
21:07 mathw :P
21:07 masak I guess.
21:07 moritz_ mathw: submit a few more patches, send in a CLA...
21:07 masak but I didn't make the rules.
21:08 mathw :D
21:08 mathw moritz_: that's the plan
21:08 mathw hey guess what
21:09 mathw masak: you did exactly what I'm halfway through doing
21:09 * mathw is happy about that
21:09 masak mathw++ # obviously a guy with good judgment
21:10 mathw except you didn't put the vim filetype hint in the file, as many of the others in core/ have
21:10 jnthn meh, who uses vim.
21:10 jnthn ;-)
21:10 mathw me
21:10 mathw although I seem to be lacking perl6.vim at the moemnt
21:10 mathw which is odd
21:10 * moritz_
21:10 mathw as i used to have it
21:10 jnthn Yes, amusingly I think masak++ does too ;-)
21:10 masak mathw: oh!
21:11 masak yeah.
21:11 masak right now, in fact.
21:11 masak but I don't care much about the difference between Perl 5 and Perl 6 syntax highlighting.
21:11 * moritz_ does
21:11 mathw it's not the most complicated method ever :)
21:11 mathw especially since you just cut and pasted it
21:15 masak mathw: and yet you only got half-way. :P
21:15 mathw nonsense
21:15 mathw I was about to build it
21:15 mathw but I had to update parrot
21:16 masak ok :)
21:17 pmurias joined #perl6
21:18 mathw aaaaargh
21:18 mathw I updated parrot
21:18 mathw and it still thinks its too old
21:19 mathw did I remember to run make install on parrot
21:19 mathw apparently not
21:20 mathw and that doesn't help
21:20 mathw how odd
21:21 masak joined #perl6
21:24 dalek nqp-rx: 19d5ef4 | pmichaud++ |  (3 files):
21:24 dalek nqp-rx: Convert 'from' to 'p'  (:p/:pos).
21:24 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/1​9d5ef4aecf75c609608dc027d7a00c5f57b222f
21:24 dalek nqp-rx: ba1f213 | pmichaud++ |  (7 files):
21:24 dalek nqp-rx: Add 'c'ontinue option to regexes.
21:24 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/b​a1f213517efc4d8f3a72603a0d4f4fef5d3cc64
21:24 dalek nqp-rx: e395215 | pmichaud++ | src/Regex/Cursor.pir:
21:24 dalek nqp-rx: Change check for :rule type.
21:24 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/e​3952157db2b4641aa083e171d19e2c599ae7f11
21:24 dalek nqp-rx: 88e6e26 | pmichaud++ | src/stage0/ (4 files):
21:24 dalek nqp-rx: Update bootstrap.
21:24 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/8​8e6e26b4d13c96b3ef1183aacf4b68d28856a0f
21:25 ng_feed rakudo-ng: masak++
21:25 ng_feed rakudo-ng: added vim setting line to the new file
21:25 masak joined #perl6
21:28 Wolfman2000 moritz_: I did some reading of the PIR after having just woken up from a nap. PIR makes me wish this was assembly instead of the real gunk
21:28 moritz_ :-)
21:29 mathw PIR is so much higher level it's silly to call it assembly
21:29 Wolfman2000 If you want, I'll try playing around with it Monday night after my presentation.
21:29 mathw except that it is, in a sense
21:29 Wolfman2000 This way I can also help with some of the operator overloading
21:30 jnthn ng: my @x = 1,2,3; @x.push(4); say @x.perl;
21:30 p6eval ng 440921: Method 'push' not found for invocant of class 'Array'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
21:31 ng_feed rakudo-ng: (jnthn)++
21:31 ng_feed rakudo-ng: We now pass mixed-placeholders.t (and are only a push function off passing slurpy-placeholders.t, it appears).
21:31 ng_feed rakudo-ng: (jnthn)++
21:31 ng_feed rakudo-ng: Various fixes to placeholder parameters.
21:32 mathw jnthn: we don't have .push in ng yet?
21:35 jnthn mathw: Seems not.
21:35 jnthn It wasn't quite right in master though, irrc.
21:35 jnthn *iirc
21:35 Wolfman2000 jnthn: I checked for push in any-list.pir on master, but...didn't find it
21:35 jnthn So it's not a copy-paste job.
21:35 jnthn Wolfman2000: It'd be in Array
21:35 jnthn Wolfman2000: List is immutable.
21:36 Wolfman2000 So not in builtins then
21:36 jnthn maybe in master it'd live in src/classes/Array.pir
21:36 mathw it's in src/classes/Array.pir
21:36 mathw I'm looking at it wondering if it can be ported fairly straight across
21:36 mathw although hopefully into src/core/Array.pm so we don't have to do all that signature stuff
21:36 pmichaud no, it cannot.
21:37 mathw pmichaud: somehow I'm not surprised
21:37 pmichaud well, arrays now are "isa RPA" instead of "hasa RPA"
21:37 mathw ahah
21:37 Wolfman2000 RPA?
21:37 pmichaud and I'm thinking that push/pop/shift/unshift should all be written in terms of splice anyway
21:37 jnthn pmichaud: Other way round?
21:37 pmichaud jnthn: right, other way round (thanks)
21:38 jnthn :-)
21:38 pmichaud they're now hasa RPA instead of isa RPA
21:38 mathw Wolfman2000: ResizablePMCArray, I believe
21:38 * pmichaud has been fighting regex integration into ng all day :-(
21:38 Wolfman2000 mathw: ugh...I am NOT a fan of those.
21:38 jnthn pmichaud: Aww...it turned out harder than expected?
21:38 mathw pmichaud: in maste rit does use splice, but it does a lot of faffing about first
21:38 pmichaud jnthn: yeah -- trying to get the methods to be standard subclass of Method has been a pain
21:39 mathw ah
21:39 mathw it goes through args, packs them all into Perl6Scalar, then splices args onto the end of self
21:39 jnthn pmichaud: Ah, how so?
21:39 pmichaud jnthn: just that it doesn't seem to work right "out of the box"
21:39 pmichaud Method 'ACCEPTS' not found for invocant of class 'Regex'
21:40 pmichaud but if I add a ".sub 'ACCEPTS' :method" to the Regex class, that doesn't help.
21:40 jnthn That's decidedly odd.
21:40 pmichaud are we still allowed to write methods in PIR ?
21:41 jnthn I believe so.
21:41 jnthn I mean, Code.new is writte in PIR for example.
21:41 pmichaud right.
21:41 jnthn Amongst many other bits and pieces.
21:41 pmichaud I saw that.
21:41 Wolfman2000 pmichaud: In perl 6? I wonder why we would want to.
21:41 pmichaud I'll try it again.
21:42 pmichaud Wolfman2000: because sometimes we can't do things in Perl 6 that can be done in PIR
21:42 pmichaud in this particular case, we have to be able to set the caller's $/
21:42 Wolfman2000 If I remember right, $/ is a capture variable
21:42 Wolfman2000 ...and Perl generally doesn't allow you to write that
21:43 pmichaud Wolfman2000: I'm not sure that's true, but assuming that it is -- that'd be why we'd have to do it in PIR instead of Perl 6 :)
21:44 jnthn pmichaud: OK - feel free to push the not-quite-working code if you want me to peek.
21:44 jnthn pmichaud: Nothing comes to mind about why that would not work.
21:44 pmichaud nopasting
21:45 pmichaud http://gist.github.com/240739
21:47 jnthn looking
21:47 pmichaud changes pushed
21:48 ng_feed rakudo-ng: pmichaud++
21:48 ng_feed rakudo-ng: Merge branch 'ng' of git@github.com:rakudo/rakudo into ng
21:48 ng_feed rakudo-ng: pmichaud++
21:48 ng_feed rakudo-ng: Updates with attempt to get Regex.ACCEPTS to work.
21:48 ng_feed rakudo-ng: pmichaud++
21:48 ng_feed rakudo-ng: Add initial version of regex matches.
21:49 IllvilJa joined #perl6
21:49 jnthn pmichaud: Will I need Parrot version bump for this?
21:50 * mathw realises that his PIR might work better if he didn't put semicolons on all the line endings
21:51 Wolfman2000 ugh. I just took a look at the push sub in master. Why must it use instructions I haven't seen yet in the tutorial when other subs use the push command?
21:51 mathw because you need to read more of the tutorial?
21:52 Wolfman2000 So future chapters cover setprop, :slurpy, :subid, set_signature_elem, etc?
21:52 mathw set_signature_elem is part of Rakudo
21:52 mathw I believe
21:53 jnthn It is.
21:53 mathw it's part of the block that creates the method's Perl 6 signature
21:53 * mathw is trying to define push in Perl 6... using inline PIR
21:53 mathw this is not good for my night brain
21:53 mathw but it's kind of interesting
21:54 Wolfman2000 mathw: I have a feeling you may want to start with copying what's in master and then trying to optimize.
21:54 pmichaud please don't do that
21:54 pmichaud the version in master is *wrong*
21:54 Wolfman2000 ...nevermind
21:54 pmichaud like "not even close" sort of wrong
21:54 pmichaud because we've fundamentally changed the way lists and arrays are stored
21:55 mathw Which is why I'm not
21:55 mathw I am learning more about PIR
21:55 mathw just trying to persuade the compiler to swallow it
21:55 pmichaud jnthn: yes, you need Parrot version bump
21:55 mathw so even if I don't come up with anything that works, it's good
21:55 frew_ joined #perl6
21:56 jnthn pmichaud: OK, doing so.
21:56 jnthn pmichaud: Nothing looks immediately wrong with the patch though :-S
21:57 ng_feed rakudo-ng: (jnthn)++
21:57 ng_feed rakudo-ng: Parse various junctional operators.
21:58 Su-Shee left #perl6
22:01 pmichaud jnthn: yeah, I'm a bit stumped by it.  I mean, it clearly knows that it's a Regex.
22:01 mathw oh
22:01 jnthn pmichaud: Right.
22:01 mathw "syntax error, unexpected $end" has to be one of the least enlightening things I've seen all day
22:01 jnthn pmichaud: New build takes a while here. :-S
22:01 mathw but it's bedtime, so I'm sure when I get back someone else will have done push right and I can see how :)
22:02 mathw night all
22:02 jnthn night, mathw
22:05 pmichaud ...wtf?
22:05 pmichaud imports = split ' ', 'PAST PCT HLL Regex _dumper'
22:05 pmichaud that can't be right
22:05 pmichaud (from Perl6::Compiler.pir)
22:06 pmichaud oh, I guess it is right.
22:06 pmichaud ummmmmm, okay, I know what's wrong then
22:06 jnthn oh :-/
22:06 pmichaud The Regex from nqp is overwriting and losing the Regex locally
22:06 jnthn *nod*
22:06 jnthn Ouch :-(
22:07 pmichaud well, there's actually nothing *in* the Regex space itself that is needed -- just Regex::Cursor
22:07 jnthn Can you just import that?
22:11 pmichaud well, it's a bit harder since it's not a top-level namespace, but I suspect I can find a way to do it.
22:12 pmichaud or perhaps the real answer will be to simply subclass the parrot classes and use the rakudo ones.  We'll have to do that anyway.
22:12 pmichaud I'll put in a cheat for now.
22:12 jnthn k
22:13 enigmujo1 joined #perl6
22:18 enigmujo left #perl6
22:18 quietfanatic According to my dictionary, the aforelinked Japanese twitterer was saying "Perl 6 is too powerful; it seems kind of like Trunks"
22:18 Wolfman2000 quietfanatic: Perl as a Dragon Ball [Z] character?
22:18 quietfanatic where Trunks is, I think, the name of a Dragon Ball Z character.
22:18 Wolfman2000 Why don't we just put programming languages in other media?
22:19 facsimile joined #perl6
22:19 quietfanatic Wolfman2000: Perl 6 is more like the kid with the huge power level who can't control it yet
22:19 moritz_ aye
22:19 Wolfman2000 ...there's only one way to do this.
22:19 moritz_ we need to develop idioms to guide poeple
22:20 Wolfman2000 <Vegeta> IT'S OVER --
22:20 Wolfman2000                              
22:20 Wolfman2000                               
22:20 Wolfman2000                              
22:20 Wolfman2000                        
22:20 Wolfman2000                              
22:20 quietfanatic That almost says something...
22:20 quietfanatic I just see a bunch of [0016] boxes
22:20 Wolfman2000 It's supposed to be 9000
22:20 Wolfman2000 In boxes
22:21 masak joined #perl6
22:21 zaslon lolmasakhazblogged! masak++ 'November 22 2009 -- think globally, act globally': http://use.perl.org/~masak/journal/39930?from=rss
22:21 masak :)
22:21 masak zaslon: you're fast again!
22:21 zaslon Sorry, I don't understand that command
22:21 cognominal joined #perl6
22:21 masak zaslon: are you sorry you don't understand this command either? :)
22:21 zaslon Sorry, I don't understand that command
22:21 * masak thought so
22:22 Avada joined #perl6
22:23 pmichaud ouch, this is turning out to be a real pain.
22:24 moritz_ doing what?
22:24 masak regexes?
22:24 pmichaud I need to get ['parrot';'Regex';'Cursor'] to appear as ['perl6';'Regex';'Cursor']
22:24 pmichaud (namespaces)
22:24 masak ah.
22:24 pmichaud I've never done importing of a second-level namespace before.... and parrot's builtins don't quite handle it.
22:24 * moritz_ thought that was what type maps do
22:25 moritz_ not importing, but mapping
22:25 pmichaud type maps aren't that sophisticated either, alas.  But really this is simply that I need one namespace to appear in two places.
22:25 pmichaud (which we do for a number of other top-level namespaces)
22:26 pmichaud oh, perhaps it's just faster to do it the right way than the cheat
22:26 * pmichaud goes to work on that :-(
22:27 pmichaud nope, that's not going to be any quicker
22:28 pmichaud *sigh*
22:28 Tene :(
22:28 pmichaud the fact that Parrot doesn't allow invocables besides Sub is _really_ annoying.
22:28 pmichaud at least, not good ways of doing it.
22:28 jnthn pmichaud: Give them an "invokable" role.
22:28 jnthn pmichaud: If that isn't working, I think it's a Parrot bug.
22:29 pmichaud jnthn: that doesn't help me in NQP-rx, which is where the root problem really lies.
22:29 jnthn Code should have 'em though.
22:29 jnthn Oh OK.
22:29 jnthn ;-(
22:29 pmichaud what I *really* want is to be able to have the regex methods that nqp-rx (or PGE, for that matter) compiles be classed different than "Sub"
22:29 pmichaud anyway, that problem isn't going to be solved this decade.
22:29 pmichaud (where decade ends in about 40 days)
22:30 pmichaud maybe I just "cheat" for now and go with Perl6Regex as the internal class name.
22:31 cognominal_ joined #perl6
22:33 jnthn night o/
22:34 cognominal_ night \o
22:49 ashizawa_ joined #perl6
22:51 pmichaud argggggggh
22:51 pmichaud okay, regexes now run, but it's a pain to get $/ to be set properly, because &infix:<~~> is imposing its own $/
22:52 pmichaud so, this begs the question... what is responsible for setting the caller's $/  ?  Is it .match, Regex.ACCEPTS, or &infix:<~~> ?
22:52 moritz_ so you need to implement some form of OUTER::?
22:53 pmichaud not OUTER
22:53 pmichaud caller
22:53 moritz_ right
22:53 pmichaud and we have to know how many callers to go up
22:53 pmichaud or we we have to implement 'lift'
22:53 pmichaud which I'm not quite ready to do
22:53 moritz_ ouch.
22:56 pmichaud eh, I guess all of them could do it.
22:56 pmichaud each one is responsible for setting its callers $/
22:56 pmichaud that can work.
23:01 pmichaud t/00-parrot/10-regex.t ............. ok
23:02 moritz_ pmichaud++
23:02 pmichaud I'm sure there are lots of broken corner cases.
23:04 pmichaud hugme tweet rakudoperl rakudo-ng now has (limited) regexes
23:04 * hugme hugs pmichaud; tweet delivered
23:04 ng_feed rakudo-ng: pmichaud++
23:04 ng_feed rakudo-ng: Merge branch 'ng' of git@github.com:rakudo/rakudo into ng
23:04 ng_feed rakudo-ng: pmichaud++
23:04 ng_feed rakudo-ng: Enable regexes, at least a limited form of them.  I'm sure there
23:05 moritz_ I was about to say "it doesn't have regex support until you push", but you really did push first :-)
23:05 pmichaud yes, I did.
23:05 pmichaud my sequence these days is becoming "push, tweet"
23:05 moritz_ it should be 'test, push, tweet' :-)
23:06 pmichaud oh, I did the test already, yes.  :)
23:08 cognominal_ pmichaud++
23:10 moritz_ pmichaud: S02-whitespace_and_comments/one-pass-parsing.t fails
23:11 pmichaud in ng?  I'd not be surprised :)
23:11 moritz_ it used to pass
23:11 pmichaud I'd still not be surprised :)
23:11 pmichaud looking
23:11 moritz_ but maybe that's because eval didn't work properly back then
23:11 moritz_ FWIW I'd be fine with commenting it out of spectest.data again
23:11 pmichaud oh, sure
23:11 moritz_ it might have been a bogus pass anyway
23:12 pmichaud we don't recognize 'regex' yet.
23:12 pmichaud the only regexes that we really handle properly are   /pattern/
23:12 moritz_ that explains a lot :-)
23:12 pmichaud (we used to recognize 'regex', but it was the NQP form of 'regex' and not the rakudo one)
23:12 pmichaud so yes, taking it out of spectest.data is wisest for now
23:13 * moritz_ pushes
23:13 ng_feed rakudo-ng: moritz++
23:13 ng_feed rakudo-ng: re-disenable one-pass-parsing.t, it was a bogus pass before
23:14 moritz_ from S05-metasyntax/changed.t
23:14 moritz_ # (The /s modifier is gone.)
23:14 moritz_ eval_dies_ok('$str ~~ m:s/./', '/s modifier (as :s) is gone');
23:14 moritz_ that's so wrong, isn't it?
23:15 moritz_ m:s exists, it's just something else today, no?
23:15 moritz_ (:sigspace)
23:15 pmichaud we've never parsed it correctly, though
23:15 moritz_ I know
23:15 moritz_ but the test as Perl 6 is wrong
23:15 pmichaud ummm. I dunno off the top of my head.
23:16 * moritz_ asks ack
23:16 moritz_ ack confirms :-)
23:16 Wolfman2000 Merge branch 'ng' of git@github.com:rakudo/rakudo into ng <-- does this mean ng is now master?
23:17 moritz_ Wolfman2000: nope
23:17 moritz_ Wolfman2000: it means that two people had different versions of "ng", and merged them
23:17 moritz_ it didn's say "... into master" :-)
23:17 moritz_ s/s/t/
23:18 moritz_ nqp: token { a }; say 'alive';
23:18 p6eval nqp: Confused at line 1, near "token { a "␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
23:18 moritz_ nqp: token { a }; say('alive');
23:18 p6eval nqp: Confused at line 1, near "token { a "␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
23:18 moritz_ nqp: grammar Foo { token { a } }; say('alive');
23:18 p6eval nqp: Unable to parse blockoid, couldn't find final '}' at line 1␤current instr.: 'parrot;Regex;Cursor;FAILGOAL' pc 1652 (src/Regex/Cursor-builtins.pir:179)␤
23:18 pmichaud tokens want a name
23:18 moritz_ nqp: grammar Foo { token b { a } }; say('alive');
23:18 p6eval nqp: alive␤
23:19 moritz_ nqp: grammar Foo { token b { \A } }; say('alive');
23:19 p6eval nqp: Obsolete use of \A as beginning-of-string matcher;in Perl 6 please use ^instead at line 1, near " } }; say("␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
23:19 pmichaud lta error there -- I'll fix it.
23:19 moritz_ nqp: grammar Foo { token b { \z } }; say('alive');
23:19 p6eval nqp: Obsolete use of \z as end-of-string matcher;in Perl 6 please use $instead at line 1, near " } }; say("␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
23:19 moritz_ nqp: grammar Foo { token b { \Z } }; say('alive');
23:19 p6eval nqp: Obsolete use of \Z as end-of-string matcher;in Perl 6 please use \n?$instead at line 1, near " } }; say("␤current instr.: 'parrot;HLL;Grammar;panic' pc 519 (src/cheats/hll-grammar.pir:197)␤
23:21 * moritz_ adds a space to that error message
23:22 pmichaud $ ./perl6
23:22 pmichaud > say "abcdefabcdef".match(/d/).from
23:22 pmichaud 3
23:22 pmichaud > say "abcdefabcdef".match(/d/, :c(5)).from
23:22 pmichaud 9
23:22 lambdabot <no location info>: parse error on input `,'
23:22 lambdabot <no location info>: parse error on input `)'
23:22 moritz_ pmichaud++
23:22 moritz_ that will make Str.split(Regex) *so* much easier
23:23 pmichaud yes, I had to rework the logic anyway so went ahead and did that.
23:24 dalek nqp-rx: a10da9f | moritz++ | src/Regex/P6Regex/Grammar.pm:
23:24 dalek nqp-rx: add a space to the "Obsolote use" error message
23:24 dalek nqp-rx: review: http://github.com/perl6/nqp-rx/commit/a​10da9f25ef58cde73a4271e371d7956e3bf6b86
23:25 * moritz_ loves small optimizations that make programs more usable
23:26 moritz_ for example gqview, and image viewer, has the "rename" context menu item
23:26 moritz_ and if your file is named foo.jpg, then the 'foo' part is already marked
23:26 moritz_ so you can go ahead and type a new name without havin to re-type the extension
23:27 Juerd Windows Explorer does that too :)
23:27 moritz_ the last Windows Explorer I worked a lot with was that of Win 98 SE
23:27 moritz_ I don't think it did that back then :-)
23:27 Juerd Heh :)
23:28 pmichaud okay, got 'eval' working today, got simple regexes working.
23:28 ng_feed rakudo-ng: pmichaud++
23:28 ng_feed rakudo-ng: Eliminate the "Perl6Regex" cheat, enable :c(ontinue) option in regexes.
23:29 pmichaud That's an earned break for an hour or three, I guess. :)
23:29 pugs_svn r29173 | moritz++ | [t/spec] remove a bogus test; the :s (sigspace) modifier exists, it just has a different meaning today
23:29 moritz_ indeed :-)
23:30 pmichaud oh, I suspect we can implement :g(lobal) too pretty soon.
23:33 moritz_ does that make sense inside a regex?
23:34 pmichaud oh, not in a regex, no
23:34 pmichaud but we can do    "foo".match(/pat/, :g)
23:34 moritz_ you mean in .match?
23:34 pmichaud yeah
23:34 pmichaud and then use that directly inside of split, subst, etc.
23:34 pmichaud (instead of repeating it several places as we do now)
23:35 Juerd Is .match preferred to ~~?
23:35 Juerd Stylewise
23:35 moritz_ not really
23:35 pmichaud no, probably not
23:35 moritz_ it's more of a stop-gap
23:35 pmichaud no, it's spec
23:35 pmichaud ~~ delegates to .ACCEPTS, which then does .match
23:35 Juerd I see
23:35 moritz_ it makes passing of pairs easier than ~~, for which you need more parsing goodness
23:35 moritz_ a specced stop-gap :-)
23:36 pmichaud well, even with ~~ it'd be     rx :g /pat/
23:36 pmichaud or    ~~ m :g /pat/
23:36 pmichaud which puts the :g on the 'rx' or 'm', not on the smartmatch
23:37 moritz_ right
23:37 Juerd Are those spaces required or can you do m:g/pat/ too?
23:38 moritz_ works without spaces too
23:38 moritz_ std: 'a' ~~ m:g/pat/
23:38 p6eval std 29172: ok 00:01 106m␤
23:38 * Juerd keeps forgetting that you can just ask the bots
23:42 * moritz_ notices that "git pull" says "Already up-to-date." while "git push" says "Everything up-to-date"
23:42 moritz_ inconsistent
23:43 cognominal_ I guess that's a requirement for the Turing test :)
23:44 * moritz_ is not sure if it'd pass a Turing test :-)
23:44 spinclad_ joined #perl6
23:44 frettled joined #perl6
23:49 moritz_ s/it/he/
23:53 moritz_ hugme: tweet rakudoperl rakudo-ng now passes 454 spectests
23:53 * hugme hugs moritz_; tweet delivered

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

Perl 6 | Reference Documentation | Rakudo