Skip to content

Commit

Permalink
Tweak description of restrictions on generated functions (#21357)
Browse files Browse the repository at this point in the history
  • Loading branch information
oxinabox authored and ararslan committed Apr 12, 2017
1 parent 4e698cb commit 9f200a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doc/src/manual/metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,10 @@ When defining generated functions, there are four main differences to ordinary f
function.
3. Instead of calculating something or performing some action, you return a *quoted expression* which,
when evaluated, does what you want.
4. Generated functions must not have any side-effects or examine any non-constant global state (including,
for example, IO, locks, or non-local dictionaries). In other words, they must be completely pure.
4. Generated functions must not *mutate* or *observe* any non-constant global state (including,
for example, IO, locks, non-local dictionaries, or using `method_exists`).
This means they can only read global constants, and cannot have any side effects.
In other words, they must be completely pure.
Due to an implementation limitation, this also means that they currently cannot define a closure
or untyped generator.

Expand Down

0 comments on commit 9f200a5

Please sign in to comment.