use strict & warnings;
A disjunction could mean any of the listed modules suffices. This comes
in handy when you code something that will work with any of three XML
parsers. Although because ordering matters, the // operator is perhaps
better.
But "use strict & warnigs;" looks great and I wonder if it can work.
Juerd
--
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html
http://convolution.nl/gajigu_juerd_n.html
I personally would not mind requiring whitespace around & in those
cases.
If parens are used for the grouping, then why is the colon required?
> The "use" ambiguity might easily be resolved by saying that "use"
> always parses using indirect object syntax, which would distinguish
> use strict & warnings;
> from
> use strict: &warnings;
I thought whitespace after the sigil was no longer allowed? That
certainly fits in the sigil-is-part-of-the-name-thing.
Well, there's a bit of a syntactic problem with & anywhere a term
might be expected after a term, since it will assume you want to
start a &foo. For another example
sub foo (Int&Str &block) {...}
is probably not going to parse right. Maybe that's a good place for
sub foo (:(Int&Str) &block) {...}
Alternately, we install a small heuristic and document it in the fine print.
By and large, we've managed to avoid such heuristics in Perl 6, but maybe
this is a good spot for an evil heuristic.
The "use" ambiguity might easily be resolved by saying that "use"
always parses using indirect object syntax, which would distinguish
use strict & warnings;
from
use strict: &warnings;
(Note: such a colon could possibly be used to distinguish Perl 6 from
Perl 5 in Main too, at least if the first "use" needs a colon.)
I don't know of any easy fix for the "type var" ambiguity though.
However, all that being said, please note that
use strict & warnings: @args;
is unlikely to be useful unless the two modules have a similar
interface. It'd be much more useful to be able to logically cascade
"use" statements as a whole.
Larry
Same here. Actually the whitespace after & makes the destinction, or not?
> If parens are used for the grouping, then why is the colon required?
Because it escapes into type-space like ::() escapes into name-space :)
--
TSa (Thomas Sandlaß)