(:at) - Operators
select a value at exactly the specified scope level
clojure
(:at scope val)Where:
Expanding into:
clojure
(:#across 2 \1 \2)Guides
Behavior
- Similar in concept to the CSS
>operator
Examples
Find calls made directly at module level, not inside any function.
clojure
(:at (mod) (call setup))Selects in lines { 1 }:
typescript
setup()
def init():
setup()Find calls inside a function but not in nested functions.
clojure
(:at (fun outer) (call x))Selects in lines { 2, 2 }:
typescript
def outer():
x()
def inner():
x()
x()Audit direct function body statements without traversing into nested scopes.
clojure
(:at (fun process) (call log))Selects in lines { 2, 2 }:
typescript
def process():
log()
def helper():
log()
log()
def other():
log()Find variable declarations at exactly the class level.
clojure
(:at (class Config) (var))Selects in lines { 4, 5 }:
typescript
x = 1
class Config:
timeout = 30
retries = 3
def setup(self):
local = 5Arguments
scope
val
- (:into)
- (:nearest)
- (:and)
- (:or)
- (:not)
- (:text)
- (:kind)
- (:replace)
- (:replace-in)
- (:capture)
- (:after)
- (:at)
- (:before)
- (:inside)
- (:outside)
- (:ref)
- ...language selectors
- ...language expressions