JanetDocsI'm feeling luckyGithub sign in

short-fn



    macro
    boot.janet on line 1939, column 1

    (short-fn arg)
    
    fn shorthand.
    
    usage:
    
      (short-fn (+ $ $)) - A function that double's its arguments.
      (short-fn (string $0 $1)) - accepting multiple args
      |(+ $ $) - use pipe reader macro for terse function literals
      |(+ $&) - variadic functions


1 exampleSign in to add an example
Loading...
(map  (fn [x] (< x 10))    [8 9 10 11])  # => @[true true false false]
(map  (short-fn (< $ 10))  [8 9 10 11])  # => @[true true false false]
(map  |(< $ 10)            [8 9 10 11])  # => @[true true false false]
cellularmitosis