If a! does the function return anything?

The style guide says that functions that change their arguments must be marked with a sign ! . However, as an example , if the function is double! returns the modified argument a . Why return it if it has already been changed? It's necessary?

+5
source share
1 answer

It costs nothing and allows you to do things like:

 b = double!(a)*x 

or

 double!(double!(a)) 

in one line if you need.

For this reason (i.e. convenience), it has become conditional.

+4
source

Source: https://habr.com/ru/post/1271989/


All Articles