Den 2015-10-01 kl. 11:47, skrev Pavel Kouřil:
How does hack solve this? Do they have backtracking in their parser?
It was discussed earlier & Bob answered it, a T_LAMDA_OP is inserted
by a token token-pre-parser before hitting the real parser, see:
Subject: Re: [PHP-DEV] [RFC] [Discussion] Short Closures
Date: Sun, 6 Sep 2015 17:59:57 -0700
From: Sara Golemon <p...@golemon.com>
To: Bob Weinand <bobw...@hotmail.com>
Copy: Björn Larsson <bjorn.x.lars...@telia.com>, PHP Internals
<internals@lists.php.net>
Regards //Björn Larsson
(Resending, because I accidentally forgot to "Reply All".)
So, if I'm understanding this correctly - this approach wouldn't
require backtracking, and would make the simplest syntax possible?
Regards
PK
Well, I don't know really being a userland developer, but I'm sure Sara &
Bob knows. It's discussed in the "[RFC] [Discussion] Short Closures" thread
and I recall it was described as an ugly hack (abomination). Still Hack has
the functionality with type-hinting, default values and simple syntax.
Regards, //Björn
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php