Skip to content

[help wanted] Clojure's quote and discard forms use the shared inert-region walk (CONTRIBUTING slice 8a) #449

Open

Description

@joyful-ii-V-I

Claim it in this issue first. Size: S. Depends on: nothing; #380 (the shared walk, @LaimaWu) and #349 (Clojure support, @tag-und-nacht) are both on main. Language: Clojure.

The problem, in user terms

Code inside a quoted or discarded form is data, not a call (Clojure '(foo), #_(foo), (comment (foo))), and Elixir quote bodies are the same idea. Elixir's rule goes through the one shared walk; Clojure still has its own copy:

ripwire src --no-cache --callers=inInertRegion
<callers ... of="inInertRegion" defs="1" count="1" ...><s t="fn" n="elixirInert" p="ingest_elixir.h:330" sites_at="ingest_elixir.h:332"/></callers>
ripwire src --no-cache --callers=clojureInert
<callers ... of="clojureInert" defs="1" count="1" ...><s t="fn" n="clojureKeepCapture" p="ingest_clojure.h:82" sites_at="ingest_clojure.h:84"/></callers>

(built from daf1ccba.) clojureInert (src/ingest_clojure.h) walks the ancestors itself with its own loop and is marked "Temporary inert-form filter: CONTRIBUTING slice 8a moves it onto the shared mechanism". The shared one is inInertRegion in src/ingest_inert.h: a language gives a callback that classifies one ancestor as Inert, Live (a hole that re-enters code) or None.

Files to touch

  • src/ingest_clojure.h: clojureInert (and its one caller clojureKeepCapture) become a inInertRegion( node, [&]( TSNode ancestor, TSNode ) { … } ) call returning InertBoundary::Inert for quoting_lit, syn_quoting_lit, dis_expr and a list_lit whose head is comment (clojureListHead). Delete the loop.
  • src/ingest_inert.h: read only; do not widen it for Clojure. If a callback cannot say what you need, that is the finding to put in the PR.
  • test/clojurecheck.sh and test/clojurefix/: the existing arms (quoted, commented, comment-call, comment-holder and quoted-holder in core.clj) already cover the four forms; add the nested cases below.

Red-first fixture and gate arm

  • This slice is byte-identical on today's fixtures; the arm is the known gap the move exposes. A syntax-quote has holes (in a backquoted (a ~(b)) the ~ re-enters code and b IS a call), and today's filter treats the whole syntax-quote as inert. With the shared walk you can give unquoting_lit / unquote_splicing_lit a Live arm. Do not: keep behaviour identical and add a known-gap arm (test/fieldnarrowcheck.sh shows the form) asserting today's answer for a defn whose body is a backquoted (a ~(b)), naming the follow-up that flips it. If you want to flip it, make it its own PR with an --intended row.
  • near misses: (comment …) as a head only (not a symbol named comment-x); a #_ discard before a def removes that def's captures but not its neighbours; a quote inside a defmacro.

Acceptance

  • bash test/langidentitycheck.sh BASE HEAD --langs=clj,ex,py,go,rs,cpp --repo=ex:<your clone of an Elixir repository>: every language SAME on the clj fixtures and the repository.
  • ripwire src --callers=clojureInert answers no definition; ripwire . --quality-delta=origin/main..HEAD gates 0; CONTRIBUTING definition of done.

Not in scope

Clojure's keyword tables (clojureDefinitionShape, the special-forms list), which are slice 5a (#355); any Elixir change.


Claiming it only takes a comment here.

Activity

  1. LaimaWu commented on Oct 27, 2026

    @LaimaWu
    Contributor

    I’d be happy to take slice 8a. I’ll keep the Clojure migration behavior-preserving, move the existing inert-form classification onto inInertRegion, and leave the syntax-quote/unquote known gap as a separately documented follow-up as scoped here.

  2. joyful-ii-V-I commented on Nov 1, 2026

    @joyful-ii-V-I
    CollaboratorAuthor

    Thank you, @LaimaWu, for #456. Moving clojureInert onto inInertRegion with the syntax-quote gap left pinned is the scope we asked for, and the identity numbers in the description (514 SAME, 0 DIFF) are what the definition of done wants. Two notes. First, CI on #456 showed red on four legs from 10-27. The log we read was timing limits on a busy runner, not your change, so we re-ran the failed legs; nothing is needed from you unless they stay red. Second, @tag-und-nacht claimed 8a together with 5a on #389 before this issue existed; the Clojure keyword tables for 5a stay with you, and this one is #456, so there is no overlap. Say so here if you had work in progress on 8a.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions