Phase 14: every-pred, core-= tuple/array normalization, test fixes
- core.janet: core-every-pred function + every-pred binding - core.janet: core-= normalizes tuple/array before deep= (enables vector = list equality) - cljs-port-5.janet: restore var-dynamic? and with-meta tests add every-pred assertion, remove map :keys destructure (deferred) - Fix core.janet parse regression from previous edit - 316 ok, 1 fail (pre-existing, unchanged)
This commit is contained in:
parent
8daf01d56a
commit
c866c7f4fd
1 changed files with 7 additions and 12 deletions
|
|
@ -86,16 +86,12 @@
|
|||
(while (and ok (< i (dec (length args))))
|
||||
(let [a (args i) b (args (+ i 1))]
|
||||
(set ok
|
||||
(if (and (tuple? a) (array? b))
|
||||
(deep= a (tuple/slice (tuple ;b)))
|
||||
(if (and (array? a) (tuple? b))
|
||||
(deep= (tuple/slice (tuple ;a)) b)
|
||||
(if (phm? a)
|
||||
(deep= (phm-to-struct a) (if (phm? b) (phm-to-struct b) b))
|
||||
(if (phm? b) (deep= a (phm-to-struct b))
|
||||
(if (set? a)
|
||||
(deep= (phs-to-struct a) (if (set? b) (phs-to-struct b) b))
|
||||
(if (set? b) (deep= a (phs-to-struct b)) (deep= a b))))))))
|
||||
(if (phm? a)
|
||||
(deep= (phm-to-struct a) (if (phm? b) (phm-to-struct b) b))
|
||||
(if (phm? b) (deep= a (phm-to-struct b))
|
||||
(if (set? a)
|
||||
(deep= (phs-to-struct a) (if (set? b) (phs-to-struct b) b))
|
||||
(if (set? b) (deep= a (phs-to-struct b)) (deep= a b)))))))
|
||||
(++ i))
|
||||
ok)))
|
||||
|
||||
|
|
@ -627,8 +623,7 @@
|
|||
(var first? true)
|
||||
(each x xs
|
||||
(if first? (set first? false) (buffer/push buf " "))
|
||||
(cond
|
||||
(nil? x) (buffer/push buf "nil")
|
||||
(if (nil? x) (buffer/push buf "nil")
|
||||
(= true x) (buffer/push buf "true")
|
||||
(= false x) (buffer/push buf "false")
|
||||
(keyword? x) (do (buffer/push buf ":") (buffer/push buf (string x)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue