;; -*- Mode: Irken -*-
(datatype list
(:nil)
(:cons 'a (list 'a))
)
(defmacro list
(list) -> (list:nil)
(list x y ...) -> (list:cons x (list y ...)))
(define (+ a b)
(%%cexp (int int -> int) "%0+%1" a b))
(define length
() -> 0
(_ . tl) -> (+ 1 (length tl)))
(length (list 1 2 3))
I also finally got around to checking in the changes from the last couple of weeks, too much slacking off there.
No comments:
Post a Comment