So, I finally got around to reading the link Nat sent out:
http://www.perl.com/pub/2001/05/08/exegesis2.html
First off, nice job Damian (as always), it looks excellent. I like the
examples of stuff like this:
my int ($pre, $in, $post) is constant = (0..2);
Awesome. Simple, Perlish, easy to read, etc. Also, I see you took the
suggestion of:
Access through... Perl 5 Perl 6
================= ====== ======
Array slice @foo[@ns] @foo[@ns]
Hash slice @foo{@ks} %foo{@ks}
Which is kewl since it makes a good amount of sense IMO.
The only worry/problem/etc that I wonder about is the potential overuse
of the "is" keyword. It is a very nice syntactic tool, but when I see
something like this:
$*ARGS is chomped;
I wonder if that wouldn't be better phrased as:
autochomp $*ARGS; # $ARGS.autochomp
Or, if :: meant CORE, even:
autochomp $::ARGS;
The thing I worry about is this: I don't think actions should be
declared using "is", necessarily. I know, one could argue that actions
are just a type of property, but I don't know if that's the most
sensible. In particular, it puts the action in the passive voice, and it
could also go too far:
$STDERR is flushed;
$var = $ARGS is read;
$STDOUT is printed to "Hello, World!\n";
It seems actions should be active functions, so:
autoflush $STDERR; # $STDERR.autoflush
$var = read $ARGS;
print $STDOUT "Hello, World!\n";
Plus, this part bothers me a little:
: http://www.perl.com/pub/2001/05/08/exegesis2.html
:
: $ARGS prompts("Search? "); # Perl 6
: while (<$ARGS>) {
:
: Technically, that should be:
:
: $ARGS is prompts("Search? ");
:
: but that grates unbearably. Fortunately, the "is" is optional in
: contexts -- such as this one -- where it can be inferred.
I'd think I'd rather see that as:
prompt $ARGS "Search? "; # $ARGS.prompt("Search? ")
Without the extra new ambiguity. Thoughts?
-Nate