Add lcompose to prelude, size to rb, and sketch out fungll. Still haven't figured out the exact datatype for grammer_slots and have decided to implement [] destrucuring in lambda params, and change let destructuring to use [].

This commit is contained in:
Nathan Braswell
2021-08-03 00:56:07 -04:00
parent dc712060cd
commit c96f20c80e
4 changed files with 143 additions and 34 deletions

7
rb.kp
View File

@@ -16,6 +16,10 @@
E empty
EE ['BB nil nil nil]
size (rec-lambda recurse (t) (match t
~E 0
[c a x b] (+ 1 (recurse a) (recurse b))))
generic-contains? (rec-lambda recurse (t cmp v found not-found) (match t
~E (not-found)
[c a x b] (match (cmp v x) '< (recurse a cmp v found not-found)
@@ -110,5 +114,6 @@
map-remove (lambda (t k) (generic-delete t map-cmp [k nil]))
)
(provide set-empty set-insert set-contains? set-remove
map-empty map-insert map-contains-key? map-get map-get-or-default map-get-with-default map-remove)
map-empty map-insert map-contains-key? map-get map-get-or-default map-get-with-default map-remove
size)
))