# Where is \`===\` actually defined?

**URL:** <https://discourse.julialang.org/t/where-is-actually-defined/45926>\
**Category:** Internals & Design\
**Created:** [September 2, 2020, 1:18am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926 "2020-09-02T01:18:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cnaak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cnaak/32/10287_2.png) [@cnaak](https://discourse.julialang.org/u/cnaak)\
**Post date:** [September 2, 2020, 1:18am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/1 "2020-09-02T01:18:02Z")

</div>

In `operators.jl` one sees that `==(x, y)` falls back to `===(x, y)`, but interestingly, `===`'s definition in `operators.jl` is just…

`===`

I’ve never seen Julia syntax like it! 🤔

On the `repl`, one gets:

```julia
julia> methods(===)
# built-in function; no methods

```

So where is `===` actually defined?  
(And what are the cases in which the syntax on `operators.jl` is valid Julia code?)

---

<div class="post-metadata">

**Author:** ![Oscar\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oscar_smith/32/25343_2.png) [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Post date:** [September 2, 2020, 1:28am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/2 "2020-09-02T01:28:16Z")

</div>

It’s in `Core` and isn’t a generic function (you can’t change what it does)

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [September 2, 2020, 1:46am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/3 "2020-09-02T01:46:17Z")

</div>

The runtime version is called jl\_egal, is defined in C and defines the semantics. Obviously there’s lots of optimizations for special cases in different parts of the compiler though.

---

<div class="post-metadata">

**Author:** ![cnaak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cnaak/32/10287_2.png) [@cnaak](https://discourse.julialang.org/u/cnaak)\
**Post date:** [September 2, 2020, 2:35am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/4 "2020-09-02T02:35:45Z")

</div>

Thank you! In which source file can the code for `Core` be found?

---

<div class="post-metadata">

**Author:** ![cnaak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cnaak/32/10287_2.png) [@cnaak](https://discourse.julialang.org/u/cnaak)\
**Post date:** [September 2, 2020, 2:39am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/5 "2020-09-02T02:39:12Z")

</div>

Thank you!

Searching for “jl\_egal” in julia’s GitHub repo returns useful stuff, and it’s easy to spot the bit-wise comparison it performs (with `memcmp`).

How the low-level `C` function is associated with Julia’s `===` is the missing piece… perhaps that’s what’s in `Core`, whose source code I’m still to find.

---

<div class="post-metadata">

**Author:** ![yuyichao](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yuyichao/32/20_2.png) [@yuyichao](https://discourse.julialang.org/u/yuyichao)\
**Post date:** [September 2, 2020, 3:03am UTC](https://discourse.julialang.org/t/where-is-actually-defined/45926/6 "2020-09-02T03:03:51Z")

</div>

All builtins are defined as c functions and most if not all are in `builtins.c`. You can find all the relevant code by searching for `===` in `src/` and ignoreing all the ones in comments…
