Added inc/dec familly

This commit is contained in:
Sanel Zukan 2008-07-14 13:58:42 +00:00
parent 6887e7fcb1
commit 7bf5456c8c

View File

@ -5,6 +5,19 @@
(define first car)
(define rest cdr)
;; inc/dec familly
(define (inc n)
(+ 1 n))
(define (dec n)
(- n 1))
(define-macro (inc! n)
`(set! ,n (+ 1 ,n)))
(define-macro (dec! n)
`(set! ,n (- ,n 1)))
;;
;; Allow defining functions like:
;; (def name (param1 param2)