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

Deprecate @vectorize_1arg for Dates functions within scope of Dates module #18456

Merged
merged 2 commits into from
Sep 14, 2016

Conversation

omus
Copy link
Member

@omus omus commented Sep 12, 2016

Deprecations for @vectorize_1arg introduced in #17302 causes Date module functions to be created in Base. I noticed this issue when running:

julia> using Base.Dates

julia> unix2datetime(0)
WARNING: both Dates and Base export "unix2datetime"; uses of it in module Main must be qualified
ERROR: UndefVarError: unix2datetime not defined

Otherwise there are issues with functions being independently defined
within multiple modules:

```julia
julia> using Base.Dates

julia> unix2datetime(0)
WARNING: both Dates and Base export "unix2datetime"; uses of it in module Main must be qualified
ERROR: UndefVarError: unix2datetime not defined
```
:unix2datetime, :rata2datetime, :julian2datetime, # base/dates/conversions.jl
)
eval(Dates, :(Base.@dep_vectorize_1arg Real $f))
end
Copy link
Member

@ararslan ararslan Sep 12, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO those parentheses make it kind of hard to read. Might be nicer as

# base/dates/*.jl
for f in (:unix2datetime, :rata2datetime, :julian2datetime) # base/dates/conversions.jl
    eval(Dates, :(Base.@dep_vectorize_1arg Real $f))
end

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change. Was just matching the surrounding style.

@Sacha0
Copy link
Member

Sacha0 commented Sep 12, 2016

Thanks for catching and fixing this @omus!

@kshyatt kshyatt added dates Dates, times, and the Dates stdlib module broadcast Applying a function over a collection labels Sep 13, 2016
@tkelman tkelman merged commit 94adc99 into JuliaLang:master Sep 14, 2016
@omus omus deleted the fix-depvect-for-dates branch September 14, 2016 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
broadcast Applying a function over a collection dates Dates, times, and the Dates stdlib module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants