Skip to content

(:inside)

selects values that appear inside a specific scope (lexically contained)

clojure
(:inside scope val)

Where:

  1. scope: the containing construct to search within *
  2. val: what to find inside the scope *

Expanding into:

clojure
(:#across _ \1 \2)

Behavior

  • The scope argument defines the container (e.g., functions, classes), and val defines what to find within.
  • Respects nesting - can be composed to find values inside nested scopes.
  • Using (:into) on the scope argument includes the scope itself in results.

Examples

Find translate() calls only inside render functions, not in boot/init code.

clojure
(:inside (fun render) (call translate))

Selects in lines { 2 } but not in { }:

typescript
def boot():
  translate()

def render():
  translate()

translate()

Locate identifiers inside specific functions to understand variable usage.

clojure
(:inside (fun y) (id x))

Selects in lines { 1 } but not in { }:

typescript
x
def x():
  x
def y():
  x
x

Find calls inside nested scopes by chaining :inside operators.

clojure
(:inside
  (fun outer)
  (:inside
    (fun inner)
    (call process)))

Selects in lines { 2 } but not in { }:

typescript
def outer():
  process()
  def inner():
    process()

def inner():
  process()

Audit which functions call a deprecated API, excluding test utilities.

clojure
(:inside
  (:and
    (fun)
    (:not (fun /^test_/)))
  (call deprecatedAPI))

Selects in lines { 2 } but not in { }:

typescript
def test_setup():
  deprecatedAPI()

def render():
  deprecatedAPI()

Arguments

scope

val

Copyright © 2022-present Semantic Works, Inc.