On Miércoles, 1 de Diciembre de 2010 10:26:00 Leslie P. Polzer escribió:
> On Nov 30, 9:46 pm, Rafael Jesús Alcántara Pérez
> 
> <[email protected]> wrote:
> > I have another issue about using defstore after initializing a binary
> > image with SBCL [1]. The problem was about "%defstore-postdefine" trying
> > to load the store using "asdf-system-directory" as a way to get the
> > directory of installation of the weblocks package. After the image was
> > loaded in another machine, it didn't found the directory so the problem
> > arose. I bypassed the problem making my own "defstore" that did not call
> > "%defstore-postdefine". After making that and passing the
> > :public-files-path to start-webapp, the application run smoothly. Can
> > calling "%defstore-postdefine" be optional in the defstore?
> 
> I don't see why it couldn't. Would you like to submit a patch?
> 
I have attached a simple patch. Feel free to sanitize it :)

Greets.

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en.

diff -r f14b59da2238 src/store/store-utils.lisp
--- a/src/store/store-utils.lisp	Sun Nov 28 19:24:17 2010 +0100
+++ b/src/store/store-utils.lisp	Mon Dec 06 02:00:33 2010 +0100
@@ -104,17 +104,19 @@
 	     (asdf-system-directory :weblocks))))
     (asdf:operate 'asdf:load-op system-name)))
 
-(defmacro defstore (name type &rest args)
+(defmacro defstore (name type &rest args &key (load-store-system-p t))
   "A macro that helps define a store. A global variable 'name' is
 defined, and 'open-store' is called with appropriate store type and
 arguments. Note that the last store will also be the default (see
 *default-store*). All stores defined via 'defstore' will be opened and
 bound when 'start-weblocks' is called, and closed when 'stop-weblocks'
-is called."
+is called. If 'load-store-system-p' is nil then it does not try to load
+package 'weblocks-<name>' (useful when making binary images)."
   `(progn
      (%defstore-predefine ',name ,type ,@args)
      (defvar ,name nil)
-     (%defstore-postdefine ',name ,type)))
+     ,(when load-store-system-p
+            `(%defstore-postdefine ',name ,type))))
 
 (defun open-stores ()
   "Opens and binds all stores."

Reply via email to