JuliaGraphics / ColorSchemes.jl

colorschemes, colormaps, gradients, and palettes
http://juliagraphics.github.io/ColorSchemes.jl/
Other
187 stars 34 forks source link

Small code cleanups #30

Closed asinghvi17 closed 4 years ago

asinghvi17 commented 4 years ago
asinghvi17 commented 4 years ago

Very interesting. I'll revert that and look for why.

asinghvi17 commented 4 years ago

Let's see if this works - I think it might have been a macro issue.

asinghvi17 commented 4 years ago

I think this is one for the "cool hack" club:

julia> import Base.:/

julia> a::String/b::String = joinpath(a, b)
/ (generic function with 116 methods)

julia> 1/2
0.5

julia> @__DIR__/"a"
ERROR: syntax: "/" is not a unary operator
Stacktrace:
    Function         Module  Signature
    ────────         ──────  ─────────
[1] top-level scope
REPL[5]:0

julia> (@__DIR__) / "a"
"mydir/a"
cormullion commented 4 years ago

perhaps joinpath is better here?

asinghvi17 commented 4 years ago

Yes, I've reworked that to use joinpath, and tests seem to pass. That example was just a hack which I remembered was possible.

asinghvi17 commented 4 years ago

The documentation build is failing because of a compat constraint. I'll add CompatHelper and adjust that.

cormullion commented 4 years ago

good stuff!