Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

define function:

  • Can also be called as macro

  • Can also be called as def

  • Can also be called as #

Define a new macro definition. The first argument should be the macro definition name, the second one should be macro and the third one should be the function to run with the macro.

Examples:

  • running: (define "add-1", (.+ 1), (map [1, 2, 3] (@ "add-1"))) will give: [2, 3, 4]

  • running: (define "add-1", (.+ 1), (map [1, 2, 3] @add-1)) will give: [2, 3, 4]

  • running: (define "three", 3, (+ 1 @three)) will give: 4

  • running: (define 12, {"key": 100}, (get (: "foo") "key" )) will return nothing