From: Peter Seibel
Subject: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <m3znfqt28d.fsf@javamonkey.com>
So I'm trying to place Lisp macros in some context relative to other
things that go by the name of "macros". Obvious examples I can think
of are:

  - macro assembers
  - C Preprocessor
  - m4
  - TeX

Can anyone think of any macro systems that are more like Common Lisp's
(excluding those with an obvious "genetic" relation such as Scheme's
or Dylan's)? For instance, are there any other macro systems that use
a data type other than text?

-Peter

-- 
Peter Seibel                                      ·····@javamonkey.com

         Lisp is the red pill. -- John Fraser, comp.lang.lisp

From: Artie Gold
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <3F99F80E.5090904@austin.rr.com>
Peter Seibel wrote:
> So I'm trying to place Lisp macros in some context relative to other
> things that go by the name of "macros". Obvious examples I can think
> of are:
> 
>   - macro assembers
>   - C Preprocessor
>   - m4
>   - TeX
> 
> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?
> 
Once upon a time (and it still may be the case) Unisys (formerly 
Burroughs) Algol
had a facility for `compile time code', whose output would be 
compiled as program source.

Unfortunately a combination of the mists of time -- as well as the 
fact that it seems no free, publicly available information exists 
(or at least *I* haven't found any), there's not much else I can 
add. ;-(

Cheers,
--ag




-- 
Artie Gold -- Austin, Texas
Oh, for the good old days of regular old SPAM.
From: Frank A. Adrian
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <9Dxmb.22$e17.13541@news.uswest.net>
Peter Seibel wrote:

> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?
> 

There are macro systems that push string-based macro expressions farther
than your examples do. The main issue is not that the language is embedded
in strings, but that there is computation and an interesting environment
available at expansion time, as well as textual substitution.

If you look at it this way, it is clear that the old SNOBOL language with
its EVAL statement could be considered an example. 

You might also check out TRAC at http://www.tracfoundation.org/.

faa
From: Marcin 'Qrczak' Kowalczyk
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <pan.2003.10.25.09.20.56.230365@knm.org.pl>
On Sat, 25 Oct 2003 03:42:11 +0000, Peter Seibel wrote:

> Can anyone think of any macro systems that are more like Common Lisp's

My bet would be camlp4 and Template Haskell.

-- 
   __("<         Marcin Kowalczyk
   \__/       ······@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/
From: Jon S. Anthony
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <m38yn91gv0.fsf@rigel.goldenthreadtech.com>
Peter Seibel <·····@javamonkey.com> writes:

> So I'm trying to place Lisp macros in some context relative to other
>...
> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)?

BLISS?

/Jon
From: Paolo Amoroso
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <877k2tfxdc.fsf@plato.moon.paoloamoroso.it>
Peter Seibel writes:

> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use

You may check Poplog.


Paolo
-- 
Paolo Amoroso <·······@mclink.it>
From: Gareth McCaughan
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <87brs5gnu6.fsf@g.mccaughan.ntlworld.com>
Peter Seibel <·····@javamonkey.com> writes:

> So I'm trying to place Lisp macros in some context relative to other
> things that go by the name of "macros". Obvious examples I can think
> of are:
> 
>   - macro assembers
>   - C Preprocessor
>   - m4
>   - TeX
> 
> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?

C++ templates.

-- 
Gareth McCaughan
.sig under construc
From: Kimmo T Takkunen
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <slrnbpln5g.p72.ktakkune@sirppi.helsinki.fi>
In article <··············@javamonkey.com>, Peter Seibel wrote:

> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?
> 

I think Concurrent Clean has now macros (Clean functions) that can do
almost anything that Clean itself can. There is some silly
restrictions like functions can't be recursive etc. Their site is now
down http://www.cs.kun.nl/~clean/ so I can't check the manual.


 Kimmo
-- 
((lambda (integer) ;; http://www.iki.fi/kt/ 
   (coerce (loop for i upfrom 0 by 8 below (integer-length integer)
                 collect (code-char (ldb (byte 8 i) integer))) 'string))
 100291759904362517251920937783274743691485481194069255743433035)
From: Rob Warnock
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <SEWdnRR3wuC7GgaiXTWc-g@speakeasy.net>
Peter Seibel  <·····@javamonkey.com> wrote:
+---------------
| So I'm trying to place Lisp macros in some context relative to other
| things that go by the name of "macros". Obvious examples I can think
| of are:
| 
|   - macro assembers
+---------------

I have commented on this several times before[1], but the ancient
PDP-10 assembler named "MACRO-10" really *deserved* its name! Its
macro system allowed you to do all manner of compile-time computation
[though not quite as much as Lisp's, since you couldn't read/write
files other than to "include" them], including accumulating state
through the course of a compilation [in compile-time variables] and
planting the result as data or code objects at the end. When I first
started using DEFMACRO [2] after years of suffering with C's so-called
"macros" my first thought was: "Wow! A macro system better than MACRO-10!"

Note: BLISS macros weren't bad, either, but weren't nearly as rich as
MACRO-10's. BLISS "structures", on the other hand, were quite interesting:
Imagine a kind of macro that tells the compiler how to interpret array
references, so that "A[I,J,K] := .A[I,J,K] + 17" might actually be a
database update!


-Rob

[1] <URL:http://groups.google.com/groups?q=rpw3+focal+macro-10>

[2] O.k., so it was in a Scheme (Jaffer's SCM), but it was still DEFMACRO.

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Sebastian Stern
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <ad7d32de.0310260240.ef29f06@posting.google.com>
Peter Seibel wrote:
> So I'm trying to place Lisp macros in some context relative to other
> things that go by the name of "macros". Obvious examples I can think
> of are:
> 
>   - macro assembers
>   - C Preprocessor
>   - m4
>   - TeX
> 
> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?

What about Mathematica? (Then again, Mathematica could be considered a
decendant of Lisp) I don't know much about Mathematica, but I do know
it has a thing called 'rules'. Mathematica's rules transform code (as
data not as strings) into other code. Of course the big difference is
that the Lisp macro expansion, unlike a rule, is evaluated in the
environment in which the macro was invoked.

Sebastian Stern
"Freedom is the freedom to say (= (+ 2 2) 4). If that is granted, all
else follows."
From: Paul Tarvydas
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <DMGmb.48532$3f.36468@twister01.bloor.is.net.cable.rogers.com>
Peter Seibel wrote:

> Can anyone think of any macro systems that are more like Common Lisp's
> (excluding those with an obvious "genetic" relation such as Scheme's
> or Dylan's)? For instance, are there any other macro systems that use
> a data type other than text?

No!

I think that you are writing a book for people coming to lisp from
"standard" languages.  There is a huge chasm between what "macro" means to
them and what "macro" means to lispers.

Lisp macros are a language/compiler-rewriting system.

So, I think you need to go to something like Lex + Yacc to get across the
"idea" of how powerful lisp macros are (e.g. a C compiler with Lex + Yacc
built into the syntax of C).

Really fancy uses of Tcl/Tk has some of lisp's power, but references to
Tcl/Tk string evals will bring all sorts of other ugly baggage with it
(e.g. misplaced concerns of major inefficiency).  Does perl have string
eval?

Or, make an analogy to a fictitious C compiler that uses the full syntax of
C as its "macro" language.

Or, maybe fancy CGI's (things that emit html "code", javascript) might get
the concept across?

pt
From: Alex Mizrahi
Subject: Re: Non-Lisp "macro" system closest to Common Lisp's?
Date: 
Message-ID: <bnl3gf$128119$1@ID-177567.news.uni-berlin.de>
(message (Hello 'Paul)
(you :wrote  :on '(Sun, 26 Oct 2003 02:59:47 GMT))
(

 PT> it (e.g. misplaced concerns of major inefficiency).  Does perl have
 PT> string eval?

yes it has

)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "Jane dates only Lisp programmers"))