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 ccaf8ba
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 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,7 @@ struct
mutable struct
abstract type
primitive type
where
...
;
```
Expand Down

0 comments on commit ccaf8ba

Please sign in to comment.