develooper Front page | perl.perl6.language | Postings from December 2004

Re: Angle quotes and pointy brackets

Thread Previous | Thread Next
From:
Smylers
Date:
December 1, 2004 00:06
Subject:
Re: Angle quotes and pointy brackets
Message ID:
slrncqqujo.12n.Smylers@stripey.com
Larry Wall writes:

> The basic problem with «...» is that most of its uses were turning out
> to be more useful that the corresponding <...>.  ... and I think I'm
> ready to propose a Great Angle Bracket Renaming.

I very much like your proposal.  (Though whether you were actually ready
to propose it yet is obviously something only you can decide ...)

>     * We steal angles away from iterators.

That means that Apocalypse 2 can be updated by _removing_ an existing
"[Update]" block!

Most of the complaints about non-Ascii characters in Perl relate to the
guillemets.  With your proposal they are relegated to much less-commonly
constructs, and people who really don't like them can mostly avoid
having to go anywhere near them.

>     * We get <...> as the qw// shorthand where a term is expected.

I like that.  When Apocalypse 2 first came out I switched to using
angles as C<qw> delimiters most of the time, such as:

  use Some::Module qw<this that>;

in an attempt to get used to them having that meaning, and so there's
less of a jump to Perl 6.  Over 3 years later I can report that they
work very well for this.

>     * Since we already stole angles from iterators, «$fh» is not
> 	how you make iterators iterate.  Instead we use $fh.fetch (or
> 	whatever) in scalar context, and $fh.fetch or @$fh or $fh[]
> 	or *$fh in list context.

Good.  That is the single thing I find hardest to teach to beginners in
Perl 5; output has an explicit C<print> statement, but the input doesn't
appear to be anywhere in the code -- there's just some brackets in a
C<while> loop, and it doesn't occur to people that brackets might have
the effect of reading from a file.

However, does anything in this proposal conflict with keeping C< <> > as
the special-case token for reading from standard-input-or-the-files-
named-on-the-command-line?  That way people who like that super-short
idiom get to keep it, in:

  for <> { ... }

while anybody who's gone to the bother of typing out a named stream has
to put a little more effort in to specify that iteration is required.

>     * That means that, roughly, we have this proportion:
> 
> 	'...' : "..." :: <...> : «...»

That makes good sense.  It also means that people are free to continue
to ignore the variant they don't like (such as the many people who
prefer to use C<"> quotes in Perl 5 even when no interpolation is
required), which to some extent reduces the validity of any carping.

Bearing in mind how much more can now be done with out unicode (or ugly
C< << > variants) and I think this proposal should result in a nett
carping reduction (especially by people who don't following this mailing
list closely and therefore haven't been getting used to the previous
scheme -- I'm sure it'd be received better by those people who are yet
to meet any Perl 6 at all).

Smylers


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About