Skip to content
This repository has been archived by the owner on Jul 17, 2019. It is now read-only.

Commit

Permalink
Switch back to using NamedTuples package (#75)
Browse files Browse the repository at this point in the history
* Switch back to using NamedTuples package

* Remove current_module
  • Loading branch information
quinnj committed Jun 5, 2018
1 parent 66df324 commit 40a51dc
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 434 deletions.
1 change: 1 addition & 0 deletions REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ julia 0.6
WeakRefStrings 0.4.0
Missings
Compat 0.59
NamedTuples 4.0.2
22 changes: 20 additions & 2 deletions src/DataStreams.jl
Original file line number Diff line number Diff line change
Expand Up @@ -484,18 +484,36 @@ end
datatype(T) = Core.eval(parentmodule(Base.unwrap_unionall(T)), nameof(T))

@static if !isdefined(Core, :NamedTuple)
include("nt.jl")
using .NamedTuples
using NamedTuples
function Base.get(f::Function, nt::NamedTuple, k)
return haskey(nt, k) ? nt[k] : f()
end

else
macro NT(args...)
return esc(:(($(args...),)))
end
end
export @NT

const ColNT = Ref{Any}()
const ColNT2 = Ref{Any}()

function __init__()
ColNT[] = @static if VERSION < v"0.7.0-DEV.2738"
nt = NamedTuples.create_namedtuple_type([:col])
x->nt(x...)
else
NamedTuple{(:col,)}
end
ColNT2[] = @static if VERSION < v"0.7.0-DEV.2738"
nt2 = NamedTuples.create_namedtuple_type([:name, :compute, :computeargs])
x->nt2(x...)
else
NamedTuple{(:name, :compute, :computeargs)}
end
end

include("namedtuples.jl")
include("query.jl")

Expand Down
Loading

0 comments on commit 40a51dc

Please sign in to comment.