Skip to content

Uniform function call syntax

Allow an eligible free-function call f(x, y, ...) to be written in receiver form x.f(y, ...), preserving the resolved callable while exposing a uniform chainable surface syntax.

Core Idea

Uniform function call syntax is a language rule under which an eligible free function whose first parameter accepts an expression can be invoked using that expression as the apparent receiver, making x.f(y) resolve as f(x,y) under the language's stated rules. Parsing produces receiver-form syntax, resolution first handles any precedence mandated for real members, then searches eligible free functions and type-checks the receiver as the first argument; chaining feeds each result into the next call.

Its autonomous residual is the specified receiver-to-first-argument call equivalence and resolution contract, not method invocation in general, dynamic dispatch, extension-method metadata, or pipelines with different evaluation rules.

Scope of Application

Uniform function call syntax applies when the analyst can specify a language implementation with free functions, receiver-form calls, typed or otherwise constrained name resolution, and a declared UFCS rewrite or lookup rule and establish that the receiver notation and ordinary free-function notation can designate the same callable and argument ordering when the language's eligibility and resolution conditions are met. The entry describes specified language behavior and design consequences; it does not recommend one language style or promise equivalence across languages with different lookup rules.

Clarity

A clear claim names the carrier, governing rule, assumptions, and recognition test. This matters because uniform can mean syntactic equivalence, unified lookup, or merely a documentation convention, so the exact rewrite and resolution rule must be stated. The disciplined statement is that the object counts as Uniform function call syntax exactly when the receiver notation and ordinary free-function notation can designate the same callable and argument ordering when the language's eligibility and resolution conditions are met

Manages Complexity

The abstraction compresses D UFCS, Nim method-call syntax, functional-language receiver forms, proposed C++ unified calls, static and dynamic typing, and IDE completion behavior into a stable carrier, rule, invariant, and failure boundary. It makes comparison tractable while retaining the variables that control validity.

Compression can hide assumptions. A responsible use therefore declares lookup scope, real-member precedence, first-argument compatibility, overload resolution, type inference, imports, templates, evaluation order, chaining, ambiguity, and diagnostics and returns to the full diagnostic whenever a convention or boundary case changes.

Abstract Reasoning

  1. Type the carrier. Establish a language implementation with free functions, receiver-form calls, typed or otherwise constrained name resolution, and a declared UFCS rewrite or lookup rule and reject examples from a different problem.
  2. Lock the rule. Express that the receiver notation and ordinary free-function notation can designate the same callable and argument ordering when the language's eligibility and resolution conditions are met independently of one notation or implementation.

Knowledge Transfer

Transfer within programming language design is strong when new cases preserve the same carrier, mechanism, and diagnostic. The move from In D, if an applicable member does not exist and an in-scope free function sun accepts x as its first argument, x.sun(1) can resolve as sun(x,1). to A sequence transformation can be written as chained receiver-form calls even when each stage is implemented as a free function. demonstrates that continuity.

Relationships to Other Abstractions

Local relationship map for Uniform function call syntaxParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Uniform functioncall syntaxDOMAINPrime abstraction: Representation — is a kind ofRepresentationPRIME

Current abstraction Uniform function call syntax Domain-specific

Parents (1) — outgoing typed relations

  • Uniform function call syntax is a kind of Representation Prime

    UFCS literally provides an alternate surface representation of the same callable relation and argument order.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Uniform function call syntax sits in a crowded region of the domain-specific corpus (36th percentile for distinctiveness): several abstractions share nearly its structure, so a description that fits it tends to fit its neighbors too.

Family — Programming Language Concepts & Notation (24 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25