mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Grammar
This commit is contained in:
parent
630f36dc03
commit
fc92f9c302
1 changed files with 3 additions and 3 deletions
|
@ -168,7 +168,7 @@ A [R<sup>7</sup>RS Compliance Chart](Scheme-Language-Compliance.md) lists differ
|
|||
|
||||
Cyclone provides two macro systems.
|
||||
|
||||
High-level hygienic macros may be created using `syntax-rules`. This system is based on a template language specified by R<sup>7</sup>RS. The specification goes into more detail on how to work with these macros.
|
||||
High-level hygienic macros may be created using `syntax-rules`. This system is based on a template language specified by R<sup>7</sup>RS. The specification goes into more detail on how to work with these macros:
|
||||
|
||||
(define-syntax when
|
||||
(syntax-rules ()
|
||||
|
@ -176,7 +176,7 @@ High-level hygienic macros may be created using `syntax-rules`. This system is b
|
|||
(if test
|
||||
(begin result1 result2 ...)))))
|
||||
|
||||
Alternatively a low-level explicit renaming (ER) macros system is also provided that allows defining macros using Scheme code, in a similar manner as `defmacro`. This macro system provides the convenience functions `(rename identifier)` to hygienically rename an identifier and `(compare identifier1 identifier2)` to compare two identifiers.
|
||||
Alternatively a low-level explicit renaming (ER) macros system is also provided that allows defining macros using Scheme code, in a similar manner as `defmacro`. This macro system provides the convenience functions `(rename identifier)` to hygienically rename an identifier and `(compare identifier1 identifier2)` to compare two identifiers:
|
||||
|
||||
(define-syntax when
|
||||
(er-macro-transformer
|
||||
|
@ -194,7 +194,7 @@ Alternatively a low-level explicit renaming (ER) macros system is also provided
|
|||
cyclone> (expand '(when #t (+ 1 2 3)) *global-environment* '())
|
||||
(if #t ((lambda () (+ 1 2 3))) )
|
||||
|
||||
- Alternatively when developing an ER macro, since its just a Scheme function, the macro can be defined as a `lambda` and passed a quoted expression to debug.
|
||||
- Alternatively when developing an ER macro, since its just a Scheme function, the macro can be defined as a `lambda` and passed a quoted expression to debug:
|
||||
|
||||
(pretty-print
|
||||
((lambda (exp rename compare)
|
||||
|
|
Loading…
Add table
Reference in a new issue