# HG changeset patch # User Linus Björnstam # Date 1566385400 -7200 # Wed Aug 21 13:03:20 2019 +0200 # Node ID 4631d74378bc9ec4811e4b142348dd66df9ea36a # Parent 9ea499203e265fbc0390a84af7a41c956903c6a7 updated readme diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -1,22 +1,28 @@ A small utility macro to allow defines in expression context of function bodies. -Install it in your site-dir and import it using (use-modules (syntax def)) +Install it in your site-dir and import it using (use-modules (syntax define)) ## Example (use-modules (syntax def)) (def (divide-minus-one a b) (when (= b 1) (error "We don't allow that here")) - (def b* (- b 1)) + (define b* (- b 1)) (/ a b*)) -This transforms all defines in expression context to (letrec ...). It also supports using (let! ...) and (let\*! ...) in expression -context, but those are transformed into let and let* respectively, which has less overhead than letrec in guile. +This transforms all defines in expression context to (letrec ...). + +## Supported forms +The bodies of begin, lambda, define, let, let\*, letrec, letrec\*, 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. ## Portability -The macros are currently written in syntax-case. If that isn't supported in your scheme, then tough luck. +The macros are currently written in syntax-rules. If that isn't supported in your scheme, then tough luck. ## License Permissified ISC. ## Documentation -There is none, however there are is info in the source comments. +There is none.