|
6.2.7 released! | pugscode.org/ <Overview Journal Logs> | pugs.kwiki.org | paste: sial.org/pbot/perl6 Set by autrijus on 13 June 2005. |
|||
| stevan_ | I think making roles work in an easily predictable way is extrememly important to their success | 00:00 | |
| since they are just another level of class decompostion I dont expect anyone but the OO hackers to use them | |||
| but they should still be accessible | |||
| so I really want to iron out all the edge cases if we can | 00:01 | ||
| ok back to converstation | |||
| breadth first is basically what you get when you flatten them | |||
| except there is no overlap | 00:02 | ||
| it is important in role composition that it is not order dependent | |||
| which is trivial is you flatten | 00:03 | ||
| because instead of shadowing (like in depth first traversal) conflict are just illegal | |||
| so order doesnt matter | |||
| mugwump | but it did matter at some point, when the roles themselves were combined | 00:05 | |
| stevan_ | nope | ||
| it doesnt matter | |||
| if they conflict, ... BOOM, .... error | |||
| mugwump | ok | ||
| stevan_ | so order is irrelecvant | ||
| mugwump | so the resolution process basically consists of disallowing the cases where it does matter. fine by me, so long as I can still MMD in methods etc :) | 00:06 | |
| stevan_ | yes | ||
| although MMD is a whole other topic :) | 00:07 | ||
| but thats not my dept. | |||
| 7 floors up and to the right, ask for autrijus, he is how you need to talk too :) | |||
| mugwump | sure. of course you can simplify MMD in concept by viewing the entire signature as a part of the method "name" | 00:08 | |
| but that's not important right now | |||
| stevan_ | yes, but thats just C++ style, and its not as cool | 00:09 | |
| we need type dispatched | |||
| Yuval (nothingmuch) has this whole idea of first class signatures which is really cool | |||
| but yes, not important right now | |||
| mugwump | ok, so we've got these Roles which are simply modelled as a collection of functions, including accessors for "private" attributes which are specially named so they can't conflict or even be accessed between roles etc | 00:11 | |
| stevan_ | uhm | ||
| thats adding restrictions to the roles though | 00:12 | ||
| according to @Larry, there is no such restriction | |||
| (for the record I agree with you, but its not my language) | |||
| mugwump | :) | ||
| but what restriction does Larry speak of? | 00:13 | ||
| stevan_ | LOL | ||
| none | |||
| thats the problem :) | |||
| mugwump | Unless the difference is, that role methods are actually considered a part of the class they are composed into, and so can see each other's private attributes and methods | 00:15 | |
| stevan_ | yu[ | ||
| yup | |||
| thats the idea | |||
| Roles are flattened in , and tossed out | 00:16 | ||
| think of the Role as a cellophane wrapper | |||
| you open it, put the contents in your class | |||
| and toss the wrapper out | |||
| maybe hold onto the instructions (meta-data) to handle things like does(), but thats all | 00:17 | ||
| this is how the current perl5 prototype works (without the state part | |||
| clkao | mugwump: oh, what's up with the store-password thing in svn::mirror? | ||
| mugwump | clkao: well, I think the thing missing is the connection between the svn config object and the auth baton | 00:19 | |
| but these objects are pretty much opaque and I couldn't find the docs when I was looking | |||
| mugwump ==> #svk | 00:20 | ||
| stevan_ wanders off for some foo | 00:25 | ||
| mugwump feeds stevan_ some foo at the bar | 00:31 | ||
| Khisanth | what exactly is a parrot language? | 00:36 | |
| mugwump | PIR? | 00:37 | |
| PASM? | |||
| Khisanth | ah those | ||
| stevan_ | ahhh the smell of schwarma | 01:00 | |
| poor Luke, this room is going to stink for a while ;) | 01:01 | ||
| mugwump | ok stevan_, I see now why there is a state problem. | 01:02 | |
| stevan_ | mugwump: its all about the flattening | 01:03 | |
| without it, you are correct, its not an issue | |||
| but with it, its bad | |||
| mmm, the hummus is good too | |||
| Toronto has really great food I have to say | 01:04 | ||
| mugwump | So, there are two differences between Roles and Classes. Attribute accessing and method invocation of roles is considered in the scope of the class which it is attached to | ||
| (and roles are not instantiated) | |||
| stevan_ | yes | ||
| think of the {} braces on the class as a closure | 01:05 | ||
| which is evaluated at compile time and results in the metamodel being constructed | |||
| which can potentially have some really interesting effects if you can access the metaclass in some way | 01:07 | ||
| class MyClass { for ('method1', 'method2') -> $label { $?CLASS.meta.add_method($label => sub { print $label } } } | 01:08 | ||
| stuff like that could (theoretically) be possible | |||
| mugwump | it's like Roles are non-composable Classes that have a parametric *scope* | ||
| stevan_ | yes | ||
| and Roles can be parameterized too | |||
| role Something [ .... T ] { has T $.foo } or something like that, I forget the syntax right now | 01:09 | ||
| mugwump | The Set or Tree classes are the ones that would need this and exist as working examples I guess | 01:10 | |
| stevan_ | yes actually it would allow for type checking of the nodes of the tree | 01:11 | |
| mugwump | So, the scope is basically the same thing as the "local" dispatch table (local being the composed dispatch table for a class) | ||
| stevan_ | roughly yes | 01:12 | |
| mugwump | for now I'm putting the ::Type object, and the "local" dispatch table into the same little black box | ||
| stevan_ | I am not sure about inner classes and such | ||
| mugwump | so being typable means that you get a scope | ||
| stevan_ | mugwump: yes thats pretty safe I think | ||
| mugwump | So, still it is the ::Type object that this "magic" is happening, all that's changed is that we're now using it for the Class' methods' scope | 01:13 | |
| and as the Role is not typable, their methods' scope must be attached to a ::Type | 01:14 | ||
| but you don't need to throw them away in the MetaModel, especially given you still need to answer .does | |||
| stevan_ | currently I gather all the info I need to implement does before I toss it | 01:15 | |
| QtPlatypus | ?eval class Foo { has &.subat; method retsub () { .subat()}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub; | 01:16 | |
| evalbot6 | \sub {...} | ||
| QtPlatypus | That wasn't what I expected. | ||
| ?eval class Foo { has &.subat; method retsub () { .subat()}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub.(); | 01:17 | ||
| evalbot6 | 2 | ||
| QtPlatypus | ?eval class Foo { has &.subat; method retsub () { .subat()()}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub; | ||
| evalbot6 | 2 | ||
| QtPlatypus | ?eval class Foo { has &.subat; method retsub () { .subat}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub; | 01:18 | |
| evalbot6 | \sub {...} | ||
| QtPlatypus | ?eval class Foo { has &.subat; method retsub () { .subat}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub.perl | ||
| evalbot6 | '\\sub {...}' | ||
| QtPlatypus | Anyone care to explain why it works that way? | 01:19 | |
| stevan_ | QtPlatypus: no :) | 01:20 | |
| I think the first one "method retsub () { .subat()}" is probably using the accessor | |||
| and so it this one (maybe) "method retsub () { .subat()}" | 01:21 | ||
| this is ugly, but it works "method retsub () { .subat()()" | |||
| ?eval class Foo { has &.subat; method retsub () { &.subat()}};my $foo= Foo.new(subat => {1 + 1});$foo.retsub; | |||
| evalbot6 | 2 | ||
| QtPlatypus | That makes sence. How would I use the attribute directly? | ||
| stevan_ | like that | ||
| QtPlatypus | Arh | ||
| Ok things make sence. | 01:22 | ||
| Odin-LAP | sense, actually. :p | 01:24 | |
| svnbot6 | r5083, mugwump++ | Various updates to the pure Perl 6 MetaModel (non-PIL version) to reflect updated interpretation of Roles and Classes | 03:07 | |
| r5084, Stevan++ | Perl6-MetaModel : there is nothing like refactoring with +93% coverage :) ... mostly just cleanup of the Perl6::Object module, it is getting pretty slimmed down now | |||
| mugwump | stevan: ping | 03:10 | |
| stevan | mugwump: pong | 03:11 | |
| I see your update | |||
| mugwump | excellent. did it make any sense? | ||
| stevan | havent looked yet | ||
| mugwump | ok | ||
| stevan | I am doing so right now | 03:12 | |
| mugwump | in particular is the Method.pm | ||
| stevan | ok | ||
| mugwump | At runtime, a method has *two* types | ||
| one type is the $object.ref | |||
| The other is the type that corresponds to the type the role was included into | 03:13 | ||
| stevan | ok | 03:14 | |
| mugwump | the first is used for public accessors and methods, and is subject to dispatch through the Class' superclasses | ||
| the second is used for private accessors and methods | |||
| so, the first is bound "late" | |||
| the second is bound "early" | |||
| and a Class is merely a Role that very quickly has all the private parts of its methods bound | 03:16 | ||
| stevan | interesting | 03:18 | |
| how would you deal with conflicts? | 03:19 | ||
| mugwump | when would they be detected? | ||
| stevan | class composition time | ||
| or role inclusion time | 03:20 | ||
| mugwump | same thing :) | ||
| stevan | any time you compose the ::Type | ||
| yes, basically | |||
| mugwump | yes | ||
| the actual rules for the conflict resolution are irrelevant to this, of course. | 03:21 | ||
| stevan | yes | ||
| mugwump | so long as they don't leave the ::Type objects with ambiguous stuff in them | ||
| stevan | but thats the hard part :) | ||
| mugwump | yes, but minimal rules which exclude many multi methods which could co-exist Shouldn't Be Hard⢠to implement | 03:22 | |
| svnbot6 | r5085, mugwump++ | Ensure Role methods can be re-used between Classes | 04:11 | |
| r5086, luqui++ | r147@Queen-of-Hearts: luqui | 2005-06-28 21:56:55 -0400 | 04:19 | ||
| r5086, luqui++ | Added some type inferrence musings. | |||
| r5087, luqui++ | r148@Queen-of-Hearts: luqui | 2005-06-28 22:14:01 -0400 | |||
| r5087, luqui++ | On disjoint sets. | |||
| r5088, luqui++ | r149@Queen-of-Hearts: luqui | 2005-06-28 22:29:45 -0400 | |||
| r5088, luqui++ | Perhaps we need a new syntax for type variables, or we need to reassign ::. | |||
| r5089, mugwump++ | Method dispatch only happens on the compiled dispatch tables, not bothering with the Meta objects | 04:26 | ||
| obra | seen autrijus | 04:43 | |
| jabbot | obra: autrijus was seen 7 hours 20 minutes 34 seconds ago | ||
| nothingmuch | evening | 05:47 | |
| seen autrijus | 05:49 | ||
| jabbot | nothingmuch: autrijus was seen 8 hours 26 minutes 22 seconds ago | ||
| nothingmuch | he was supposed to wake up by now ;-) | ||
| Khisanth | go knock on his door? | 05:51 | |
| nothingmuch | i'm not staying at the hotel | ||
| and it's not nice to wake someone up in the middle of their beau^H^H^H^H^Hhacking sleep | 05:52 | ||
| . o O ( why are there so many conflicts ? ) | 05:58 | ||
| svnbot6 | r5090, nothingmuch++ | array container implementation | ||
| r5091, nothingmuch++ | array is compilable, and tested.. still broken | |||
| r5092, nothingmuch++ | Sorry stevan++, here's Scalar | 05:59 | ||
| Khisanth wonders if you can do ../../../../method | 06:04 | ||
| nothingmuch | Khisanth: .. being superclass or caller? | 06:05 | |
| ;-) | |||
| jql | Didn't &prefix:<../> get shot down? | 06:06 | |
| nothingmuch | uh | ||
| i thought it was a joke | 06:07 | ||
| mugwump | That's a really good idea! | ||
| jql | well, considering how ./ isn't a joke. :) | ||
| revdiablo | I think Juerd was serious about ../ for about 12 hours | ||
| jql | heh | ||
| mugwump | and then? :) | ||
| QtPlatypus | I thought that it got shot down. | ||
| jql | and then we wondered "how could anyone use that?" | 06:08 | |
| well, I wondered it | |||
| revdiablo | he woke up the next day and realized | ||
| jql | I dunno what @Larry thought | ||
| Khisanth | well if there is going to be the ugly ./method why not go along with it and have ../../method too? :) | ||
| mugwump | ok that's fine for SUPER, but what about NEXT? | 06:09 | |
| jql | ./+method # bring it | ||
| revdiablo | .->method # ;) | ||
| nothingmuch | that's why file systems need continuations | 06:10 | |
| coral | i like talk like that | 06:11 | |
| nothingmuch++ | |||
| coral gets out the pom-poms | |||
| nothingmuch | bah, it's 2 am | ||
| coral | could perlfs.sourceforge.net/ be ported to pugs? | 06:12 | |
| nothingmuch | and I'm screwing around with PIL underlying runtime stuff | ||
| instead of working on my talk | |||
| Khisanth | nothingmuch: following in tradition? | 06:16 | |
| svnbot6 | r5093, nothingmuch++ | Testing is good for you | ||
| gaal | hello. what should the prelude be compiled to with the fast-prelude scenario? pugs ast? something else? what target do we always have? what would be easy to dump partially and later inject to the environment? | 06:17 | |
| PIL? | 06:18 | ||
| revdiablo | previously known as PAST | ||
| nothingmuch | hola PIL | 06:19 | |
| err, gaal | |||
| gaal | that's why it was called that. | ||
| it was called past in the past. | |||
| revdiablo | heh | ||
| in the past PIL was called PAST, duh. | |||
| Khisanth | DR. PHIL | 06:20 | |
| gaal | aloha nm | ||
| nothingmuch | gaal: i have a new laptop | 06:21 | |
| gaal | "become new"! :) | ||
| nothingmuch | i actually had it before, but i forgot to tell you | ||
| thanks =) | |||
| gaal | (not sure they speak inglezit on the chanell) | ||
| nothingmuch | uh, how did an ingy module work without YAML installed?! | 06:23 | |
| holy crap, this computer is so fast | 06:24 | ||
| nothingmuch is going to run the Regexp::Common test suite, just to see it go fast | |||
| gaal | why does script/pugscc still mention 'dump.ast'? i thought that was obsoleted? | ||
| ....why is pugscc still written in p5? :) | |||
| nothingmuch | uh | 06:25 | |
| gaal | i 80% ported it once when i wanted to fix the cygwin path ickiness, but was missing some features. i imagine those are already available | 06:26 | |
| but well, i guess it works now and is probably faster than a p6 version... | 06:27 | ||
| gaal looks for food | 06:29 | ||
| Khisanth | hmm | ||
| where can I find more info on .as()? or can that bible thing tell me? :) | 06:46 | ||
| nothingmuch | woah, i'm 20 | 07:06 | |
| gaal | happy birthday! | ||
| obra | happy birthday, nothingmuch | 07:08 | |
| gaal | ?eval sub f {say "not said"}; f(); say "said" | 07:39 | |
| evalbot6 | said bool::true | ||
| gaal | why is "not said" not said? | ||
| QtPlatypus | could be the say saftly thing | 07:40 | |
| gaal | ?eval sub fatal { die; die; die } fatal(); say "immortal" | ||
| evalbot6 | immortal bool::true | ||
| gaal | nope, same thing in one-liner. | 07:41 | |
| Khisanth | hmm | ||
| gaal | dispatching is very b0rked! | ||
| ?eval no_such(); say "alive" | |||
| evalbot6 | Error: No compatible subroutine found: "&no_such" | ||
| gaal | this is very bad :) | 07:42 | |
| Khisanth | hmm do that enough times and I get undef | 07:43 | |
| instead of bool::true | |||
| gaal | the bool::true is simply the valuation of the last say | ||
| QtPlatypus | ?eval my $a=1;sub foo () {$a++}; foo(); $a | 07:44 | |
| evalbot6 | \1 | ||
| Khisanth | but why should say start returning undef all of a sudden? | ||
| gaal | why should functions not be called all of a sudden? the current r is not sane. | ||
| Khisanth | well that is for sure :) | 07:45 | |
| gaal svn log -v's for possible recent culprits | 07:46 | ||
| Khisanth | ok returning doesn't seem to work at all | 07:47 | |
| gaal | backtracing, 5039 now | 07:51 | |
| make unoptimized++ | |||
| b0rkage == r5040 | 07:53 | ||
| hmm, i don't understand why this breaks! evalExp circa line 309 *does* get called. | 08:18 | ||