[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lossage after lossage



It doesn't help to be superstitious about Maclisp. In fact, it helps a lot
to keep things as simple as possible, not using a feature unless you
really understand what it is doing. Here is what I recommend:

(1) In one file, put your "compile-time" environment. This includes
    macros and readmacros, and special declarations, e.g.

(herald macros)
(defvar helplist)
(defun help-comment-readmacro ()
  (push (cons (read) (read)) helplist))
(setsyntax #/~ 'macro 'help-comment-readmacro)
(defmacro helplist-begin ()
  (setq helplist ())
(defmacro helplist-end ()
  `(defprop help ,helplist comments))

;; Note that I didn't bother with defining a fancy DEFREADMACRO, since
;; it just isn't worth the trouble.

(2) Then your source-file would look like :

(eval-when (eval compile)
  (or (get 'macros 'version) (load "macrofile")))

(helplist-begin)

.... stuff stuff stuff ...

(helplist-end)

(3) Do not use the Maclisp string package. It is has proven to
    be completely unreliable. An alternative, which has been used in a text
    editor written in maclisp, is in "GJC;CHAR >" on MIT-MC.
    Someday a reasonable string may be released as part of the Maclisp
    distribution, until then you should be able to get by fine with
    something like "GJC;CHAR >"
    Note that this file should be loaded at COMPILE and RUNTIME,
    since it includes declarations, readmacros, and code.

-gjc