Skip to content

Add _+_ as terse alias for infix - #11

Merged
jiriknesl merged 1 commit into
masterfrom
feat/underscore-plus-alias
Apr 27, 2026
Merged

jiriknesl merged 1 commit into
masterfrom
feat/underscore-plus-alias

Conversation

@jiriknesl

Copy link
Copy Markdown
Contributor

Adds `+` as a one-line macro alias for `infix`. The name visually echoes the textbook operand-operator-operand notation (□ ⊕ □), is ASCII, and is fast to type (home-row + shift).

```clojure
(+ 3 + 4) ;; => 7
(+ 2 * 3 + 4 * 2) ;; => 14
((+ x => x * x) 5) ;; => 25
(+ count([1 2 3]) + 1) ;; => 4
```

All existing infix features carry through (arrow lambdas, fn(args), nested grouping). Tests added in `test/infix/alias_test.clj`. Full suite: 83 / 471 passing.

The textbook notation for an infix expression is operand-operator-operand
(□ ⊕ □); `_+_` mirrors that visually while staying ASCII and home-row.
Implemented as a thin macro that splices its args into `infix`, so all
features — arrow lambdas, fn(args), nested groups — carry through.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jiriknesl
jiriknesl merged commit e86fc4d into master Apr 27, 2026
1 check passed
@jiriknesl
jiriknesl deleted the feat/underscore-plus-alias branch April 27, 2026 08:46
@jiriknesl jiriknesl mentioned this pull request Apr 27, 2026
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.

1 participant