sperl

Simon on 2001-04-25T19:10:30

Perl 6 is letting us redesign Perl in major ways. But what about the minor tweaks? All the nice but incompatible stuff that you've wanted to do in Perl 5. sperl is a little project of mine to allow this sort of thing - call it a hyper-experimental branch of Perl, if you like.

For instance, I really like lvalues; I like them a lot. So I'd like sperl to be able to use, say, splice as an lvalue. (Well, you can do it for substr, so why not splice?) Let's extend that idea. Why not have other operators be lvaluable: -s $filename = 0; would truncate the file to zero, and so on.

Oh, we could even go mad. We've got operator overloading, whereby operators fire off subroutines. If these subroutines happened to be lvaluable, we could have lvaluable operators, couldn't we? This would make perfect sense for object attributes, where the $object.attribute = $value syntax is quite natural. I've got this working - it actually takes rather a lot less messing around with the core than you'd expect.

Let's make more things take $_ by default, such as push and unshift. We could add user-defined builtins without too much hassle.

Hopefully, Perl 6 will make it easy for Perl-alike languages such as sperl to be quickly constructed and played with.