Skip to content

decide: nine constructs measuring short in a boolean slot #1475

Description

@dekobon

Summary

Nine constructs measured short of an identifier control in a boolean slot
during the 2026-09-14 batch, each deliberately not fixed because counting
it is a judgement call rather than a clear omission. Collecting them so the
measurements are not lost; each needs a decision, not a sweep.

All measured with a rebuilt release binary against an identifier control at
the same cyclomatic, per #1458.

C# — four spellings, 0 conditions against 1 decision

source notes
if (default(bool)) default_expression — a real bool terminal; the strongest candidate of the four
if (checked(b)) checked_expression — a transparent wrapper; arguably belongs in the peel, not the terminal set
if (b = C()) assignment_expression — the = counts on the A axis; whether the predicate also counts on C is the #1461 walrus question in C# form
if (new Wrapper()) object_creation_expression via a user-defined implicit bool conversion

A fifth, if (x switch { _ => true }), scores 0 only because its sole arm is
the excluded bare discard — that one is working as designed.

Non-literal shapes measuring short against sibling precedent

  • JavaScript this — Kotlin lists ThisExpression in its terminal set;
    the JS family does not.
  • Groovy object_creation_expression — JS has NewExpression and PHP
    has ObjectCreationExpression in theirs; Groovy does not.
  • Groovy spread_dot_expression (a*.b) — a navigation form, but it
    yields a list whose Groovy truth is emptiness rather than the navigation,
    and no sibling language counts a spread. The closest call of the fifteen
    unlisted Groovy _expression alternatives.

Perl / Ruby / Elixir shapes outside the literal class

Found while extending the literal sweep; out of that class and undecided:
Perl s/// and tr/// (operations on $_ yielding a count),
anonymous_function, array_dereference (@$b scores 0 while @a scores
1 — arguably the clearest defect in this list); Ruby lambda and a range in
a predicate slot; Elixir anonymous_function and &f/1.

Also worth a look, unmeasured

Groovy::Identifier2 (141) was not observed emitted in any probe during the
batch. Either it is a hidden or unreachable variant — in which case §2 says
pin its unreachability — or it is reachable and unlisted.

How to take this

Do not land these as one sweep. Each is a policy call about what ABC's C
axis counts, and #1461 is the standing decision that governs the shape of the
answer: a relational operator scores by use, a value-bearing operand scores
in a boolean slot. Classify each construct against that rule first, then
measure the corpus cost of the ones that survive.

Related

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions