[Top][All Lists]

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

Re: address@hidden

From: Matthew R Wette
Subject: Re: address@hidden
Date: Thu, 14 Dec 2000 16:06:50 -0800

address@hidden writes ...
> i'm trying to do the following:
> (define (newdefine symbol procedure)
>       (begin
>               (println "you just defined something")
>               (define symbol procedure)))
> doing this has the obvious problem that "procedure" will get evaulated
> before getting passed to the inside of the newdefine proedure, therefore
> i need to do this as a macro.  But while i've read every book i have on
> scheme macros, and tried expirmenting with the guile macro commands, 
> and passing differnt parameters to them, i cannot figure out how to get
> the guile macros to work.
> how would one use the guile macro system to do such a thing?

  (use-modules (ice-9 syncase))
  (define-syntax newdefine
    (syntax-rules ()
     ((_ symbol procedure)
       (write "you just defined something")
       (define symbol procedure)))))

  (newdefine x 1)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]