Created
May 6, 2023 04:42
-
-
Save kbridge/7d846648327f086e09e4849702b1592e to your computer and use it in GitHub Desktop.
clojure style exercise
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; style 1 | |
(let [console (System/console) | |
password-char-array (.readPassword console "Password (hidden): " (to-array ())) | |
password (String. password-char-array) | |
quoted (fn [s] (str \' s \'))] | |
(println (quoted password))) | |
;; style 2 | |
(-> (System/console) | |
(.readPassword "Password (hidden): " (to-array ())) | |
(String.) | |
(#(str \' % \')) | |
(println)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment