add @? macro - #136
Conversation
Good point. I am OK to require 1.3+. In downstream packages (like DataFrames.jl) we can allow several versions of Missings.jl. Also I assume that soon 1.0 will stop being LTS and then we will stop supporting it. |
Co-authored-by: Alex Arslan <ararslan@comcast.net>
|
Technically we could allow both (by checking |
We've already moved that way with Arrow.jl, and a few others I think. I've heard through the grapevine that 1.6 or 1.7 will be a new LTS, so I agree it should be fine to start officially dropping 1.0. |
|
Missings.jl is more delicate as it is a dependency of e.g DataFrames.jl so this decision should be coordinated across the whole ecosystem. @oxinabox - would dropping of support of Julia 1.0 be considered breaking following the semver? In this PR (if we want to leave this decision for later and if we agree that |
|
not breaking. |
|
I have made it work in all versions post 1.0 including. Just on old versions I skipped docstring. |
|
Seeing this in JuliaData, I imagine there has been extensive discussion on this topic. But I think it's rather unfortunate to use such a terse syntax "just" for syntax sugar that can even be implemented as a type alias (e.g., Maybe we can avoid "wasting" the syntax space too much by only using macro var"?"(ex)
(Meta.isexpr(ex, :braces) && length(ex.args) == 1) || error("...")
t, = ex.args
:(Union{$(esc(t)), Missing})
endso that It'd let us use, e.g., |
There have been lengthily discussions and they all end up in deciding not to decide yet.
This is the point. An example from a recent user question: It is really painful to type and read. And I think we just have to decide on something as JuliaData ecosysem gets more adoption.
This is one option. Another options that came to my mind are: and then we would write Let us discuss. There is no rush to decide. |
Is (Conflict of interest: I wrote Maybe.jl which is built around the idea of improving the usability of
I strongly suggest that we should keep the invariance |
|
@tkf - I agree with both comments in general. I am just looking for some solution that would shorten the code for users. |
|
Clever PR! I'm not sure how I feel about this. @tkf's remarks are very relevant. I agree that At any rate if we went with |
|
OK - let us call @ViralBShah then and ask him whom we should ask 😄. |
|
@StefanKarpinski is the person whose attention needs to be drawn here. And also @JeffBezanson, if he wants to chime in. |
I think it is high time to make a bold decision and add
@?to Missings.jl. The proposal is slightly modified original @tkf code.@pdeffebach + @jkrumbiegel I was not sure how to properly add a docstring which should be:
CC @nalimilan