;;; ----------------------------------------------------------------------
;;;
;;; Talk basic startup
;;;
;;; ----------------------------------------------------------------------


;;; Setup the workspace environment

;; First: Set the (workspace-path). This tells Talk where to search for
;; the workspaces.

(setf (workspace-path)
  (append '(#f"${ILT_DIR}/iltcplib/src"
	    #f"${ILT_DIR}/iltviews/src"
	    #f"${ILT_DIR}/powercls/src"
	    #f"${ILT_DIR}/iltviews/contrib/src"
	    #f"${ILT_DIR}/talk/contrib/src"
	    #f"${ILT_DIR}/talk/contrib/ttt/src"
	    #f"${HOME}/talk-play/src")
	  (workspace-path)))

;; Second: Set the (default-workspace).

(setf (default-workspace) 'playws)

;; Third: Determine the list of workspaces we want to see, and load them.

(defglobal .library-workspaces
  '((libiltdev . talkws)
    (libiltviewse . iltviewsws)
    (libpwce . powerws)))

(let ((workspaces
        (collecting
          (for (((lib wsp) in-alist: .library-workspaces))
            (when (module-loaded-p lib)
              (collect wsp))))))
  ;; Load them all at once. This also loads the (default-workspace).
  (in-workspaces workspaces)
)


;;; Debug mode.

(debug t)
