M README.md +1 -1
@@ 4,7 4,7 @@ Install it in your site-dir and import i
## Example
(use-modules (syntax def))
- (def (divide-minus-one a b)
+ (define (divide-minus-one a b)
(when (= b 1) (error "We don't allow that here"))
(define b* (- b 1))
(/ a b*))
M examples.scm +6 -6
@@ 1,16 1,16 @@
-(use-modules (syntax def))
+(use-modules (syntax define))
;; This is a sort of contrived example since you wouldn't write it like this.
-(def (fib n)
+(define (fib n)
(unless (positive? n)
(error "positives only!"))
- (def (internal-fib n a b)
+ (define (internal-fib n a b)
(cond
((zero? n) a)
(else
- (let*! next-a b)
- (let*! next-b (+ a b))
- (let*! next-n (1- n))
+ (define next-a b)
+ (define next-b (+ a b))
+ (define next-n (1- n))
(internal-fib next-n next-a next-b))))
(internal-fib n 0 1))