develooper Front page | perl.perl5.porters | Postings from November 2010

Re: [PATCH] deprecate ?PATTERN?

Thread Previous | Thread Next
From:
Zefram
Date:
November 24, 2010 02:03
Subject:
Re: [PATCH] deprecate ?PATTERN?
Message ID:
20101124100307.GY24999@lake.fysh.org
Rafael Garcia-Suarez wrote:
>Can you give an example of future usage of "?" you were thinking about ?

The issue that came up was the possibility of adding a "?" postfix to
existing infix operators.  We were specifically talking about adding to
"->", making "->?", but this particular case doesn't suffer from ?pat?,
because "->" isn't an infix operator in that sense -- it's a postfix
operator, and the syntax that follows the "->" is very restricted,
not a general expression.

Potential operators that would be affected by it include "*?", "=?", and
so on.  They currently run into the problem that "$a=?$b" looks like the
start of a valid parse, and will tokenise as "$ a = ?$b".  It's difficult
to construct a complete expression that could be interpreted either way,
but the tokeniser needs to decide between the two interpretations of
the question mark without considering how later parts of the expression
will parse.

I don't think we have any specific semantics in mind for new operators
using a "?", apart from the unproblematic "->?" (for which we have
multiple possible meanings).

-zefram

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