11# ## Format registry infrastructure
22@compat abstract type OS end
33@compat abstract type Unix <: OS end
4- immutable Windows <: OS end
5- immutable OSX <: Unix end
6- immutable Linux <: Unix end
4+ struct Windows <: OS end
5+ struct OSX <: Unix end
6+ struct Linux <: Unix end
77
8- immutable LOAD end
9- immutable SAVE end
8+ struct LOAD end
9+ struct SAVE end
1010
1111split_predicates (list) = filter (x-> x <: OS , list), filter (x-> ! (x <: OS ), list)
1212applies_to_os (os:: Vector ) = isempty (os) || any (applies_to_os, os)
@@ -37,7 +37,7 @@ where `sym` is always a symbol. For example, a .csv file might have
3737
3838An easy way to write `DataFormat{:CSV}` is `format"CSV"`.
3939"""
40- immutable DataFormat{sym} end
40+ struct DataFormat{sym} end
4141
4242macro format_str (s)
4343 :(DataFormat{$ (Expr (:quote , Symbol (s)))})
222222DataFormat `fmt`. For example, `File{fmtpng}(filename)` would indicate a PNG
223223file.
224224"""
225- immutable File{F<: DataFormat } <: Formatted{F}
225+ struct File{F<: DataFormat } <: Formatted{F}
226226 filename:: String
227227end
228228File {sym} (fmt:: Type{DataFormat{sym}} , filename) = File {fmt} (filename)
@@ -245,7 +245,7 @@ written in known `Format`. For example, `Stream{PNG}(io)` would
245245indicate PNG format. If known, the optional `filename` argument can
246246be used to improve error messages, etc.
247247"""
248- immutable Stream{F<: DataFormat ,IOtype<: IO } <: Formatted{F}
248+ struct Stream{F<: DataFormat ,IOtype<: IO } <: Formatted{F}
249249 io:: IOtype
250250 filename:: Nullable{String}
251251end
0 commit comments