better load file interface
Wed Jul 26 04:22:21 PDT 2006 grue@mail.ru
* better load file interface
diff -rN -u old-lifp/console.lisp new-lifp/console.lisp
--- old-lifp/console.lisp 2014-07-30 06:15:42.000000000 -0700
+++ new-lifp/console.lisp 2014-07-30 06:15:42.000000000 -0700
@@ -141,10 +141,26 @@
:defaults file))
(values file dir))))
+(defun splice-filename (file)
+ "Returns file itself and its directory as the second value"
+ (values file (make-pathname
+ :directory (pathname-directory file)
+ :name nil
+ :type nil
+ :defaults file)))
(defun load-module (startup lib-loader)
"Loads IF module into the interpreter"
- (multiple-value-bind (file dir) (pick-file)
+ (multiple-value-bind (file dir)
+ (splice-filename (get-open-file :filetypes '(("Loadable files"
+ "*.fas *.lisp")
+ ("Compiled story files"
+ "*.fas")
+ ("Plain story files"
+ "*.lisp")
+ ("All files" "*"))
+ :title "Load story file"))
+ ;;(pick-file) <- was used before
(unless file (append-text *text* (format nil "Failed to load module.~%"))
(return-from load-module nil))
(funcall lib-loader file dir)
@@ -194,5 +210,4 @@
(terpri *standard-output*))
(progn (configure *text* :state "normal")
(append-text *text* (apply #'format nil string args))
- (append-text *text* "
-"))))
\ No newline at end of file
+ (append-text *text* (make-string 1 :initial-element #\Newline)))))