Closed p6rt closed 15 years ago
Currently all of the builtins for perl6 are written in PIR. However, it would make more sense if some builtins were written in Perl 6.
We have all of the pieces we need to make this happen -- we just need (1) a logical means of keep track of builtins written in Perl 6 versus builtins written in PIR, and (2) to decide if the Perl 6 written builtins are part of a library loaded at runtime (stored where?) or part of the perl6.pbc binary.
Pm
I would appreciate if someone would look over this patch before committing it. I'm open to comments.
Zev
If anyone wants to work on this ticket, writing a Perl 6 version of the patch given in RT#49085 might be a good test case or starting point.
Pm
@pmichaud - Status changed from 'new' to 'open'
The attached file contains method definitions for splice and pick as implemented in Perl 6. They have been tested as stand-alone subroutines, but not as actual Array methods. The "is also" trait does not yet parse parameter lists correctly, so methods can't be successfully added to the class.
A couple of caveats:
- The parameter lists in the methods have been fudged so as to get by errors currently being thrown. They're not exactly as in S29. (ie. typed optional parameters have to have a default value assigned or a type mismatch error is thrown)
- I wasn't able to fully test them as methods, as the parser doesn't parse it correctly it yet. They should be more or less okay, perhaps with a couple syntactical fixes.
- It's not a patch against any given file, as I wasn't quite sure what to patch against. :)
On Fri May 09 14:36:59 2008, pmichaud wrote:
If anyone wants to work on this ticket, writing a Perl 6 version of the patch given in RT#49085 might be a good test case or starting point.
Pm
On Fri Dec 28 15:59:18 2007, pmichaud wrote:
Currently all of the builtins for perl6 are written in PIR. However, it would make more sense if some builtins were written in Perl 6.
And boy did it take us a little while to get there, but today we have. :-)
See under src/setting/ for various .pm files that make the start of our Perl 6 setting (similar to what other languages call a prelude).
Also, this ticket had a patch supplying a Perl 6 implementation of splice for Array, from cspencer. After a couple of tweaks, I have added this to the prelude too. Thanks!
So, resolving this ticket.
Thanks,
Jonathan
@jnthn - Status changed from 'open' to 'resolved'
Migrated from rt.perl.org#49173 (status was 'resolved')
Searchable as RT49173$