4 ms·
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.
by jcromartie 16y 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.
- metageek 16y agoThat's true; we've already got special cases like WITH-OPEN-FILE.
- masklinn 16y agoActually, 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.
- masklinn 16y ago> 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.