%3a31/rec.sls
raw| 1 | #!r6rs |
| 2 | ;; Copyright 2009 Derick Eddington. My MIT-style license is in the file named |
| 3 | ;; LICENSE from the original collection this file is distributed with. |
| 4 | |
| 5 | (library (srfi :31 rec) |
| 6 | (export rec) |
| 7 | (import (rnrs)) |
| 8 | |
| 9 | ;; Taken directly from the SRFI-31 |
| 10 | (define-syntax rec |
| 11 | (syntax-rules () |
| 12 | ((rec (NAME . VARIABLES) . BODY) |
| 13 | (letrec ( (NAME (lambda VARIABLES . BODY)) ) NAME)) |
| 14 | ((rec NAME EXPRESSION) |
| 15 | (letrec ( (NAME EXPRESSION) ) NAME)))) |
| 16 | |
| 17 | ) |