aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormryouse2022-07-21 02:47:30 +0000
committermryouse2022-07-21 02:47:30 +0000
commitbca7d0afed84bd97ccfc6dbb486746aefa9cc1f5 (patch)
treeb3101b4302797a964c0ecce47ee9a134264b776d
parent9461eda584c4a853b1c3be2658807a8ac4f9a6e7 (diff)
function renames and return types
-rw-r--r--libs/dict.neb14
1 files changed, 7 insertions, 7 deletions
diff --git a/libs/dict.neb b/libs/dict.neb
index 9dccf97..7dc3dcc 100644
--- a/libs/dict.neb
+++ b/libs/dict.neb
@@ -3,18 +3,18 @@
(and
(list? val) ; TODO should this be automatic?
(or
- (eq? 0 (list-length val))
+ (eq? 0 (length val))
(and
- (eq? 1 (list-length val))
+ (eq? 1 (length val))
(list? (first val)))
(apply and (map list? val)))
- (eq? 0 (list-length (filter (lambda (x) (not (eq? x 2))) (map list-length val))))))
+ (eq? 0 (length (filter (lambda (x) (not (eq? x 2))) (map length val))))))
-(type :dict :list dict?)
+(type :dict :[:any] dict?)
-(func dict () (list))
+(func dict :dict () (list))
-(func has? (in :dict key)
+(func has? :bool (in :dict key)
(not (empty?
(filter (lambda (x) (eq? (first x) key)) in))))
@@ -22,7 +22,7 @@
(first (rest (first
(filter (lambda (x) (eq? (first x) key)) d)))))
-(func set (d :dict key val)
+(func set :dict (d :dict key val)
(if (has? d key)
(map (lambda (x) (if (eq? key (first x)) (list (first x) val) x)) d)
(append d (list key val))))