tag-find: experiment in rust, go and joker languages
[experiments.git] / tag_find / tag-find.joke
1 (def tag "tag")
2
3 (def dir-name ".")
4
5 (def file-listing (joker.os/ls dir-name))
6
7 (def start-sequence "#+")
8
9 (defn tag-line?
10 [line]
11 (and (joker.string/starts-with? line start-sequence) (joker.string/includes? line tag)))
12
13 (defn contains-tag?
14 [tag file-name]
15 (let [contents (joker.string/split-lines (slurp file-name))]
16 (if (any? (map tag-line? contents))
17 file-name
18 nil
19 )))
20
21 (println (map #(contains-tag? tag (:name %)) file-listing))