Hacker News new | ask | show | jobs
by jcromartie 5719 days ago
I can't help you with strong typing, but I'm pretty sure a macro would go a long way towards implementing RAII in a Lisp.
2 comments

> I'm pretty sure a macro would go a long way towards implementing RAII in a Lisp.

Well yeah, just build the macro you need on top of unwind-protect, that's pretty standard common lisp fare.

That's true; we've already got special cases like WITH-OPEN-FILE.
Actually, you already have something better than RAII in unwind-protect. Just create whatever macro you need on top of that (I'm pretty sure with-open-file is just a macro on top of unwind-protect, Siebel seems to agree in his chapter on files) and you're done.