scsh-users
[Top] [All Lists]

Re: Dirty macros with define-syntax?

To: scsh-news@zurich.ai.mit.edu
Subject: Re: Dirty macros with define-syntax?
From: Rolf-Thomas Happe <rthappe@mathematik.uni-freiburg.de>
Date: 06 Mar 2002 17:03:37 +0100
Organization: IAM * ALU Frg * Germ
Antti Karttunen writes:
> Next I would like to know whether a macro defined
> in such way as a transformer function can define more
> similar dirty macros by calling define-syntax
> at its expansion time? And if so, should those invocations
> (of macro define-convform) occur inside some of the
> structure- (i.e. Scheme48/scsh-module) -definitions?

You may find the little Doedel package listed at
http://www.scsh.net/resources/markup.html
moderately helpful, in particular the config file
doedules.scm.  You'll find low-level macros, some using
helper functions, macros defining macros, plus the 
corresponding structure definitions.  (The package 
contains also an experimental trashy part misusing
SYNTAX-RULES to extend rather than to define syntax.)
 
> Or should I use guile-scsh instead, with presumably has
> the guile's old-fashioned define-macros?

The hair you notice comes with Scheme 48's refined module 
system.  Macros and modules don't team up easily, by their 
very nature: both macro expanders and the expanded code
may refer to objects by name, but the module system 
restricts visibility and forces you to make (part of)
the structure of the program explicit.  That is to say,
I wouldn't give up on structured programming and stick
with s48/scsh.

rthappe



<Prev in Thread] Current Thread [Next in Thread>