[postmodern-devel] with-connection problem

Ryszard Szopa ryszard.szopa at gmail.com
Tue Sep 18 16:06:33 UTC 2007


On 9/18/07, Marijn Haverbeke <marijnh at gmail.com> wrote:

> Oh, you seem to be under the impression that I actually introduced
> test cases for the changes -- how naive ;) . I didn't, but a quick

Oh. I thought you reimplemented WITH-CONNECTION using
CALL-WITH-CONNECTION (nb. that's a lot better name for that function)
in order to avoid code reduplication blahblahblah ;), so the tests for
WITH-CONNECTION would reveal any errors. Yeah, I definitely should
look more thoroughly at the patches I apply in oder to test them :)

> usage of call-with-connection (your with-connection-fun) and
> with-connection* (a variant of with-connection which evaluates the
> specification list) should show any problems I introduced. I stared at
> the code for a few minutes, so it shouldn't contain any glaring
> mistakes, but you never know.

Apparently, you missed a comma before SPEC in WITH-CONNECTION*, so
there was an undefined variable error. After applying the attached
patch:

CL-USER> (let ((test "test"))
	   (pomo:with-connection* (list test "richard" "dupa" "localhost")
	     (pomo:query (:select 1))))
((1))
CL-USER> (let ((test "test"))
	   (pomo:call-with-connection (list test "richard" "dupa" "localhost")
				      (lambda ()
					(pomo:query (:select 1)))))
((1))

I hope it's OK now.

Bests,

    -- Richard
-- 
http://szopa.tasak.gda.pl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: with-connection-star.patch
Type: text/x-patch
Size: 5988 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/postmodern-devel/attachments/20070918/570cd328/attachment.bin>


More information about the postmodern-devel mailing list