[postmodern-devel] postmodern:connected-p

Renato Lucindo lucindo at gmail.com
Sat Sep 22 18:13:14 UTC 2007


Hello,

The function postmodern:connected-p should fail when its argument is a
variable bounded to nil? For instance, here is some code using the package
:postmodern :

(defun connect-to-database ()
  (when (not (connected-p *database*))
    (connect-toplevel *db-name* *db-user* *db-pass* *db-host*)))

This code fails because *database* is nil at first.

If the function cl-postgress:database-open-p was changed into this:

(defun database-open-p (connection)
  "Returns a boolean indicating whether the given connection is currently
connected."
  (and connection
       (connection-socket connection)
       (open-stream-p (connection-socket connection))))

the code above would work as expected.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/postmodern-devel/attachments/20070922/99cd2601/attachment.html>


More information about the postmodern-devel mailing list