What does exclamation mark means after the name of

2020-04-03 04:41发布

问题:

I saw a function like this

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

What does ! means here?

回答1:

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 convention, it's not easy to know whether a function will change the content of input arguments or not.



标签: julia