What do ! mean for functions

My question is probably relatively basic, but I haven’t found any information about it anywhere. On the performance tips page, some functions have ! and some don’t. What is the meaning of ! and are there other characters of this kind?

1 Like

By convention in Julia, the ! at the end of a function name indicates that the function is going to modify in-place one (or more) of its arguments, commonly (but not necessarily, check the docstring) the first one. I reiterate this is a convention, nothing is enforced, but the community has been fairly consistent in following the convention.

You found many uses of in-place functions in the performance page because in-place operations tend to be very efficient, as they reuse memory and avoid extra allocations.

6 Likes