News for hackers. Stuff that matters.
Re:Convincing Programmers They Want To Use Lisp by ScottBurson on Monday February 21, 2011 @05:00PM (#2247411)
No, you're conflating two features. He's not talking about `unwind-protect', which he hasn't even used in his example (that would be the equivalent of `try' ... `finally'). He's talking about the fact that in Lisp, you can make a single abstraction that encapulates the entire pattern of opening the file before doing something and closing it afterwards. This is not that common a language feature, though it is catching on. Python's `with' was introduced in 2.5, which came out a few months after his post was written. Scala's "automatic closures" (I would say "automatic lambdas") show another way to provide this functionality, more general than Python's `with'; I think the blogger can be forgiven for not having heard of Scala in 2006. Java has no elegant way to do this.
Re:Convincing Programmers They Want To Use Lisp by teilo on Monday February 21, 2011 @05:04PM (#2247441)
Thank you. I appreciate the correction and clarification.