Skip to content

ops/:outside

selects values that appear outside a specific scope (lexically excluded)

clojure
(:outside scope val)

Where:

  1. scope: the containing construct to exclude from search *
  2. val: what to find outside the scope *

Behavior

  • The inverse of :inside - finds values that are NOT contained within the specified scope.
  • Can be nested with :inside to create complex scope filters.

Examples

Find top-level calls that aren't wrapped in any function.

clojure
(:outside (fun) (call))

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

typescript
setup()

def init():
  setup()

cleanup()

Locate identifiers at module level, excluding those inside functions.

clojure
(:outside (fun) (id x))

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

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

Find code inside one scope but outside nested scopes.

clojure
(:inside
  (fun outer)
  (:outside
    (fun inner)
    (id x)))

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

typescript
x
def outer():
  x
  def inner():
    x
  x

Find direct module-level translate() calls to wrap in i18n initialization.

clojure
(:outside (fun) (call translate))

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

typescript
def boot():
  translate()

def render():
  translate()

translate()

Arguments

scope

val

Copyright © 2022-present Semantic Works, Inc.