chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Problem with sqlite3 egg


From: Alejandro Forero Cuervo
Subject: [Chicken-users] Problem with sqlite3 egg
Date: Wed, 8 Aug 2007 12:30:36 -0500
User-agent: Mutt/1.5.16 (2007-06-11)

Hello.

I've been having some problems getting the sqlite3:for-each-row
procedure from the sqlite3 egg to play along nicely with the
iterator->stream procedure from the stream-ext egg.

The iterator->stream procedure uses continuations to turn an iteration
inside out: to build a lazy (srfi-40) stream of objects based on an
iterator interface.  For example,

  (iterator->stream
    (lambda (collect _)
      (collect 1)
      (collect 2)
      (collect 3)))

evaluates to the stream with the objects 1, 2 and 3.  The same goes
for

  (iterator->stream
    (lambda (collect _)
      (for-each collect '(1 2 3))))

I'm trying to build a stream with the results of a SQL SELECT:

  (iterator->stream
    (lambda (collect _)
      (sqlite3:for-each-row collect db "SELECT name FROM people;")))

Reading the second element in the resulting stream, however, produces
the following error:

  Error: (sqlite3:statement->c-pointer) bad sqlite3:statement object, contained 
pointer is #f: #<sqlite3:statement>

Unfortunately, this prevents me from making Svnwiki depend on the
sqlite3 egg (instead of the sqlite egg), which I've been wanting to do
for quite a while (since sqlite3 provides ALTER TABLE, which, AFAIK,
sqlite does not).

Any help to understand or solve this problem would be appreciated.  My
guess is that an internal object that sqlite3:for-each-row uses is
getting destroyed before it should be.

Alejo.
http://azul.freaks-unidos.net/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]