Commit 472ebbd7 authored by Liam Schumm's avatar Liam Schumm

Add list_find command

parent 413b9062
......@@ -11,6 +11,13 @@
(define (list_cddr x) (list_cdr (list_cdr x)))
(macro (rcar arr) (list_get (int_dec (list_length arr)) arr))
(define (list_find arr item)
(_list_find arr item 0))
(define (_list_find arr item index)
(if (= (list_car arr) item) index
(_list_find (list_cdr arr) item (+ index 1))))
(define (list_append arr item) (list_add arr (list item)))
(define (list_prepend arr item) (list_add (list item) arr))
(define (_map f_address arr out) (if (equal (list_length arr) 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment