Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an exclamation mark mean after the name of a function?

Tags:

julia

I saw a function like this

function operator!(c::Matrix, out::Matrix)     ...... end 

What does ! mean here?

like image 942
Fazeleh Avatar asked Jul 30 '17 05:07

Fazeleh


People also ask

What is function exclamation mark?

Exclamation mark makes any function always return a boolean. The final value is the negation of the value returned by the function.

What does an exclamation mark mean after a name?

The name explanation point is often used to convey a sense of excitement on the part of the text receiver upon receiving a text from the texter. The Name Exclamation Point is a good way to signal to someone that you're excited to talk to them without seeming too over the top in the rest of your text.


1 Answers

In Julia, it's a convention to append ! to names of functions that modify their arguments. The reason is Julia function arguments are passed-by-sharing, without this "bang" convention, it's not easy to know whether a function will change the content of input arguments or not.

like image 193
Gnimuc Avatar answered Sep 22 '22 08:09

Gnimuc