(:before)
selects values that appear before an anchor in source order
clojure
(:before anchor val)Where:
Behavior
- Respects lexical scope - only considers values and anchors within the same scope.
- Using (:into) on the anchor includes the anchor itself in the search area.
Examples
Find module-level calls that execute before function definitions to detect initialization order issues.
clojure
(:before (fun) (call))Selects in lines { 1 } but not in { }:
typescript
configure()
def configure():
pass
def render():
setup()Locate translate() calls before i18n initialization to fix ordering bugs.
clojure
(:inside
(fun /render/)
(:before
(call init_i18n)
(call translate)))Selects in lines { 2, 2 } but not in { }:
typescript
def render1():
translate()
def render2():
init_i18n()
translate()
def render3():
translate()
init_i18n()Find variables declared before a specific import to reorder dependencies.
clojure
(:before (import react) (id))Selects in lines { 1 } but not in { }:
typescript
x
import { useState } from 'react'
yInclude the anchor in results by refining with :into.
clojure
(:before (:into (fun)) (id))Selects in lines { 1, 2 } but not in { }:
typescript
x
def y():Arguments
anchor
• (:#across) • (:after) • (:at) • (:before) • (:inside) • (:outside) • (:kind) • (:ref) • (:text) • (:into)
Does NOT support: Composition — Replacement
val
• inherit