Andrew Gwozdziewycz on 5 Feb 2008 07:10:12 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: good example of macros?

  • From: "Andrew Gwozdziewycz" <apgwoz@gmail.com>
  • To: philly-lambda@googlegroups.com
  • Subject: Re: good example of macros?
  • Date: Tue, 5 Feb 2008 10:10:02 -0500
  • Authentication-results: mx.google.com; spf=pass (google.com: domain of apgwoz@gmail.com designates 209.85.162.176 as permitted sender) smtp.mail=apgwoz@gmail.com; dkim=pass (test mode) header.i=@gmail.com
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to:received:received:received-spf:authentication-results:received:dkim-signature:domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:reply-to:sender:precedence:x-google-loop:mailing-list:list-id:list-post:list-help:list-unsubscribe; bh=t3GPFQTz/wzydeEPbIb2CFWs1o62B9RMI2n4nVQBaok=; b=NCxun9suGYl9EKpnOXAUmfmKzZc8XsSswf1AJkUMh+eoMQZjKpVgk7LUWkE2hFpHpc7fPxrzzvLxKTZ3l0+m/TBm82oJC7pDbSogtDQgJaKxjcBbgnY/yFfWvul5lTJqouzmd+UNl21AjIxtM3z5RJr97vwAWIZmqBTMBuyvR4g=
  • Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=mOjMilwl5XRrP3thaeBLnMcZ4eA0/6Lh8T20oR1WWM0=; b=Xg8xy0zlYrXJTSzq0axXT/TFRtOcZoobCdkwzdl/bvZcep8OOBlc0d/aQqirUJxW9fNhlAqQ40edU8W0CVsD2oSFNr/as4kCNq2zX/EJFARKaeeYbhW/cnqeDZhZM4Ztk7++nc1LbFcy24ozKYK8Bs9HdIbyXau3Mvejb10iFZU=
  • Mailing-list: list philly-lambda@googlegroups.com; contact philly-lambda-owner@googlegroups.com
  • Reply-to: philly-lambda@googlegroups.com
  • Sender: philly-lambda@googlegroups.com

On Feb 4, 2008 10:30 PM, Kyle R. Burton <kyle.burton@gmail.com> wrote:
>
> > > One set of macros that has always interested me was the automata
> > > example in this paper:
> > > http://www.cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf
> > > by Shriram Krishnamurthi.
> > >
> > > It really shows the power of what can be done. cut, while a great
> > > macro and a way to save some keystrokes really doesn't do macros
> > > justice.
>
> What that paper shows is a great example of macros - though, I wonder
> how well it'd fit (time wise) into the introduction to lisp
> presentation - perhaps into a presentation on more intermediate or
> advanced topics (like macros)?

I agree. It may however get people thinking about just what is
possible with macros. `cut` isn't nearly as compelling an example.
Explanation of it is left as an excercise to the reader... :)

> Also, do you have any references for
> define-syntax, syntax-rules, and let-syntax?  The best one I'd found
> so far is JRM's syntax-rules primer:

R5RS defines define-syntax, syntax-rules and let-syntax (as well as
letrec-syntax), so you're canonical reference is there. The primer you
linked too is a better practical guide.

> Are there any others that you can recommend?

Not that I can think of. Ed Watkeys might know of more resources, or
better examples.

> I can be prepared to talk through that paper -- if that is what the group wants...

I'm not suggesting anyone wants that. I high level introduction to
Lisp is probably the best choice. I sent you the link to the paper,
because the purpose of the paper was merely to show a practical
application of macros.

-- 
Andrew Gwozdziewycz
apgwoz@gmail.com
http://www.apgwoz.com  | http://www.photub.com