views:

383

answers:

2

I know that in pure object-oriented languages like Java it usually makes sense to use ORMs like Hibernate. But what would I do when writing a CRUD-type functionality in Clojure or Common LISP?

Passing around SQL as the first-order functions? But isn't having SQL in HTML-generating code very ugly?

Thanks,

Olek

+3  A: 

Common Lisp is not a self-consciously FP language. Clojure can just use Hibernate.

For Common Lisp: databases. Here's a persistent object one. And here is the first part of a tutorial that uses it with Hutchentoot, a CL webserver and dynamic webpage toolkit. SQL in CL can look like this (which looks longer than it really is, because the SQL is horizontally formatted and the CL isn't). And if you like, this guy is working on a web framework (using CLSQL and Elephant, already linked-to) that aims at tersity, with an eye on the arc challenge.

EDIT: a recent answer expands on this.

ayrnieu
CL-SQL is really nice, and shows how object-oriented and functional can work together.
Svante
+1  A: 

an alternative set of Common Lisp tools is described in another answer

Attila Lendvai