On 24-07-2022 03:21, Zelphir Kaltstahl wrote:

~~~~
(define-syntax require
   (identifier-syntax
    (syntax-error "'require' can only be used as part of a contract 
construct")))
~~~~

Can you explain how it works?

If you meant: how can identifier-syntax + syntax-error be used? -- I don't have more information than the explanations in the manual on identifier-syntax and syntax-error.

If you meant: how does it work?  I don't know how Guile's macro system is implemented, you'll have to look at the source code of (ice-9 psyntax), maybe read the paper it cites.

If you meant: how to use it? All you have to do is replace your (define require ...) by the (define-syntax require ...)

Greetings,
Maxime

Attachment: OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to