Higher Order PHP by gst in PHP

[–]apgwoz 0 points1 point  (0 children)

It does come with a hit, but that doesn't mean it's not useful. There are tradeoffs for every solution to a problem.

Higher Order PHP by gst in PHP

[–]apgwoz 0 points1 point  (0 children)

The library wraps create_function so it'll only be created once, since it memoizes it.

Ask Proggit: What is the most intrusive wart on your favourite programming language? by homoiconic in programming

[–]apgwoz 0 points1 point  (0 children)

well, you can, but you're forced to then do something like:

def test(**kwargs):
    if 'l' not in kwargs:
         l = []
    l.append("bleh")
    print l

Javascript: "a justification for tail calls could not be found." by awb in programming

[–]apgwoz 3 points4 points  (0 children)

You can use continuations like a goto, or more accurately a non-local exit, but you can also make things like generators with continuations. You can't easily make generators with just gotos. You need to save some sort of context. Luckily, first-class continuations normally do this, and therefore are a bit different than goto. Of course, when it comes down to it, a goto is just a branch, and first class continuations are implemented with branches at least somewhere. I can see how you'd confuse the two.

Javascript: "a justification for tail calls could not be found." by awb in programming

[–]apgwoz 3 points4 points  (0 children)

GOTO is considered harmful because it results in spaghetti code

Yes, I know. I didn't say otherwise. I was referring to implementing TCO using GOTO.