Skip to content

Prefer ≟ and add equality aliases - #5

Open
isomorphisms wants to merge 4 commits into
irfrom
equality-glyph-aliases
Open

Prefer ≟ and add equality aliases#5
isomorphisms wants to merge 4 commits into
irfrom
equality-glyph-aliases

Conversation

@isomorphisms

@isomorphisms isomorphisms commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Prefer as IR's user-facing equality spelling and accept ?=, =?, ?=?, and ¿=? as aliases, alongside existing = and ==.

The new spellings canonicalize to the existing == operation, preserving equality precedence and behavior. Single = remains contextual for named arguments and formal defaults.

Lexer invariant: IR intentionally retains its broad user-definable Unicode infix fallback. Reserved glyphs are recognized first by explicit lexer rules; only unreserved glyphs fall through to generic SPECIAL handling. In particular, becomes EQ, not SPECIAL, while an unreserved glyph such as remains usable as an ordinary infix function.

code/tests/ir-unicode-lexer.R exercises that boundary. Every hexadecimal code point in that regression has the rendered glyph on the same line, and the test checks the mapping itself (including 0x03c0π) so those comments cannot silently disagree with what intToUtf8 prints. It then defines and calls a function literally named π, checks the four assignment arrows and all requested equality aliases, and defines/evaluates through the generic infix path.

Current head 909cb9db888d5c666c3f0bc5cba7ee84d5d14fe0 has a successful Ubuntu 24.04 GitHub Actions build: dependencies, configure, full build, and the focused Unicode lexer regression all pass. Both the pull-request and same-head push runs completed successfully.

Closes #4.

Recognize ≟, ?=, =?, ?=?, and ¿=? as equality spellings that canonicalize to the existing == operation. Keep single = contextual for named/default arguments, prefer ≟ in user-facing examples, and cover the aliases in regression tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lexer: reserved Unicode syntax must beat generic infix fallback

1 participant