# Julia Reserved/Key Words

**URL:** <https://discourse.julialang.org/t/julia-reserved-key-words/4781>\
**Category:** Internals & Design\
**Created:** [July 11, 2017, 3:01am UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781 "2017-07-11T03:01:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [July 11, 2017, 3:01am UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781/1 "2017-07-11T03:01:32Z")

</div>

I found the following string literals in julia/src/julia-parser.scm

```
@doc_str do macrocall struct
__dot__ end	memq toplevel
_cmd eqv	memv true
_str false	module try
abstract finally	mutable tuple
bitstype for none type
block function	parameters	typealias
call global	primitive typed_comprehension
catch if quote typed_hcat
cell1d kw ref typed_vcat
comparison line	return vect
const local	row where
curly macro	string	

```

which of these are officially designated as Julia Reserved Words?  
Would it be possible to add the official list of reserved words to the Julia documentation?

---

<div class="post-metadata">

**Author:** ![jeff.bezanson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeff.bezanson/32/48_2.png) [@jeff.bezanson](https://discourse.julialang.org/u/jeff.bezanson)\
**Post date:** [July 11, 2017, 10:50pm UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781/2 "2017-07-11T22:50:53Z")

</div>

> which of these are officially designated as Julia Reserved Words

Very few. I’m not sure how you came up with that list; it seems pretty random to me. There is a list of reserved words in the scheme global variable `reserved-words`.

---

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [July 11, 2017, 11:29pm UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781/3 "2017-07-11T23:29:43Z")

</div>

As I indicated, I looked at the source code file for the Julia parser (julia-parser.scm) and searched for all “hard coded” strings that start with a single quote such as 'if, 'quote, 'end, 'type, etc. (I may even have missed a few). The list contains words like 'try, 'catch, 'finally; 'mutable, 'type; 'true, 'false; macro, etc.; all of which I assume are words reserved for the Julia language.

At the other hand, I take it that “hard coded” strings like '@doc\_str, cell1d, typed\_hcat do not fall in the category of reserved words. I am also able to define both  
const where = 1  
f(x::T, y::T) where {T\<:Number = …  
in the same program without Julia complaining.  
Hence my question: what is the official list of reserved keywords. (for proper highlighting of Julia syntax in my editor)

---

<div class="post-metadata">

**Author:** ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Post date:** [July 11, 2017, 11:38pm UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781/4 "2017-07-11T23:38:18Z")

</div>

I looked at the variables initial-reserved-words and reserved-words in the same source file (totally missed that the first time 😊  
That is exactly what I was looking for. Thank you for pointing me to those variables. 🕶

---

<div class="post-metadata">

**Author:** ![shorty66](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/shorty66/32/3254_2.png) [@shorty66](https://discourse.julialang.org/u/shorty66)\
**Post date:** [July 12, 2017, 7:22am UTC](https://discourse.julialang.org/t/julia-reserved-key-words/4781/5 "2017-07-12T07:22:31Z")

</div>

Just in case somebody is looking for the definition in the future:

initial-reserved-words:

```julia
begin while if for try return break continue
function macro quote let local global const do
struct
abstract typealias bitstype type immutable #to be deprecated
module baremodule using import export importall

```

reserved-words:

```julia
end else catch finally true false # todo: make this more complete

```
