pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
meppl good night 01:30
pugs_svn r19830 | moritz++ | [t] moved regex/from_perl6_rules/pos_modifier.t to S05-modifier/, 07:35
r19830 | moritz++ | cleaned up POD, inserted fudge directives
r19831 | moritz++ | spec/S05-modifier/pos.t: .pos is now $/.to 07:44
ruoso pugs: class Foo { method a { "a" } }; class Bar is Foo { sub a { "b" } }; my $a = Bar.new(); say $a.a; 10:33
exp_evalbot OUTPUT[b␤]
ruoso pugs: class Foo { method a { "a" } }; class Bar is Foo { sub a { "b" } method b { self.a } }; my $a = Bar.new(); say $a.b; 10:34
exp_evalbot OUTPUT[b␤]
ruoso is this correct? Method call vs. Subroutine call in S12 seems to imply otherwise 10:34
moritz_ pugs: class F { sub a {'a' }} say F.new.a 10:40
exp_evalbot OUTPUT[a␤]
ruoso in theory, class F { sub a { 'a'} } actually register "a" in *package* F, and not in class F. Which means that "a" is not part or the F prototype. That would make it unavailable to the method resolution, and when the calling fall back to sub dispatch, it would, as being inside package F, have "a" declared in the scope, and so it could be called. 10:49
but the question is, when it converts the method notation to sub dispatch, does it takes the sub from the object's package? as p5 would, for instance... 10:50
ruoso pugs: class F { sub a { "a" } }; my $f = F.new(); $f.a; F::a(); 10:51
exp_evalbot RESULT["a"]
ruoso pugs: class F { sub a { "a" } }; my $f = F.new(); say join ',', $f.a; F::a();
exp_evalbot OUTPUT[a␤]
ruoso pugs: class F { sub a { "a" } }; my $f = F.new(); say join ',', F::a();
exp_evalbot OUTPUT[a␤] 10:51
ruoso pugs: class F { sub a { "a" } }; my $f = F.new(); say join ',', $f.a;
exp_evalbot OUTPUT[a␤]
ruoso pugs: class F { sub a { "a" } }; my $f = F.new(); say join ',', $f.a, F::a();
exp_evalbot OUTPUT[a,a␤]
Alias_ hmm 10:52
I need to finish LetMeIn so moritz_ can use something other than commitbit :) 10:53
pugs_svn r19832 | moritz++ | [irclog] fixed double logging of /topic changes 10:54
moritz_ Alias_: I'm not the only commitbit user, I guess ;) 10:54
Alias_ Well, there's some history there
In the beginning, there was Insurrection 10:55
Which I used to use on my open repository, and lots of people liked
But was absolutely impossible to install
So after much wailing and gnashing of teeth (Jesse|Audrey) made a clone of it
Thus, commitbit 10:56
A clone of insurrection based on Jifty
Only problem for me is I can't ever seem to get Jifty installed EITHER
moritz_ lol
Alias_ So I've made ANOTHER clone, using absolutely as little code and modules as possible
Simple cgi only
No look and feel, so it works on my mobile phone crappy browser 10:57
Or on Nintendo Wii, or in EVE Online, Second Life, et al
svn.ali.as/
And it only has one file, and 2 dependencies
All of which are pure perl
And it doesn't need a database... 10:58
Just works directly off the .htpasswd file that svn uses natively
moritz_ cool
Alias_ It's just not quite polished enough to release :)
ruoso would $foo.^addmethod(...) be the same as $foo.WHAT.^addmethod(...) ? 11:36
moritz_ ruoso: did you see my remark about vienna.pm's winter of code? 11:37
ruoso I did... thanks... I'm just thinking a little longer on what I'll do...
moritz_ ok 11:38
ruoso if we consider $obj.HOW !=== $obj.WHAT.HOW, that is a way to add a method to that object instance only, which may be usefull, and make the runtime composition more natural
that causes the protoobject to have the same representation as the object, which is certainly a good thing 11:41
and probably a mandatory feature for autovivification to work 11:42
ruoso www.perlfoundation.org/perl6/index....ementation 12:26
lambdabot Title: SMOP p6opaque Implementation / Perl 6, tinyurl.com/2z5spt
ruoso I now have an interesting design of the p6opaque structure
the object and the protoobject have the same structure 12:27
and I have an interesting feature which is that an object might be its own prototype, when runtime composition is made in it... 12:28
kolibrie TimToady: I've misplaced a script called 'uni' which I believe you wrote (for looking up unicode characters). Is it available somewhere? 14:53
spx2 does perl6 understand how to add arrays like vectors in R^n ? 15:04
moritz_ yes, with hyper ops 15:05
spx2 moritz_, is it possible in perl5 as well ?
moritz_ pugs: say (1, 2, 3 »+« 9, 8, 7).perl
exp_evalbot OUTPUT[decodeUTF8': bad data: '\187'␤decodeUTF8': bad data: '\171'␤*** Hyper OP only works on lists␤ at /tmp/v1t3iHfJI2 line 1, column 5 - line 2, column 1␤]
spx2 what key is that ? 15:06
>> ?
moritz_ pugs: say (1, 2, 3 >>+<< 9, 8, 7).perl
exp_evalbot OUTPUT[*** Hyper OP only works on lists␤ at /tmp/JYOE9uJQ7I line 1, column 5 - line 2, column 1␤]
moritz_ pugs: say ((1, 2, 3) >>+<< (9, 8, 7)).perl 15:06
exp_evalbot OUTPUT[(10, 10, 10)␤]
pasteling "rhr" at 65.94.10.253 pasted "kolibrie: uni" (20 lines, 450B) at sial.org/pbot/30217
moritz_ spx2: in p5 you can use PDL
spx2 cool !
moritz_, thanks
moritz_ spx2: you're welcome 15:07
spx2 moritz_, I was thinking of using this in some golf conding but seeing they have only perl 5.8.8 I think I'll have to abandon the ideea...
the dudes hosting the contest are totally deprecated
moritz_ not totally, 5.10 is only 2 month old
spx2 I'm sure if they would install perl6 all contests would be won by perl6 people ...
moritz_ with the small caveat that p6 isn't yet ready 15:08
kolibrie rhr: thank you!
spx2 moritz_, yes I'm waiting for it for some time
moritz_ spx2: don't wait, help! 15:09
spx2 moritz_, theres a book on perl6 out on apress do you think it would be a good read/help ?
moritz_ spx2: there's "Perl 6 and Parrot Essentials", but it's outdated
spx2 moritz_, yes someone told me that here before and thats sad 15:10
moritz_ and there are the synopsis here: perlcabal.org/syn/
lambdabot Title: Official Perl 6 Documentation
spx2 moritz_, its sad because the manual/docs arent always as friendly as a book is
moritz_ the book is now open source, you can update it if you want
the perl6 parts are somewhere in docs/ in the pugs repository 15:11
spx2 I haven't closely watched of perl6 development 15:12
and no offence
moritz_ 'course
spx2 but I have the feeling of total chaos and disorganised people ... 15:13
very smart but totally disorganised
moritz_, what do you think about this ?
moritz_ spx2: well, it's a volunteer's effort, you can't tell people what to do 15:14
spx2: the parrot part of the development is backed by TPF and well organized
spx2 moritz_, yes but I heard from a friend that perl6 people have received serious funding recently
moritz_ that's the parrot part, yes 15:15
The Perl Foundation seems to think that parrot is the one and only way to implement perl 6
and I agree that it is likely to be successfull, but that diversity is also a good thing
spx2 diversity=>work dispersed across several directions leading to same things done differently 15:16
coagulation of work=>faster development of perl6
coagulation of work=>good estimates of when perl6 will be out 15:17
and we all want perl6 out !
moritz_ pugs proved that wrong
spx2 moritz_, how did it prove it wrong ?
moritz_ you can't spec a language without developing it
spx2 can't all the people work on the same stuff ? 15:18
moritz_ and the fast pugs development lead to big improvement in the specs
[particle] there's no way to get a good estimate of (largely unpaid) volunteer effort
moritz_ which makes it easier for the parrot folks much more directed, and easier
spx2 [particle], but mozilla pumped some dough ...
moritz_ spx2: as I said, that mostly goes into parrot, which is well organized already
[particle] mofo gave one man a grant for four months' work
and that work is progressing nicely, we've already seen the benefits 15:19
moritz_ aye
[particle] i'd *love* to see the other perl 6 implementations get more organized, and receive funding 15:20
ruoso TimToady, when you have some time, could you please take a look at www.perlfoundation.org/perl6/index....ementation ... I'm hoping that this model can implement P6 OO gracefully, but I really would appreciate your review
lambdabot Title: SMOP p6opaque Implementation / Perl 6, tinyurl.com/2z5spt
moritz_ [particle]: do you know if PGE supports the <token> ** <other_token> syntax? 15:22
[particle] i don't believe it does. 15:22
moritz_ ok, thanks
[particle] what does that mean?
moritz_ a sequence of <token>s separated by <othertoken>s 15:23
[particle] ah, hrmm
moritz_ <item>**',' is a comma separated list
[particle] nice syntax.
no, you'll still have to do <item>? [ ',' <item> ]* 15:24
moritz_ without the first ? 15:24
[particle] actually, for the example you gave, forget the ?
moritz_ ;)
[particle] i think pge only gets <item> ** {3} 15:25
cj moin moin 16:52
TimToady bleah, it's way too early for it to be this late... 17:23
rindolf Hi all.
Hi TimToady
TimToady ruoso: the $a.a mess was a fossil from the old design of p6 that purposefully confused 0-argument methods with 1-argument subs 17:24
that is now solved with "is export" on methods, so $a.a should never see a "sub a"
so it's a pugs buglette
pasteling "TimToady" at 71.139.8.150 pasted "The uni script" (23 lines, 520B) at sial.org/pbot/30223 17:27
TimToady kolibrie: see above 17:28
kolibrie TimToady: thanks!
ruoso so, method dispatch does not fallback to sub dispatch?
TimToady never, we just install a sub alias if they explicitly say "is export"
ruoso nice... that makes thing simpler 17:29
TimToady which makes it easy to have both push(@array: 1,2,3) and push(@array, 1,2,3)
with the same impl
bphillips just curious (if anyone knows) is the current expectation that Audrey probably won't be able to return to the project?
TimToady indeed, if anyone wants to fix pugs...
I would not expect it; her health is much more important 17:30
ruoso so, class F { sub a { "a" } method a { "b" } }; is valid...
bphillips TimToady: agreed - I just hadn't heard any news on that topic in a long time 17:30
ruoso where the sub install it in the package and the method install it in the prototype
TimToady I can argue it both ways 17:32
I think anyone who installs both a sub and a method of hte same name is crazy
and the package has always been the record of the public interface of a class
in p5
ruoso well... in fact, it's the same case as push(@array and @array.push 17:33
[particle] ...enough rope...
can you have a module and a class with the same name?
TimToady yeah
question is how you want someone external to the package to name methods
(if you want to allow it)
but that solution of course does not extend to anon classes 17:34
moritz_ is the double colon all gone?
TimToady we still have ::
ruoso isn't that the meaning of HOW ?
I mean...
HOW is the interface to mess with the class definition
even if it is anonymous
TimToady sure, and certainly that will be the primary way of looking up methods 17:35
as I said, I can argue it either way
TimToady for now assume that the method doesn't have to also live in the packge 17:35
since that's simpler 17:36
ruoso actually, that's how I'm planning to implement p6opaque
in smo
TimToady if someone wants to install such aliases for external use, we can think about it pragmatically later
ruoso smop
even an anon-class can have methods, that won't probably be in any package 17:37
[particle] hrmm, i should implement 'is export' in rakudo. it'll clean up the sub wrappers we have around many of our methods
ruoso TimToady, did you have a chance to see the sketches on the smop p6opaque implementation? 17:38
TimToady I've skimmed it, but I'm not awake enough yet to think it through 17:40
ruoso ok..
btw... S12 needs to be updated to reflect the current status
Method call vs. Subroutine call
ruoso if I go on with the current p6opaque plan, the following will be possible: my $foo = 0 but True; my $bar = $foo.new(); say $bar ?? "1" !! "0"; # the result is 1 17:42
moritz_ that's... astonishing ;) 17:43
TimToady oh, I had forgotten about the failover from method to sub, so maybe it's not a pugs bug...
TimToady told you I wasn't awake yet... 17:43
ruoso heh
so... does the failover exist or not? 17:45
TimToady for now it does, but you don't have to worry about unless the method dispatch fails completely first, so I wouldn't worry about it at all right now 17:46
ruoso ok... but one important thing
packages doesn't inherit from each other, right? classes do... does the fallback goes through the object hierarchy *again* trying to find the sub? 17:47
TimToady no
TimToady it's just a translation of $a.foo to foo($a) and try the multiple dispatcher 17:47
ruoso that is possibly unexpected...
TimToady possibly 17:48
moritz_ but multi dispatch honors inheritance
ruoso so, foo would have to be declared in the current scope?
and not in the object's package
TimToady only if you declared multi a, not sub a
ruoso or would it be the same semantic as in p5... 17:49
where $foo.a translates to $($foo.WHO)::a()
TimToady on your 0 but True example, it is supposed to work that way, but I think you're thinking of the protoobject as its own class, whereas I was thinking that "but" creates an anonymous class shared by $foo and $bar 17:50
ruoso well... in my example, $bar is $foo 17:51
:)
and $foo is Int does True
because my current plan allows the object itself to have more definitions
and it become its own class
when you do runtime composition 17:52
TimToady but you can also just create a new anon class whenever you need to external to the object, if you want to implement it that way
Q is whether your approach forces overhead onto classy objects unnecesarrily
since most of them will share a class
ruoso I see 17:53
TimToady maybe we can have more than one P6opaque :)
ruoso probably we will
TimToady one optimized for prototype, one optimized for class-based
TimToady whole point of having a representation knob is that it can have more than one setting 17:54
but on the user side of .HOW you shouldn't easily be able to tell the difference 17:55
and HOW is really a macro that can cheat as much as it likes 17:56
so we probably have to restrict the set of possible representations to that known by the HOW in the current lexical scope
which implies that an application might have to predeclare its representations
before we can know what's safe to put into a HOW macro
ruoso well... 17:57
[particle] HOWs fair if you predeclare
ruoso the whole point in smop is enabling different representations
the thing here really is that we are going to need an HOW API 17:59
and a Representation API
for them to be interchangeable
I mean... during BUILD, the class will have to talk with the HOW, and the HOW will have to talk with the Representaiton 18:00
and in the end, there must be a complete object, independent of its representation
that's one of the most scary features of Perl 6, and the one I most like 18:01
in theory, you can create a Int that uses a Glib representation
it's insane, and I love it 18:03
TimToady bows, and gestures to the Cabal for their share of applause 18:05
ruoso heh 18:13
ruoso www.perlfoundation.org/perl6/index....mop_oo_api 19:40
lambdabot Title: SMOP OO API / Perl 6
ruoso first sketches on the Object/HOW/REPR API
ruoso as usual, any review is more than appreciated. 19:43
home & 19:44
buchet I try to write some tests for S17; so perhaps I need a commit bit. Do somebody have one for me? 20:07
[particle] i can give you one 20:08
is S17 in the pugs repo?
buchet isn't it docs/Perl6/Spec/Concurrency.pod? 20:10
jnthn Concurrency tests? Oooh... :-) 20:11
buchet I said: I will try....:-) 20:12
wolverian is that up to date / official? 20:13
[particle] ok, gimme your email and username, i'll send you your bit
moritz_ welcomes our new concurrency overlord 20:26
[particle] buchet: email/username? i'd like to welcome our new overlord, too :) 20:28
TimToady n 20:43
TimToady .oO(...)
cognominal_ you can use ... as argument of method call too? 20:45
moritz_ just as a prototype indicator 20:46
pugs_svn r19833 | rhr++ | [irclog] add CPS and PCT to abbr.dat
cognominal_ if it commes with an array context, you may get away thx to lazyness :)
s/commes/comes/ 20:47
it may translate in some sort of array thunk that evaluates to an error :) 20:49
[particle] wonders what the oO() method on the current topic does. pull a news item from perl.org?
> perl6 -e'.oO()' 20:51
lambdabot Improperly terminated character constant at "'" (column 15)
[particle] This Week on perl 5-porters - 27 January-2 February 2008
:)
cognominal_ grinder++ 20:51
[particle] buchetc: you need to '/msg nickserv identify buchetc' in order to send private messages 20:54
cognominal_ I wish that irc could somehow use openids too 20:55
[particle] that'd be nice, yeah. 20:56
[particle] buchetc: it's customary to add your name to AUTHORS to test your commit bit. welcome! 21:04
TimToady buchetc: nevermind my email then, if it gets to you :) 21:05
pugs_svn r19834 | buchetc++ | test commit bit 21:19
moritz_ welcome buchetc ;) 21:20
TimToady buchetc: feel free to ask questions about (or even edit) S17 as it seems appropriate 21:25
moritz_ and this is a good read for inspiration: www.seas.upenn.edu/~lipeng/homepage/unify.html 21:27
lambdabot Title: Unifying events and threads
[particle] parrot's concurrency pdd is a good read, too. especially because it has been implemented already :) 21:39
TimToady so implement gather/take :) 21:46
[particle] TimToady: looking at S09, it's not clear what 'my @array[-5];' will do 21:55
it think it's clear what it *should* do.
how do i ask an array whether it's fixed size or not? 21:56
TimToady @array[-5] should always fail, probably at compile time 21:59
lambdabot Unknown command, try @list
TimToady oh, didn't see the "my"
should still fail...
[particle] that's what i imagine. 22:00
jnthn returns from $REALLIfE 22:01
[particle] but the spec is ambiguous by omission
TimToady as for inspection, that's what .shape should tell you
[particle] ah. shape. great.
i'll ack that in the docs
TimToady it's mentioned in S09 22:02
the only argument for [-5] being allowed is the same reason we allow 0..-5 for a null range 22:03
but it seems a stretch
[particle] so 'my @array[5];' desugars to 'my @array = Array.new(:shape<5>)' or somesuch
well, perhaps [0-5] or [*-5]
but i think [-5] is bad 22:04
TimToady well, more like my @array := Array.new
[particle] right, sorry. should be bound.
TimToady the type of the container includes its shape 22:05
[particle] but how do i know that it can't be extended?
shape doesn't tell me if it's fixed or resizable
TimToady if it's a resizable dimension it uses * instead 22:06
[particle] ok, so .shape would return Whatever in that dimension 22:06
TimToady yes 22:07
[particle] and i can fix an array's size after creation, using .shape(...)
and if that makes the array smaller, does it return the values it's culled? 22:08
TimToady well, you'd have to use .=shape, and it might well fail 22:12
[particle] hrmm.
so, 's possible .shape() can only set during bind 22:13
TimToady .new really
[particle] er, yeah. right-o.
hrmm. my Array @x is ro; 22:14
oops
my Array @x[5] is ro;
is that just the shape that's read-only, or the contents too?
TimToady um, you've just declared an array of Array 22:15
[particle] hee. so i have.
my Foo ...
TimToady but the ro is applied to @x as a whole
"is" always aims at the entire declaratoin 22:16
[particle] the container and the contents
TimToady is applies the trait to the container, and the container may apply it to its contents if it wishes
[particle] ok, so it seems much better to use 'constant' rather than 'is ro' on container.
TimToady use readonly if you want to bind to something that varies at run time but you don't want to modify otherwise 22:17
constant can't vary at run time even
that's why parameters are readonly rather than constant
they get rebound on each call 22:18
[particle] ah
TimToady but over the life of the call they're invariant
[particle] i know some people like that
TimToady well I should commute 22:19
later &
rakudo_svn r25590 | jonathan++ | [rakudo] Work around the class/role ordering issue for now, so people can play with OO in Rakudo until we work out a Real Solution. 22:58