;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Filename: setup.il
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Description: Load all files with .il extension from first directory in
;;; SkillPath.
;;; This file should be called from the top level setup file which has set
;;; the skill path to point at the directory in which this file is located.
let((loadFiles excludeFiles allFiles skillFiles)
;;----------------------------------------------------------
;; List files (with non .il extension) to be loaded
;;----------------------------------------------------------
loadFiles = list(
); includeFiles
;;----------------------------------------------------------
;; List files (with .il extension) not to be loaded
;;----------------------------------------------------------
excludeFiles = list(
"setup.il" ; prevent recursive load
"cdsp4_lib.il" ;
); excludeFiles
;;-----------------------------------------------------------
;; Get all the skill files in the current directory
;;-----------------------------------------------------------
allFiles = getDirFiles(simplifyFilename(car(getSkillPath())))
skillFiles = setof(file allFiles rexMatchp("\\.il$" file))
;;-----------------------------------------------------------
;; Derive list of files to be loaded
;;-----------------------------------------------------------
foreach(file skillFiles
unless(member(file loadFiles) || member(file excludeFiles)
loadFiles = cons(file loadFiles)
); unless
); foreach
;;-----------------------------------------------------------
;; Load the files - loadi to keep going after an error
;;-----------------------------------------------------------
foreach(file loadFiles loadi(file))
);let