[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: pragmas

Michael Vanier <mvanier@cs.caltech.edu> writes:

> Good to know ;-)
> I think much of the prejudice against perl has to do with people
> (like me) who only used it way back when there weren't a lot of the
> current options.
> Perl seems to win the prize as the language with the most pragmas,
> by which I mean language-altering special statements (maybe there is
> a better word for this).  You got yer "use strict", "use warnings",
> etc. etc.  How do people feel about this feature in general?

So long as they can be lexically scoped I'm keen on them. But I'm a
Perl programmer so I probably would say that wouldn't I? Whilst I'm
generally keen on strictures in Perl, there are times when I want to
turn them off for a space. This is especially useful for the kind of
'meta' modules like the proof of concept thing I did to implement the
'extract method' refactoring for Perl (which I'm supposed to be
delivering a forty minute talk on in about three weeks, and I've not
looked at the code for about a year... I hope I can still understand
it. Right now I'm trying to stick a GUI on it, and it HURTS...)

> I personally like the idea of pragmas if there is no other way to
> get the same flexibility, although I would probably have set the
> defaults differently than perl's are set ;-)

Don't worry, in Perl 6 the defaults will be set rather more strictly
and there'll be shiny new stuff for bundling up your 'custom' sets of
pragmata in a single module so you can do:

   use package_strictures;

Oh yeah, and we get a nicer macro/source filter system too... Here's
hoping we manage to implement the bloody thing.