Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-01-12

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:21 ovid Whee!  I've now submitted a patch for adding the .trim method: http://use.perl.org/~Ovid/journal/38261  That was frustrating and fun at the same time.
00:21 jnthn ovid: It tends to get more fun and less frustrating as time passes. :-)
00:21 ovid I hope so :)
00:22 ovid OK, time for bed.  Head hurt.  Need pillow.
00:22 jnthn Sleep well
01:05 cspencer joined #perl6
01:06 icwiener_ joined #perl6
01:06 DemoFreak joined #perl6
01:06 Blasi joined #perl6
01:06 athenot joined #perl6
01:06 gbacon joined #perl6
01:06 simcop2387 joined #perl6
01:06 c1sung joined #perl6
01:06 yahooooo joined #perl6
01:06 Matt-W joined #perl6
01:06 dmpk2k joined #perl6
01:06 drbean_ joined #perl6
01:06 nothingmuch joined #perl6
01:06 edenc joined #perl6
02:31 agentzh left #perl6
02:49 jiing joined #perl6
02:49 _jedai_ joined #perl6
02:50 meteorjay joined #perl6
02:51 alester joined #perl6
03:01 alanhaggai joined #perl6
03:19 agentzh joined #perl6
03:20 rakudo_svn r35431 | pmichaud++ | [rakudo]:  Throw an exception for bare "say" or "print" (RT #62028).
03:25 eternaleye joined #perl6
03:34 pmichaud rakudo: say;
03:34 p6eval rakudo 35431: OUTPUT«say requires an argument at line 1, near ";"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
03:34 pmichaud rakudo: say for 1..3;
03:34 p6eval rakudo 35431: OUTPUT«␤␤␤»
03:34 pmichaud oops.
03:35 meppl joined #perl6
03:36 meppl good morning
04:00 rakudo_svn r35432 | pmichaud++ | [rakudo]:  Missed a bare say in r35431 -- this fixes it (RT #62028).
04:08 stephens joined #perl6
04:31 pmichaud rt slow.
04:38 pmichaud rakudo: say for 1..3;
04:38 p6eval rakudo 35432: OUTPUT«say requires an argument at line 1, near "for 1..3;"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
04:38 pmichaud better.
04:40 _jedai_ joined #perl6
05:27 _jedai_ joined #perl6
05:39 xuser joined #perl6
05:43 xuser joined #perl6
05:45 cotto joined #perl6
05:46 xuser joined #perl6
05:55 lumi_ joined #perl6
06:04 ejs joined #perl6
06:10 _jedai_ joined #perl6
06:21 hudnix joined #perl6
07:00 _jedai_ joined #perl6
07:06 maerzhase joined #perl6
07:23 eternaleye_ joined #perl6
07:46 namenlos joined #perl6
07:51 meppl joined #perl6
08:01 _jedai_ joined #perl6
08:10 krunen joined #perl6
08:11 elmex joined #perl6
08:19 pbuetow joined #perl6
08:21 iblechbot joined #perl6
08:34 maerzhase joined #perl6
08:36 DemoFreak joined #perl6
08:36 felipe joined #perl6
08:44 brunoV joined #perl6
08:52 vixey joined #Perl6
09:22 araujo joined #perl6
09:23 masak joined #perl6
09:28 maerzhase joined #perl6
09:36 |jedai| joined #perl6
09:38 spx2_ joined #perl6
09:38 moritz_ perl6: sub e(@a) { print @a.elems; }; e([1, 2, 3])
09:38 p6eval elf 24885, pugs, rakudo 35432: OUTPUT«3»
09:48 moritz_ currently perl6.vim is too slow for real-world usage
09:49 moritz_ I think we should sacrifice exactness for more speed
09:49 moritz_ any objections? (espeically from literal)
09:50 literal yeah, I was intending to do that
09:50 literal basically, have some perl6_extended_foo options when you want slow, but exact highlighting
09:51 moritz_ +1
09:51 literal but use something fast which covers only the common cases, by default
09:53 Matt-W speed would be nice
10:01 |jedai| joined #perl6
10:02 Southen_ joined #perl6
10:10 riffraff joined #perl6
10:17 alexn_org joined #perl6
10:37 jhuni joined #perl6
11:04 ludan joined #perl6
11:13 ruoso joined #perl6
11:14 knewt_ joined #perl6
11:17 plainhao joined #perl6
11:34 donaldh joined #perl6
12:00 |jedai| joined #perl6
12:01 Lorn joined #perl6
12:26 |jedai| joined #perl6
12:30 Lorn_ joined #perl6
12:35 Cantacuzenus joined #perl6
12:35 eternaleye joined #perl6
12:45 Southen joined #perl6
13:00 ludan joined #perl6
13:06 eternaleye joined #perl6
13:08 pmurias joined #perl6
13:11 masak ovid++ # trim
13:16 pugs_svn r24886 | pmurias++ | [smop] merged has_next/eval/next into eval
13:18 elmex joined #perl6
13:19 masak so, do I just add trim() to S29? any opinions?
13:22 moritz_ as a method in Str, I wouldn't object
13:23 masak moritz_: and 'is export', yes. I saw that some adaptions needed to be made from ovid's pod doc suggestion.
13:23 masak also the named params, if we decide to throw those in.
13:37 masak .perl only exists in method form, right? there's no 'perl($var)'?
13:38 moritz_ afaict yes
13:39 moritz_ perl6: say perl [1, 2, 3]
13:39 p6eval rakudo 35436: OUTPUT«Could not find non-existent sub perl␤current instr.: '_block14' pc 96 (EVAL_16:46)␤»
13:39 p6eval ..elf 24886: OUTPUT«Undefined subroutine &GLOBAL::perl called at (eval 119) line 3.␤ at ./elf_f line 3861␤»
13:39 p6eval ..pugs: OUTPUT«\(1, 2, 3)␤»
13:39 moritz_ and as usual, pugs permits nearly everything :-)
13:41 Matt-W In Perl 6, is there any difference between (1, 2, 3) and [1, 2, 3]?
13:42 moritz_ yes
13:42 moritz_ the former will flatten in list context
13:43 moritz_ perl6: my @a = 1, (2, 3, 4), [5, 6, 7]; say @a.perl
13:43 p6eval pugs: OUTPUT«\(1, 2, 3, 4, \(5, 6, 7))␤»
13:43 p6eval ..rakudo 35436: OUTPUT«[1, 2, 3, 4, [5, 6, 7]]␤»
13:43 p6eval ..elf 24886: OUTPUT«[1,2,3,4,[5,6,7]]␤»
13:43 moritz_ note that rakudo and elf say the same thing, elf just omits the whitespaces
13:49 masak Matt-W: (1,2,3) is a List, [1,2,3] is an Array.
13:49 Matt-W aaaah
13:49 masak moritz_: that's a bug in Elf, I'd say.
13:49 moritz_ yet a List also .perl'ifies ilke an array
13:49 moritz_ masak: why is it a bug?
13:50 masak Matt-W: List objects are immutable, Arrays are mutable.
13:50 Matt-W so [1, 2, 3] gives you a single object, which can then be stuck into a list as an element
13:50 Matt-W rather like an anonymous array reference in perl 5, in some situations
13:50 masak moritz_: um, now that I think about it, it isn't...
13:50 Matt-W how convenient :)
13:50 masak moritz_: I was confusing .perl with stringification.
13:50 moritz_ neither S02 nor S29 define a format for the output
13:50 masak moritz_: you're right.
13:50 masak should they?
13:51 masak I mean, is there a good reason to?
13:51 moritz_ not really
13:51 moritz_ for things as complicated as subroutines I'm sure the implementations will differ
13:52 masak maybe warn people not to depend on implementation specifics in .perl methods?
13:52 maerzhase joined #perl6
13:52 moritz_ that's a topic for user-level documentation, not design documents
13:53 Matt-W I'd have thought it was acceptable to provide any alternative that parses back to the original structure
13:53 moritz_ aye, that's the current spec
13:53 masak moritz_: I see S29 as user-level documentation.
13:54 masak I think that's why I care about it the way I do.
13:55 moritz_ masak: compare it to perlfunc in verbosity, and you'll see that it's not nearly there
13:56 masak I know. :/
13:56 jimmy_ joined #perl6
13:56 masak I prefer to compare it to Ruby's ri.
13:56 jimmy_ hello masak.
13:56 Matt-W well it might be one day
13:57 Matt-W we're still in early days here when it comes to docs
13:57 jimmy_ rakudo: say self;
13:57 p6eval rakudo 35436: OUTPUT«Lexical 'self' not found␤current instr.: '_block14' pc 51 (EVAL_15:38)␤»
13:57 moritz_ I think that's something we should discuss with @Larry when we get to it
13:58 masak 你好, jimmy_
13:58 moritz_ but I don't see anybody complaining about too much user-level documentation in any of the synopsis documents
13:59 moritz_ so that topic can wait
13:59 Matt-W There isn't any user-level documentation in most of the synopses :)
14:00 * jimmy_ is going to game.
14:00 moritz_ there are occasional "to achieve $perl5_feature do $this instead" comments
14:02 Matt-W it's not really a comprehensive attempt at user-level documentation
14:02 riffraff joined #perl6
14:02 Matt-W I've made a couple of abortive attempts at a Perl 6 tutorial thingy
14:02 masak I think having a good REPL and ri/perldoc-like thing ready for Rakudo 1.0 would be a worthwhile goal.
14:02 Matt-W yes
14:02 masak sometimes I think Envy should be one of the Perl virtues.
14:03 masak look at what Ruby has :)
14:03 masak http://poignantguide.net/ruby/expansion-pak-1.html
14:03 Matt-W there needs to be Perl 6 for Perl 5 Hackers too
14:03 masak aye, definitely.
14:03 masak if you want the O'Reilly contract, start writing the manuscript now.
14:04 Matt-W I did have a chapter published once in someone else's book
14:04 moritz_ Matt-W: Perl6::Perl6::Differences and my 5-to-6 blog both aim in that direction
14:04 Matt-W moritz_: excellent
14:04 Matt-W I was sure I wasn't the only person thinking about it
14:05 moritz_ speaking if writing... if all goes well I'll write an article about Perl 6 Regexes for one of Germanies most reputable IT magazines
14:06 Matt-W Excellent
14:06 Matt-W I shall have to brush up on my German
14:06 moritz_ s/if/of/
14:07 moritz_ sadly I have to assign them the copyright, so I can't publish it freely
14:07 masak moritz_++
14:07 masak I guess there's not much room for negotiation there.
14:08 Matt-W You just have to live with that sometimes
14:08 Matt-W At least you'll be getting the word out
14:08 moritz_ and on the bright side it'll also bring me some money
14:09 moritz_ not very much, but perhaps half of my tuition fees for the semester :-)
14:09 Matt-W That's not to be scoffed at
14:09 Matt-W The only thing I've made serious headway on with regard to Perl 6 documentation is a set of slides loosely based on some Perl 5 ones I did for work
14:09 Matt-W but about Perl 6 instead
14:10 Matt-W the trouble is I keep being tempted to compare to Perl 5, whereas I just want to present it as its own thing
14:10 donaldh moritz_: where does your 5 to 6 blog reside?
14:10 moritz_ donaldh: http://perlgeek.de/blog-en/perl-5-to-6/
14:10 Matt-W Also I need to do more coding in Perl 6 to get the depth of knowledge to write the thing accurately
14:10 moritz_ it's not been very active lately
14:12 donaldh some useful examples all the same
14:12 moritz_ they are not tailored to work with present day rakudo
14:12 moritz_ more to show off, and generate some interest
14:14 Matt-W It's good stuff though
14:16 moritz_ thanks
14:18 mdxi seconded. very good stuff :)
14:18 masak thirded. kudos.
14:18 moritz_ OH NOEZ, I'VE BEEN THIRDED :-)
14:20 masak were the traffic higher here today, you'd surely have been fourthed and fifthed :P
14:20 moritz_ OMG
14:21 moritz_ people use quite a lot RSS these days
14:21 masak brave new world.
14:21 moritz_ the rss feed got 90k hits, the most popular HTML page (the link above) has about 1/10 hits
14:22 moritz_ even though many people use google reader, which caches the feed internally
14:23 avar moritz_: does the http://perlgeek.de/blog-en/ rss feed cover perl 6 and perl6-to-5 ?
14:23 avar mm, 5-to-6
14:23 donaldh moritz_++
14:25 avar evidently so
14:26 avar moritz_: your rss needs a date for each entry
14:26 moritz_ avar: http://perlgeek.de/blog-en/index.rss covers all the blog, including non-perl6-stuff
14:27 * avar saw
14:27 moritz_ avar: aye, but that freakin' blog system isn't easy :(
14:28 avar http://rakudo.de/ <- has the test suite really grown this much since last year or is it only t/spec ?
14:29 moritz_ avar: mostly t/spec has grown
14:29 moritz_ aka moved from rest of t/
14:46 elmex joined #perl6
15:05 |jedai| joined #perl6
15:12 icwiener joined #perl6
15:13 Exodist joined #perl6
15:22 ejs joined #perl6
15:26 orafu joined #perl6
15:49 * masak ♥ Rakudo
15:56 maerzhase joined #perl6
15:57 barney joined #perl6
15:59 riffraff joined #perl6
16:00 stephens joined #perl6
16:02 alester joined #perl6
16:04 pugs_svn r24887 | moritz++ | [t/spec] unfudge a passing smartmatch test (NaN ~~ NaN) for rakudo
16:05 vixey joined #Perl6
16:08 ejs1 joined #perl6
16:12 |jedai| joined #perl6
16:17 rindolf joined #perl6
16:22 jferrero joined #perl6
16:24 PZt joined #perl6
16:26 Lorn joined #perl6
16:30 rakudo_svn r35442 | pmichaud++ | [rakudo]:  Adjust reference/NCI semantics of IO.  Fixes RT #62166.
16:35 alexn_or1 joined #perl6
16:40 rakudo_svn r35443 | jonathan++ | [rakudo] Fix role composition regression from rvar branch merge; methods in the class now resolve conflicts again.
16:41 pugs_svn r24888 | moritz++ | [t/spec] unfudge test for role composition
16:42 jnthn moritz_: Ooh, damm, I had a local patch for that and forgot to apply it! :-)
16:42 awwaiid joined #perl6
16:43 moritz_ jnthn: same here, but after 5min I remembered :-)
16:43 awwaiid joined #perl6
16:43 masak probably no harm done :)
16:43 jnthn Nope. :-)
16:46 pdcawley joined #perl6
16:53 justatheory joined #perl6
17:00 |jedai| joined #perl6
17:03 hercynium joined #perl6
17:08 alexn_org joined #perl6
17:20 namenlos masak: here i am
17:20 masak namenlos: there you are. welcome.
17:21 ruoso joined #perl6
17:25 |jedai| joined #perl6
17:27 tomyan joined #perl6
17:27 tomyan std: say [*] < 1 2 3 >;
17:28 p6eval std 24888: OUTPUT«00:07 120m␤»
17:30 rakudo_svn r35444 | jonathan++ | [rakudo] Add more type registry implementation. For now it's not enabled, as it causes us to regress two sanity tests and 20ish spectests; follow up commits will deal with this.
17:36 eric256 joined #perl6
17:36 * eric256 wades in through 6 inches of snow ;)
17:38 Lorn_ joined #perl6
17:39 azawawi joined #perl6
17:50 rakudo_svn r35445 | jonathan++ | [rakudo] Mark Bool and Order as enums, so they are seen as types during the parse.
17:51 pbuetow joined #perl6
17:59 sjn joined #perl6
17:59 charsbar joined #perl6
17:59 cookys joined #perl6
17:59 kolibrie joined #perl6
17:59 shachaf joined #perl6
18:00 rakudo_svn r35446 | jonathan++ | [rakudo] Fix up type variable declaration handling in is_type.
18:00 shachaf joined #perl6
18:00 sjn joined #perl6
18:00 kolibrie joined #perl6
18:01 perl6examples joined #perl6
18:01 eric256 mberends++
18:10 Psyche^ joined #perl6
18:20 rakudo_svn r35447 | jonathan++ | [rakudo] The term action was emitting sub calls incorrectly (not doing namespace lookups), however we didn't notice in a couple of tests because of the typename hack. The type registry picks this up. This patch is from rakudoreg branch, with updates to follow other changes to
18:20 rakudo_svn ..this action method.
18:20 rakudo_svn r35448 | jonathan++ | [rakudo] Make enums declare the types they introduce in the block symbol table.
18:27 meppl good night
18:30 rakudo_svn r35449 | jonathan++ | [rakudo] Refinement types need to do the Abstraction role.
18:31 [particle]1 joined #perl6
18:36 |jedai| joined #perl6
18:45 ryanc joined #perl6
18:48 charsbar joined #perl6
18:48 jnthn moritz_: ping
18:49 jnthn oh, don't worry actually...misread a fudge directive
18:52 pugs_svn r24889 | jnthn++ | [t/spec] Change a todo to a skip, since Rakudo will barf on it once it starts caring that types have been declared (e.g. soon).
18:53 PerlJam jnthn: oh!  How soon is soon?  Does that mean that my $x = Foo.new will barf if it hasn't seen Foo ?
18:55 jnthn PerlJam: Yes.
18:55 PerlJam cool.
18:56 jnthn > my $x = Foo.new;
18:56 jnthn Could not find non-existent sub Foo
18:56 lambdabot <no location info>: parse error on input `='
18:56 PerlJam So ... soon like in the next day or so?  or the next week?  or ... ?
18:56 jnthn (For now. But I've got some other bits to STD.pm to try and pull in also.)
18:56 jnthn PerlJam: I'm down to one failing spectest.
18:56 jnthn So maybe even today.
18:57 PerlJam jnthn++
18:57 [particle] jnthn: you may regress the one test, if you can't figure it out soon
18:57 jnthn However, the one that fails reveals something kinda...interesting...that I wanna discuss with pmichaud.
18:57 jnthn [particle]: I know what it is now.
18:57 [particle] ah, nice. what is it?
18:58 jnthn It's a lexical vs package scoping confusion.
18:58 jnthn It's only been thrown up by one test. But it hurts.
19:01 jnthn Writing class foo {} and sub Bar {} will have correct behaviour once I put in the grammar.pg patch. Just checked that one. :-)
19:01 mberends joined #perl6
19:26 |jedai| joined #perl6
19:27 Matt-W jnthn++ # fixing the  bug I found yesterday
19:27 jnthn Matt-W: Thanks for reporting and writing the test. :-)
19:28 Matt-W Least I can do
19:28 Matt-W Since I don't understand the compiler :)
19:28 riffraff joined #perl6
19:35 estrabd joined #perl6
19:40 maerzhase joined #perl6
19:59 vixey joined #Perl6
20:03 |jedai| joined #perl6
20:05 OuLouFu joined #perl6
20:10 rakudo_svn r35454 | infinoid++ | [cage] Fix a t/codingstd/cuddled_else.t failure.
20:32 DemoFreak joined #perl6
20:35 |jedai| joined #perl6
20:42 _dh left #perl6
20:53 [particle]1 joined #perl6
21:09 mberends Hi everyone, you're welcome to browse a new Rakudo HTTP::Daemon running at http://autoexec.demon.nl:8888/ , the source code is within http://github.com/eric256/perl6-examples/tree/master
21:09 eric256 mberends++ ;)
21:10 eric256 i get a can't establish connection at that address btw
21:10 eric256 ohh and its up ;)
21:10 eric256 nice
21:10 mberends I'm being #perl6-bombed and #parrot-bombed!
21:11 eric256 nothing like a little stress testing
21:11 eric256 now we just need to hack in a working Net IO ;) so you don't have to fork out to netcat
21:12 mberends holding up though, about 2 seconds to render each page. Nice visitor log on the console.
21:12 eric256 is there a perl6 CGI module ;)
21:12 [particle]1 yes, in pugs repo
21:12 [particle]1 don't know if it compiles on rakudo, though
21:12 mberends a bit of one in November...
21:13 eric256 i get a failed to connect 2 out of 3 tries
21:13 mberends quite a few others are getting through, still a page every 2 seconds
21:13 eric256 oh cool. i wanted to write a DVD/Blue Ray collection managment website. might be fun to build in perl6
21:15 perl6examples joined #perl6
21:22 mberends joined #perl6
21:26 pugs_svn r24890 | Ovid++ | Tests for the 'trim' builtin.
21:26 pugs_svn r24890 | Ovid++ |
21:26 pugs_svn r24890 | Ovid++ | This is not currently specced, but it's being discussed and I've implemented
21:26 pugs_svn r24890 | Ovid++ | the core feature (the bit apparently agreed upon).
21:26 pugs_svn r24890 | Ovid++ |
21:26 pugs_svn r24890 | Ovid++ | Not sure what to say about trimming lists.
21:26 |jedai| joined #perl6
21:32 * eric256 sees talk about moving rakudo to git and is excited ;)
21:33 mberends now a Googlebot has asked for my robots.txt file. no such luck, Google.
21:34 eric256 wow taht was fast... google hit the IRC log already i'm guessing?
21:34 mberends I have no idea how those messages travel
21:35 moritz_ eric256: the irc log has enough backlings (in the order of 1k) and changes daily, so google sees reason to re-crawl it daily
21:39 DemoFreak joined #perl6
21:42 AzureStone joined #perl6
21:55 mberends is someone here browsing from ournaturalcompanions.com ?
21:59 c9s_ joined #perl6
22:00 kisu_ joined #perl6
22:11 |jedai| joined #perl6
22:17 Whiteknight joined #perl6
22:19 donaldh joined #perl6
22:24 ovid joined #perl6
22:26 pasteling "ovid" at 82.152.164.233 pasted "Bug? Method 'perl' not found for invocant of class 'Match'" (11 lines, 667B) at http://sial.org/pbot/34406
22:26 ovid That's breaking my new version of Test.pm.
22:27 moritz_ ovid: that's a sad, known "feature"
22:27 ovid :(
22:27 ovid Crud.  I'll need to work around it.  Most of the spectests pass with the new Test.pm (the biggest difference is the have/want diagnostics)
22:31 mdxi is it ok to be stoked about finally stumbling on the synopses yesterday morning, and thinking they are full of awesome? or should i just be ashamed of somehow not being aware of them for this long?
22:34 moritz_ mdxi: I'm constantly amazed when I discover a new section that I never understood before
22:36 |jedai| joined #perl6
22:37 _dh joined #perl6
22:38 pugs_svn r24891 | moritz++ | [t/spec] more tests for initializing parent attributes
22:39 ovid mdxi: That's perfectly fine. Plenty of people are going to be astonished when they see what Perl 6 can pull off.
22:40 pasteling "ovid" at 82.152.164.233 pasted "Known bug? Method '!.^' not found for invocant of class 'Exception'" (10 lines, 641B) at http://sial.org/pbot/34407
22:40 moritz_ rakudo: try { die "Goodbye cruel world!" };say $! ~~ Exception
22:40 p6eval rakudo 35458: OUTPUT«1␤»
22:41 moritz_ ovid: looks like a (to me unknown) parse bug
22:41 ovid OK.  I'll file it.  Test.pm is going to take a while :)
22:43 eric256 whats does .^ do?  (/me assumes it has something to do with inheritance...dunno)
22:44 moritz_ eric256: it calls a method on the meta class, or proto object or whatever it's called
22:44 eric256 moritz_: hmmm well that sounds as if i was in the right ball park
22:45 eric256 is that something like $!.HOW.isa("Exception") then?
22:45 moritz_ eric256: yes
22:46 [particle] my class Array is instead { ... }; # can take care of lexically replacing Array
22:46 eric256 rakudo: try { die "Goodbye cruel world!" };say $!.HOW.isa("Exception")
22:46 p6eval rakudo 35458: OUTPUT«too few arguments passed (2) - 3 params expected␤current instr.: 'parrot;P6metaclass;isa' pc 107 (runtime/parrot/library/P6object.pir:155)␤»
22:47 eric256 rakudo: try { die "Goodbye cruel world!" };say $!.HOW
22:47 p6eval rakudo 35458: OUTPUT«get_string() not implemented in class 'P6metaclass'␤current instr.: 'print' pc 18303 (src/builtins/io.pir:26)␤»
22:49 ovid rakudo: my $foo = "asdf";say $foo.HOW.isa("Exception")
22:49 p6eval rakudo 35458: OUTPUT«too few arguments passed (2) - 3 params expected␤current instr.: 'parrot;P6metaclass;isa' pc 107 (runtime/parrot/library/P6object.pir:155)␤»
22:49 moritz_ rakudo: say "abc".isa(Exception)
22:49 p6eval rakudo 35458: OUTPUT«0␤»
22:50 moritz_ for real world code .isa (inheritance) or ~~ (type conformance) is usally enough
22:50 jnthn ovid: When calling methods on the metaclass, you also need to pass along the invocant.
22:50 jnthn rakudo: my $foo = "asdf";say $foo.HOW.isa($foo, "Exception")
22:50 p6eval rakudo 35458: OUTPUT«0␤»
22:51 jnthn But there's a special syntax for that.
22:51 jnthn rakudo: my $foo = "asdf";say $foo.^isa("Exception")
22:51 p6eval rakudo 35458: OUTPUT«0␤»
22:51 jnthn Which calls it on HOW and passes $foo along as well.
22:51 pugs_svn r24892 | moritz++ | [t/spec] svn props on trim.t (use util/add-svn-props.{pl,sh})
22:52 ovid jnthn: I'm not sure I understand.  I mean, I *know* what you're saying is right, but how does that relate to the bug with try { die "Goodbye cruel world!" };say $!.^isa("Exception")?
22:53 jnthn ovid: I hadn't read *that* bit. ;-)
22:53 jnthn Oh
22:53 moritz_ jnthn: that's a parse error, it complains about not being able to call method !.^isa
22:53 moritz_ erm, !.^
22:54 moritz_ but that ! actually belongs to $!
22:54 moritz_ missing LTM fail?
22:54 ovid Yeah, it looks like a parse error, but ...
22:54 ovid rakudo: try { die "Goodbye cruel world!" };say $!.HOW.isa("Exception")
22:54 p6eval rakudo 35458: OUTPUT«too few arguments passed (2) - 3 params expected␤current instr.: 'parrot;P6metaclass;isa' pc 107 (runtime/parrot/library/P6object.pir:155)␤»
22:54 jnthn rakudo: try { die "OMGWTFBBQ" }; say $!.WHAT;
22:54 p6eval rakudo 35458: OUTPUT«Exception␤»
22:54 moritz_ rakudo: try { die "Goodbye cruel world!" };say$!.HOW.isa($!, "Exception")
22:54 p6eval rakudo 35458: OUTPUT«say requires an argument at line 1, near "$!.HOW.isa"␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
22:54 ovid That also fails.  My new Test.pm is failing a few tests is failing because of that.
22:54 moritz_ rakudo: try { die "Goodbye cruel world!" };say $!.HOW.isa($!, "Exception")
22:54 p6eval rakudo 35458: OUTPUT«1␤»
22:55 jnthn rakudo: try { die "OMGWTFBBQ" }; say $!.^isa(Exception);
22:55 moritz_ ovid: if you use .HOW, you have to duplicate the $!
22:55 p6eval rakudo 35458: OUTPUT«Method '!.^' not found for invocant of class 'Exception'␤current instr.: '_block14' pc 99 (EVAL_20:55)␤»
22:55 ovid Ah!  That's the workaround :)
22:55 jnthn rakudo: try { die "OMGWTFBBQ" }; say ($!).^isa(Exception);
22:55 p6eval rakudo 35458: OUTPUT«Method '!.^' not found for invocant of class 'Exception'␤current instr.: '_block14' pc 99 (EVAL_20:55)␤»
22:55 ovid rakudo: try { die "Goodbye cruel world!" };say $!.WHAT eq "Exception"
22:55 p6eval rakudo 35458: OUTPUT«1␤»
22:55 moritz_ ovid: no, it's specced that way
22:55 ovid It's not great, but it might do for now.
22:55 * jnthn is consused
22:55 moritz_ .HOW doesn't give you enough information for introspection
22:56 ovid jnthn: I'm consused, too ;)
22:56 jnthn Well, it's more than one metaclass may represent many classes, so you have to say which one you mean. :-)
22:56 moritz_ the only thing wrong in Rakudo is the parse error
22:56 jnthn I'm confused why ($!).^isa is also broke though.
22:57 jnthn rakudo: eval '$!.^isa(Exception)'; say $!;
22:57 p6eval rakudo 35458: OUTPUT«Use of uninitialized value␤␤»
22:57 * jnthn was expecting the parse error...
22:57 justatheory joined #perl6
22:58 eric256 rakudo: try { die "Goodbye cruel world!" };my $x = $!; say $x.^isa("Exception")
22:58 p6eval rakudo 35458: OUTPUT«Method '!.^' not found for invocant of class 'Exception'␤current instr.: '_block14' pc 119 (EVAL_20:60)␤»
22:58 eric256 doesn't appear to be a parse error.
22:58 eric256 well maybe, is that a compiler optimization + parse error? lol
22:59 jnthn say $!.^isa(Exception);
22:59 jnthn rakudo: say $!.^isa(Exception);
22:59 p6eval rakudo 35458: OUTPUT«0␤»
22:59 moritz_ eric256: the ! in the error mesasge shouldn't be there
22:59 jnthn Oh!
22:59 moritz_ erm
22:59 moritz_ wait
22:59 jnthn Why did it work there. :-|
23:00 jnthn rakudo: $! = Exception.new; say $!.^isa(Exception);
23:00 p6eval rakudo 35458: OUTPUT«1␤»
23:00 eric256 see not a parse error
23:00 moritz_ right
23:01 jnthn rakudo: $! = Exception.new; say $!.PARROT; try { die "seriously wtf?" }; say $!.PARROT
23:01 p6eval rakudo 35458: OUTPUT«Perl6Scalar->Perl6Exception␤Method 'PARROT' not found for invocant of class 'Exception'␤current instr.: '_block14' pc 142 (EVAL_19:61)␤»
23:01 jnthn Aha.
23:01 |jedai| joined #perl6
23:02 jnthn Type mapping issue. Somehow.
23:04 moritz_ rakudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new(:y<2>, B{ :x<1> } ); say $o.y.perl; say $o.x.perl;
23:04 p6eval rakudo 35458: OUTPUT«undef␤"1"␤»
23:04 moritz_ jnthn: that's a nice bug I just submitted
23:05 moritz_ ironically the initialization of the parent attribute (the more complicated thing) worked, the :y<2> did not
23:06 jnthn Maybe introduced in rvar which refactored class construction, or maybe dates back before then.
23:06 eric256 akudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new(A{ :y<2> }, :x<1> ); say $o.y.perl; say $o.x.perl;
23:06 eric256 rakudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new(A{ :y<2> }, :x<1> ); say $o.y.perl; say $o.x.perl;
23:07 eric256 rakudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new(A{ :y<2> }, :x<1> ); say $o.y.perl; say $o.x.perl;
23:07 p6eval rakudo 35458: OUTPUT«"2"␤undef␤»
23:07 eric256 unicode hates me
23:07 eric256 rakudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new(A{ :y<2> }, A{ :x<1> ); say $o.y.perl; say $o.x.perl;
23:07 p6eval rakudo 35458: OUTPUT«Statement not terminated properly at line 1, near "(A{ :y<2> "␤␤current instr.: 'parrot;PGE;Util;die' pc 129 (runtime/parrot/library/PGE/Util.pir:83)␤»
23:07 eric256 ]arg
23:07 eric256 rakudo: class A { has $.x }; class B is A { has $.y }; my $o = B.new( :y<2> , A{ :x<1> }); say $o.y.perl; say $o.x.perl;
23:07 eric256 unicode and my keyboard both hate me
23:07 moritz_ forgot at }
23:07 p6eval rakudo 35458: OUTPUT«undef␤"1"␤»
23:07 * eric256 gives up and goes to sleep
23:08 moritz_ good idea, actually
23:08 moritz_ it's already tomorrow
23:08 eric256 yea the } and the Enter are too close
23:08 jnthn Hmm. Don't have any immediate fix for that Exception issue.
23:08 moritz_ it can be really annoying that on German keyboards ~ and Enter are too close
23:08 moritz_ sometimes I want to write 'rm *~' to get rid of the vim backup files
23:09 moritz_ and you know what happens when I hti the Enter key instead of ~ ;-)
23:09 eric256 thank goodnees your using revision control ;)
23:10 moritz_ not for my home dir :/
23:10 moritz_ I probably should :)
23:10 rakudo_svn r35459 | moritz++ | [rakudo] implement Str.trim, patch courtesy by Ovid++
23:10 ovid Yay :)  My first "real" Perl 6 patch.  I'm so proud :)
23:11 jnthn ovid++ # nice work!
23:11 jnthn S29 needs a patching too, to add trim, if that didn't already happen. :-)
23:12 * jnthn should really get around to working on S14 at some point soonish too.
23:12 ovid Thanks.  It wasn't an impressive task, but it was a nice introduction to pir.
23:12 eric256 looks like try creates a Failure not an exception? but the Failure pir has a !exception method...whats the ! mean in parrot?
23:12 [particle]1 joined #perl6
23:13 jnthn We use ! for "private" usually. eric256: The problem is that somehow the Parrot Exception doesn't get given various methods it would normally inherit from Object, though, it seems.
23:13 |jedai| joined #perl6
23:14 jnthn As in, Parrot's Exception class and Rakudo's Object class. So much mapping "fun"!
23:15 ovid Known?  Method 'perl' not found for invocant of class 'Iterator'
23:15 eric256 well the !exception method in Failure.pir creatse an Exception object if it doesn't already have an exception... i think pir might hurt my head at this point
23:15 moritz_ ovid: not to me
23:15 ovid Sigh.  Another one to reduce to a minimal test case :)
23:15 moritz_ ovid: masak would be so proud ;-)
23:16 ovid Now to figure out what the goldbach conjecture is doing :)
23:16 ovid Who is masak?
23:16 moritz_ our chief bug reporter
23:16 moritz_ and developer of a Perl 6 wiki engine
23:17 jnthn Probably half of the RT queue is his reports. :-) masak++
23:17 jnthn (If not more...)
23:17 moritz_ half of the RT tickets in the perl6 queue are his, I think
23:17 ovid Oops!  I should pay more attention.
23:17 aindilis joined #perl6
23:18 * eric256 forgets to check the volume nob on his radio before cursing at it for not working
23:19 Limbic_Region joined #perl6
23:23 * moritz_ *really* goes to bed now
23:25 ovid Larry says that @array.trim should die with 'no such method' because of @array >> .=trim.  How would I implement that?
23:26 [particle]1 check  that the param does Scalar?
23:27 [particle]1 wait, won't the sig already check for that?
23:27 ovid Is it sub 'trim' :method :multi('Str')?
23:27 ovid I have sub 'trim' :method :multi(_)
23:27 [particle]1 likely, yes
23:28 ovid I'll try that.
23:28 [particle]1 it might be (['Str'])
23:28 [particle]1 that bit of syntax has recently been discussed, not sure what's current
23:28 aindilis joined #perl6
23:31 jnthn Does this mean that maybe it's just a method on Str, not on Any?
23:31 ovid It looks like "sub 'trim' :method :multi('Str')" works just fine.
23:34 ovid jnth: Yeah, that's what it would mean.  Hmm ... I'm not sure if that's what would be intended.
23:36 ovid I also asked "Won't that fail with 'No such method' on an array of hashes? Or are hyperops applied recursively?"
23:37 [particle]1 you can do >> .keys.trim
23:38 [particle]1 hrmm, maybe it'd be @array>>.values.keys.trim;
23:38 [particle]1 if you want to trim the keys of the hash
23:39 [particle]1 >> is probably going to iterate over @array.values, so it's probably just .keys.trim
23:39 jnthn I think it's recursively.
23:39 jnthn I think hyperops also work over hashes.
23:39 jnthn I didn't implement that bit though.
23:39 [particle]1 i guess i have some re-reading to do :)
23:40 jnthn I looked at the hashes bit and thought...OK, another day. :-)
23:41 eric256 wouldn't that be @array>>.key.trim ? i was thinking >> would be like .key.trim for @array (but that might not be the case)
23:41 ovid Wow! It's astonishing how many bugs my new Test.pm has exposed! :(
23:42 [particle]1 what is Pair.trim going to do? that's the question.
23:42 kane_ joined #perl6
23:44 jnthn ovid: Look forward to the tickets. ;-)
23:46 ovid jnthn: far too many right now. I'm going to send my new Test.pm as an attachment (not a patch) to perl6-compiler to see if I've just screwed up royally.
23:47 jnthn ovid: It's also possible you're touching on stuff that's not implemented yet.
23:48 eric256 ovid:  you can put it up in http://github.com/eric256/perl6-examples/tree/master/lib if you want a place where other people can hack on it outside the official repo
23:54 [particle]1 where is test.pl in the perl 5 source?
23:54 [particle]1 i'm just looking online at the repo, don't have a checkout
23:54 [particle]1 ah, found it in t/
23:56 pasteling "ovid" at 82.152.164.233 pasted "Sample Test.pm" (257 lines, 7.3K) at http://sial.org/pbot/34409
23:56 ovid eric256:  I'm tired and need to go to bed, so if you want to see what I did for languages/perl6/Test.pm, just check that paste.
23:56 aindilis` joined #perl6
23:56 |jedai| joined #perl6
23:56 ovid Great timing :)

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

Perl 6 | Reference Documentation | Rakudo