Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But we started with the problem baz('bar') being horrible; so can't that be substituted here too then?

  baz(function($x) { return bar($x) })
it's just verbose and indirect: we're making a wrapper (which looks like it may be an extra object at run-time) just to get around a quoting problem.


Yes, that's what I meant when I said:

> This is annoying though, since we're forced to perform an eta-expansion of bar just to avoid the syntax error that `$foo = bar;` gives.

> It's like writing `0+$n` to avoid getting a syntax error when writing `$n`; completely unnecessary, and most likely a bug in the parser.

Maybe we differ on where the problem lies; "a quoting problem" sounds like you think the script is at fault; I would say that the PHP language/implementation is at fault.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: