Hello, I am using functions to read data, apply a certain function and then use a function to write results. I have not been able to figure out the correct way of passing one function as an argument to another function, and how to use functions to read and write data. When I try to run the program it does not seem to do anything.

**I have given some examples below regarding what I am trying to do. I would like to understand the correct way of doing it. Specifically, I would like to know:**

**how to use functions to read data, apply some functions, and then print the results? If I use functions in this manner then its doesn’t seem to do anything, but if I write the code as a script then it works fine.**

```
using CV
function read_data()
# Read data
x = Matrix{Float64}(CSV.read("./filename.csv")
y = Matrix{Float64}(CSV.read("./filename2.csv")
return x, y
end
const z = 1
function f(read_data::Function,z)
# Calculate something using the data
x, y = read_data()
P= x + y+z
return P
end
function write_results(f::Function)
Result = f(read_data::Function,z)
CSV.write("FileSaveName.csv",DataFrame(Addition=Result,X=x,Y=y,Z=z))
return println("Results saved in FileSaveName.csv")
end
function run_model()
P= f(read_data::Function,write_results::(f::Function))
end
```