altos/lisp: Add floats
[fw/altos] / src / lisp / ao_lisp_const.lisp
index 191ef00581ff2b602fa3a295cb1455fb2601a258..9fb7634c5858e1cd7d4d76330b8ab72953ad9da6 100644 (file)
 
 (defun caddr (l) (car (cdr (cdr l))))
 
-(defun nth (list n)
-  (cond ((= n 0) (car list))
-       ((nth (cdr list) (1- n)))
-       )
+(define list-tail (lambda (x k)
+                   (if (zero? k)
+                       x
+                     (list-tail (cdr x (- k 1)))
+                     )
+                   )
+  )
+
+(define list-ref (lambda (x k)
+                  (car (list-tail x k))
+                  )
   )
 
                                        ; simple math operators
 (odd? 3)
 (odd? -1)
 
-(define exact? number?)
-(defun inexact? (x) #f)
-
                                        ; (if <condition> <if-true>)
                                        ; (if <condition> <if-true> <if-false)
 
 
 (let ((x 1)) x)
 
+(define let* let)
                                        ; boolean operators
 
 (define or (lexpr (l)