# Julia keywords

**URL:** <https://discourse.julialang.org/t/julia-keywords/102673>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [August 10, 2023, 11:31am UTC](https://discourse.julialang.org/t/julia-keywords/102673 "2023-08-10T11:31:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [August 10, 2023, 11:31am UTC](https://discourse.julialang.org/t/julia-keywords/102673/1 "2023-08-10T11:31:29Z")

</div>

Hi,  
Reading the Julia documentation, I understand that `using`, `import`, `function` …etc are reserved keywords.  
I was wondering if users can create their own keywords? If yes, is there an example of how I can do that?  
Thank you

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [August 10, 2023, 11:40am UTC](https://discourse.julialang.org/t/julia-keywords/102673/2 "2023-08-10T11:40:10Z")

</div>

What do you mean by custom keywords? A keyword is a word that is reserved by the language. If you “define your own word”, then it is not reserved by the language and so is not a keyword.

You can define constants, functions (and operators), or macros. Does it not satisfy your needs?

Try to explain what is your end-goal, please.

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [August 10, 2023, 11:44am UTC](https://discourse.julialang.org/t/julia-keywords/102673/3 "2023-08-10T11:44:57Z")

</div>

I would like to define my own word, not reserved by the default language. End goal is to extend the language.

---

<div class="post-metadata">

**Author:** ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Post date:** [August 10, 2023, 11:47am UTC](https://discourse.julialang.org/t/julia-keywords/102673/4 "2023-08-10T11:47:47Z")

</div>

No, you cannot do that without changing the code of the compiler/interpreter. I think this holds true to most if not all programming languages.

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [August 10, 2023, 11:55am UTC](https://discourse.julialang.org/t/julia-keywords/102673/5 "2023-08-10T11:55:55Z")

</div>

Thank you, that answers my question.

---

<div class="post-metadata">

**Author:** ![abraemer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abraemer/32/51403_2.png) [@abraemer](https://discourse.julialang.org/u/abraemer)\
**Post date:** [August 10, 2023, 12:47pm UTC](https://discourse.julialang.org/t/julia-keywords/102673/6 "2023-08-10T12:47:15Z")

</div>

While you cannot define new keywords, Julia supports quite powerfull Macros. With these you essentially rewrite arbitrary syntactically correct Julia code to your liking. You’ll probably be able to achieve most of the stuff you want with clever use of macros. I’ll leave you with the [Manual page about macros](https://docs.julialang.org/en/v1/manual/metaprogramming/).

---

<div class="post-metadata">

**Author:** ![adienes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/adienes/32/37459_2.png) [@adienes](https://discourse.julialang.org/u/adienes)\
**Post date:** [August 10, 2023, 1:51pm UTC](https://discourse.julialang.org/t/julia-keywords/102673/7 "2023-08-10T13:51:36Z")

</div>

@gitboy16 I just want to note that the previous responses are in the context of defining a new syntax for your _own_ code. If you are interested in extending the language as a whole (and submitting a PR into the main branch for the whole world to use), this would be done likely in `JuliaSyntax.jl`

---

<div class="post-metadata">

**Author:** ![goerz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerz/32/3269_2.png) [@goerz](https://discourse.julialang.org/u/goerz)\
**Post date:** [August 10, 2023, 6:27pm UTC](https://discourse.julialang.org/t/julia-keywords/102673/8 "2023-08-10T18:27:20Z")

</div>

Well, it’s pretty unlikely that significant changes to the syntax, including new keywords, would get merged: [PSA: Julia is not at that stage of development anymore](https://discourse.julialang.org/t/psa-julia-is-not-at-that-stage-of-development-anymore/44872)

---

<div class="post-metadata">

**Author:** ![ericsfraga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ericsfraga/32/192_2.png) [@ericsfraga](https://discourse.julialang.org/u/ericsfraga)\
**Post date:** [August 11, 2023, 2:09pm UTC](https://discourse.julialang.org/t/julia-keywords/102673/9 "2023-08-11T14:09:00Z")

</div>

Except maybe LISP and similar? But macros provide similar functionality in Julia, to some degree.
