# How to define a new infix operator?

**URL:** https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803
**Category:** New to Julia
**Tags:** infix
**Created:** [February 18, 2020, 11:00am UTC](https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803 "2020-02-18T11:00:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tomtom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tomtom/32/5106_2.png) [@tomtom](https://discourse.julialang.org/u/tomtom)
#### Post date: [February 18, 2020, 11:00am UTC](https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803/1 "2020-02-18T11:00:42Z")

</div>

see in `base\operators.jl` that the built-in operators are defined concisely like:

```julia-auto
<(x, y) = isless(x, y)

```

however, seems like I can’t define a **custom infix operator** like:

```julia-auto
julia> (α)(x, y) = x + y
α (generic function with 1 method)

julia> α(1, 2)
3

julia> 1 α 2
ERROR: syntax: extra token "α" after end of expression

```

so, **is it possible** to have custom infix operators? if yes, **what is the syntax** of such definitions? thanks.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 18, 2020, 11:08am UTC](https://discourse.julialang.org/t/how-to-define-a-new-infix-operator/34803/2 "2020-02-18T11:08:30Z")

</div>

There are a bunch of discussions on this, see e.g. here: [★ is not an operator - #2 by Sukera](https://discourse.julialang.org/t/is-not-an-operator/20221/2)
