From 008d609a8bdcd1ea7e92ef5e977245026abea03c Mon Sep 17 00:00:00 2001 From: Felisp Date: Sat, 6 Jan 2024 05:39:29 +0100 Subject: [PATCH] When-else2 should be correct, replaced original implementation What am i doing with my life, it's 5:37 in the morning ffs --- src/rss_thread_watch/core.clj | 2 +- src/rss_thread_watch/utils.clj | 11 ----------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/src/rss_thread_watch/core.clj b/src/rss_thread_watch/core.clj index 9b25b22..c87da0c 100644 --- a/src/rss_thread_watch/core.clj +++ b/src/rss_thread_watch/core.clj @@ -66,7 +66,7 @@ [cmd-args] (let [file-to-try (u/nil?-else (first cmd-args) "./config.edn")] - (u/when-else2 (load-config file-to-try) + (u/when-else (load-config file-to-try) (println "WARN: Using default internal config because suggessted " file-to-try " not found.") CONFIG-DEFAULT))) diff --git a/src/rss_thread_watch/utils.clj b/src/rss_thread_watch/utils.clj index 13944fd..788852a 100644 --- a/src/rss_thread_watch/utils.clj +++ b/src/rss_thread_watch/utils.clj @@ -31,17 +31,6 @@ result#))) (defmacro when-else - "Evaluates tst, if it's true returns it's result. - If it's not, return else" - [tst else] - `(let [res# ~tst] - (if res# - res# - ~else))) - -;; Todo: Test this properly and if working, replace when-else with this -;; Todo: find a way to download clojure documentation for offline use -(defmacro when-else2 "Evaluates [tst], if it's truthy value returns that value. If it's not, execute everything in [else] and return last expr." [tst & else]