JanetDocsI'm feeling luckyGitHub sign in

case



    macro
    boot.janet on line 195, column 1

    (case dispatch & pairs)

    Select the body that equals the dispatch value. When pairs has an odd
    number of arguments, the last is the default expression. If no match
    is found, returns nil.


See also:condmatch1 exampleSign in to add an example
Loading...
(defn output [x]
  (case x
    :a "a"
    "b"))

(output :a) # => "a"
(output "anything else") # => "b"
swlkr