Skip to content

Commit

Permalink
Improve description of Julia keywords
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins committed Sep 17, 2018
1 parent 1324ceb commit 180297b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/src/base/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ ans

## Keywords

This is the list of reserved keywords in Julia:
`baremodule`, `begin`, `break`, `catch`, `const`, `continue`, `do`,
`else`, `elseif`, `end`, `export`, `false`, `finally`, `for`, `function`,
`global`, `if`, `import`, `let`, `local`, `macro`, `module`, `quote`,
`return`, `struct`, `true`, `try`, `using`, `while`.
Those keywords are not allowed to be used as variable names.

The follwoing two word sequences are reserved:
`abstract type`, `mutable struct`, `primitive type`.
However, you can create variables with names:
`abstract`, `mutable`, `primitive` and `type`.

Finally `where` is resolved contextually as a keyword in parametric method
definition syntax, but creation of variable named `where` is allowed.

```@docs
module
export
Expand Down Expand Up @@ -65,6 +80,9 @@ struct
mutable struct
abstract type
primitive type
where
true
false
...
;
```
Expand Down

0 comments on commit 180297b

Please sign in to comment.