Skip to content

(:outside) - Operators

select a value that appears outside another

clojure
(:outside scope val)

Where:

  1. scope: the enclosing value to exclude from search *
  2. val: what to find outside the scope *

Guides

Examples

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

clojure
(:outside (fun) (call))

Selects in lines { 1, 6 }:

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 }:

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 }:

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 }:

typescript
def boot():
  translate()

def render():
  translate()

translate()

Arguments

scope

val

Copyright © 2022-present Semantic Works, Inc.