JuliaRheology / RHEOS.jl

RHEOS - Open Source Rheology data analysis software
MIT License
39 stars 9 forks source link

strainfunction and stressfunction should take function argument first #141

Closed akabla closed 3 years ago

akabla commented 3 years ago

this would allow to use them with a do-block. https://docs.julialang.org/en/v1/manual/functions/#Do-Block-Syntax-for-Function-Arguments https://docs.julialang.org/en/v1/manual/style-guide/#Write-functions-with-argument-ordering-similar-to-Julia-Base

d = strainfunction(d) do t
       sin(t)/t+cos(t)
    end
akabla commented 3 years ago

Both orders of parameters are allowed in order to avoid breaking changes. I think we should keep both versions on the long run. The in-place version can be a bit confusing with the syntax stressfunction!(f,d). #142