Skip to content

Language record

Clojure

Clojure namespaces are indexed with the reader's own rules: :refer and :as decide what a bare call is allowed to resolve to, a name the namespace declares itself shadows the referred one, and a macro is a function carrying a marker rather than a separate kind.

.clj, .cljs, .cljc, .edn · 1 registry id · 11 of 14 relationship types

The registry row this page is generated from

Read at render time from the same family row the register reads, so nothing in this block can disagree with it.

Extensions
.clj, .cljs, .cljc, .edn
Registry names
clojure
Recorded symbols
namespaces · functions · protocols

Relationship types this analyzer constructs

11 of 14 constructed, read from this analyzer's source and re-derived by the languages gate. Each row below is one of the engine's types, in the engine's own order.

Relationship typeConstructed
callsconstructed by this analyzer
extendsconstructed by this analyzer
implementsconstructed by this analyzer
usesconstructed by this analyzer
importsconstructed by this analyzer
exportsconstructed by this analyzer
containsconstructed by this analyzer
referencesconstructed by this analyzer
overridesconstructed by this analyzer
instantiatesconstructed by this analyzer
decoratesruled absent
rendersconstructed by this analyzer
mixes_inruled absent
part_ofruled absent

11 constructed, 3 not constructed. All 3 absent types are recorded as ruled absent: the written reason and the corpus measurement behind each are in this family's completeness record. The register explains what each label means.

What this analyzer does not resolve

  • A call to clojure.core is suppressed unless this namespace declares or refers that name, and the check is position-aware: a form above (defn map ...) really is the standard library while one below it is the file's own var. The exclusion list holds 723 names.
  • recur is a special form that transfers control to the enclosing fn — it names no var and invokes nothing — so it produces no edge, and neither does a call whose name was minted for an anonymous function.
  • There is no override edge, and that is a fact about Clojure: a defmethod introduces a var sharing a name with the multimethod rather than replacing a member of anything, so there is no override to record.

Every line above was written against Clojure’s own analyzer module and is named against a construct in it, so it can be checked against the source. Nothing here is inherited from a template, or from another language’s page.

Where you meet it in a repository

Recognised by extension — .clj, .cljs, .cljc, .edn. Everything below is about where those files actually sit in a working repository.

  • A Clojure codebase is one file per namespace, and the :require form at the top is the only statement that says where anything came from.
  • Protocols are usually defined next to the functions they dispatch on, while the implementations live wherever the concrete type does.
  • Test namespaces use deftest, which bb records as a function, so test bodies are indexed alongside the code they exercise.

Questions this index answers

Phrased as retrievals, because that is what an index can honestly do: it holds the symbols and the edges between them, and hands them back with the evidence attached.

  1. Which namespaces require this library?
  2. Which names does this namespace refer from another one?
  3. Which records implement this protocol?
  4. Which functions does this namespace declare, macros included?

What the analyzer sees in code like this

A namespace with an aliased require, a record type, and a call through the alias
(ns myapp.cart
  (:require [myapp.account :as acct]))

(defrecord Cart [id total])      ; bb records: type Cart · fields id, total

(defn place [cart user]           ; bb records: function place
  (acct/charge! user (:total cart)))   ; bb records: a call through the alias

Symbols are stored with the file they came from and the bytes they span, so a hit points at a line rather than at a guess. The annotations in the sample are commentary for the reader, not strings the index would store.

Languages that turn up in the same repository

Functional & declarative — the count beside each name is how many relationship types that family’s analyzer constructs.

The extensions, registry names, recorded symbols and relationship types above are the parser registry row for Clojure, read while the page rendered — the same row the register reads, so the two surfaces cannot tell two stories. Every relationship type listed as constructed appears in src/ast/real-*, the analyzer modules bb ships. bb 0.1.0 answers from a local store over 50 languages (53 registry ids, three of them aliases). There is no benchmark on this page: every claim here is one you can go and read in the source.