home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / usr.bin / lisp / lispnews / text0213.txt < prev    next >
Encoding:
Text File  |  1985-11-10  |  3.1 KB  |  83 lines

  1. A very quick check reveals the following suspiciousness:  The function
  2. in flavors.l being compiled when the failure occurs is apparently:
  3.  
  4. (DEFUN (FLAVOR :NAMED-STRUCTURE-INVOKE) (OPERATION &OPTIONAL SELF &REST ARGS)
  5.   (SELECTQ OPERATION
  6.        (:WHICH-OPERATIONS '(:PRINT-SELF :DESCRIBE))
  7.        (:PRINT-SELF
  8.         (SI:PRINTING-RANDOM-OBJECT (SELF (CAR ARGS))
  9.            (FORMAT (CAR ARGS) "FLAVOR ~S" (FLAVOR-NAME SELF))))
  10.        (:DESCRIBE (DESCRIBE-FLAVOR SELF))
  11.        (OTHERWISE
  12.         (FERROR NIL "~S UNKNOWN OPERATION FOR FLAVOR" OPERATION))))
  13.  
  14. This is the first appearance in the file of defun with a "function
  15. spec" instead of a symbol as the first argument.  This is a Lisp
  16. Machine hack which basically means to squirrel the functional object
  17. away under the :NAMED-STRUCTURE-INVOKE property of the plist of FLAVOR.
  18. (More precisely, the first arg is the Maclisp compatability syntax for
  19. (:PROPERTY FLAVOR :NAMED-STRUCTURE-INVOKE) ...)
  20.  
  21. Liszt could be choking as it tries to store into the
  22. function-definition slot of something other than a symbol.  Such
  23. abilities of defun are not documented in Franz, and it might be that
  24. your defun macro in common0.l has not been extended for such usage.
  25. Locally it is defined as follows:
  26.  
  27. ;--- defun
  28. ; maclisp style function defintion
  29. ;
  30. (def defun
  31.    (macro (l)
  32.       (prog (name type arglist body specind specnam)
  33.      (setq name (cadr l) l (cddr l))
  34.      (cond ((dtpr name)
  35.         (cond ((memq (cadr name) '(macro expr fexpr lexpr))
  36.                (setq l (cons (cadr name) l)
  37.                  name (car name)))
  38.               (t (setq specnam (car name)
  39.                    specind (cadr name)
  40.                    name (concat (gensym) "::" specnam))))))
  41.      (cond ((null (car l)) (setq type 'lambda))
  42.            ((eq 'fexpr (car l)) (setq type 'nlambda l (cdr l)))
  43.            ((eq 'expr (car l))  (setq type 'lambda l (cdr l)))
  44.            ((eq 'macro (car l)) (setq type 'macro l (cdr l)))
  45.            ((atom (car l))
  46.         (setq type 'lexpr
  47.               l (nconc (list (list (car l)))
  48.                    (cdr l))))
  49.            (t (setq type 'lambda)))
  50.      (setq body (list 'def name (cons type l)))
  51.      (cond (specnam
  52.           (return (list 'progn ''compile
  53.                 body
  54.                 (list 'putprop
  55.                       (list 'quote specnam)
  56.                       (list 'getd
  57.                         (list 'quote name))
  58.                       (list 'quote specind)))))
  59.            (t (return body))))))
  60.  
  61. You could also check by invoking liszt without arguments and then
  62. asking it
  63.     (testmac '(defun (foo bar) () (hello goodbye)))
  64. and seeing if it properly generates
  65.     (progn 'compile (defun ... ) (putprop ... ))
  66.  
  67. On another matter, I have recently been making a number of minor
  68. bugfixes to the flavor and various other MIT compatibility packages.
  69. These files come indirecly from Maclisp or Lisp Machines, and the ports
  70. have generally never been exercised sufficiently to check all the
  71. obscure features.  These fixes postdate the versions Rich Zippel
  72. recently transmitted to Berkeley.  I will shortly distribute the
  73. new versions to Berkeley.
  74.  
  75. Believe it or not, the flavor system really does work under Franz.
  76. So do hash tables, defstruct, format, etc.  I use them every day.
  77.  
  78. Steve Haflich, MIT Experimental Music Studio
  79. smh@mit-ems@mit-mc
  80. {decvax!genrad, ihnp4}!mit-eddie!smh
  81.  
  82.  
  83.