Newsgroups: comp.lang.lisp
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!barmar
From: barmar@think.com (Barry Margolin)
Subject: Re: macro misbehaviour
Message-ID: <1991Jun11.035518.11535@Think.COM>
Sender: news@Think.COM
Reply-To: barmar@think.com
Organization: Thinking Machines Corporation, Cambridge MA, USA
References: <1991Jun9.215315.25797@src.dec.com>
Date: Tue, 11 Jun 91 03:55:18 GMT
Lines: 25

In article <1991Jun9.215315.25797@src.dec.com> meehan@src.dec.com (Jim Meehan) writes:
>2. You're using a macro only because you're trying to "call" another macro;
...
>It may be that the macro (Define-Class x y z) expands into something
>simple like (*Define-Class 'x 'y 'z), where *Define-Class is a function
...
>If that's not an option, then you may want to define a separate "pass"
>in which you make all your calls to class-from-file

Actually, solving the problem of trying to "call" a macro is one of the few
excuses for using EVAL.

CLASS-FROM-FILE could be a function (*not* a macro) that looks something
like this:

(defun class-from-file (file-name)
  (with-open-file (input-stream file-name :direction :input)
    (dotimes (q 4)
      (eval `(define-class ,(read input-stream) ,(read input-stream)
		.,(read input-stream))))))
-- 
Barry Margolin, Thinking Machines Corp.

barmar@think.com
{uunet,harvard}!think!barmar
