Skip to content

Conversation

@CameronBieganek
Copy link
Contributor

This will allow users to type ScopedValues.with without having to do a using or import. (As can be done for Iterators.take and Threads.nthreads, etc.)

This needs to be backported to 1.11, in my opinion.

@nsajko
Copy link
Member

nsajko commented May 22, 2024

Why clutter the main namespace? I think Base.ScopedValues is fine.

@LilithHafner
Copy link
Member

LilithHafner commented May 22, 2024

This could be confusing if someone loads the ScopedValues.jl package (e.g. for compat with Julia < 1.11)

@CameronBieganek
Copy link
Contributor Author

Why clutter the main namespace? I think Base.ScopedValues is fine.

Do you think Base.ScopedValues.ScopedValue(x) is fine? Or Base.ScopedValues.with? I think exporting ScopedValues makes sense given that we do the same thing for commonly used modules like Iterators, Threads, and Sys. "Why clutter the namespace?" is an argument that I'm getting tired of hearing. It lacks substance. Why not make ScopedValues convenient and ergonomic to use?

But yeah, the situation with ScopedValues.jl is unfortunate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants