r3182: *** empty log message ***
[reversi.git] / edge-table-storage.lisp
index 34a3142da9d916af3c33e537c7adbb3479bad48c..1d2d6e17f2ec1883c022a9e4026ca2dceb6fecf9 100644 (file)
@@ -2,20 +2,39 @@
 ;;;;
 ;;;; FILE IDENTIFICATION
 ;;;; 
-;;;;  Name:           edge-table-storage.cl
+;;;;  Name:           edge-table-storage.lisp
 ;;;;  Purpose:        Store precompiled edge table for reversi
-;;;;  Programer:      Kevin M. Rosenberg, M.D.
+;;;;  Programer:      Kevin Rosenberg
 ;;;;  Date Started:   1 Nov 2001
-;;;;  CVS Id:         $Id: edge-table-storage.lisp,v 1.1 2002/10/25 08:36:42 kevin Exp $
 ;;;;
+;;;; $Id: edge-table-storage.lisp,v 1.2 2002/10/25 09:23:39 kevin Exp $
+;;;;
+;;;; This file is Copyright (c) 2002 by Kevin M. Rosenberg
+;;;;
+;;;; Reversi users are granted the rights to distribute and use this software
+;;;; as governed by the terms of the Lisp Lesser GNU Public License
+;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL.
 ;;;;***************************************************************************
 
 (in-package :reversi)
 
-(defparameter *et-path* nil)
-
 (eval-when (:compile-toplevel :load-toplevel :execute)
 
+  (defparameter *et-path* nil)
+
+  (if *load-truename*
+      (setq *et-path* (make-pathname
+                      :directory (pathname-directory *load-truename*)
+                      :host (pathname-host *load-truename*)
+                      :device (pathname-device *load-truename*)
+                      :name "edge-table"
+                      :type "dat"))
+    (setq *et-path* (make-pathname
+                    :directory '(:absolute "usr" "share" "common-lisp"
+                                           "source" "reversi" "data")
+                    :name "edge-table"
+                    :type "dat")))
+
   (defun store-edge-table (et &optional (path *et-path*)) 
     (with-open-file (stream path :direction :output
                            :if-exists :supersede)
@@ -32,8 +51,6 @@
                        (setf (aref et i) (read stream)))
                      et))))
   
-  (setq *et-path* (make-pathname :defaults *load-truename* :name nil :type nil))
-  
   (unless (probe-file *et-path*)
     (store-edge-table (make-edge-table)))