(in-package "PENMAN")

;;; File: mule-readtables.lisp
;;; 

;;; Mule has unfortunate character encodings that need to be 
;;; passed through the readtable... Almost all characters
;;; can occur in inopportune places. The following therefore
;;; provide a file loading function which takes an optional
;;; second parameter: this is a character that can be
;;; guaranteed *for the given file* to be able to function
;;; as a string delimiter and *only* as a string delimiter.
;;; So far the underscore has been reasonable, but there are
;;; cases when this does not work. 

(defvar *mule-temp-readtable* (copy-readtable))

(defun Mule-Load-File (file &optional (delchar #\_))
  (let ((*mule-temp-readtable* (copy-readtable)))
    (set-syntax-from-char delchar #\" *mule-temp-readtable* *readtable*)
    (set-syntax-from-char #\" #\a *mule-temp-readtable* *readtable*)
    (let ((*readtable* *mule-temp-readtable*))
      (load file))))



