(fun)
function definitions
clojure
(fun name? args? kind?)Where:
- name: function name (providing a name excludes arrow functions) *
- args: function parameters *
- kind: function modifier to match *
Matching:
- declarations, e.g.
function x() {} - arrow functions, e.g.
() => {} - expressions, e.g.
(function() {}) - generators, e.g.
function* x() {}
Examples
Audit async functions before changing error handling behavior.
clojure
(fun _ _ (is async))Selects in lines { 1, 2 } but not in { 3, 4 }:
typescript
async function loadUser() {}
const refresh = async () => {}
function loadUserSync() {}
function* ids() {}Find APIs that already accept an AbortSignal so they can be wired to cancellation.
clojure
(fun _ (arg _ (id signal)))Selects in lines { 1, 2 } but not in { 3 }:
typescript
function request(url, signal) {}
const withSignal = (signal, url) => {}
function withoutSignal(url) {}Locate generator utilities before replacing them with async iterators.
clojure
(fun _ _ (is generator))Selects in lines { 1, 2 } but not in { 3 }:
typescript
function* ids() { yield 1 }
const makeIds = function* () { yield 2 }
async function fetchIds() {}Arguments
name
• Identifier: shorthand for (id)
• Pattern: shorthand for (id)
• (id)
• (:into) • (:and) • (:or) • (:not) • (:text) • (:kind) • (:replace) • (:capture)
args
• (arg)
• (:into) • (:and) • (:or) • (:not) • (:text) • (:kind) • (:replace) • (:capture)
kind
Does NOT support: Refinement — Replacement