Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-10-27

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
01:00 alester joined #perl6
01:00 PZt joined #perl6
01:02 justatheory joined #perl6
01:10 hercynium joined #perl6
01:14 agentzh azawawi: is there anything to be done on my part? ;)
01:15 agentzh *on my side
01:43 hercynium_ joined #perl6
01:44 charsbar joined #perl6
02:15 alc joined #perl6
02:19 alanhaggai joined #Perl6
02:30 agentzh left #perl6
02:31 agentzh joined #perl6
02:33 simcop2387 joined #perl6
02:46 alanhaggai_ joined #Perl6
03:41 justatheory joined #perl6
03:55 sri_kraih joined #perl6
03:58 Psyche^ joined #perl6
04:17 [particle] joined #perl6
04:27 Auzon joined #perl6
05:14 spx2 joined #perl6
05:16 azawawi hi
05:16 azawawi agentzh: none... things are perfect ;-)
05:21 azawawi @tell moritz_ the synopsis is now up2date with the latest small|full links. I think we should put a message when a 404 is received.
05:21 lambdabot Consider it noted.
05:24 azawawi @tell agentzh what is the cron schedule for docs/feather/script/update-syn?
05:24 lambdabot Consider it noted.
05:24 azawawi agentzh++
05:24 azawawi work &
05:31 chrisdolan joined #perl6
05:32 chrisdolan Rakudo closures in regexps: they're just PIR, not Perl6, right?
05:35 wayland76 Example?
05:39 chrisdolan m/ foo {{ say "foo found" }} /
05:39 Bzek joined #perl6
05:40 chrisdolan PGE defaults to PIR and I can't see anywhere that Rakudo overrides that default with the :lang adverb
05:43 wayland76 rakudo: m/ foo {{ say "foo found" }} /
05:43 p6eval rakudo 31963: RESULT[{ ... }]
05:43 wayland76 rakudo: say m/ foo {{ say "foo found" }} /
05:43 p6eval rakudo 31963: OUTPUT[_block15␤]
05:44 chrisdolan Err, I should probably have asked in #parrot...
05:44 wayland76 Well, chris, you're beyond me :).  Based on past experience, I'd say that there's probably no-one listening now except you and me, but if you hang around for a while
05:44 wayland76 ...people usually start turning up a few hours from now
05:45 wayland76 You could try, anyway
05:45 wayland76 (try the #parrot channel, that is)
05:46 wayland76 btw, those results we saw come back from rakudo are beyond my understanding :)
05:47 chrisdolan rakudo: "a" ~~ m/ a {{ say "hi" ~ "bye" }}/
05:47 p6eval rakudo 31963: OUTPUT[error:imcc:syntax error, unexpected '~', expecting '\n' ('~')␤      in file 'EVAL_12' line 3␤hi␤]
05:48 chrisdolan rakudo: "a" ~~ m/:lang('Perl6') a {{ say "hi" ~ "bye" }}/
05:48 p6eval rakudo 31963: OUTPUT[Null PMC access in invoke()␤current instr.: '_block17_corou' pc 231 (EVAL_11:97)␤]
05:49 chrisdolan oops
05:49 chrisdolan rakudo: "a" ~~ m/:lang(Perl6) a {{ say "hi" ~ "bye" }}/
05:49 p6eval rakudo 31963: OUTPUT[invoke() not implemented in class 'Perl6::Compiler'␤current instr.: '_block17_corou' pc 231 (EVAL_11:97)␤]
05:50 chrisdolan So, I can explicitly tell PGE to compile closures as Perl6, but it fails to execute
05:59 ylsid joined #perl6
06:10 pbuetow joined #perl6
06:26 wayland76 Could be a bug.  Have you looked at the Rakudo bug tracker yet?
06:27 wayland76 (btw, I hadn't clicked that regexes could work that way -- cool :) )
06:31 agentzh @tell azawawi daily: 01 * * * * nice -n5 /home/agentzh/update-syn
06:31 lambdabot Consider it noted.
06:40 ashizawa joined #perl6
07:26 adc_Penner joined #perl6
07:45 Khisanth joined #perl6
07:46 iblechbot joined #perl6
07:51 adc_Penner2 joined #perl6
07:55 tewk_ joined #perl6
08:18 bacek_ joined #perl6
08:21 duzy joined #perl6
08:24 ylsid joined #perl6
08:28 araujo joined #perl6
08:29 ejs joined #perl6
08:36 Bzek joined #perl6
08:37 duzy hi, all, somebody knows how to avoid a Perl6 grammar <ident>* eat the last '\n' of a string like "abc def asd \n"
08:38 duzy i'm trying to parse a space separated string, but <ident>* will eat the last "\n", this is what I want to avoid...
08:40 pmurias joined #perl6
08:44 smg joined #perl6
08:46 schmalbe joined #perl6
08:55 cosimo joined #perl6
09:20 penk joined #perl6
09:40 tomyan joined #perl6
09:40 elmex joined #perl6
09:53 yantom joined #perl6
10:06 araujo joined #perl6
10:11 ruoso joined #perl6
10:18 pmurias ruoso: hi
10:22 ruoso hi pmurias
10:23 smg joined #perl6
10:23 pmurias ruoso: do you still believe in using token names in the MOP?
10:24 pmurias i just relised that add_macro uses the multi token name ;)
10:24 ruoso I was thinking that maybe the thing that receives the AST and returns the object might already call the specific metaclass method
10:26 pmurias in the real compiler we need to construct classes and subs as we go in order for BEGIN to work
10:28 ruoso right... and we can make the compiler pluggable for each of this contructors
10:28 ruoso including the built-ins
10:28 ruoso but that's after bootstrap
10:29 ruoso for now we can just assume to know "knowhow", "class" and "module"
10:30 ruoso and if we leave the initialization of the class to this compiler plug-in, we can have whatever API in the Meta
10:30 ruoso since it will be handwritten anyway
10:31 pmurias does a module have a metainstance?
10:35 ruoso well, a module is an object..
10:36 wolv joined #perl6
10:48 pmurias we also have to know "role"
10:57 elmex_ joined #perl6
11:02 gp_davied joined #perl6
11:05 pasteling "huehuehue" at 125.164.119.100 pasted "aw" (1 line, 4B) at http://sial.org/pbot/32894
11:09 ruoso pmurias, yes... yes... role...
11:10 pmurias :)
11:10 gp_davied where is channel scanner
11:10 gp_davied i need shell
11:10 gp_davied or new rfi
11:11 pmurias rfi = ?
11:11 gp_davied remote file injection
11:22 pmurias gp_davied: i don't think you're likely to get exploits here fyi it's a publicly logged channel
11:47 bacek_ joined #perl6
11:47 penk left #perl6
11:50 simcop2387 joined #perl6
12:07 Juerd_ feather3 is at 100% cpu usage
12:07 Juerd_ Could someone have a look please?
12:08 Bzek joined #perl6
12:09 gp_davied joined #perl6
12:10 Lorn joined #perl6
12:17 Ontolog joined #perl6
12:26 |Jedai| joined #perl6
12:30 ruoso pmurias, anyway... I think we can move on with add_method and compose_role...
12:36 pugs_svn r22781 | ruoso++ | [smop-s1p] sanitizing signatures in Object.pm
12:38 ruoso pmurias, I'm unsure about ClassHOW:170
12:38 ruoso pmurias, would you mind taking a look...
12:38 ruoso ?
12:38 ruoso it's about using protoobjects in arguments to BUILDALL
12:39 pmurias i'm doing last minute bugfixing now ;)
12:44 Jedai joined #perl6
12:44 ruoso TimToady, "The default BUILD and BUILDALL are inherited from Object" in S12 seems to imply that BUILD is a method, but it's a submethod... some clarification in that section would be appreciated...
12:47 xinming_ joined #perl6
13:02 pugs_svn r22782 | ruoso++ | [smop-s1p] small fix in ClassHOW.pm
13:03 ruoso TimToady, is v6/smop/src-s1p/ClassHOW.pm:56 correct according to the spec? is that the way BUILDALL calls each BUILD?
13:08 kanru joined #perl6
13:13 iblechbot joined #perl6
13:17 pugs_svn r22783 | ruoso++ | [smop-s1p] proposed ClassHOW.add_method implementation
13:19 abra joined #perl6
13:20 pmurias ruoso: what line is ClassHOW:170 in HEAD?
13:20 ruoso sorry.. wrong line...
13:20 ruoso it's line 70
13:20 ruoso not 170
13:21 PerlJam It's a junctive dissonance?
13:45 ruoso is it sane to consider that the compiler will be smart to create the accessors for attributes on his own? or is the metaclass supposed to register the accessor when someone adds an attribute via MOP?
13:48 abra joined #perl6
13:49 * ruoso will consider that add_attribute will only create the attribute slot, not add any accessors ...
13:51 abra left #perl6
13:53 TheFluff joined #perl6
13:54 pugs_svn r22784 | ruoso++ | [smop-s1p] proposed ClassHOW.add_attribute implementation
13:58 pedrob joined #perl6
14:02 alanhaggai joined #Perl6
14:06 TJCRI joined #perl6
14:08 abra joined #perl6
14:09 jhorwitz joined #perl6
14:14 pugs_svn r22785 | ruoso++ | [smop-s1p] proposed ClassHOW.compose_role implementation
14:15 * ruoso just assumed Code has a method called "yada" that returns true if this method contains a plain ...
14:16 ruoso this is important during role_composition...
14:22 pugs_svn r22786 | ruoso++ | [smop-s1p] small typo in ClassHOW.pm identified by STD
14:31 abra joined #perl6
14:34 fronty joined #perl6
14:34 fronty left #perl6
14:38 iblechbot joined #perl6
14:42 alester joined #perl6
14:43 mj41_ joined #perl6
14:46 ruoso @tell pmurias, I was wondering if it would help if we make SMOP a p5 library, then you would be able to initialize the types in src-s1p directly... without the need to go through the m0ld compiler...
14:46 lambdabot Consider it noted.
14:49 * ruoso lunch &
15:07 Exodist joined #perl6
15:53 hercynium joined #perl6
15:54 ZuLuuuuuu joined #perl6
15:55 justatheory joined #perl6
16:00 zamolxes joined #perl6
16:03 fridim_ joined #perl6
16:20 schmalbe joined #perl6
16:33 Lorn joined #perl6
16:35 masak joined #perl6
16:37 Ontolog joined #perl6
16:38 pbuetow joined #perl6
16:44 ruoso joined #perl6
16:53 pedrob joined #perl6
17:03 masak stdparse: my Int Str $a;
17:10 pbuetow who, an Int and a Str at the same time?
17:13 masak pbuetow: I was just curious about whether that's gramatically legal
17:13 pbuetow ahh ok :)
17:13 moritz_ std: my Int Str $a;
17:13 lambdabot moritz_: You have 2 new messages. '/msg lambdabot @messages' to read them.
17:13 p6eval std 22786: OUTPUT[parsed␤]
17:13 moritz_ @massages
17:13 lambdabot azawawi said 1d 12h 12m 59s ago: im getting nouns for =begin pod comments from STD_syntax_highlight, is that the right behavior?
17:13 lambdabot azawawi said 11h 51m 49s ago: the synopsis is now up2date with the latest small|full links. I think we should put a message when a 404 is received.
17:18 masak TimToady: if I create a variable of type Int Str, what can I store in it?
17:19 [particle] is that Int|Str?
17:19 lambdabot [particle]: You have 1 new message. '/msg lambdabot @messages' to read it.
17:19 [particle] @moosages
17:19 lambdabot azawawi said 1d 21h 49m 9s ago: size results between --simple and full mode are http://feather.perl6.nl/~azawawi/simple_test/
17:21 masak [particle]: I don't know. Rakudo seems to treat it as Int&Str, which means I can't store anything in it.
17:22 [particle] i don't think i've seen two types in a row before
17:22 [particle] is there a synopsis example?
17:22 masak don't know that either, but STD seems to feel it's ok :)
17:24 [particle] blech
17:24 moritz_ aye, it parses it as two typnames
17:25 moritz_ but I wonder what the semantics are
17:25 PerlJam moritz_: I think the answer is  "wrong"  :)
17:27 masak they might be wrong.
17:27 masak I see no immediate use for writing separate type names like that
17:29 masak especially since there's already Int|Str and Int&Str
17:30 PerlJam might it be something more like  "Array of Int"  without the "of" ?
17:30 PerlJam (If I had to guess, that's where I'd go)
17:30 PerlJam otherwise, it's confusing and wrong. :)
17:31 masak PerlJam: so you mean that it maybe means something in the order of "Int of Str"?
17:31 azawawi joined #perl6
17:31 masak I'm not sure I can map that to anything sensible.
17:32 PerlJam I mean that may be its intended use and "my Int Str $foo" in an unintended consequence
17:32 masak to me, it feels like only "container" types like Array oughta be able to talk about "of"
17:32 masak PerlJam: I would argue that, if that is indeed the resulting semantics, then that's confusing and wrong, too :)
17:33 azawawi rakudo: say "good evening";
17:33 p6eval rakudo 31963: OUTPUT[good evening␤]
17:33 PerlJam Now we only need to wait for TimToady to confirm or deny  :)
17:35 smg joined #perl6
17:36 masak aye. I like this way of working.
17:38 [particle] our Boss of Me $TimToady;
17:38 masak :P
17:39 masak so the question is, is "Boss Me" legal, and does it mean the same as "Boss of Me"
17:39 moritz_ CPAN.pm-- # asking me for hundreds of optional dependencies, all of them separatel
17:39 masak CPAN.pm++ # automating installation for me in 99% of the cases
17:40 TimToady all the constraints in a parameter are ANDed together
17:40 PerlJam masak: PERL_MM_USE_DEFAULT=1 doesn't help?
17:41 TimToady including any implied by the sigil
17:41 PerlJam ah
17:41 TimToady Int Str can only contain to a type that supports both roles
17:42 TimToady note that we don't actually support junctional syntax on types
17:42 TimToady since Foo &bar is ambiguous
17:42 PerlJam so whitesapce disambiguation or not allowed?
17:42 [particle] heh
17:43 TimToady no
17:43 masak TimToady: is "5" an Int and a Str?
17:43 masak how can I store it into an Int Str $a?
17:44 [particle] class Foo is Int is Str {...}; my Foo $x .= new; my Int Str $a = $x;
17:44 masak heh
17:44 TimToady does is sufficient, you don't need is
17:44 masak so "5" isn't an Int?
17:45 TimToady are the quotes part of it?
17:45 [particle] rakudo: my Int $x = "5";
17:45 p6eval rakudo 31963: OUTPUT[Type check failed␤current instr.: 'parrot;Perl6Object;infix:=' pc 60 (src/gen_builtins.pir:52)␤]
17:45 masak yes.
17:45 masak rakudo: my Int Str $a = 5;
17:45 [particle] rakudo: my Int $x = 5;
17:45 p6eval rakudo 31963: OUTPUT[Type check failed␤current instr.: 'parrot;Perl6Object;infix:=' pc 60 (src/gen_builtins.pir:52)␤]
17:45 p6eval rakudo 31963: RESULT[5]
17:45 masak rakudo: my Int Str $a = "5";
17:45 p6eval rakudo 31963: OUTPUT[Type check failed␤current instr.: 'parrot;Perl6Object;infix:=' pc 60 (src/gen_builtins.pir:52)␤]
17:46 TimToady rakudo: my Int Str $a = "5" but Int(5);
17:46 p6eval rakudo 31963: OUTPUT[The but operator can only be used with a role or enum value on the right hand side␤current instr.: 'die' pc 13159 (src/gen_builtins.pir:8135)␤]
17:46 [particle] closer to working :)
17:47 TimToady except that C<but> will install a separate value for the Int vs the Str
17:47 TimToady so you want to compose an IntStr or something
17:47 TimToady and rakudo apparently needs to learn about punned roles/classes
17:48 PerlJam So ... this is the explicit mechanism for schizophrenic variables?
17:48 masak I'm wondering if there is any rakudobug stuff to be reported from all of this...
17:49 TimToady rakudo: class IntStr does Int does Str { ... }
17:49 p6eval rakudo 31963: OUTPUT[Method 'methods' not found␤current instr.: '!keyword_does' pc -85527 ((unknown file):-1)␤]
17:49 TimToady ?!?
17:49 masak there it is! :)
17:50 PerlJam Is the type constraint ANDing explicit in a synopsis somewhere?  I'm missing it.
17:50 masak seems user-defined roles are OK, but things like Int and Str aren't
17:51 moritz_ rakudo implements these as classes
17:52 masak moritz_: shouldn't matter, should it?
17:52 masak a class has a corresponding role automatically created for it
17:52 TimToady if you use a role as a class, it should attempt to create it for you
17:52 moritz_ that NYI ;)
17:54 masak but there's nothing wrong about 'class A does Int' is there? I'm rakudobugging it right now.
17:54 adc_Penner joined #perl6
17:54 masak oh well, it shouldn't throw that error, in any case.
17:55 meppl joined #perl6
18:16 pedrob joined #perl6
18:17 pmichaud std:  if(3<4) { say "yes"; }
18:17 p6eval std 22786: OUTPUT[parse failure␤]
18:18 moritz_ std: if(1);
18:18 p6eval std 22786: OUTPUT[cp: cannot create regular file `lex/STD/EXPR': Permission denied␤parse failure␤]
18:18 * moritz_ curses file caching
18:18 PerlJam pmichaud: you need a space on that one  :)
18:19 elmex joined #perl6
18:19 pmichaud PerlJam:  I was explicitly testing RT#60152, which doesn't have a space.
18:19 moritz_ std: if(1);
18:19 p6eval std 22786: OUTPUT[parse failure␤]
18:19 PerlJam oh.
18:19 pmichaud the ticket says that rakudo does the wrong thing here (it does), but I wanted to report what the "right thing" was, which is that it's a syntax error.
18:19 anonymous_ joined #perl6
18:19 pmichaud but I wanted to verify that before saying so.
18:20 moritz_ my local copy of STD.pm parses if(1);
18:20 pmichaud as it should.
18:20 moritz_ aye
18:21 * moritz_ heads off to table tennis
18:23 REPLeffect joined #perl6
18:26 abra joined #perl6
18:55 ruoso TimToady, just in case you didn't backlog... http://irclog.perlgeek.de/​perl6/2008-10-27#i_649346
18:55 lambdabot Title: IRC log for #perl6, 2008-10-27
18:58 pugs_svn r22787 | azawawi++ | [STD_syntax_highlight] ETOOMUCHTIME now writes errors to the
18:58 pugs_svn r22787 | azawawi++ | [STD_syntax_highlight] simple and full html instead of doing nothing.
18:58 TimToady the *default* BUILD is a method so other classes can inherit it if they don't with to define their own, but that is because the default BUILD is written generically.  the assumption is that any BUILD defined by a subclass will have specific knowledge about that class, and therefore should be a submethod
18:59 TimToady on the subject of registering things in the grammar, you can't modify the grammar by registration, only by derivation, or you essentially have monkey-typed languages in a lexical scope, which p6 prohibits
18:59 TimToady actions for existing grammatical rules are fine, of course
19:06 ruoso TimToady, but default BUILD you mean the one defined in Object
19:06 ruoso s/but/by/
19:07 ruoso TimToady, that applies for adding multi-token variants?
19:07 ruoso oh forget it... just finished parsing what you've said correctly...
19:08 ruoso I should derive the grammar to define the new multi-token variant...
19:08 pmurias joined #perl6
19:09 ruoso TimToady, but about BUILD, have you seen the code in src-s1p?
19:10 * azawawi wonders if there are any tips or tricks for speeding up STD.pm ;-)
19:10 pmurias ruoso: re add_attribute i think it adds the accessor as one of the things metaclasses are used is changing the accessor to some inferior scheme like set_foo/get_foo
19:11 TimToady azawawi: mostly just compile to an engine that actually supports p6 regexes better than p5 does  :)
19:11 TimToady that being said, there's still lots of room for optimizing STD on p5
19:12 TimToady but no easy tricks, or I'd have done them by now
19:12 azawawi TimToady: STD_syntax_highlight, 375 tests ~ 3 hours
19:13 pmurias how much of it is parsing?
19:13 azawawi TimToady: mostly in rx.t which im starting to hate ;-)
19:13 TimToady I parse the entire t/ in less than an hour
19:13 pmichaud std: my %h; %h{"key"} = "value"; say %h\{"key"};
19:13 p6eval std 22787: OUTPUT[parse failure␤]
19:13 TimToady how long does a normal 'make testt' take on your machine?
19:13 azawawi pmurias: i think we have a recursive loop in match traversal in rx.t
19:13 azawawi TimToady: im using feather1
19:14 TimToady I don't know how that compares to my laptop
19:15 PerlJam Juerd should get another grant to upgrade the hardware and setup a small cluster  :)
19:15 pmurias azawawi: i doubt it, a recusive loop wouldn't finish at all
19:15 azawawi pmurias: somehow things are pretty slow in rx.t and memory is like 450m max
19:16 pmurias azawawi: you could try a profiler
19:16 pasteling "azawawi" at 212.38.146.187 pasted "Timing STD_syntax_light" (375 lines, 26K) at http://sial.org/pbot/32904
19:17 azawawi pmurias: from these results, you can clearly see we have a problem in rx.t
19:18 azawawi pmurias: i have not tried profiling perl code before; any resources?
19:19 pmurias Devel::NYTProf?
19:20 azawawi pmurias: cant find it on feather1
19:20 pmurias azawawi: it's on cpan
19:21 azawawi pmurias: i know; is it better than Devel::DProf ?
19:22 TimToady if STD has to rebuild the cache for rx.t, it takes 450m and 1m26s
19:22 TimToady if the cache exists already, it's only 178mb and 45s
19:22 ruoso TimToady, class A { }; class B is A { submethod BUILD {...} }; class C is B { }.... I suppose A inherits BUILD from Object, B uses its own, and C inherits from Object as well...
19:22 ruoso but it goes calling BUILD from less-derived to most-derived
19:23 ruoso which means that it will end up calling the same BUILD defined in object several times
19:23 TimToady yes, which is why that one must be written *generically*
19:23 pmurias azawawi: i'm not very experienced with profilers, the only time i tried Devel::DProf it didn't work
19:24 pmurias s/not very experienced/very inexperienced/
19:24 pmurias NYTProf is line based
19:24 TimToady but you'd better have a large disk drive if you're going to use NYTProf on rx.t  :)
19:25 ruoso TimToady, but if it's generic, why does it need to be a method... I mean... why does it need to be called several times?
19:25 ruoso it could just be called as a submethod in Object
19:25 ruoso that would do the initialization for all the attributes
19:25 TimToady it's generic insofar as it knows which class it is being called on behalf of, and pretends to be a submethod for that class
19:26 ruoso hmmm... ok
19:26 TimToady but things still have to happen in the right order
19:26 azawawi TimToady: btw, im getting <noun>s from pod comments [STD.pm], is that right?
19:26 TimToady so that any user's BUILD submethod can depend on the more basic parts of the object to be there already
19:27 ruoso TimToady, right... but how does Object.BUILD knows in which context it's being called?
19:27 TimToady I don't know how you'd get a noun from a pod comment offhand
19:27 ruoso TimToady, the whitespaces are part of the token inside noun
19:27 ruoso TimToady, then it's expanding the token to the last whitespace
19:28 ruoso as pod is whitespace, it gets inside the noun
19:28 TimToady I think :keepall is the wrong approach, probably
19:29 pmurias TimToady: why?
19:29 ruoso maybe it's possible to remove the trailing whitespace from the token and leave it to be catch outside it
19:29 TimToady because it attaches the ws to the noun, for instance :)
19:30 pmurias ruoso: when you leave messages and you use @tell pmurias, .... the messages goes to pmurias, ;)
19:30 TimToady I think the generically correct solution is to invert the information on the _ array by position so we can return a linear list of tokens and interstices
19:30 TimToady we already have the _ array to keep track of information by position
19:30 ruoso pmurias, I'm aware of that... are you referring to something in particular?
19:30 TimToady that's how we map positions to line numbers
19:31 TimToady we also cache ws knowledge in the _ array
19:31 TimToady and }\n info
19:31 pmichaud off-topic:   is there a way to test an object for definedness without marking the corresponding exception as handled?
19:31 pmurias ruoso: the message you left me today
19:31 TimToady caching the inverted which-rules-matched-here info would be trivial
19:32 pmichaud in particular, I'm thinking of   my Int $x = foo();   # foo returns some sort of Failure object
19:34 * azawawi profiling S03-operators/assign.t on feather1
19:34 TimToady I suppose it could be argued that $x ends up with an undefined Int+Failure object
19:34 * ruoso ETOOMANYTHREADS
19:35 pmichaud yes, but in testing the Failure returned from foo() for definedness, aren't we also marking the exception as handled?
19:35 ruoso pmurias, I still didn't get your point... what's wrong with the message?
19:36 TimToady if the failure is copied into the Intish location, then that could be marked as unhandled, I suppose
19:37 pmichaud that sounds funny.
19:37 pmichaud (odd, not ha-ha)
19:38 TimToady well, is the electron you sent from A the same electron you noticed at B, or is it a clone?  :)
19:39 TimToady the fundamental question seems to be whether $x can store a failure if it's declared Int
19:39 pmichaud S02 already says yes.
19:39 pmichaud S02:  Variables with non-native types can always contain undefined values, such as Object, Whatever and Failure objects. See S04 for more about failures (i.e. unthrown exceptions):
19:39 TimToady (we can always fix up a "handled" after the fact, or install a .peekdefined method)
19:39 pmichaud my Int $x = undef;    # works
19:40 TimToady so there's Int protoobject, and Int with Failure mixed in
19:40 TimToady I guess
19:40 pmurias ruoso: lambdabot marked is as going to "pmurias," instead of "pmurias"
19:40 pmichaud the thing about fixing up a handled "after the fact" is that we really don't know to test for handled until after we've seen that the object is undefined
19:40 pmichaud same for cloning
19:40 TimToady so is there a mechanism whereby the mixin can make sure $x is "unhandled"?
19:40 ruoso pmurias, oh... that... how stupid..
19:41 ruoso so there might be a lot of messages for this 'pmurias,' guy
19:41 pmichaud unless assignment of a Failure always marks it as unhandled, which also sounds odd.
19:42 pmichaud anyway, I don't need an immediate answer and didn't really mean to hijack the other conversation.  Just something to think about.
19:42 pmichaud (I was primarily asking in case there was an immediate answer I hadn't seen/considered.)
19:42 TimToady I'm saying the original Failure from foo() may be marked handled, but the failureness copied into $x's Int may instill unhandleness there.  I don't think we're just binding foo's failure directly to $x
19:44 TimToady It's possible there's exact answer to "what does handled mean?", much as tainting is just a rule-of-thumbish thing
19:44 TimToady s/there's/there's no/
19:44 pmichaud fair enough.  For now, assigning a Failure marks it as unhandled, then?
19:44 TimToady I think so
19:44 pmichaud okay, thanks.
19:45 ruoso TimToady, ok... back to BUILD...
19:46 ruoso how does Object.BUILD knows which is the subclass it's intializing?
19:46 TimToady BUILDALL is essentially a dispatcher, so it uses the same mechanism as the dispatcher does (whatever that is :)
19:47 ruoso right... that's the BUILDALL aprt
19:47 ruoso *part
19:47 ruoso BUILDALL traverses the hierarchy, calling BUILD on each, from less-derived to most-derived
19:47 TimToady so it could just be a CALLER:: variable, for instance
19:48 TimToady but any dispatcher knows the actual class on whose behalf the method is being called currently
19:48 TimToady even if the invocant is a different type
19:48 ruoso hmm... ok...
19:48 TimToady so every dispather must make that info available somehow
19:48 TimToady *tch
19:49 TimToady most methods don't care about it, but if we say that every such dispatcher must keep the current class in a contextual var, the user method can get at it
19:49 ruoso so maybe it's saner for the MetaClass to define an automatic BUILD submethod if none is defined
19:50 TimToady could even call it $+CLASS (or $*CLASS maybe)
19:50 TimToady as distinguised from $?CLASS, which is compile-time constant
19:51 TimToady which is also distinguished from self.WHAT
19:51 TimToady a given object can have 3 different types at the same time :)
19:52 ruoso while I see your point... I'm pondering if defining a BUILD if there isn't one wouldn't be a better option
19:52 ruoso but maybe that's too complicated...
19:52 TimToady certainly one way to implement a generic is with an autoloader :)
19:53 ruoso let me see how the code using $+CLASS looks like...
19:53 TimToady essentially, that's just the loop variable in your dispatcher
19:53 ruoso sure... but how does it look like in Object.BUILD
19:54 TimToady sure, that's the user end of things, and I'm glad to delegate that part to you  :P
19:54 ruoso heh... I could argue defining Object is not really user-end ;)
19:55 TimToady I delegate the meta end of things too :)
19:55 ruoso heh
19:55 TimToady I really only care about the middle end
19:57 ruoso Ok... if I understand correctly, Object.BUILD should loop on all of $+CLASS attributes, and initialize them as they exist in the *%initialize...
19:57 azawawi assign.t tmon.out ~ 676m so far and growing...
19:59 ruoso hmm... the MOP needs a method to list the attributes without including the inherited ones... any suggestion for the name of such method?
20:00 TimToady I though S12 mentioned an option for that
20:00 ruoso hmm... cool..
20:00 * ruoso re-re-re-re-reading S12
20:01 TimToady S12:1983 mentions a selector parameter but doesn't name it
20:02 azawawi TimToady: about 8gb needed for to DProf rx.t ... Not bad.
20:02 ruoso TimToady, any idea on how this selector should look like?
20:02 TimToady offhand, no
20:02 TimToady probably needs to be specced.
20:03 TimToady and the current mention is in respect to the .methods method
20:03 ruoso which naturally could be extended to .attributes
20:03 TimToady maybe :where() or some such
20:03 ruoso :where<local>
20:04 TimToady :where{.depth == 0}  :)
20:05 TimToady depends on what the thing gets smartmatched against eventually, I suppose
20:05 ruoso I was considering ~~ 'local'
20:05 ruoso and I wasn't really keeping track of traverse depth...
20:05 TimToady I doubt that's what an attribute descriptor would stringify to
20:06 ruoso ah... the attribute descriptor... I was thinking about matching the :$where parameter to
20:06 TimToady anyway, there's probably a Right Way, and a Wrong Way, and a Perl WAy
20:07 TimToady could also be a .attributes where Mumble
20:07 TimToady that is, basically a grep outside the .attributes call
20:08 TimToady but that's probably suboptimal
20:08 TimToady since the internals probably keep the lists separate
20:08 ruoso I'm not sure the attribute descriptor knows where it is...
20:08 ruoso I think it's the class that lists the attribute descriptors
20:08 TimToady indeed
20:09 TimToady so basically, just a parameter to tell the class what you want back, somehow or other
20:09 ruoso so, is  :where<local> reasonable?
20:09 TimToady that has little benefit over :local
20:09 TimToady I'm leary of string options
20:09 ruoso indeed...
20:10 azawawi is feather1 on?
20:10 ruoso TimToady, so... :$local  it is
20:10 TimToady unless that's the default
20:10 TimToady and :transitive is the option
20:11 TimToady or :super, or whatever
20:11 ruoso I tend to think that the Class should appear as opaque
20:11 ruoso to the user
20:11 ruoso most of the time
20:11 TimToady nodnod
20:11 ruoso so getting a partial information of the class should not be the default, I think
20:11 * TimToady agrees
20:11 azawawi i cant seem to access feather1
20:14 TimToady I am not getting any DNS service for it, even
20:14 spx2 joined #perl6
20:14 TimToady maybe .nl got hit by an asteroid
20:14 ruoso TimToady, is calling ^methods(:local) sufficient to get a true value or does it need to be ^methods(:local(1))
20:15 TimToady :local is Bool::True
20:15 xinming joined #perl6
20:15 TimToady :!local is Bool::False
20:15 ruoso ok... that's cool
20:15 TimToady or maybe just 1 and 0
20:16 TimToady but probably typed to Bool
20:16 ruoso true in bool context
20:16 ruoso :P
20:16 azawawi @tell juerd_ feather1..3 are offline. (8:16pm gmt)
20:16 lambdabot Consider it noted.
20:16 TimToady question is whether it should bind to a Bool context
20:19 ruoso TimToady, one thing I've just figured out...
20:19 ruoso I'm initializing the attributes using the accessor...
20:19 ruoso if they are public and rw
20:19 * azawawi has nothing to do now &
20:20 ruoso that means if an attribute accessor is overriden, it might call an accessor of a subclass before the BUILD in that subclass is called
20:20 ruoso that is probably ok, since that's what overriding is...
20:20 ruoso but it should probably be noticed in the spec...
20:21 TimToady in general BUILD should only be setting $!foo, not $.foo
20:22 ruoso but should it still do that only for public and rw attributes?
20:22 ruoso and does that mean everybody trusts Object?
20:23 TimToady if you're going to delegate infrastructure to a parent class, you have to trust it
20:23 ab5tract joined #perl6
20:23 ruoso right... so that's a yes...
20:23 ruoso :P
20:24 ruoso but does it initialize only public and rw attributes?
20:24 ruoso er... initialize is a bad word...
20:24 ruoso set the value sent in the constructor or using protoobjects describes better
20:26 ruoso TimToady, and also... which is the syntax for accessing a private attribute by its string name in a class by its string name... $object.::($+CLASS)!"$name" ?
20:27 TimToady that looks about right.
20:27 TimToady BUILD can initialize private attributes as well
20:27 bacek_ joined #perl6
20:27 TimToady that is its usual mode of operation, in fact.
20:28 TimToady it doesn't care whether there's an accessor, it just sets $!foo if you pass :foo($bar)
20:28 ruoso even if it's private....
20:28 ruoso I know you seem to have just said that...
20:28 TimToady even if it's public, it sets $!
20:29 ruoso my question is if it makes sense to allow private attributes to be set in the constructor
20:29 TimToady I think it does
20:29 ruoso right... as it's a purely-design issue... I'll just take your word ;P
20:29 TimToady private attributes are the only ones that are really there
20:30 ruoso yeah... I know... there are no such thing as "public attributes"
20:30 TimToady with $.foo there's no guarantee that you own $!foo
20:30 TimToady so you shouldn't be setting up someone else's attributes virtually
20:31 ruoso $object.::($+CLASS)!"$key" = %initialize{$key};
20:31 ruoso now *that*'s a weird line
20:31 TimToady submethods are for setting up your part of the object, and not someone else's
20:33 ruoso I just wish I could commit...
20:33 ruoso TimToady, btw... I'm using $meth.yada to check if this is a {...} method
20:34 ruoso having a way to find that out is required when composing roles that degenerate to interfaces
20:35 TimToady hmm, .yada needs to be true for token { <...> } as well
20:35 ruoso ok... considering I was asking if ".yada" was a good idea ;)
20:36 TimToady we should probably recognize these at compile time, really
20:36 ruoso agreed...
20:37 TimToady if only under the policy of "if it can be determined at compile time that a piece of code will fail at run time..."
20:38 pmurias ruoso: why can't you commit?
20:38 ruoso can't connect to svn
20:38 TimToady feather was hit by an asteroid
20:38 ruoso TimToady, I think S12 implies compile-time also...
20:38 ruoso when it says the role degenerate to an interface
20:40 ruoso TimToady, it looks like STD doesn't parse $object.::($+CLASS)!"$key" as expected
20:40 pmurias ruoso: re making smop a perl5 library how does it relate to embedding perl5 in smop
20:40 pmurias ?
20:40 ruoso pmurias, it will probably make things easier in the future, but it's not entirely related
20:41 TimToady ruoso: I will look at it after lunch &
20:41 pmurias ruoso: the 2 things overlap don't they?
20:42 pmurias like having a SV RI?
20:42 ruoso yes... that is the part of making it easier in the future
20:42 ruoso but I don't think we're going to be able to callback p5 code so easily
20:43 ruoso but if we do, there's no point in embedding p5 in smop
20:43 ruoso at least in the near future
20:43 pmurias calling p5 from smop is very important
20:44 ruoso yes... that's the "future" part ;)
20:44 pedrob_ joined #perl6
20:45 ruoso in fact... if we can callback p5 from smop, it doesn't really matter who started first, p5 or smop...
20:45 ruoso the two interpreters would simply interoperate...
20:45 ruoso but my plan for p5<->smop integration is a bit more brave
20:46 ruoso I think I plan to make p5 really stackless, and eventually having a modified p5 interpreter inside smop that puts an initial pointer in the begging of SV*
20:46 ruoso being the SV RI
20:46 ruoso and allowing continuations in p5 and in SMOP
20:47 xuser joined #perl6
20:48 ruoso and then you wouldn't even know when you were running in the p5 interpreter or in the smop interpreter
20:51 ZuLuuuuuu joined #perl6
20:51 pmurias that's propably the optimal solution for p5 interop
20:52 pmurias but having smop as a CPAN module which can be used to run a given fragment of code also has some benefits
20:52 pmurias even if we would have lots of contiunation barriers
20:53 ruoso pmurias, sure sure... one of them being glue together STD5 + viv + mildew + SMOP to run p6 code
20:53 ruoso and eventually being a Moose backend
20:53 ruoso which is something that is in my mind for a while now...
20:54 ruoso but if everything goes right, we'll be able to run p6 code from inside p5
20:54 ruoso using SMOP as runtime...
20:55 * ruoso later &
20:57 spx2 is there a good description of how infix->postfix should be done on parenthesisized arithmetic expressions ? if so,where should I read this ?
20:59 xinming_ joined #perl6
20:59 pmurias spx2: parenthesisized means you don't have to do OPP?
20:59 pedrob_ joined #perl6
21:00 spx2 OPP= ?
21:01 spx2 also,I will stress that they are not fully parenthesisez expressions
21:01 spx2 I mean there can be some like 3+4*5-6*(2+3)
21:03 pmurias spx2: like in http://en.wikipedia.org/wiki​/Operator-precedence_parser
21:03 lambdabot Title: Operator-precedence parser - Wikipedia, the free encyclopedia
21:04 pmurias homework of any sort ;)
21:04 pmurias ?
21:05 spx2 pugs_svn: no,I'm working on improving my programming skills so that I will get a job not working on stupid problems
21:05 spx2 ok
21:05 spx2 http://scriptasylum.com/tutorials/infix_p​ostfix/algorithms/infix-postfix/index.htm
21:05 lambdabot Title: Infix to Postfix Conversion, http://tinyurl.com/3ygxjo
21:05 spx2 I've tried to follow this
21:06 spx2 which btw,is a simpler than the link you gave...and the author seems to have worked up a working implementation
21:06 spx2 pmurias: have you implemented something like this ?
21:06 pmurias yes
21:06 pmurias using the wikipedia link
21:06 spx2 hmm nice :)
21:06 spx2 maybe I'll look into it more
21:08 ZuLuuuuuu left #perl6
21:09 pedrob__ joined #perl6
21:23 xuser joined #perl6
21:26 zamolxes joined #perl6
21:29 Muixirt joined #perl6
21:32 pedrob joined #perl6
21:56 moritz_ can anybody access feather right now?
22:01 Muixirt hi moritz_
22:01 moritz_ hi Muixirt
22:04 Muixirt spectest_regession is still not working for S16-io/basic-open on my x86_64 Linux box
22:04 moritz_ Muixirt: did you open a ticket for that?
22:04 Muixirt no
22:05 moritz_ Muixirt: please do. rakudobug@perl.org
22:05 Muixirt I'm wondering if someone else sees that.  x86_64 Linux is quite common nowadays
22:07 pedrob joined #perl6
22:10 pedrob_ joined #perl6
22:14 pedrob__ joined #perl6
22:15 Muixirt moritz_, btw the output of make spectest_regression is littered with "Use of uninitialized value"
22:15 moritz_ I know :(
22:16 Muixirt the perl5 spits that out, right?
22:16 moritz_ no
22:16 moritz_ rakudo itself
22:16 moritz_ rakudo: say 2 + undef;
22:16 p6eval rakudo 31963: OUTPUT[Use of uninitialized value␤2␤]
22:16 Muixirt oops
22:17 moritz_ problem is, we don't have a way to disable the warnings
22:17 moritz_ somewhere in the tests we test for the value of 2+undef, and we'd like to disable the warnings
22:18 moritz_ rakudo: say try { 2 + undef};
22:18 p6eval rakudo 31963: OUTPUT[Use of uninitialized value␤2␤]
22:21 pedrob___ joined #perl6
22:29 dalek joined #perl6
22:29 pedro____ joined #perl6
22:30 wolverian joined #perl6
22:34 Juerd joined #perl6
22:34 PerlJam joined #perl6
22:37 pmichaud joined #perl6
22:40 pugs_svn r22788 | moritz++ | [t/spec] some unfudging for rakudo
22:42 masak joined #perl6
22:46 chrisdolan @find chris
22:46 lambdabot Not in scope: type variable `chris'
22:46 chrisdolan oops
22:47 masak @seen chris
22:47 lambdabot I haven't seen chris.
22:47 masak where in the world is chris? ;)
22:50 wayland76 Probably hanging out with Carmen Sandiego :)
22:50 masak as good a guess as any :)
22:54 eternaleye joined #perl6
22:59 [particle]1 joined #perl6
23:07 pugs_svn r22789 | ruoso++ | [smop-s1p] Object.BUILD is no longer a submethod, but a method that is aware of which class it is representing...
23:07 ruoso joined #perl6
23:24 sri_kraih_ joined #perl6
23:25 eternaleye joined #perl6
23:26 araujo joined #perl6
23:32 felipe joined #perl6
23:40 ruoso anyone interested... any review on v6/smop/src-s1p/Object.pm and ClassHOW.pm is very much appreciated...
23:47 masak ruoso: pleasant reading
23:47 masak Object.pm, line 121:
23:48 masak couldn't one make that line a default value of the $repr parameter in the args list instead?
23:51 masak ruoso: overall, it's refreshing to reach this kind of full-fledged Perl 6 code. we don't do stuff of this calibre yet in November. :)
23:52 ruoso masak, :P...
23:52 ruoso unfortunally this code doesn't yet compile...
23:52 ruoso but it is going to be compiled by mildew
23:52 masak ruoso: I look forward to that.
23:52 ruoso and it's going to be the actual code behind SMOP MOP
23:53 masak sounds cool.
23:54 pugs_svn r22790 | ruoso++ | [smop-s1p] make p6opaque default in the signature instead of doing inside the block, as pointed by masak++
23:59 masak ruoso: ClassHOW.pm, line 39: what are the parentheses doing?
23:59 Limbic_Region joined #perl6

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

Perl 6 | Reference Documentation | Rakudo