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

I've taken Groovy's with... syntax and built utils that are ie:

public void withConnection(Callback<Connection> callback) { Connection connection = createConnection(); try { callback.call(connection); } finally { connection.dispose(); } }

Once Java actually gets closures it'll make this soooo much nicer.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: