Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2008-02-07

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

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

Perl 6 | Reference Documentation | Rakudo