JuliaHEP / JuliaHEP-2023

Materials for the JuliaHEP 2023 Workshop
https://juliahep.github.io/JuliaHEP-2023/
Creative Commons Attribution 4.0 International
4 stars 4 forks source link

Use `iseven` or `isodd` in broadcast tutorial #14

Closed Moelf closed 10 months ago

Moelf commented 10 months ago

https://github.com/JuliaHEP/JuliaHEP-2023/blob/292dd63319e8100c0012984e51ce7650606f4d20/julia-intro/docs/julia-intro-broadcasting.ipynb#L153-L158

This doesn't seem like idiomatic Julia to me, maybe just broadcast iseven() or isodd(). Since you already demonstrated docstring before

aoanla commented 10 months ago

Hm, true, I didn't really think about it - the perils of still sometimes translating code into Julia from a different internal model. I don't object to iseven() at all