add example of mutating values in function

This commit is contained in:
Bogumił Kamiński 2022-05-27 13:22:37 +02:00
parent cb20d79549
commit 9393f239f6

View File

@ -218,6 +218,14 @@ end
s
s / length(y)
function f!(x)
x[1] = 10
return x
end
x = [1, 2, 3]
f!(x)
x
# Code for listing 2.7
function times_two(x)