Commits

Anonymous committed 424c2aa

No more get-key-blocking &rest map args

Looking back over the library, I realized that &rest args aren't really
used with maps anywhere else, so it doesn't make sense to use them here.

  • Participants
  • Parent commits 5c6417b

Comments (0)

Files changed (3)

docs/2-terminals.markdown

     ;
     ; => \a
 
-`get-key-blocking` optionally accepts a check interval or timeout:
+`get-key-blocking` optionally accepts a check interval and/or timeout:
 
     :::clojure
-    (t/get-key-blocking term :interval 100 :timeout 5000)
+    (t/get-key-blocking term {:interval 100 :timeout 5000})
     ;
     ; Key presses will be checked for every 100 msecs. If you wait
     ; 5 seconds, nil will be returned.

src/lanterna/screen.clj

     returning nil.
 
   "
-  [^Screen screen & {:keys [interval timeout] :as opts}]
-  (block-on get-key [screen] opts))
+  ([^Screen screen] (get-key-blocking screen {}))
+  ([^Screen screen & {:keys [interval timeout] :as opts}]
+     (block-on get-key [screen] opts)))
 
 
 (comment

src/lanterna/terminal.clj

     returning nil.
 
   "
-  [^Terminal terminal & {:keys [interval timeout] :as opts}]
-  (block-on get-key [terminal] opts))
+  ([^Terminal terminal] (get-key-blocking terminal {}))
+  ([^Terminal terminal {:keys [interval timeout] :as opts}]
+     (block-on get-key [terminal] opts)))
 
 
 (comment
   (start t)
   (set-fg-color t :yellow)
   (put-string t "Hello, world!")
-  (get-key-blocking t :timeout 1000)
-  (get-key-blocking t :interval 2000)
+  (get-key-blocking t {:timeout 1000})
+  (get-key-blocking t {:interval 2000})
   (stop t)
 
   )