12345678910111213141516171819202122 |
- ;; Using eval-when, one can tell Guile when an expression
- ;; should be evaluated. eval-when is followed by a list of
- ;; phase names. There are 4 phases one can specify: expand,
- ;; load, eval, compile. For more information see the
- ;; official manual at
- ;; https://www.gnu.org/software/guile/manual/html_node/Eval-When.html
- ;; Reminder:
- ;; #' = syntax -- what you write is just syntax -- pattern variables still inserted
- ;; #` = quasisyntax -- for when you need Scheme to calculate parts of the template
- ;; #, = unsyntax -- counterpart to quasisyntax -- evaluate expr inside an #` expr
- ;; #,@ = unsyntax-splicing -- evaluate and splice
- (eval-when (expand load eval)
- (define-syntax give-thing
- (λ (something)
- (syntax-case something ()
- [(_ anything)
- (syntax
- (lambda (a . b) anything))]))))
|