Number: 1567

Date: 29-Jun-84  8':52':22

Submitter: Sannella.PA

Source: Shrager.pa

Subject: Want DEFMACRO support for Macros in Interlisp-D

Lisp Version: 

Description: '
Date': 28 Jun 84 11':05 PDT'
From': masinter.pa'
Subject': [Shrager.pa': Re': DefMacro]'
To': lispsupport'
cc': shrager, jonl'
'
Please enter this in as an AR, attn Masinter, Want better support for Macros in Interlisp-D, Environment/File package, Priority': Perhaps, Difficulty': Moderate, Impact': Annoying.'
'
Thanks,'
'
Larry'
'
     ----- Begin Forwarded Messages -----'
'
Date': 27 Jun 84 13':41 PDT'
From': Shrager.pa'
Subject': Re': DefMacro'
In-reply-to': masinter.pa''s message of 27 Jun 84 13':12 PDT'
To': masinter.pa'
cc':  JonL.pa'
'
In MacLisp, compute macros share the first order status of function definitions.  You don''t have to jam things onto props and there is a special defining form for them called "defmacro"':'
'
	(DEFMACRO foo (a b c) |''(prog (print , a)'
							   (print , b)'
				... etc ...'
		)'
'
The computation is precisely like that of a computational macro.  It binds up A, B, and C, and then returns a form to be evaled (either interpretively or inserted by the compiler for runtime execution).'
'
MacLisp macros are used much more freely than InterLisp macros. I believe that it is the first order status enjoyed by macros, in having their own defining form, etc, that enables this more extensive utility.  I use defmacro all the time, but use macros in InterLisp almost never (until last evening, at which point I wrote defmacro, and so will now begin using them again).  The problem with InterLisp macros, is that (a) there is an extra hassle in making them, and (b) there is an extra hassle in reading through all the silly types of macros.  In fact, MacLisp defmacro (combined with bquote) subsumes all these interpretations of the InterLisp macro': "=", "NIL", computational, and "LAMBDA"/"NLAMBDA".  '
'
In any case, my implementation of defmacro, merely binds a dummy var (since the only way to start up a computational macro is to have the car of the macro prop be an atom) and then destructs it into the required atoms, finally evaling the form.  All this machinery gets automagically putproped to the ''MACRO prop of the named macro.  The implementation is just a couple lines of InterLisp code. '
'
However, not only do I want to  make the macro work right once defined, but I want it to look right in DEdit and be filed correctly (i.e., pretty printed with the defmacro defining form, rather than as a macro prop).  I thought that this would be easy... but it apparently isn''t so easy.'
'
How''s that for a clear exposition?'
'
Thanks for the help,'
	Jeff'
'
     ----- End Forwarded Messages -----'


Workaround: 

Test Case: 

Edit-By: masinter.PA

Edit-Date: 13-Jul-84 20':28':14

Attn: Masinter, JonL

Assigned To: 

In/By: 

Disposition: 

System: Programming Environment

Subsystem: File Package

Machine: 

Disk: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Difficulty: Moderate

Frequency: Everytime

Impact: Annoying

Priority: Perhaps

Status: Open

Problem Type: Design - UI

Source Files: