# \#infix

**URL:** https://discourse.julialang.org/tag/infix/1851.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Weird error when trying to use \`≔\` (\\coloneq) as infix operator](https://discourse.julialang.org/t/weird-error-when-trying-to-use-coloneq-as-infix-operator/21578)

<div class="topic-metadata">

**Author:** [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Replies:** 2\
**Last updated:** [August 27, 2025, 11:16am UTC](https://discourse.julialang.org/t/weird-error-when-trying-to-use-coloneq-as-infix-operator/21578 "2025-08-27T11:16:53Z")

</div>

When overloading ≔ like this: julia\> ≔(a, b) = a==b ≔ (generic function with 1 method) the following works just fine: julia\> ≔(3,2) false But I get a weird error when trying to use it as an infix-operator: julia\> 2≔…

---

## [User-defined binary functions used infix](https://discourse.julialang.org/t/user-defined-binary-functions-used-infix/121601)

<div class="topic-metadata">

**Author:** [@pao](https://discourse.julialang.org/u/pao)\
**Replies:** 1\
**Last updated:** [October 22, 2024, 4:58pm UTC](https://discourse.julialang.org/t/user-defined-binary-functions-used-infix/121601 "2024-10-22T16:58:34Z")

</div>

Hi guys, is there any method for using a binary user-defined function infix between actual argument values? I see a lot of discussion about infix operators, representable with a single character, but nothing about re…

---

## [Make my own alias infix operator](https://discourse.julialang.org/t/make-my-own-alias-infix-operator/103631)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 23\
**Last updated:** [September 9, 2023, 4:57am UTC](https://discourse.julialang.org/t/make-my-own-alias-infix-operator/103631 "2023-09-09T04:57:22Z")

</div>

Hi there :slight\_smile: I see that custom infix operators are a long-standing object to discussion, and I like to ask if there is a way today, how I can alias ∘ to \>\> As an explanation, my VSCode wont tab complete the …

---

## [Is there any way to make custom binary infix operators right associative?](https://discourse.julialang.org/t/is-there-any-way-to-make-custom-binary-infix-operators-right-associative/3202)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 7\
**Last updated:** [April 20, 2023, 1:35am UTC](https://discourse.julialang.org/t/is-there-any-way-to-make-custom-binary-infix-operators-right-associative/3202 "2023-04-20T01:35:17Z")

</div>

If I define some new binary infix operator, it appears to always be left associative by default, i.e. julia\> ⨳(a,b) = (a,b) julia\> 1⨳2⨳3 ((1,2),3) Is there any to make it right associative instead? I had guessed defini…

---

## [Julia's infix as synonym for ∉ operator?](https://discourse.julialang.org/t/julias-infix-as-synonym-for-operator/82846)

<div class="topic-metadata">

**Author:** [@nvhoang.3110](https://discourse.julialang.org/u/nvhoang.3110)\
**Replies:** 9\
**Last updated:** [June 16, 2022, 10:58am UTC](https://discourse.julialang.org/t/julias-infix-as-synonym-for-operator/82846 "2022-06-16T10:58:38Z")

</div>

Hello everyone. I think there’s somebody raising the question in the past but since there’s no news or recent development then, I would like to talk about it again. Julia has the infix operator in and its equivalence ∈.…

---

## [Infix operator](https://discourse.julialang.org/t/infix-operator/74317)

<div class="topic-metadata">

**Author:** [@jonoke](https://discourse.julialang.org/u/jonoke)\
**Replies:** 6\
**Last updated:** [January 10, 2022, 6:38am UTC](https://discourse.julialang.org/t/infix-operator/74317 "2022-01-10T06:38:05Z")

</div>

I have defined an infix operator using \\parallel and it works for 2 arguments, but I get a strange error when I try for 3 arguments (as infix). Is there a trick to get multiple args to work like 1+2+3+4 … etc. thanks n…

---

## [If f = +, why can't I use f as an infix operator (e.g., 2 f 3 == 5)?](https://discourse.julialang.org/t/if-f-why-cant-i-use-f-as-an-infix-operator-e-g-2-f-3-5/66698)

<div class="topic-metadata">

**Author:** [@dgpdx](https://discourse.julialang.org/u/dgpdx)\
**Replies:** 16\
**Last updated:** [August 20, 2021, 4:09am UTC](https://discourse.julialang.org/t/if-f-why-cant-i-use-f-as-an-infix-operator-e-g-2-f-3-5/66698 "2021-08-20T04:09:08Z")

</div>

3 + 4 gives the usual result. f = + followed by 3 f 4 gives an error. Why doesn’t this work?

---

## [How to define an infix operator that can act on multiple arguments at once like \`:\`?](https://discourse.julialang.org/t/how-to-define-an-infix-operator-that-can-act-on-multiple-arguments-at-once-like/64954)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [July 19, 2021, 11:21pm UTC](https://discourse.julialang.org/t/how-to-define-an-infix-operator-that-can-act-on-multiple-arguments-at-once-like/64954 "2021-07-19T23:21:53Z")

</div>

Forgive me if I am wrong, but why can : act on 3 arguments at a time as an infix operator? julia\> @which 1:2:3 (::Colon)(start::T, step::T, stop::T) where T\<:Real in Base at range.jl:22 If I want to define a new operat…

---

## [Infix function notation for \`setdiff\`](https://discourse.julialang.org/t/infix-function-notation-for-setdiff/38381)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 5\
**Last updated:** [April 28, 2020, 6:40pm UTC](https://discourse.julialang.org/t/infix-function-notation-for-setdiff/38381 "2020-04-28T18:40:41Z")

</div>

I’m looking for suggestions for an infix function for Base.setdiff. I’ve seen $\\setminus$ (∖) used, but that’s not a valid identifier character probably because it’s often indistinguishable from backslash (\\) (Ah yes: be…

---

## [How to define a new infix operator?](https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 1\
**Last updated:** [February 18, 2020, 11:08am UTC](https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803 "2020-02-18T11:08:30Z")

</div>

see in base\\operators.jl that the built-in operators are defined concisely like: \<(x, y) = isless(x, y) however, seems like I can’t define a custom infix operator like: julia\> (α)(x, y) = x + y α (generic function wit…

---

## [List of binary infix operators](https://discourse.julialang.org/t/list-of-binary-infix-operators/32282)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [December 15, 2019, 7:03pm UTC](https://discourse.julialang.org/t/list-of-binary-infix-operators/32282 "2019-12-15T19:03:20Z")

</div>

Is there a documentation page where all the binary infix operators are gathered? Thanks

---

## [Error I don't understand involving infix operator](https://discourse.julialang.org/t/error-i-dont-understand-involving-infix-operator/29212)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 11\
**Last updated:** [October 3, 2019, 11:53pm UTC](https://discourse.julialang.org/t/error-i-dont-understand-involving-infix-operator/29212 "2019-10-03T23:53:01Z")

</div>

So, I defined a function like so (using \\parallel): julia\> ∥(a,b) = 1/(1/a+1/b) ∥ (generic function with 1 method) julia\> ∥(10,10) 5.0 julia\> 10∥10 5.0 julia\> 10∥10∥10 ERROR: TypeError: non-boolean (Float64) used in …

---

## [How can an infix operator with subscript such as ⋆ₛ work?](https://discourse.julialang.org/t/how-can-an-infix-operator-with-subscript-such-as-work/9929)

<div class="topic-metadata">

**Author:** [@suiato](https://discourse.julialang.org/u/suiato)\
**Replies:** 2\
**Last updated:** [March 23, 2018, 7:26pm UTC](https://discourse.julialang.org/t/how-can-an-infix-operator-with-subscript-such-as-work/9929 "2018-03-23T19:26:08Z")

</div>

Using ⋆ as an infix operator works in Julia. For example, function ⋆(a, b) a + b end works. But, function ⋆ₛ(a, b) a + b end gives an error message ERROR: syntax: expected “end” in definition of function “⋆”. I…

---

## [! for infix operators](https://discourse.julialang.org/t/for-infix-operators/8257)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 18\
**Last updated:** [January 11, 2018, 6:50pm UTC](https://discourse.julialang.org/t/for-infix-operators/8257 "2018-01-11T18:50:19Z")

</div>

From the docs: Predicate function negation: when the argument of ! is a function, it returns a function which computes the boolean negation of f. Hence, !iseven is a function that returns true if the argument is not …

---

## [Why are ↗, ↖ not useable as Binary infix operators?](https://discourse.julialang.org/t/why-are-not-useable-as-binary-infix-operators/6777)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 2\
**Last updated:** [October 30, 2017, 3:50pm UTC](https://discourse.julialang.org/t/why-are-not-useable-as-binary-infix-operators/6777 "2017-10-30T15:50:06Z")

</div>

It seems to be possible to define all sorts of binary infix operators, like ∨, ⋖, ⋗, ⊴ work fine. But why can’t I assign ↗, ↖ as binary infix operators? they are \\nearrow and \\nwarrow. For example, in my Dendriform.jl …

---

## [Make contains infix](https://discourse.julialang.org/t/make-contains-infix/4644)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [July 4, 2017, 7:30pm UTC](https://discourse.julialang.org/t/make-contains-infix/4644 "2017-07-04T19:30:33Z")

</div>

why not make contains infix?
