JuliaLang / Compat.jl

Compatibility across Julia versions
Other
145 stars 117 forks source link

Adding `get` with `CartesianIndex` #701

Closed mtsch closed 4 years ago

mtsch commented 4 years ago

My package is failing on 1.0 because get(::Array, ::CartesianIndex, default) is undefined. I would love to create a pull request for this, but I'm not sure when this feature was added. I can't find anything about it in Julia's NEWS.md.

martinholters commented 4 years ago

I think this was added in https://github.com/JuliaLang/julia/pull/30268 which would be v1.1.0-DEV.811.

PR welcome!

mtsch commented 4 years ago

Thanks! Just for future reference, where do you find the correct version if you know the PR/commit?

martinholters commented 4 years ago

Let me quote our README:

If you're adding additional compatibility code to this package, the contrib/commit-name.sh script in the base Julia repository is useful for extracting the version number from a git commit SHA. For example, from the git repository of julia, run something like this:

bash $ contrib/commit-name.sh a378b60fe483130d0d30206deb8ba662e93944da
0.5.0-dev+2023

This prints a version number corresponding to the specified commit of the form X.Y.Z-aaa+NNNN, and you can then test whether Julia is at least this version by VERSION >= v"X.Y.Z-aaa+NNNN".

mtsch commented 4 years ago

Thanks, I completely missed that! Sorry for the dumb question.