Skip to content

(:after)

selects values that appear after an anchor in source order

clojure
(:after anchor val)

Where:

  1. anchor: the reference point in the source code *
  2. val: what to find after the anchor *

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 variable uses after a null check to verify safe access.

clojure
(:inside
  (fun)
  (:after
    (if (:and (id data) (id)))
    (mem (:ref (id data)))))

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

typescript
def process():
  if data:
    return data.value
  return None

Locate translate() calls after i18n initialization to verify correct ordering.

clojure
(:inside
  (fun /render/)
  (:after
    (call init_i18n)
    (call translate)))

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

typescript
def render1():
  translate()

def render2():
  init_i18n()
  translate()

def render3():
  translate()
  init_i18n()

Find all code after an error check to understand error handling flow.

clojure
(:inside
  (fun)
  (:after
    (if (:and (id error) (id)))
    (call)))

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

typescript
def process():
  if error:
    log()
  cleanup()

Include the anchor in results by refining with :into.

clojure
(:after (:into (id a)) (id))

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

typescript
a
b
a

Arguments

anchor

Does NOT support: CompositionReplacement

val

inherit

Copyright © 2022-present Semantic Works, Inc.