Add creation and indexing of lists and vectors, with their literal forms. Compiling quote has a bug though, and passes through - will have to consider how to fix

This commit is contained in:
Nathan Braswell
2020-04-20 01:16:34 -04:00
parent b505c021f2
commit d726705845
2 changed files with 88 additions and 25 deletions

16
bf.kp
View File

@@ -72,5 +72,17 @@
;(def! fact (fn* [n] (if (<= n 1) 1 (* (fact (- n 1)) n))))
;(def! main (fn* [] (let* (to_ret (fact 5)) (do (println to_ret) to_ret))))
(def! ret_with_call (fn* [n] (fn* [x] (+ n x))))
(def! main (fn* [] ((ret_with_call 3) 5)))
;(def! ret_with_call (fn* [n] (fn* [x] (+ n x))))
;(def! main (fn* [] ((ret_with_call 3) 5)))
(def! test (fn* [] (let* (
;(l (list 3 4 5))
a 5
l '(a 4 5)
;l (vector 3 4 5)
;l [a 4 5]
)
(nth l 0))))
(def! main (fn* [] (let* (it (test)) (do (println it) it))))