;; can use :cl foo to compile and load in alload
(proclaim '(optimize (speed 3) (safety 3) (compilation-speed 0) (space 1)
		     ;;(debug 3)
		     ))

;; ------------------------- GLOBALS FOR COMPILATION ---------------------------
(defvar *current-experiment* 
  "holds name of current loaded experiment in terms of init function")

(defvar *myPath* "" )

(setq *mypath* "/home/beet3/cmaley/diversity/null/clade/")
(defvar *scratchPath* "" )

(defvar *fasl-path*)
(setf *fasl-path* "/home/beet3/cmaley/diversity/null/clade/")

;(defvar *seedFile* "" )
;(setq *seedFile* "myrng.seeds1")

(defvar *source-path* "")
(setq *source-Path* "/home/beet3/cmaley/diversity/null/clade/")

;; ------------------------------- UTILITY ROUTINES ---------------------------

;(defun load-fasl-list (file-list)
;  (let (loadfile)
;    (setf *print-pretty* t)
;  #+:MCL  (setf *backtrace-on-break* t)
;  #+:MCL  (setf *save-local-symbols* t)
;  #+:MCL  (setf *fasl-save-local-symbols* t)
;    (checkSpecialEgc)
;    (tenuring 
;     (dolist (fname file-list)
;           (setf loadfile (concatenate 'string *fasl-Path* (string fname) ".wfasl"))
;           (load loadfile :verbose nil :print nil))
;     ) ;end of tenuring
;    )) ;;end of load-fasl-list

(defun load-fasl-list (file-list)
  (let (loadfile)
    (setf *print-pretty* t)
     (dolist (fname file-list)
	   (setf loadfile (concatenate 'string *fasl-Path* (string fname) ".wfasl"))
	   (load loadfile :verbose nil :print nil))
    )) ;;end of load-fasl-list

(defun load-lisp-list (file-list)
  (let (loadfile)
    (setf *print-pretty* t)
    #+:MCL(setf *backtrace-on-break* t)
    #+:MCL(setf *save-local-symbols* t)
    #+:MCL(setf *fasl-save-local-symbols* t)
    (checkSpecialEgc)
    (setf *load-verbose* t)
    ;;(checkForDebug)
    (dolist (fname file-list)
	   (setf loadfile (concatenate 'string *source-Path* (string fname) ".lisp"))
	   (load loadfile))
    )) ;;end of load-lisp-list

(defun compile-file-list (file-list &optional (verbose-flag t) (print-level 1))
  (let (compile-file fasl-file)
    (setf *print-pretty* t)
    #+:MCL(setf *backtrace-on-break* t)
    #+:MCL(setf *save-local-symbols* t)
    #+:MCL(setf *fasl-save-local-symbols* t)
    (dolist (fname file-list)
	    (setf compile-file (concatenate 'string *source-Path*  (string fname) ".lisp"))
	    (setf fasl-file (concatenate 'string *fasl-Path*  (string fname) ".wfasl"))	    
	    (compile-file compile-file :output-file fasl-file :load t
			  :verbose verbose-flag :print print-level)
	    ;;(break)
	    )))

(defvar *tree-files* '("consts" "tree-macros" "random" "data-structs" "tree" "io" "classify" "diversity" "debug"))
  
;(load "consts")
;(load "tree-macros")
;(load "random")
;(load "data-structs")
;(load "tree")
;;(load "analysis")
;;(load "extinction")
;(load "io")
;(load "classify")
;(load "diversity")
;(load "debug")
