Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fedemengo committed Feb 24, 2023
1 parent 75971c7 commit 01e46b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
8 changes: 3 additions & 5 deletions fnl/init.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@
(global in
(fn [x lst]
"Returns true if <x> is in <lst>"
(var found nil)
(each [k v (pairs lst)]
(when (= x v)
(set found true)))
found))
(accumulate [found false
_ v (pairs lst)]
(or found (= x v)))))

;; car and cdr to let the magic begin
(global car
Expand Down
4 changes: 2 additions & 2 deletions fnl/mods/tools/telescope.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
:<C-e>
(fn []
(var nwd (first_dir_from_entry prompt_buf cwd))
(when (should_cd (. opts :cwd) nwd)
(when (should_cd cwd nwd)
(set cwd nwd)
(tset opts :cwd cwd)
(tset opts :entry_maker (make_entry.gen_from_file opts))
Expand All @@ -222,7 +222,7 @@
:<tab>
(fn []
(var nwd (all_dirs_from_entry prompt_buf cwd))
(when (should_cd (. opts :cwd) nwd)
(when (should_cd cwd nwd)
(set cwd nwd)
(tset opts :cwd cwd)
(tset opts :entry_maker (make_entry.gen_from_file opts))
Expand Down
4 changes: 2 additions & 2 deletions tests/test.fnl
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@

(assert= true (in 2 [1 2 3]))
(assert= true (in 2 {:a 1 :b 2 :c 3}))
(assert= nil (in 2 [1 3 4]))
(assert= nil (in 2 {:a 1 :b 3 :c 4}))
(assert= false (in 2 [1 3 4]))
(assert= false (in 2 {:a 1 :b 3 :c 4}))

;;(cons s t)
(assert-eq [1 2 3 4 5 6] (cons [1 2 3] [4 5 6]))
Expand Down

0 comments on commit 01e46b0

Please sign in to comment.