# @pure macro

**URL:** https://discourse.julialang.org/t/pure-macro/3871
**Category:** General Usage
**Created:** [May 23, 2017, 4:51am UTC](https://discourse.julialang.org/t/pure-macro/3871 "2017-05-23T04:51:20Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [May 23, 2017, 2:37pm UTC](https://discourse.julialang.org/t/pure-macro/3871/3 "2017-05-23T14:37:43Z")

</div>

Just as a counterbalance, improper `@pure` annotations can introduce bugs. The optimizations it enables rely on an _extremely_ strict definition of pure. It really should be named something like `@hyperpure`. Some of the restrictions include:

- It must always return exactly (`===`) the same result for a given input. Watch out for mutable types. I think constant globals are okay, though.
- The function it’s used on cannot be further extended by other methods after it gets called.
- It cannot recurse.
- It’s undocumented and not exported (for good reason), but this means the complete list of preconditions is really only in a few people’s heads.

---

_[View the full topic](https://discourse.julialang.org/t/pure-macro/3871)._
