On Thu, Oct 1, 2015 at 1:40 PM, Levi Morrison <le...@php.net> wrote:

> > Or we can figure out some other such symbol. Worse casing no white space,
> > brain storming:
>
> Please, I already asked people to stop making suggestions for shorter
> syntax for `use()`. Again, if use() is a pain then auto-importing the
> used variables is a good solution. If it's not a pain why are you
> suggesting new syntax?
>

In PHP, I expect to "use" external variables in my closure. I'm taking no
stance on whether that's generally a good or bad thing to do in any
particular language. I'm saying that, in PHP, that's how its done.  It's
different from other languages, which can be confusing, as online
documentation comments show [1].  But once you've RTM and learned it, you
stop thinking about it.  It's just what you do.

Now enter auto-importing, which is a *great* solution... were it not for
precedent, everything else I've learned about closures in PHP, standing in
the way.  Auto-importing lets me trade convenience of typing fewer
characters for a higher cognitive load.  I have to remember that PHP
behaves differently when I type function vs. fn even though the outcome is
the same.  I don't consider that a win for the language, because it will
cascade to exceptions in the documentation, plenty of SO questions, and
probably a PHP Sadness.

What I want is a one-to-one behavior mapping between long syntax and
short.  The syntax suggestions put out on the list attempt to reconcile a
great feature with an earnest belief that language consistency trumps
typing convenience.

[1]: http://php.net/manual/en/class.closure.php#117427

Reply via email to