⇦ Back to Janet API Survey

* (function)

* is the multiply operator/function.

repl> (root-env '*)
@{:doc "(* & xs)\n\nReturns the product of all elements in xs. If xs is empty, returns 1."
  :value <function *>}

*= (macro)

There is also a macro variant that mutates its first argument.

repl> (macex '(*= x 2))
(set x (<function *> x 2))
repl> (root-env '*=)
@{:doc "(*= x & ns)\n\nShorthand for (set x (\\* x n))."
  :macro true
  :source-map ("boot.janet" 143 1)
  :value <function *=>}

Things I Learned

Created:

Updated: