-
Notifications
You must be signed in to change notification settings - Fork 17
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
Suppress warnings on julia v0.6 #26
Changes from 7 commits
cdb51fc
4a7bebb
f2e2a43
e194e2e
c933069
d4cbe72
07755e5
aa29cfc
33c6ec3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ os: | |
- linux | ||
- osx | ||
julia: | ||
- 0.4 | ||
- 0.5 | ||
- nightly | ||
notifications: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
julia 0.4 | ||
julia 0.5 | ||
DataFrames 0.7 | ||
DataArrays 0.3 | ||
FileIO 0.1.2 | ||
GZip 0.2 | ||
Compat 0.8 | ||
Compat 0.17 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
""" | ||
RDA (R data archive) reading context. | ||
|
||
* Stores flags that define how R objects are read and converted | ||
into Julia objects. | ||
* Maintains the list of R objects that could be referenced later in | ||
the RDA stream. | ||
* Stores flags that define how R objects are read and converted into Julia objects. | ||
* Maintains the list of R objects that could be referenced later in the RDA stream. | ||
""" | ||
type RDAContext{T <: RDAIO} | ||
type RDAContext{T<:RDAIO} | ||
io::T # RDA input stream | ||
|
||
# RDA format properties | ||
|
@@ -18,22 +16,15 @@ type RDAContext{T <: RDAIO} | |
|
||
# intermediate data | ||
ref_tab::Vector{RSEXPREC} # SEXP array for references | ||
|
||
function RDAContext(io::T, kwoptions::Vector{Any}) | ||
fmtver = readint32(io) | ||
rver = readint32(io) | ||
rminver = readint32(io) | ||
kwdict = Dict{Symbol,Any}(kwoptions) | ||
new(io, | ||
fmtver, | ||
VersionNumber(div(rver,65536), div(rver%65536, 256), rver%256), | ||
VersionNumber(div(rminver,65536), div(rminver%65536, 256), rminver%256), | ||
kwdict, | ||
RSEXPREC[]) | ||
end | ||
end | ||
|
||
RDAContext{T <: RDAIO}(io::T, kwoptions::Vector{Any}) = RDAContext{T}(io, kwoptions) | ||
int2ver(v::Integer) = VersionNumber(v >> 16, (v >> 8) & 0xff, v & 0xff) | ||
function RDAContext{T<:RDAIO}(io::T, kwoptions::Vector{Any}=Any[]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe the old inner constructor was added in the first place to ensure the fields are valid? It so, you can keep it using the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure I understand. In what way would the inner constructor ensure validity of fields that the external constructor would not? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because when the inner ctor is explicitly defined, the default implicit inner ctor (which takes the value for every field) is not generated. So any creation of the object would have to go through the explicitly provided inner ctor. Inner Constructors in the Julia manual. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't feel confident in making this change. Could someone else do it, please? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this outer ctor version is fine. Initializing the fields from |
||
fmtver = readuint32(io) | ||
rver = int2ver(readint32(io)) | ||
rminver = int2ver(readint32(io)) | ||
kwdict = Dict{Symbol,Any}(kwoptions) | ||
RDAContext(io, fmtver, rver, rminver, kwdict, RSEXPREC[]) | ||
end | ||
|
||
""" | ||
Registers R object, so that it could be referenced later | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ const ATTRLISTSXP = 0xEF | |
## | ||
############################################################################## | ||
|
||
typealias RDATag UInt32 | ||
const RDATag = UInt32 | ||
|
||
isobj(fl::RDATag) = (fl & 0x00000100) != 0 | ||
hasattr(fl::RDATag) = (fl & 0x00000200) != 0 | ||
|
@@ -85,7 +85,7 @@ sxtype(fl::RDATag) = fl % UInt8 | |
Base class for RData internal representation of all R types. | ||
`SEXPREC` stands for S (R predecessor) expression record. | ||
""" | ||
abstract RSEXPREC{S} | ||
@compat abstract type RSEXPREC{S} end | ||
|
||
""" | ||
R symbol. | ||
|
@@ -98,12 +98,12 @@ end | |
""" | ||
Base class for all R types (objects) that can have attributes. | ||
""" | ||
abstract ROBJ{S} <: RSEXPREC{S} | ||
@compat abstract type ROBJ{S} <: RSEXPREC{S} end | ||
|
||
""" | ||
Base class for all R vector-like objects. | ||
""" | ||
abstract RVEC{T, S} <: ROBJ{S} | ||
@compat abstract type RVEC{T, S} <: ROBJ{S} end | ||
|
||
""" | ||
R vector object. | ||
|
@@ -112,13 +112,14 @@ type RVector{T, S} <: RVEC{T, S} | |
data::Vector{T} | ||
attr::Hash # collection of R object attributes | ||
|
||
RVector(v::Vector{T} = T[], attr::Hash = Hash()) = new(v, attr) | ||
@compat RVector{T,S}(v::Vector{T} = T[], attr::Hash = Hash()) where {T,S} = new(v, attr) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIU
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I reverted the change but now get a warning
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need |
||
|
||
end | ||
|
||
typealias RLogicalVector RVector{Int32, LGLSXP} | ||
typealias RIntegerVector RVector{Int32, INTSXP} | ||
typealias RNumericVector RVector{Float64, REALSXP} | ||
typealias RComplexVector RVector{Complex128, CPLXSXP} | ||
const RLogicalVector = RVector{Int32, LGLSXP} | ||
const RIntegerVector = RVector{Int32, INTSXP} | ||
const RNumericVector = RVector{Float64, REALSXP} | ||
const RComplexVector = RVector{Complex128, CPLXSXP} | ||
|
||
""" | ||
R vector object with explicit NA values. | ||
|
@@ -129,12 +130,12 @@ immutable RNullableVector{T, S} <: RVEC{T, S} | |
attr::Hash # collection of R object attributes | ||
end | ||
|
||
typealias RStringVector RNullableVector{RString,STRSXP} | ||
typealias RList RVector{RSEXPREC,VECSXP} # "list" in R == Julia cell array | ||
const RStringVector = RNullableVector{RString,STRSXP} | ||
const RList = RVector{RSEXPREC,VECSXP} # "list" in R == Julia cell array | ||
|
||
""" | ||
Representation of R's paired list-like structures (`LISTSXP`, `LANGSXP`). | ||
Unlike R that represents it as singly-linked list, | ||
Unlike R which represents these as singly-linked list, | ||
`RPairList` uses vector representation. | ||
""" | ||
immutable RPairList <: ROBJ{LISTSXP} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll also need to raise the minimum version of Compat in this file to 0.17 (I think that's it) to allow
@compat abstract type
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, will do.