From d5e50a8f40d8fdc50be26632ca05193230a433cb Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Wed, 10 Feb 2010 09:13:32 +0100 Subject: [PATCH] clean up config stuff, move into own file and own package. modify system loader to include this file Signed-off-by: AJ Rossini --- cls.asd | 55 ++++------------------------------------------------- src/config.lisp | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/packages.lisp | 12 +++++++++++- 3 files changed, 72 insertions(+), 52 deletions(-) create mode 100644 src/config.lisp diff --git a/cls.asd b/cls.asd index 6c2be6e..d839593 100644 --- a/cls.asd +++ b/cls.asd @@ -1,5 +1,5 @@ ;; -*- mode: lisp -*- -;;; Time-stamp: <2010-01-14 08:08:39 tony> +;;; Time-stamp: <2010-02-09 08:33:51 tony> ;;; Created: <2005-05-30 17:09:47 blindglobe> ;;; File: cls.asd ;;; Author: AJ Rossini @@ -16,58 +16,10 @@ (in-package :cl-user) -;;; enforce all floating reads as doubles -;; (setf *read-default-float-format* 'double-float) - -;;; optimization settings -;; (proclaim '(optimize (safety 2) (space 3) (speed 3))) - -(defpackage :lisp-stat-config - (:documentation "holds Common Lisp Statistics configuration/loading variables and related functions.") - (:nicknames :cls-config) - (:use :common-lisp) - (:export *common-lisp-stat-version* - *default-path* - *lsos-files* *basic-files* *ls-files* - *cls-home-dir* *cls-data-dir* *cls-examples-dir*)) - -(in-package :lisp-stat-config) - -(defvar *common-lisp-stat-version* "1" - "Version currently loaded and being used. Need to make into a - parseable object for version testing. Currently using integers.") - -(defparameter *cls-home-dir* - (directory-namestring - (truename (asdf:system-definition-pathname :cls))) - "Value considered \"home\" for the installation") - -#| -(setf *cls-home-dir* - ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w - ;; #p"/home/tony/sandbox/CommonLispStat.git/" - #p"/home/tony/sandbox/CLS.git/") -|# - -(macrolet ((ls-dir (root-str) - `(pathname (concatenate 'string - (namestring *cls-home-dir*) ,root-str))) - - (ls-defdir (target-dir-var root-str) - `(defvar ,target-dir-var (ls-dir ,root-str)))) - (ls-defdir *cls-asdf-dir* "ASDF/") - (ls-defdir *cls-data-dir* "Data/") - (ls-defdir *cls-external-dir* "external/") - ;; reminder of testing - ;;(macroexpand '(ls-defdir *cls-asdf-dir* "ASDF")) - ;;(macroexpand-1 '(ls-defdir *cls-asdf-dir* "ASDF")) - ;;(macroexpand-1 '(ls-dir "ASDF")) - ) - ;;(pushnew *cls-asdf-dir* asdf:*central-registry*) ;;(pushnew #p"C:/Lisp/libs/" asdf-util:*source-dirs* :test #'equal) ; eg for Microsoft -(defpackage #:cls-system +(cl:defpackage #:cls-system (:use :common-lisp :asdf)) (in-package #:cls-system) @@ -127,7 +79,8 @@ "packaging" :pathname #p"src/" :components - ((:file "packages"))) + ((:file "packages") + (:file "config"))) (:module "proto-objects" diff --git a/src/config.lisp b/src/config.lisp new file mode 100644 index 0000000..2c12ef8 --- /dev/null +++ b/src/config.lisp @@ -0,0 +1,57 @@ +;;; -*- mode: lisp -*- + +;;; Time-stamp: <2010-02-08 16:10:16 tony> +;;; Creation: <2009-03-12 17:14:56 tony> +;;; File: template.lisp +;;; Author: AJ Rossini +;;; Copyright: (c)2009--, AJ Rossini. Currently licensed under MIT +;;; license. See file LICENSE.mit in top-level directory +;;; for information. +;;; Purpose: Template header file + +;;; What is this talk of 'release'? Klingons do not make software +;;; 'releases'. Our software 'escapes', leaving a bloody trail of +;;; designers and quality assurance people in its wake. + +;;; This organization and structure is new to the 21st Century +;;; version.. Think, "21st Century Schizoid Man". + +;;; enforce all floating reads as doubles +;; (setf *read-default-float-format* 'double-float) + +;;; optimization settings +;; (proclaim '(optimize (safety 2) (space 3) (speed 3))) + + +(in-package :lisp-stat-config) + +(defvar *common-lisp-stat-version* "1" + "Version currently loaded and being used. Need to make into a + parseable object for version testing. Currently using integers.") + +(defparameter *cls-home-dir* + (directory-namestring + (truename (asdf:system-definition-pathname :cls))) + "Value considered \"home\" for the installation") + +#| +(setf *cls-home-dir* + ;; #p"/cygdrive/c/local/sandbox/Lisp/CommonLispStat/"w + ;; #p"/home/tony/sandbox/CommonLispStat.git/" + #p"/home/tony/sandbox/CLS.git/") +|# + +(macrolet ((ls-dir (root-str) + `(pathname (concatenate 'string + (namestring *cls-home-dir*) ,root-str))) + + (ls-defdir (target-dir-var root-str) + `(defvar ,target-dir-var (ls-dir ,root-str)))) + (ls-defdir *cls-asdf-dir* "ASDF/") + (ls-defdir *cls-data-dir* "Data/") + (ls-defdir *cls-external-dir* "external/") + ;; reminder of testing + ;;(macroexpand '(ls-defdir *cls-asdf-dir* "ASDF")) + ;;(macroexpand-1 '(ls-defdir *cls-asdf-dir* "ASDF")) + ;;(macroexpand-1 '(ls-dir "ASDF")) + ) diff --git a/src/packages.lisp b/src/packages.lisp index b6c7823..cd8c784 100644 --- a/src/packages.lisp +++ b/src/packages.lisp @@ -1,6 +1,6 @@ ;;; -*- mode: lisp -*- -;;; Time-stamp: <2010-01-03 16:21:25 tony> +;;; Time-stamp: <2010-02-08 16:10:40 tony> ;;; Creation: <2008-03-11 19:18:34 user> ;;; File: packages.lisp ;;; Author: AJ Rossini @@ -31,6 +31,16 @@ ;;; Basics + +(defpackage :lisp-stat-config + (:documentation "holds Common Lisp Statistics configuration/loading variables and related functions.") + (:nicknames :cls-config) + (:use :common-lisp) + (:export *common-lisp-stat-version* + *default-path* + *lsos-files* *basic-files* *ls-files* + *cls-home-dir* *cls-data-dir* *cls-examples-dir*)) + (defpackage :lisp-stat-object-system (:nicknames :ls-objects :lsos) (:use :common-lisp) -- 2.11.4.GIT