🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Dana S. Nau Tue, 23 Sep 1986 14:57
Franz Lisp compiler problems
#698
Author: Dana S. Nau
Date: Tue, 23 Sep 1986 14:57
21 lines
1345 bytes
I'm trying to get Franz Lisp to compile macros without putting
	(declare (macros t))
in the file being compiled.  The reason why I want to do this is that
my code needs to be intelligible to lisps other than just Franz, and
"(declare (macros t))" seems to be pretty Franz-dependent.

I thought this could be done by invoking the compiler as follows:
	liszt -e '(declare (macros t))' foo.l
However, this didn't work--the compiler acted exactly the same as if I had
typed
	liszt foo.l

I've tried several other approaches as well, but the only thing that has
worked is to do it all from Unix:
	(echo '(declare (macros t))' ; cat foo.l) > bar.l
	liszt bar.l
and that seems like a real kluge.  Can anyone suggest anything better?
-- 

Dana S. Nau,  Comp. Sci. Dept.,  U. of Maryland,  College Park,  MD 20742
dsn@maryland		seismo!umcp-cs!dsn		(301) 454-7932
Re: Franz Lisp compiler problems
#699
Author: Charles A. Cox
Date: Thu, 02 Oct 1986 18:14
19 lines
1353 bytes
In article <3542@umcp-cs.UUCP> dsn@umcp-cs.UUCP (Dana S. Nau) writes:
>I'm trying to get Franz Lisp to compile macros without putting
>	(declare (macros t))
>in the file being compiled.  The reason why I want to do this is that
>my code needs to be intelligible to lisps other than just Franz, and
>"(declare (macros t))" seems to be pretty Franz-dependent.

I think the easiest way would be to put the following statement in your
file:

#+Franz (declare (macros t))

That way only the franz reader will see the declare.

Incidentally, Franz users with questions and answers like these may be
interested in subscribing to "franz-friends@Berkeley.EDU".  Send
requests to
  "franz-friends-request@Berkeley.EDU" or to
  "...!ucbvax!franz-friends-request".
Re: Franz Lisp compiler problems
#701
Author: michael maxwell
Date: Thu, 02 Oct 1986 18:51
23 lines
1680 bytes
In article <3542@umcp-cs.UUCP> dsn@umcp-cs.UUCP (Dana S. Nau) writes:
>I'm trying to get Franz Lisp to compile macros without putting
>	(declare (macros t))
>in the file being compiled.  The reason why I want to do this is that
>my code needs to be intelligible to lisps other than just Franz, and
>"(declare (macros t))" seems to be pretty Franz-dependent.
>
>I thought this could be done by invoking the compiler as follows:
>	liszt -e '(declare (macros t))' foo.l
>However, this didn't work--the compiler acted exactly the same as if I had
>typed
>	liszt foo.l
>
I'm not sure why this didn't work; I do something quite similar, and it
works--but then there are lots of versions of Franz (ours is opus 38.91)...
What I'd suggest is putting a conditional into the file, like:
	#+franz (declare (macros t))
We use exactly this, and it works (in our opus!).  The documentation is in
section 8.3.4.1 of our manual.  This also exists in Common Lisp.
-- 
Mike Maxwell
Boeing Advanced Technology Center
	...uw-beaver!uw-june!bcsaic!michaelm
Re: Franz Lisp compiler problems
#703
Author: Barry Margolin
Date: Sun, 05 Oct 1986 07:40
23 lines
1543 bytes
In article <708@bcsaic.UUCP> michaelm@bcsaic.UUCP (michael maxwell) writes:
>In article <3542@umcp-cs.UUCP> dsn@umcp-cs.UUCP (Dana S. Nau) writes:
>>I'm trying to get Franz Lisp to compile macros without putting
>>	(declare (macros t))
>>in the file being compiled.
...
>>I thought this could be done by invoking the compiler as follows:
>>	liszt -e '(declare (macros t))' foo.l
>>However, this didn't work ...
>I'm not sure why this didn't work;....

I think I am.  He should have used 
	liszt -e '(macros t)' foo.l

If Franz declare is like Maclisp declare, it means that the enclosed
forms should be evaluated when the form is compiled; when a declare form
is evaluated by the interpreter it is ignored completely.  So, the
original version passed in a declare form, which was evaluated (not
compiled) and summarily ignored.
-- 
    Barry Margolin
    ARPA: barmar@MIT-Multics
    UUCP: ..!genrad!mit-eddie!barmar
Re: Franz Lisp compiler problems
#707
Author: Dana S. Nau
Date: Tue, 14 Oct 1986 15:31
56 lines
2759 bytes
In article <3542@umcp-cs.UUCP>, I asked how one could get Franz Lisp to
compile macros without putting
	(declare (macros t))
into the file being compiled.  The reason for this was that the code
needed to be intelligible to Lisps other than just Franz Lisp, and
"(declare (macros t))" is unintelligible to other Lisps.

Several people sent me proposed solutions, and others wrote asking to see
these solutions.  My attempts at sending direct responses haven't worked, so
I'm posting a summary to the net:

----------------

The following suggestion came from three different people:

	ricks@cad.berkeley.edu (Rick L Spickelmier)
	seismo!ihnp4!ihuxf!dunk (Tom Duncan)
	seismo!mcvax!botter.vu44.uucp!fons (Fons Botman)

The suggestion is to use something like

	#+franz (declare (macros t))

This only works in Lisps which recognize the #+ readmacro.  However, this
includes all of the Lisp systems I'm using (Franz Lisp, Symbolics Zeta Lisp,
and TI Zeta Lisp).  Thus, this is the solution I decided to use.

----------------

Botman also made two other suggestions.
The first suggestion was to invoke the compiler as

	liszt -e '(declare (macros t))' source-file

On Opus 42.16.3, this doesn't work--the declaration is ignored.  The second
suggestion was to put all the system-dependent code (including the "(declare
(macros t))" statement into a file called sysdep.l, and put

	(include sysdep.l)

into the source file.  This works in Franz Lisp, but not in other Lisps,
because the meaning of "include" is Franz-dependent.

----------------

topaz!think!mit-eddie!mit-athena!yba@trillian.arpa suggested that I create a
makefile which invoked "liszt < control-file" rather than "liszt
source-file".  "control-file" could then include all sorts of
Franz-dependent stuff, followed by the s-expression (liszt source-file).
This approach would less be convenient than the #+franz readmacro, but it
would be more general, in the sense that it would work with Lisps which
don't recognize the #+franz readmacro.
-- 

Dana S. Nau,  Comp. Sci. Dept.,  U. of Maryland,  College Park,  MD 20742
dsn@maryland		seismo!umcp-cs!dsn		(301) 454-7932
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads