960960 export axes
961961end
962962
963+ # 0.7.0-DEV.3137
964+ @static if ! isdefined (Base, :Nothing )
965+ const Nothing = Void
966+ const Cvoid = Void
967+ export Nothing, Cvoid
968+ end
969+
963970@static if ! isdefined (Base, :Some )
964971 import Base: promote_rule, convert
965972 if VERSION >= v " 0.6.0"
@@ -968,35 +975,35 @@ end
968975 value::T
969976 end
970977 promote_rule(::Type{Some{S}}, ::Type{Some{T}}) where {S,T} = Some{promote_type(S, T)}
971- promote_rule(::Type{Some{T}}, ::Type{Void }) where {T} = Union{Some{T}, Void }
978+ promote_rule(::Type{Some{T}}, ::Type{Nothing }) where {T} = Union{Some{T}, Nothing }
972979 convert(::Type{Some{T}}, x::Some) where {T} = Some{T}(convert(T, x.value))
973- convert(::Type{Union{Some{T}, Void }}, x::Some) where {T} = convert(Some{T}, x)
974- convert(::Type{Union{T, Void }}, x::Any) where {T} = convert(T, x)
980+ convert(::Type{Union{Some{T}, Nothing }}, x::Some) where {T} = convert(Some{T}, x)
981+ convert(::Type{Union{T, Nothing }}, x::Any) where {T} = convert(T, x)
975982 """ )
976983 else
977984 include_string (@__MODULE__ , """
978985 immutable Some{T}
979986 value::T
980987 end
981988 promote_rule{S,T}(::Type{Some{S}}, ::Type{Some{T}}) = Some{promote_type(S, T)}
982- promote_rule{T}(::Type{Some{T}}, ::Type{Void }) = Union{Some{T}, Void }
989+ promote_rule{T}(::Type{Some{T}}, ::Type{Nothing }) = Union{Some{T}, Nothing }
983990 convert{T}(::Type{Some{T}}, x::Some) = Some{T}(convert(T, x.value))
984- convert{T}(::Type{Union{Some{T}, Void }}, x::Some) = convert(Some{T}, x)
985- convert{T}(::Type{Union{T, Void }}, x::Any) = convert(T, x)
991+ convert{T}(::Type{Union{Some{T}, Nothing }}, x::Some) = convert(Some{T}, x)
992+ convert{T}(::Type{Union{T, Nothing }}, x::Any) = convert(T, x)
986993 """ )
987994 end
988- convert (:: Type{Void } , x:: Any ) = throw (MethodError (convert, (Void , x)))
989- convert (:: Type{Void } , x:: Void ) = nothing
995+ convert (:: Type{Nothing } , x:: Any ) = throw (MethodError (convert, (Nothing , x)))
996+ convert (:: Type{Nothing } , x:: Nothing ) = nothing
990997 coalesce (x:: Any ) = x
991998 coalesce (x:: Some ) = x. value
992- coalesce (x:: Void ) = nothing
999+ coalesce (x:: Nothing ) = nothing
9931000 # coalesce(x::Missing) = missing
9941001 coalesce (x:: Any , y... ) = x
9951002 coalesce (x:: Some , y... ) = x. value
996- coalesce (x:: Void , y... ) = coalesce (y... )
997- # coalesce(x::Union{Void , Missing}, y...) = coalesce(y...)
1003+ coalesce (x:: Nothing , y... ) = coalesce (y... )
1004+ # coalesce(x::Union{Nothing , Missing}, y...) = coalesce(y...)
9981005 notnothing (x:: Any ) = x
999- notnothing (:: Void ) = throw (ArgumentError (" nothing passed to notnothing" ))
1006+ notnothing (:: Nothing ) = throw (ArgumentError (" nothing passed to notnothing" ))
10001007 export Some, coalesce
10011008else
10021009 import Base: notnothing
0 commit comments