mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Added inc/dec familly
This commit is contained in:
parent
6887e7fcb1
commit
7bf5456c8c
@ -5,6 +5,19 @@
|
|||||||
(define first car)
|
(define first car)
|
||||||
(define rest cdr)
|
(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:
|
;; Allow defining functions like:
|
||||||
;; (def name (param1 param2)
|
;; (def name (param1 param2)
|
||||||
|
Loading…
Reference in New Issue
Block a user