Re: New Parrot mailing list
Allison sent me this reply: > On Sep 19, 2008, at 3:42 AM, Allison Randal wrote: > James E Keenan wrote: > > Does this mean that the newsgroup perl.perl6.internal on nntp.perl.org is dying as well? > > If so, I think that will be a real loss. I vastly prefer the news interface to a mailing list for following such groups. > I set up the Google Group, because I know a number of people are using it. Can I see a show of hands of people who are only using NNTP and would have difficulty switching to a regular email subscription or Google Group? (I can't send to a newsgroup from my email client, so Jim, could you forward this on?) > > And I wish this had been discussed publicly before this announcement!) > I mentioned it on #parrotsketch and other places. > It's part of the general migration away from perl.org infrastructure. > Allison
Re: Parrot 0.7.1 "Manu Aloha" released
Patrick R. Michaud wrote: I sent the appropriate patch to the webmaster, but it hasn't been applied yet (and I lack a commit bit for the parrotcode.org site). Once that's applied, the url should be fixed. Thanks, applied. I also updated parrot.org. Allison
Re: New Parrot mailing list
Patrick R. Michaud wrote: On Thu, Sep 18, 2008 at 11:00:31AM +0200, Allison Randal wrote: We'll likely end up with messages scattered between both lists for a little while, but the perl6-internals/parrot-porters addresses are deprecated and will be disabled after a sensible deprecation cycle (and after the automatic RT posts have been shifted to parrot-dev). Will we also be able to get svn commits to the new mailing list, or at least to *a* mailing list? The svn commits are a different mailing list, which will stay where it is until we move the subversion server to parrot.org. (Then the new commits mailing list will be [EMAIL PROTECTED]) The new mailing list will not automatically update tickets in the RT queue, for that CC <[EMAIL PROTECTED]> on the message. Wouldn't it be possible to have the new mailing list manager check for [perl #n] in the message subject and automatically forward it (controlling for loops as appropriate)? Yes, almost certainly. But we're also moving to a new ticket queue, so I'd rather not invest the time in hacking up the new infrastructure to interface with the old infrastructure. There's a question on the new system of whether we should continue to have tickets forward to the main development list like we do now, or have them forward to a separate 'parrot-tickets' mailing list like we do with commit log messages. What seems best to you all? (If we do separate the lists, anyone has the option to have them all file into the same mail folder, it just gives others the option of separating ticket traffic from regular messages.) Allison
Re: New Parrot mailing list
James E Keenan wrote: > I set up the Google Group, because I know a number of people are using it. Can I see a show of hands of people who are only using NNTP and would have difficulty switching to a regular email subscription or Google Group? (I can't send to a newsgroup from my email client, so Jim, could you forward this on?) And only just now found that Jim had CC'd the parrot mailing list as well as the news group that I wasn't able to reply to. I wouldn't be sad to see NNTP go. Allison
Re: [perl #58982] Bug -- make per6 unexpected dot
After realclean works fine. Sorry -- Pozdrawiam
[perl #59014] Made some fixes to split on a regex and moved from Str.pir to any-str.pir
# New Ticket Created by "Chris Davaz" # Please include the string: [perl #59014] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59014 > Got rid of "tempstr" and now returns the entire string on a non-match. Index: src/builtins/any-str.pir === --- src/builtins/any-str.pir (revision 31220) +++ src/builtins/any-str.pir (working copy) @@ -71,7 +71,42 @@ .return(retv) .end +=item split() +Splits something on a regular expresion + +=cut + +.sub 'split' :method :multi(_, 'Sub') +.param pmc regex +.local pmc match +.local pmc retv +.local int start_pos +.local int end_pos + +$S0 = self +retv = new 'List' +start_pos = 0 + +match = regex($S0) +if match goto loop +retv.'push'($S0) +goto done + + loop: +match = regex($S0, 'continue' => start_pos) +end_pos = match.'from'() +end_pos -= start_pos +$S1 = substr $S0, start_pos, end_pos +retv.'push'($S1) +unless match goto done +start_pos = match.'to'() +goto loop + + done: +.return(retv) +.end + =item index() =cut split.p6 Description: Binary data
Re: Should $.foo attributes without "is rw" be writable from within the class
Qui, 2008-09-18 às 18:11 +0200, TSa escreveu: > Shouldn't there be a warning in B that $!B::bar overwrites $!A::bar > without an accessor? Actually, $!B::bar doesn't overwrite $!A::bar... the problem is simply that $!A::bar is not visible from inside B, and therefore, there's nothing to be overriden... daniel
[perl #45909] [TODO] Replace quadratic search with something linear in find_exception_handler()
On Wed Sep 17 16:57:06 2008, cotto wrote: > On Mon Oct 01 10:40:33 2007, pcoch wrote: > > In src/exceptions.c there is the todo comment: [TODO: replace > > quadratic search with something linear, hopefully without trashing > > abstraction layers > > > I can't find this comment any more, nor any occurrence of this ticket's > number. I'll do some digging later to see where the comment went, but > it's likely that this ticket can be resolved or rejected. > > Christoph This comment was deleted by Allison in r27357 as part of the pdd25cx work. Since that revision deleted the comment and more or less completely rewrote the function in question, I'm resolving this ticket.
Re: New Parrot mailing list
On Fri, 19 Sep 2008, James E Keenan wrote: > Allison sent me this reply: > I set up the Google Group, because I know a number of people are using > it. Can I see a show of hands of people who are only using NNTP and > would have difficulty switching to a regular email subscription or > Google Group? I use NNTP. I much prefer the command-line news interface to Google Groups, but I guess I wouldn't go so far as to say I would have "difficulty" switching to a regular email subscription. Or, to put it another way: If there were an NNTP interface, I would definitely use it, but I wouldn't want anyone else to be stuck implementing and maintaining it just for my occasional use. -- Andy Dougherty [EMAIL PROTECTED]
Re: New Parrot mailing list
Allison Randal wrote: James E Keenan wrote: > I set up the Google Group, because I know a number of people are using it. Can I see a show of hands of people who are only using NNTP and would have difficulty switching to a regular email subscription or Google Group? (I can't send to a newsgroup from my email client, so Jim, could you forward this on?) And only just now found that Jim had CC'd the parrot mailing list as well as the news group that I wasn't able to reply to. I wouldn't be sad to see NNTP go. Allison: That's false. I replied to the newsgroup, which is mirrored by the mailing list. Whenever I've posted to the list (independent of posts to RT), the posts have been mirrored by the mailing list. You asked we to "forward this on," so I did exactly what I've done for hundreds of other posts over the last two years.
[perl #58866] calling a PIR sub with 206 params segfaults parrot
On Thu Sep 18 08:52:10 2008, julianalbo wrote: > I changed the fix in r31230 to allocate char instead of char *, > adjusted the formula for buffer size and added a comment explaining it > to lower the level of black magic, and added a check for each item, > dropping the XXX comment that asked for it. > > I hope this is enough understanding of the error ;) > Thanks. I think neither of us read the code quite correctly, but your patch was a significant improvement. It also fixed a hard-to-reproduce bug that GeJ was running into on FreeBSD 7.1. In looking at the code, I can see some ways to make the test more comprehensive. I'm going to reopen it as a way to remind me to write some more exhaustive tests which exercise sub signatures as well as sub calls.
[perl #59016] Re: Made some fixes to split on a regex and moved from Str.pir to any-str.pir
# New Ticket Created by "Chris Davaz" # Please include the string: [perl #59016] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59016 > Sorry forgot to put the method in alphabetical order, here you go. On Fri, Sep 19, 2008 at 12:36 AM, Chris Davaz <[EMAIL PROTECTED]> wrote: > Got rid of "tempstr" and now returns the entire string on a non-match. > Index: src/builtins/any-str.pir === --- src/builtins/any-str.pir (revision 31220) +++ src/builtins/any-str.pir (working copy) @@ -71,7 +71,6 @@ .return(retv) .end - =item index() =cut @@ -173,6 +172,42 @@ .return ($P0) .end +=item split(/PATTERN/) + +Splits something on a regular expresion + +=cut + +.sub 'split' :method :multi(_, 'Sub') +.param pmc regex +.local pmc match +.local pmc retv +.local int start_pos +.local int end_pos + +$S0 = self +retv = new 'List' +start_pos = 0 + +match = regex($S0) +if match goto loop +retv.'push'($S0) +goto done + + loop: +match = regex($S0, 'continue' => start_pos) +end_pos = match.'from'() +end_pos -= start_pos +$S1 = substr $S0, start_pos, end_pos +retv.'push'($S1) +unless match goto done +start_pos = match.'to'() +goto loop + + done: +.return(retv) +.end + =item substr() =cut
[perl #59064] [BUG] split function doesn't work
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #59064] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59064 > On Sat, Sep 20, 2008 at 12:33:27AM +1100, Илья wrote: > >For example: > > split /''/, $string > >splits between characters. > > this do not work properly in Rakudo: > say (split /''/, "foo").perl; # ["foo"] Currently the split function (note function, not method) is in src/classes/Str.pir, and it appears to be coercing its arguments into strings. This function needs to be moved to src/builtins/any-str.pir, and updated to accept pmc arguments. Perhaps something like: .namespace [''] .sub 'split' :multi(_, _) .param pmc sep .param pmc target .return target.'split'(sep) .end Pm
[perl #59068] [BUG] .perl on strings doesn't properly escape all sequences
# New Ticket Created by Patrick R. Michaud # Please include the string: [perl #59068] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59068 > On Fri, Sep 19, 2008 at 11:29:30AM +0400, Andrew Shitov wrote: > when I tried to use a dollar sign on a page, November failed to read > the modified page. It turns out that .perl method does not escape > dollars, thus > say '$'.perl > produces > "$" > while I expect to get > "\$" > > Fail happens when the string containing non-escaped dollar is being eval-ed. We probably also need to escape other items that might cause interpolation in strings, such as {, @, and % . Also need to check that non-ASCII characters are properly encoded. Pm
Re: New Parrot mailing list
James E Keenan wrote: That's false. I replied to the newsgroup, which is mirrored by the mailing list. Whenever I've posted to the list (independent of posts to RT), the posts have been mirrored by the mailing list. You asked we to "forward this on," so I did exactly what I've done for hundreds of other posts over the last two years. Makes sense. There's likely a delay from the time a post goes to the newsgroup before it makes it to the mailing list, so I replied to the direct message (where you CC'd the newsgroup), long before it hit the mailing list. (IIRC, I've been caught by this before.) Thanks for forwarding it on, exactly as I asked. :) Allison
Re: New Parrot mailing list
Andy Dougherty wrote: I use NNTP. I much prefer the command-line news interface to Google Groups, but I guess I wouldn't go so far as to say I would have "difficulty" switching to a regular email subscription. Or, to put it another way: If there were an NNTP interface, I would definitely use it, but I wouldn't want anyone else to be stuck implementing and maintaining it just for my occasional use. I wonder why no one has developed a command-line NNTP-like interface for email? Maybe following mailing lists via RSS and feed readers has satisfied the need enough that no one got around to it? This looks interesting, if anyone's motivated: http://www.methodize.org/nntprss/ Allison
Patch for split(thing, delimiter) function
Moved the split function from Str.pir to any-str.pm and removed the Perl6Str coercion. Index: src/builtins/any-str.pir === --- src/builtins/any-str.pir (revision 31254) +++ src/builtins/any-str.pir (working copy) @@ -172,6 +172,31 @@ .return ($P0) .end +=item split + + our List multi Str::split ( Str $delimiter , Str $input = $+_, Int $limit = inf ) + our List multi Str::split ( Rule $delimiter = /\s+/, Str $input = $+_, Int $limit = inf ) + our List multi Str::split ( Str $input : Str $delimiter , Int $limit = inf ) + our List multi Str::split ( Str $input : Rule $delimiter , Int $limit = inf ) + +String delimiters must not be treated as rules but as constants. The +default is no longer S<' '> since that would be interpreted as a constant. +P5's C<< split('S< >') >> will translate to C<.words> or some such. Null trailing fields +are no longer trimmed by default. We might add some kind of :trim flag or +introduce a trimlist function of some sort. + +B partial implementation only + +=cut + +.namespace[] +.sub 'split' :multi(_,_) +.param pmc sep +.param pmc target +.return target.'split'(sep) +.end + +.namespace['Any'] .sub 'split' :method :multi('String') .param string delim .local string objst @@ -202,12 +227,6 @@ .return(retv) .end -=item split(/PATTERN/) - -Splits something on a regular expresion - -=cut - .sub 'split' :method :multi(_, 'Sub') .param pmc regex .local pmc match Index: src/classes/Str.pir === --- src/classes/Str.pir (revision 31254) +++ src/classes/Str.pir (working copy) @@ -318,39 +318,6 @@ .return s.'capitalize'() .end - -=item split - - our List multi Str::split ( Str $delimiter , Str $input = $+_, Int $limit = inf ) - our List multi Str::split ( Rule $delimiter = /\s+/, Str $input = $+_, Int $limit = inf ) - our List multi Str::split ( Str $input : Str $delimiter , Int $limit = inf ) - our List multi Str::split ( Str $input : Rule $delimiter , Int $limit = inf ) - -String delimiters must not be treated as rules but as constants. The -default is no longer S<' '> since that would be interpreted as a constant. -P5's C<< split('S< >') >> will translate to C<.words> or some such. Null trailing fields -are no longer trimmed by default. We might add some kind of :trim flag or -introduce a trimlist function of some sort. - -B partial implementation only - -=cut - -.sub 'split' -.param string sep -.param string target -.local pmc a, b - -a = new 'Perl6Str' -b = new 'Perl6Str' - -a = target -b = sep - -.return a.'split'(b) -.end - - =item chop our Str method Str::chop ( Str $string: )
Re: Should $.foo attributes without "is rw" be writable from within the class
HaloO, Daniel Ruoso wrote: Qui, 2008-09-18 às 18:11 +0200, TSa escreveu: Shouldn't there be a warning in B that $!B::bar overwrites $!A::bar without an accessor? Actually, $!B::bar doesn't overwrite $!A::bar... the problem is simply that $!A::bar is not visible from inside B, and therefore, there's nothing to be overriden... May I pose three more questions? 1. I guess that even using $!A::bar in methods of B is an access violation, right? I.e. A needs to trust B for that to be allowed. 2. The object has to carry $!A::bar and $!B::bar separately, right? 3. How are attribute storage locations handled in multiple inheritance? Are all base classes virtual and hence their slots appear only once in the object's storage? Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare "Simplicity does not precede complexity, but follows it." -- A.J. Perlis 1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa Ramanujan
Re: Patch for split(thing, delimiter) function
Chris Davaz wrote: > Moved the split function from Str.pir to any-str.pm and removed the > Perl6Str coercion. Thanks, applied as r31265. Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
What should ''.split('') return?
Hi, what should ''.split('') return? The empty list, or a list with one null string? Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
Re: What should ''.split('') return?
On Fri, Sep 19, 2008 at 05:58:59PM +0200, Moritz Lenz wrote: : Hi, : : what should ''.split('') return? The empty list, or a list with one null : string? Empty list would make more sense as a degenerate case. In 'a'.split('') we don't return the null strings before or after 'a', just ('a'). Larry
[perl #59074] Patch for split(thing, delimiter) function
# New Ticket Created by "Chris Davaz" # Please include the string: [perl #59074] # in the subject line of all future correspondence about this issue. # http://rt.perl.org/rt3/Ticket/Display.html?id=59074 > Moved the split function from Str.pir to any-str.pm and removed the Perl6Str coercion. Index: src/builtins/any-str.pir === --- src/builtins/any-str.pir (revision 31254) +++ src/builtins/any-str.pir (working copy) @@ -172,6 +172,31 @@ .return ($P0) .end +=item split + + our List multi Str::split ( Str $delimiter , Str $input = $+_, Int $limit = inf ) + our List multi Str::split ( Rule $delimiter = /\s+/, Str $input = $+_, Int $limit = inf ) + our List multi Str::split ( Str $input : Str $delimiter , Int $limit = inf ) + our List multi Str::split ( Str $input : Rule $delimiter , Int $limit = inf ) + +String delimiters must not be treated as rules but as constants. The +default is no longer S<' '> since that would be interpreted as a constant. +P5's C<< split('S< >') >> will translate to C<.words> or some such. Null trailing fields +are no longer trimmed by default. We might add some kind of :trim flag or +introduce a trimlist function of some sort. + +B partial implementation only + +=cut + +.namespace[] +.sub 'split' :multi(_,_) +.param pmc sep +.param pmc target +.return target.'split'(sep) +.end + +.namespace['Any'] .sub 'split' :method :multi('String') .param string delim .local string objst @@ -202,12 +227,6 @@ .return(retv) .end -=item split(/PATTERN/) - -Splits something on a regular expresion - -=cut - .sub 'split' :method :multi(_, 'Sub') .param pmc regex .local pmc match Index: src/classes/Str.pir === --- src/classes/Str.pir (revision 31254) +++ src/classes/Str.pir (working copy) @@ -318,39 +318,6 @@ .return s.'capitalize'() .end - -=item split - - our List multi Str::split ( Str $delimiter , Str $input = $+_, Int $limit = inf ) - our List multi Str::split ( Rule $delimiter = /\s+/, Str $input = $+_, Int $limit = inf ) - our List multi Str::split ( Str $input : Str $delimiter , Int $limit = inf ) - our List multi Str::split ( Str $input : Rule $delimiter , Int $limit = inf ) - -String delimiters must not be treated as rules but as constants. The -default is no longer S<' '> since that would be interpreted as a constant. -P5's C<< split('S< >') >> will translate to C<.words> or some such. Null trailing fields -are no longer trimmed by default. We might add some kind of :trim flag or -introduce a trimlist function of some sort. - -B partial implementation only - -=cut - -.sub 'split' -.param string sep -.param string target -.local pmc a, b - -a = new 'Perl6Str' -b = new 'Perl6Str' - -a = target -b = sep - -.return a.'split'(b) -.end - - =item chop our Str method Str::chop ( Str $string: )
Re: Should $.foo attributes without "is rw" be writable from within the class
Sex, 2008-09-19 às 17:49 +0200, TSa escreveu: > Daniel Ruoso wrote: > > Qui, 2008-09-18 às 18:11 +0200, TSa escreveu: > >> Shouldn't there be a warning in B that $!B::bar overwrites $!A::bar > >> without an accessor? > > Actually, $!B::bar doesn't overwrite $!A::bar... the problem is simply > > that $!A::bar is not visible from inside B, and therefore, there's > > nothing to be overriden... > May I pose three more questions? > > 1. I guess that even using $!A::bar in methods of B is an > access violation, right? I.e. A needs to trust B for that > to be allowed. Yes > 2. The object has to carry $!A::bar and $!B::bar separately, right? Yes > 3. How are attribute storage locations handled in multiple inheritance? > Are all base classes virtual and hence their slots appear only once > in the object's storage? In SMOP, it is handled based on the package of the Class, the private storage inside the object is something like $obj.^!private_storage<$!bar> and $ojb.^!private_storage<$!bar> daniel
Re: {SPAM} Re: Should $.foo attributes without "is rw" be writable from within the class
Sex, 2008-09-19 às 17:49 +0200, TSa escreveu: > Daniel Ruoso wrote: > > Qui, 2008-09-18 às 18:11 +0200, TSa escreveu: > >> Shouldn't there be a warning in B that $!B::bar overwrites $!A::bar > >> without an accessor? > > Actually, $!B::bar doesn't overwrite $!A::bar... the problem is simply > > that $!A::bar is not visible from inside B, and therefore, there's > > nothing to be overriden... > May I pose three more questions? > > 1. I guess that even using $!A::bar in methods of B is an > access violation, right? I.e. A needs to trust B for that > to be allowed. Yes > 2. The object has to carry $!A::bar and $!B::bar separately, right? Yes > 3. How are attribute storage locations handled in multiple inheritance? > Are all base classes virtual and hence their slots appear only once > in the object's storage? In SMOP, it is handled based on the package of the Class, the private storage inside the object is something like $obj.^!private_storage<$!bar> and $ojb.^!private_storage<$!bar> daniel
Re: What should ''.split('') return?
Larry Wall wrote: > On Fri, Sep 19, 2008 at 05:58:59PM +0200, Moritz Lenz wrote: > : Hi, > : > : what should ''.split('') return? The empty list, or a list with one null > : string? > > Empty list would make more sense as a degenerate case. In > > 'a'.split('') > > we don't return the null strings before or after 'a', just ('a'). And with the same argumentation the same holds true for regexes as well? 'a'.split(rx/a/) # also empty list ''.split(rx/ '' /) # dito Moritz -- Moritz Lenz http://moritz.faui2k3.org/ | http://perl-6.de/
Re: Should $.foo attributes without "is rw" be writable from within the class
Daniel Ruoso wrote: > TSa wrote: >> May I pose three more questions? >> >> 1. I guess that even using $!A::bar in methods of B is an >> access violation, right? I.e. A needs to trust B for that >> to be allowed. > > Yes > >> 2. The object has to carry $!A::bar and $!B::bar separately, right? > > Yes > >> 3. How are attribute storage locations handled in multiple inheritance? >> Are all base classes virtual and hence their slots appear only once >> in the object's storage? > > In SMOP, it is handled based on the package of the Class, the private > storage inside the object is something like > > $obj.^!private_storage<$!bar> > > and > > $ojb.^!private_storage<$!bar> Note that this ought only be true of class inheritance; with role composition, there should only be one $!bar in the class, no matter how many roles define it. -- Jonathan "Dataweaver" Lang
Re: Should $.foo attributes without "is rw" be writable from within the class
Jon Lang wrote: Daniel Ruoso wrote: TSa wrote: May I pose three more questions? 1. I guess that even using $!A::bar in methods of B is an access violation, right? I.e. A needs to trust B for that to be allowed. Yes 2. The object has to carry $!A::bar and $!B::bar separately, right? Yes 3. How are attribute storage locations handled in multiple inheritance? Are all base classes virtual and hence their slots appear only once in the object's storage? In SMOP, it is handled based on the package of the Class, the private storage inside the object is something like $obj.^!private_storage<$!bar> and $ojb.^!private_storage<$!bar> Note that this ought only be true of class inheritance; with role composition, there should only be one $!bar in the class, no matter how many roles define it. Yes, though note that they will only share a slot if they have the exact same type. Otherwise it's a composition-time error. Jonathan
Re: How to define a new value type?
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: So again the question: are back refs from the value to the containers required to implement Perl 6? I guess not. If I understand what you are saying, I agree. You can only go from some container to a value, not the opposite direction, and can't tell if the object is held by more than one container.
Re: Should $.foo attributes without "is rw" be writable from within the class
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: class A { has $.foo = "A"; has $!bar = "A"; method blahh() { say $.foo ~ $!foo ~ $!bar; } } class B is A { has $.foo = "B"; has $!bar = "B"; } my $a = A.new; my $b = B.new; say $a.blahh; # prints AAA say $b.blahh; # prints BAA, right? Shouldn't there be a warning in B that $!B::bar overwrites $!A::bar without an accessor? And of course the example shows that $!foo in blahh is not derivation friendly. Or am I getting things wrong and there can be only one $!foo and $!bar in the namespace of the objects created from A and B? That is the declarations in B are superfluous if not outright wrong? Well, or they only affect the generated constructor and the storage location is shared? The latter would nicely contrast them to non twigil attributes in the form 'has $foo'. A::!foo will be distinct from B::!foo. The accessor in B will override the accessor from A. I would not mind a warning, since the implementation knows what is going on being auto-generated. But in general, if you write methods that are accessors, separate from the backing data, the compiler can't tell what you meant and won't give any warning. --John
Re: Should $.foo attributes without "is rw" be writable from within the class
TSa Thomas.Sandlass-at-vts-systems.de |Perl 6| wrote: May I pose three more questions? 1. I guess that even using $!A::bar in methods of B is an access violation, right? I.e. A needs to trust B for that to be allowed. Correct. 2. The object has to carry $!A::bar and $!B::bar separately, right? Correct. 3. How are attribute storage locations handled in multiple inheritance? Are all base classes virtual and hence their slots appear only once in the object's storage? The slots are direct in that class. The accessor functions are virtual, though. It is not specified anywhere, nor even discussed that I've found, whether base classes are "virtual" (merged) in the C++ sense. I have this flagged as an open design question. Since you have "roles", perhaps you don't need virtual base classes. I think no snap decision should be made, but the ramifications and use-cases explored in some detail. --John
Re: Should $.foo attributes without "is rw" be writable from within the class
Daniel Ruoso wrote: > Jon Lang wrote: >> Note that this ought only be true of class inheritance; with role >> composition, there should only be one $!bar in the class, no matter >> how many roles define it. > > er... what does that mean exactly? Unless something has drastically changed since I last checked the docs, roles tend to be even more ethereal than classes are. You can think of a class as being the engine that runs objects; a role, OTOH, should be thought of as a blueprint that is used to construct a class. Taking your example: > role B { > has $!a; > } > > role C { > has $!a; > } > > class A does B, C { > method foo() { > say $!a; > } > } > > I think in this case $!B::a and $!C::a won't ever be visible, while the > reference to $!a in class A will be a compile time error. :snip: > Or does that mean that > >class A does B, C {...} > > actually makes the declarations in B and C as if it were declared in the > class A? Correct. Declarations in roles are _always_ treated as if they were declared in the class into which they're composed. And since only classes are used to instantiate objects, the only time that a role actually gets used is when it is composed into a class. -- Jonathan "Dataweaver" Lang
method signature issues
In any-str.pir we need to figure out how to change .sub 'split' :method :multi('String') into .sub 'split' :method :multi(_, 'String') since the former method signature is causing problems for me as I'm trying to implement .sub 'split' :method :multi(_, 'Sub') with an additional optional argument (the limit of how many elements to return in the list). While we still have the ".sub 'split' :method :multi('String')" method and I try to run some Perl 6 code that uses the newly added optional parameter to ".sub 'split' :method :multi(_, 'Sub')", I get the following error: say "theXbiggestXbangXforXtheXbuck".split(/X/, 3).perl; too many arguments passed (3) - 2 params expected current instr.: 'parrot;Any;split' pc 10833 (src/gen_builtins.pir:6926) Line 6926 of gen_builtins.pir is ".sub 'split' :method :multi('String')", not the expected method ".sub 'split' :method :multi(_, 'Sub')". Any when we change .sub 'split' :method :multi('String')" to " .sub 'split' :method :multi(_, 'String')" I can't even compile Perl 6. I get the following error: No applicable methods. current instr.: 'parrot;Perl6;Grammar;Actions;dec_number' pc 129924 (src/gen_actions.pir:11299) >From this point I'm not sure what's going on any help would be greatly appreciated. Best Regards, -Chris