Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request] Do not use Base.tryparse to parse CLI args #285

Open
jakobnissen opened this issue Sep 25, 2024 · 0 comments
Open

[Request] Do not use Base.tryparse to parse CLI args #285

jakobnissen opened this issue Sep 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jakobnissen
Copy link
Contributor

The problem is that this encourages (forces?) users to implement methods like Base.tryparse(::Type{Vector{Float64}}, x::String), which is piracy.
Now, most likely, this will not cause issues, since users will only implement them if they find the methods to not exist in Base. However

  • It makes depdendents of Comonicon risky to use together, since different packages may define the same tryparse methods
  • These methods may be implemented in future versions of Julia

A straightforward solution would be to have a distinct function like Comonicon.try_parse_arg, which has a default definition try_parse_arg(x::Type{T}, s::AbstractString) where T = tryparse(T, s).
This should not cause breakage.

@jakobnissen jakobnissen added the bug Something isn't working label Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
1 participant