Writing during the Superbowl

Whiteknight on 2009-02-02T02:00:33

Like so many other Philadelphia fans, I'd much rather do anything else besides watch two other teams. So, tonight I'm working on some book stuff.

I've been testing many of my code examples on IRC using some of the creative and helpful bots that inhabit the various channels. You type in a line of Perl 6 code, and the bots will execute them and return the results. This is very handy for most cases, but the limitations in the various incomplete implementations become readily apparent.

I was trying to introduce the notion of dynamic scope at one point, and tried to test the keywords CALLER and OUTER. Of course, neither of these are implemented yet in Rakudo, so I quickly moved on to other topics. Today I started work talking about code blocks, closures, and pointy blocks. I was in the channel testing some things out and got a lot of help from moritz++. He reviewed some of my work and pointed out some areas where I was wrong, and where I had been right but the spec has now changed to make it wrong.

moritz also corrected some of my misunderstandings and non-best-practices concerning conditionals and pointy blocks. I don't just want to teach this material to new readers, I want to teach it right.

So far I've drafted material on quite a few topics. I welcome any feedback people have about any of them:

1) variables, sigils, context, types 2) basic arithmetic and string operators 3) if/unless conditionals and loops 4) subroutines, blocks, closures, and pointy-blocks 5) classes, objects, and methods

Next I'm going to get started on a basic treatment of Perl 6 regular expressions and grammars. I'll be deferring discussion of the Perl 5 RE syntax to the Perl 5 Wikibook, and will probably be borrowing some of the grammar discussion from the PGE stuff I wrote in the Parrot book. Material from all these places will be migrated to the Perl 6 Essentials book in the pugs repo, and the Parrot book in the Parrot repo too.

I've heard a few complaints about having too many books, but I personally think it's a good thing. More books in more places can attract more readers and more writers. You can approach the same material in multiple ways, which is something I try to make conscious effort to do. Maybe the effort is spread a little bit thin at first, but it's the long-term viability of these projects that I'm most concerned with. Time will tell if my ideas here pan out.

Perl 6 book at Wikibooks