[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: [p5pod] [ID 20000124.002] Unterminated C<...> at perlvar.pod line 188
Ronald J Kimball writes:
: I can understand the desire, perhaps even the need, for it.
: C<$ref-E<gt>[0]> is hard to read.
Seems like we need a better delimiter, like C<>$ref->[0]<> or something.
: Actually, I think the subtlest problem to my proposal is that someone might
: try to represent the comparison operator as C<<=>>, which would actually be
: the assignment operator. Hmm.
In this approach, that'd be
C<><=><>
vs
C<=>
The only thing you wouldn't be able to represent is <>, which unfortunately
can't be represented as C<><Z<>><> either. Hmm.
Alternately, there are actually very few places in all the standard pods
that match /\b[A-Z]\[/, and most of those are in verbatim paragraphs.
So maybe we just need to ordain C[<=>] as an alternative way to quote.
But then the first example above doesn't work.
Here's a wacky idea. If you say C<>, then the next character after that
is the quote character. Or how 'bout something that says the next thing
gets to choose its own quote: Q<>C{$ref->[1]}
Actually, here's another interesting idea. Make a rule that if the
first thing in C< is a space, then the last thing in it has to be a
space too. So you get C< -> > and C< <> > and C< $ref->[1] >. That's
pretty darn close to optimal on readability. Now the only thing you
have problems with is > itself, which would still be C<>> or some
such. So far there are only about six occurrences of "C< " in the
standard docs, and they'd be easy to patch.
Unfortunately, this doesn't generalize well to the other letter escapes.
But strippable spaces might generalize better if you pick some other
character that is unlikely to follow <. We could have
C<: $ref->[0] :>
C<: <=> :>
B<: -w :>
I<: not :>
etc. There are no occurrences of /\b[a-z]<: / in the standard docs
as far as I can tell.
And now we come full circle back to C<< $ref->[0] >> because there are
no occurrences of /\b[A-Z]<< / in the docs either. So we just make
a rule that if you double the angle brackets, you have to add whitespace
around it too.
C<< $ref->[0] >>
C<< <=> >>
B<< -w >>
I<< not >>
This is POD. This is your brain on POD. Any questions?
Larry
- References to:
-
Ronald J Kimball <rjk@linguist.dartmouth.edu>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]