@@ 3,20 3,24 @@ Install it in your site-dir and import i
## Example
- (use-modules (syntax def))
+ (use-modules (syntax define))
(define (divide-minus-one a b)
(when (= b 1) (error "We don't allow that here"))
(define b* (- b 1))
(/ a b*))
-This transforms all defines in expression context to (letrec ...).
+This transforms all defines in expression context to (letrec ...).
+
+## guile 2.2 AND 3
+
+guile-3 famously has definitions in some expression contexts. This expands on that (definitions in cond clauses and so on), and should also work just fine in guile 2.2 - albeit at a performance cost because internal definitions and letrec is slower in guile2.
## Supported forms
-The bodies of begin, lambda, define, let, let\*, letrec, letrec\*, case and cond are transversed and transformed.
+The bodies of begin, lambda, define, let, let\*, letrec, letrec\*, when, unless, case, and cond are transversed and transformed.
## Caveats
-This is a module-local transformation, thus macros imported from other modules don't allow this transformation.
+This is a module-local transformation, thus macros imported from other modules don't allow this transformation. Say, for example (ie-9 match), srfi-11, (ice-9 receive). For guile-3 many of these will work anyway, but will fail in guile-2.2.
## Portability
The macros are currently written in syntax-rules. If that isn't supported in your scheme, then tough luck.