News for hackers. Stuff that matters.
Re:Calculus with Julia by abisen on Saturday May 18, 2024 @06:50PM (#40402739)
If I am not using named arguments I find myself using the pipe operator a lot. I also find it more readable.

array |> mean |> round

For scenarios with named arguments there is a little not so cleaner workaround

array |> mean |> x->round(x, digits=2)

Re:Calculus with Julia by andyferris on Saturday May 18, 2024 @07:42PM (#40402998)
array |> mean |> round(; digits=2) should also work and is a bit more concise.
Re:Calculus with Julia by SatvikBeri on Saturday May 18, 2024 @11:08PM (#40403917)
This doesn't work, at least for me on 1.10. `round(; digits=2)` would have to produce a function. But Julia doesn't have automatic currying, so that only happens if someone has implemented a special-case version (e.g. (==)(3) returns a partial function that tests for equality with 3.)