# @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:** 5

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [May 30, 2017, 6:40pm UTC](https://discourse.julialang.org/t/pure-macro/3871/5 "2017-05-30T18:40:38Z")

</div>

@mbauman about mutable types: it’s okay to use mutable types in the intermediate computation if the output is immutable, right? The case I am thinking of is building an `SVector` for the result, but using a `Vector` to internally build that. Since

```julia
using StaticArrays
a = @SArray [1,2,3]
b = @SArray [1,2,3]
a === b # true

```

it seems like it would work, but I just wanted to double check. If so, that makes it much easier to build type-inferrable `SArray`s in functions.

If that’s the case, then I believe a function like this should be `Base.@pure`?

[https://github.com/shivin9/PDEOperators.jl/blob/master/src/fornberg.jl#L34](https://github.com/shivin9/PDEOperators.jl/blob/master/src/fornberg.jl#L34)

---

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