[Top][All Lists]

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

Re: Write a macro which defines a procedure

From: Zelphir Kaltstahl
Subject: Re: Write a macro which defines a procedure
Date: Sun, 21 Jul 2019 04:05:21 +0200
User-agent: Posteo Webmail

Ah thanks! Sometimes one does not see the simple solution. I was thinking that it would have to be something complicated.

On 2019-07-20 22:37, Ricardo Wurmus wrote:
Hi Zelphir,

This was I found out about an issue, but not sure how to solve it. It
seems like `module-define!` wants to have a symbol as input. But I
could not figure out how to create a symbol from an identifier.

Here is my updated version of the macro:
(define-syntax define-api-route
  (syntax-rules ()
    [(define-api-route route http-method my-content-type)
     (module-define! (current-module)
;; `route` should be `/container/json` for example.

Use (quote route) instead.

reply via email to

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