JuliaFolds2 / OhMyThreads.jl

Simple multithreading in julia
https://juliafolds2.github.io/OhMyThreads.jl/
MIT License
139 stars 9 forks source link

Don't export `@set` #115

Closed jariji closed 1 month ago

jariji commented 1 month ago

OhMyThreads.@set is pretty niche functionality and it clashes with Accessors.@set. Currently it's exported, would it be okay to not export it?

carstenbauer commented 1 month ago

It's not at all niche if you use the @tasks macro API.

I would recommend that you only explicitly import/using the bits that you need (e.g. using OhMyThreads: tmapreduce) rather then just doing using OhMyThreads.

While the simple using X is, unfortunately, very common in Julia codes, it is quite generally an anti-pattern that doesn't scale well. (Any export that a package might add over time could break your code, because clashes like the one you mention here could occur.)