From: "Brett Cannon" <bac@OCF.Berkeley.EDU> > > Wouldn't this also allow one to code in a contract programming style ala > Icon (assuming I remember correctly how contract programming works)? I > mean you have control over the enter and exit of the thunk (would this > still be called a thunk, or just syntactic sugar for calling > ``__exit__()`` and ``__enter__()``; more like a thunk-ish protocol?) which > is what I thought was the focus of contract programming. > > Either way this seems rather nice. And if you can pass in arguments (as I > think ``FILE = file('blah.txt', 'rb'): (some_argument):`` is supposed to > implement) this would be really nice. =) no there is no first-class thunk here, this is really just sugar for a try-finally. The point here is not to need first-class thunks!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4