(fun)
function definitions
clojure
(fun name? args?)Where:
Matching:
- simple definitions, e.g.
def name(): - definitions with parameters, e.g.
def name(arg):
Behavior
- Matches
defstatements; does not match lambda expressions.
Examples
Find test functions for cleanup.
clojure
(fun /^test_/)Selects in lines { 1, 3 } but not in { 5 }:
python
def test_login():
pass
def test_logout():
pass
def helper():
passIdentify handlers that accept a request parameter.
clojure
(fun _ (arg 1 (id request)))Selects in lines { 1 } but not in { 3 }:
python
def handle(request, response):
pass
def handle_no_request(response):
passLocate main entrypoints for refactoring.
clojure
(fun main)Selects in lines { 1 } but not in { 3 }:
python
def main():
pass
def run():
passArguments
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)