Hello Chicken Scheme
June 29th, 2007
I’ve been looking for a way to put my pilot logbook into a relational database so I can use sql for queries. The plan is to put sqlite and chicken scheme on a Nokia 770 . I’ll write some helper logic in scheme and use it to update my logbook after each flight. I figure it’s a good way to learn scheme if nothing else. My Nokia 770 is in the mail so for now I’m just trying to learn scheme on Ubuntu.
What follows is my distilled experience installing chicken with sqlite support.
Ubuntu feisty wants to install an old version of chicken. Most eggs want the latest chicken compiler so I had to get the source tree from here . I was getting strange errors from chicken-setup; “Error: unbound variable: required-chicken-version” when I had the old version installed.
Assuming a current install of sqlite3 this should all work.
$ wget http://www.call-with-current-continuation.org/chicken-2.6.tar.gz
$ tar -xzvf chicken-2.6.tar.gz
$ cd chicken-2.6
$ ./configure
$ make
$ sudo make install
$ mkdir ~/tmp
$ cd ~/tmp
$ sudo chicken-setup sqlite3
$ sqlite3 test.db
> create table memos(text, priority INTEGER);
> insert into memos values ('Tara is hot', 100);
> .quit
$ csi
> (require-extension sqlite3)
> (define db (sqlite3:open "test.db"))
> (sqlite3:first-row db "select * from memos" )
I don’t know enough scheme to figure out if ‘db’ is opening a new connection on each appearance. I require more reading so I’ll quit writing for now.
Your Response