Has anyone had any experience with persistent object libraries? I've tried cl-prevalence, elephant, and rucksack, but none work on clisp 2.45, running on windows xp . Is there any out there that actually work?

Oh, and i do realize that elephant uses uffi, which doesn't support clisp. I used the cffi-uffi-compat package that came with cffi. I eventually ran up against an error i couldn't understand, namely 'can't redefine standardized method. use call-next-method instead.' hmmm.Also, rucksack doesn't support clisp either, but i modified the file package.lisp so as to not signal an error when clisp is used. Then i told it to use the clos package for clisp (the file package.lisp required each implementation to specify location of mop protocol). Then, i modified rucksack.lisp in order to make dummy with-lock, process-lock, and make-lock functions/macros, since clisp doesn't support multithreads. This time, the error that i ran up against was that file-position was attempting to position a stream past then end of the file. Argg...And yes, it works on sbcl, but i want to use clisp!

A hah! I found an annoying implementation difference! On clisp, if file-position is given a number beyond it's eof, it signals an error, but if sbcl receives a number beyond it's eof, it just fills the non-used positions with a #\null character or 0 or whatever I redefined file-position in the rucksack package. Wow, now the macro with-rucksack works , now i have to see what's else is wrong, still getting that pesky end of file error!

It appears that for one call tof ile-position, the file-length isn't increasing even though write-byte is called. The output for this particular case is (minus the "writing" 0 part, which indicates that the write has succeded, according to write-byte) :

As you can see, i need an extra length of (24-10) +1 = 15 added, so the end file-length should be 10+15 = 25.But, since for some reason it stays at 10 for a while, it doesn't work.Anyone knows what's happening? Thx!

EDIT:I even tried restarting clisp and re-loading, i got the same error, which is something of a relief

OK, so i think i finally got rucksack working with clisp. Just a quick question, though. Is the above file-position function the most efficient implementation or can i do better. In addition, just wondering, is the file-length property figured out by counting through the file or is this property stored somehow in the stream?

Thx! The changes were actually very very minor, its just finding them thats really annoying. Which reminds me, i should probably relate what i did to get it to work, for others.

Locate the package.lisp file.At the top should be something like #-(...bunch of lisp implementations) (error "...")Include clisp in the bunch of lisp implementations.

Then, go to the :use statement. Add #+clisp :clos to the listNow, we need to add a new file-position function. In sbcl, if we try to positionthe file beyond the eof, it will add #\Null characters or 0s for padding depending on stream type.

Locate the serialize.lisp file. Change the max-character-code function to the following.The problem here is that in sbcl, it will return 0 if the string is empty, but clisp will return nil.(defun max-character-code (string) "Returns the highest character code in string." #+clisp (if (string-equal string "") (return-from max-character-code 0)) (loop for char across string maximize (char-code char)))

Finally, and this is a hack, we need to suppress clisp warnings. The thing is, when we have nested (with-rucksacks) for the same database, it tries to have more than one open stream to a file. If we don't suppress it, it will crash our program. I guess you could also try try catch blocks, but whatever.

In windows:create a shortcut to clisp by right clicking on clisp.exe and clicking create shortcut. Rename it as "click-appease" or something. Right click shortcut and click on properties. Under shortcut tab, rename target to something like following, replacing thing between parantheses by the pathname of your shortcut."C:\Program Files\clisp-2.45\clisp.exe" -on-error appeaseClick OK, and your done. Use this shortcut when you use clisp and rucksack together. No clue how to do it on other systems.

A much better way would probably be to create a global hashtable which has the pathname as a key and an open stream or nil if there is none as the item. Something like that, anyways. Actually, you shouldn't have nested with-rucksacks for the same database in the first place, but you can figure out why the example signals a warning.