The Raku Programming Language Collect, Conserve and Remaster Project
Originally published on 7 November 2009 by Jonathan Worthington.
I’ve spent most of my waking hours today (and a bit of yesterday) starting to build things out on top of the metamodel foundations in Rakudo’s ng branch. It’s feeling much cleaner that what we had before, and I’ve not found anywhere yet where it’s feeling like I’m having to stick magic into the actions that is specific to a certain type of package. In fact, compared to before, the package_def action method is really quite compact and clean. The whole process of constructing a class (or role or grammar) is just a series of method calls on the metaclass.
Here’s a list of things that I’ve got done since the last blog post.
Any again by default, which took me on a detour into getting the add_parent method of the metaclass working. We can’t quite do inheritance again yet though - that needs traits to be completed too.GrammarHOW - that subclasses the metaclass for classes - ClassHOW. It simply overrides the compose method (what we call when we’re finished defining a package) and checks if there are any explicit parents, and if not adds Grammar as a parent, then delegates up to the superclass to do the rest of the work.is rw variant too. Again, the accessor method is added thorugh the metaclass, and this time it got a proper signature (I suspect there was probably a bug in the previous implementation to be found - maybe even a ticket - over this).self (or only make it available through self if the invocant is not specifically requested). This fixes the “can’t put where clauses on the invocant” issue that came up a while back - now (in theory at least - didn’t test it) you’ll be able to write a bunch of multis that dispatch based on constraints on the invocant.Basically, my aim is to get us able to start bringing the Raku setting back as soon as possible. Today Patrick did the infrastructural work for that, which was a great start. I was close to us having inheritance working by writing a trait modifier in there, but then realized that while lexical subs now work great (like, way cleaner than in master), package ones don’t. Fail. Ah well, it’s 3am and I need sleep. Thanks to Vienna.pm for sponsoring this chunk of work.