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

I think that few people are actually aware of this as an idiom. Rather, many people are aware of just a few special cases, but have not considered this in the more general form.

All the examples of various languages providing this for open files also kind of misses it. The point is not whether a particular language supports this for open files, but whether people recognize the idiom and the language supports doing this yourself wherever it fits. For a pattern this incredibly common it's a point well worth making.



Yeah, you may be right that the full generality of the pattern is not appreciated.

For what it's worth, I think most commonly used languages can implement some form of the context function in my example.




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

Search: