Skip to content

(:has) - Operators

select a value that contains another

clojure
(:has val)

Where:

  1. val: what must be inside this value *

Examples

Find log calls happening inside any arm of a match statement.

clojure
(match-arm _ (:has (call log::debug!)))

Selects in lines { 5 } but not in { 12 }:

rust
fn main(args: Vec<String>) {
  for arg in args {
    match arg.as_str() {
      "--help" => {
        log::debug!("is asking for help")
      }

      _ => {}
    };
  }

  log::debug!("done")
}

Arguments

val

Does NOT support: RefinementReplacement

Copyright © 2022-present Semantic Works, Inc.