Codebase list julia / 64ae287
New upstream version 1.0.0 Mo Zhou 5 years ago
176 changed file(s) with 2496 addition(s) and 15996 deletion(s). Raw diff Collapse all Expand all
5858 pushd /tmp/julia/share/julia/test &&
5959 if [ $(echo "$FILES_CHANGED" | grep -cv '^doc/') -gt 0 ]; then
6060 /tmp/julia/bin/julia --check-bounds=yes runtests.jl all --skip Sockets | bar -i 30 &&
61 /tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download;
61 /tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download;
6262 fi &&
6363 popd &&
6464 mkdir /tmp/embedding-test &&
4444
4545 ./usr/bin/julia --check-bounds=yes test/runtests.jl all
4646 ./usr/bin/julia --check-bounds=yes test/runtests.jl \
47 LibGit2/online OldPkg/pkg Pkg/pkg download
47 LibGit2/online Pkg/pkg download
4848 }
4949
5050 test-embedding(){
133133 # skip tests if only files within the "doc" dir have changed
134134 - if [ $(echo "$FILES_CHANGED" | grep -cv '^doc/') -gt 0 ]; then
135135 /tmp/julia/bin/julia --check-bounds=yes runtests.jl $TESTSTORUN &&
136 /tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download; fi
136 /tmp/julia/bin/julia --check-bounds=yes runtests.jl LibGit2/online Pkg/pkg download; fi
137137 - popd
138138 # test that the embedding code works on our installation
139139 - mkdir /tmp/embedding-test &&
0 Julia v0.7.0 Release Notes
1 ==========================
2
3 New language features
4 ---------------------
5
6 * Local variables can be tested for being defined
7 using the new `@isdefined variable` macro ([#22281]).
8
9 * Destructuring in function arguments: when an expression such as `(x, y)` is used as
10 a function argument name, the argument is unpacked into local variables `x` and `y`
11 as in the assignment `(x, y) = arg` ([#6614]).
12
13 * Named tuples, with the syntax `(a=1, b=2)`. These behave very similarly to tuples,
14 except components can also be accessed by name using dot syntax `t.a` ([#22194]).
15
16 * Keyword argument containers (`kw` in `f(; kw...)`) are now based on named tuples. Dictionary
17 functions like `haskey` and indexing can be used on them, and name-value pairs can be
18 iterated using `pairs(kw)`. `kw` can no longer contain multiple entries for the same
19 argument name ([#4916]).
20
21 * Custom infix operators can now be defined by appending Unicode
22 combining marks, primes, and sub/superscripts to other operators.
23 For example, `+̂ₐ″` is parsed as an infix operator with the same
24 precedence as `+` ([#22089]).
25
26 * The macro call syntax `@macroname[args]` is now available and is parsed
27 as `@macroname([args])` ([#23519]).
28
29 * The construct `if @generated ...; else ...; end` can be used to provide both
30 `@generated` and normal implementations of part of a function. Surrounding code
31 will be common to both versions ([#23168]).
32
33 * Added `⟂` (`\perp`) operator with comparison precedence ([#24404]).
34
35 * The `missing` singleton object (of type `Missing`) has been added to represent
36 missing values ([#24653]). It propagates through standard operators and mathematical functions,
37 and implements three-valued logic, similar to SQLs `NULL` and R's `NA`.
38
39 * Field access via dot-syntax can now be overloaded by adding methods to
40 `Base.getproperty` and `Base.setproperty!` ([#1974]), optionally along with
41 a corresponding `Base.propertynames` method for reflection ([#25311]).
42
43 * Values for `Enum`s can now be specified inside of a `begin` block when using the
44 `@enum` macro ([#25424]).
45
46 * Keyword arguments can be required: if a default value is omitted, then an
47 exception is thrown if the caller does not assign the keyword a value ([#25830]).
48
49 * The pair operator `=>` is now broadcastable as `.=>` which was previously a parsing error ([#27447])
50
51 Language changes
52 ----------------
53
54 * The syntax for parametric methods, `function f{T}(x::T)`, has been
55 changed to `function f(x::T) where {T}` ([#11310]).
56
57 * The fallback constructor that calls `convert` is deprecated. Instead, new types should
58 prefer to define constructors, and add `convert` methods that call those constructors
59 only as necessary ([#15120]).
60
61 * The syntax `1.+2` is deprecated, since it is ambiguous: it could mean either
62 `1 .+ 2` (the current meaning) or `1. + 2` ([#19089]).
63
64 * Mutable structs with no fields are no longer singletons; it is now possible to make
65 multiple instances of them that can be distinguished by `===` ([#25854]).
66 Zero-size immutable structs are still singletons.
67
68 * In string and character literals, backslash `\` may no longer
69 precede unrecognized escape characters ([#22800]).
70
71 * Juxtaposing binary, octal, and hexadecimal literals is deprecated, since it can lead to
72 confusing code such as `0xapi == 0xa * pi` ([#16356]).
73
74 * Numeric literal juxtaposition now has slighty lower precedence than unary operators,
75 so for example `√2x` parses as `(√2) * x` ([#27641]).
76
77 * Declaring arguments as `x::ANY` to avoid specialization has been replaced
78 by `@nospecialize x`. ([#22666]).
79
80 This can also be used in global scope, to apply to all subsequent method definitions
81 in the module (until `@specialize`). ([#28065])
82
83 * Keyword argument default values are now evaluated in successive scopes ---
84 the scope for each expression includes only previous keyword arguments, in
85 left-to-right order ([#17240]).
86
87 * The parsing of `1<<2*3` as `1<<(2*3)` is deprecated, and will change to
88 `(1<<2)*3` in a future version ([#13079]).
89
90 * The parsing of `<|` is now right associative. `|>` remains left associative ([#24153]).
91
92 * `:` now parses like other operators, as a call to a function named `:`, instead of
93 calling `colon` ([#25947]).
94
95 * `{ }` expressions now use `braces` and `bracescat` as expression heads instead
96 of `cell1d` and `cell2d`, and parse similarly to `vect` and `vcat` ([#8470]).
97
98 * Nested `if` expressions that arise from the keyword `elseif` now use `elseif`
99 as their expression head instead of `if` ([#21774]).
100
101 * `let` blocks now parse the same as `for` loops; the first argument is either an
102 assignment or `block` of assignments, and the second argument is a block of
103 statements ([#21774]).
104
105 * `do` syntax now parses to an expression with head `:do`, instead of as a function
106 call ([#21774]).
107
108 * Parsed and lowered forms of type definitions have been synchronized with their
109 new keywords ([#23157]). Expression heads are renamed as follows:
110
111 + `type` => `struct`
112
113 + `bitstype` => `primitive` (order of arguments is also reversed, to match syntax)
114
115 + `composite_type` => `struct_type`
116
117 + `bits_type` => `primitive_type`
118
119 * The `global` keyword now only introduces a new binding if one doesn't already exist
120 in the module.
121 This means that assignment to a global (`global sin = 3`) may now throw the error:
122 "cannot assign variable Base.sin from module Main", rather than emitting a warning.
123 Additionally, the new bindings are now created before the statement is executed.
124 For example, `f() = (global sin = "gluttony"; nothing)` will now resolve which module
125 contains `sin` eagerly, rather than delaying that decision until `f` is run. ([#22984]).
126
127 * `global const` declarations may no longer appear inside functions ([#12010]).
128
129 * Uninitialized `BitArray` constructors of the form `BitArray[{N}](shape...)` have been
130 deprecated in favor of equivalents accepting `undef` (an alias for
131 `UndefInitializer()`) as their first argument, as in
132 `BitArray[{N}](undef, shape...)`. For example, `BitVector(3)` is now
133 `BitVector(undef, 3)`, `BitMatrix((2, 4))` is now
134 `BitMatrix(undef, (2, 4))`, and `BitArray{3}(11, 13, 17)` is now
135 `BitArray{3}(undef, 11, 14, 17)` ([#24785]).
136
137 * Dispatch rules have been simplified:
138 method matching is now determined exclusively by subtyping;
139 the rule that method type parameters must also be captured has been removed.
140 Instead, attempting to access the unconstrained parameters will throw an `UndefVarError`.
141 Linting in package tests is recommended to confirm that the set of methods
142 which might throw `UndefVarError` when accessing the static parameters
143 (`need_to_handle_undef_sparam = Set{Any}(m.sig for m in Test.detect_unbound_args(Base, recursive=true))`)
144 is equal (`==`) to some known set (`expected = Set()`). ([#23117])
145
146 * `const` declarations on local variables were previously ignored. They now give a
147 warning, so that this syntax can be disallowed or given a new meaning in a
148 future version ([#5148]).
149
150 * Placing an expression after `catch`, as in `catch f(x)`, is deprecated.
151 Use `catch; f(x)` instead ([#19987]).
152
153 * In `for i = ...`, if a local variable `i` already existed it would be overwritten
154 during the loop. This behavior is deprecated, and in the future `for` loop variables
155 will always be new variables local to the loop ([#22314]).
156 The old behavior of overwriting an existing variable is available via `for outer i = ...`.
157
158 * In `for i in x`, `x` used to be evaluated in a new scope enclosing the `for` loop.
159 Now it is evaluated in the scope outside the `for` loop.
160
161 * In `for i in x, j in y`, all variables now have fresh bindings on each iteration of the
162 innermost loop. For example, an assignment to `i` will not be visible on the next `j`
163 loop iteration ([#330]).
164
165 * Variable bindings local to `while` loop bodies are now freshly allocated on each loop iteration,
166 matching the behavior of `for` loops.
167
168 * Prefix `&` for by-reference arguments to `ccall` has been deprecated in favor of
169 `Ref` argument types ([#6080]).
170
171 * The constructor `Ref(x::T)` now always returns a `Ref{T}` ([#21527]).
172
173 * All line numbers in ASTs are represented by `LineNumberNode`s; the `:line` expression
174 head is no longer used. `QuoteNode`s are also consistently used for quoted symbols instead
175 of the `:quote` expression head (though `:quote` `Expr`s are still used for quoted
176 expressions) ([#23885]).
177
178 * The `+` and `-` methods for `Number` and `UniformScaling` are not ambiguous anymore since `+`
179 and `-` no longer do automatic broadcasting. Hence, the methods for `UniformScaling` and `Number` are
180 no longer deprecated ([#23923]).
181
182 * The keyword `importall` is deprecated. Use `using` and/or individual `import` statements
183 instead ([#22789]).
184
185 * `reduce(+, [...])` and `reduce(*, [...])` no longer widen the iterated over arguments to
186 system word size. `sum` and `prod` still preserve this behavior. ([#22825])
187
188 * Like `_`, variable names consisting only of underscores can be assigned,
189 but accessing their values is deprecated ([#24221]).
190
191 * Raw string literal escaping rules have been changed to make it possible to write all strings.
192 The rule is that backslashes escape both quotes and other backslashes, but only when a sequence
193 of backslashes precedes a quote character. Thus, 2n backslashes followed by a quote encodes n
194 backslashes and the end of the literal while 2n+1 backslashes followed by a quote encodes n
195 backslashes followed by a quote character ([#22926]).
196
197 * `reprmime(mime, x)` has been renamed to `repr(mime, x)`, and along with `repr(x)`
198 and `sprint` it now accepts an optional `context` keyword for `IOContext` attributes.
199 `stringmime` has been moved to the Base64 stdlib package ([#25990]).
200
201 * The syntax `(x...)` for constructing a tuple is deprecated; use `(x...,)` instead ([#24452]).
202
203 * Non-parenthesized interpolated variables in strings, e.g. `"$x"`, must be followed
204 by a character that will never be an allowed identifier character (currently
205 operators, space/control characters, or common punctuation characters) ([#25231]).
206
207 * The syntax `using A.B` can now only be used when `A.B` is a module, and the syntax
208 `using A: B` can only be used for adding single bindings ([#8000]).
209
210 * `=>` now has its own precedence level, giving it strictly higher precedence than
211 `=` and `,` ([#25391]).
212
213 * The conditions under which unary operators followed by `(` are parsed as prefix function
214 calls have changed ([#26154]).
215
216 * `begin` is disallowed inside indexing expressions, in order to enable the syntax
217 `a[begin]` (for selecting the first element) in the future ([#23354]).
218
219 * Underscores for `_italics_` and `__bold__` are now supported by the Base Markdown
220 parser. ([#25564])
221
222 * `…` (`\dots`) and `⁝` (`\tricolon`) are now parsed as binary operators ([#26262]).
223
224 * Assignment syntax (`a=b`) inside square bracket expressions (e.g. `A[...]`, `[x, y]`)
225 is deprecated. It will likely be reclaimed in a later version for passing keyword
226 arguments. Note this does not affect updating operators like `+=` ([#25631]).
227
228 * `try` blocks without `catch` or `finally` are no longer allowed. An explicit empty
229 `catch` block should be written instead ([#27554]).
230
231 * `AbstractArray` types that use unconventional (not 1-based) indexing can now support
232 `size`, `length`, and `@inbounds`. To optionally enforce conventional indices,
233 you can `@assert !has_offset_axes(A)`.
234
235 * Module pre-compilation is now the default for code loading. Adding a
236 `__precompile__()` declaration is no longer necessary, although
237 `__precompile__(false)` can still be used to opt-out ([#26991]).
238
239 Breaking changes
240 ----------------
241
242 This section lists changes that do not have deprecation warnings.
243
244 * The package manager `Pkg` has been replaced with a new one. See the manual entries on
245 "Code Loading" and "Pkg" for documentation.
246
247 * `replace(s::AbstractString, pat=>repl)` for function `repl` arguments formerly
248 passed a substring to `repl` in all cases. It now passes substrings for
249 string patterns `pat`, but a `Char` for character patterns (when `pat` is a
250 `Char`, collection of `Char`, or a character predicate) ([#25815]).
251
252 * `readuntil` now does *not* include the delimiter in its result, matching the
253 behavior of `readline`. Pass `keep=true` to get the old behavior ([#25633]).
254
255 * `lu` methods now return decomposition objects such as `LU` rather than
256 tuples of arrays or tuples of numbers ([#26997], [#27159], [#27212]).
257
258 * `schur` methods now return decomposition objects such as `Schur` and
259 `GeneralizedSchur` rather than tuples of arrays ([#26997], [#27159], [#27212]).
260
261 * `lq` methods now return decomposition objects such as `LQ`
262 rather than tuples of arrays ([#26997], [#27159], [#27212]).
263
264 * `qr` methods now return decomposition objects such as `QR`, `QRPivoted`,
265 and `QRCompactWY` rather than tuples of arrays ([#26997], [#27159], [#27212]).
266
267 * `svd` methods now return decomposition objects such as `SVD` and
268 `GeneralizedSVD` rather than tuples of arrays or tuples of numbers ([#26997], [#27159], [#27212]).
269
270 * `countlines` now always counts the last non-empty line even if it does not
271 end with EOL, matching the behavior of `eachline` and `readlines` ([#25845]).
272
273 * `getindex(s::String, r::UnitRange{Int})` now throws `StringIndexError` if `last(r)`
274 is not a valid index into `s` ([#22572]).
275
276 * `ntuple(f, n::Integer)` throws `ArgumentError` if `n` is negative.
277 Previously an empty tuple was returned ([#21697]).
278
279 * `⋮`, `⋱`, `⋰`, and `⋯` are now parsed as binary operators, not ordinary
280 identifiers. `≔`, `≕`, and `⩴` now parse with assignment rather than comparison
281 precedence ([#26262]).
282
283 * Juxtaposing string literals (e.g. `"x"y`) is now a syntax error ([#20575]).
284
285 * `finalizer(function, object)` now returns `object` rather than `nothing` ([#24679]).
286
287 * The constructor of `SubString` now checks if the requested view range
288 is defined by valid indices in the parent `AbstractString` ([#22511]).
289
290 * Macro calls with `for` expressions are now parsed as generators inside
291 function argument lists ([#18650]). Examples:
292
293 + `sum(@inbounds a[i] for i = 1:n)` used to give a syntax error, but is now
294 parsed as `sum(@inbounds(a[i]) for i = 1:n)`.
295
296 + `sum(@m x for i = 1:n end)` used to parse the argument to `sum` as a 2-argument
297 call to macro `@m`, but now parses it as a generator plus a syntax error
298 for the dangling `end`.
299
300 * `@__DIR__` returns the current working directory rather than `nothing` when not run
301 from a file ([#21759]).
302
303 * `@__FILE__` and `@__DIR__` return information relative to the file that it was parsed from,
304 rather than from the task-local `SOURCE_PATH` global when it was expanded.
305
306 * All macros receive an extra argument `__source__::LineNumberNode` which describes the
307 parser location in the source file for the `@` of the macro call.
308 It can be accessed as a normal argument variable in the body of the macro.
309 This is implemented by inserting an extra leading argument into the
310 `Expr(:macrocall, :@name, LineNumberNode(...), args...)`
311 surface syntax. ([#21746])
312
313 * Passing the same keyword argument multiple times is now a syntax error ([#16937]).
314
315 * `getsockname` on a `TCPSocket` now returns the locally bound address and port
316 of the socket. Previously the address of the remote endpoint was being
317 returned ([#21825]).
318
319 * The `~/.juliarc.jl` file has been moved to `~/.julia/config/startup.jl` and
320 `/etc/julia/juliarc.jl` file has been renamed to `/etc/julia/startup.jl` ([#26161]).
321
322 * Using `ARGS` within `startup.jl` files or within a .jl file loaded with `--load` will no
323 longer contain the script name as the first argument. Instead, the script name will be
324 assigned to `PROGRAM_FILE`. ([#22092])
325
326 * The format for a `ClusterManager` specifying the cookie on the command line is now
327 `--worker=<cookie>`. `--worker <cookie>` will not work as it is now an optional argument.
328
329 * The representation of `CartesianRange` has changed to a
330 tuple-of-AbstractUnitRanges; the `start` and `stop` fields are no
331 longer present. Use `first(R)` and `last(R)` to obtain
332 start/stop. ([#20974])
333
334 * The `Diagonal`, `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` type definitions have
335 changed from `Diagonal{T}`, `Bidiagonal{T}`, `Tridiagonal{T}` and `SymTridiagonal{T}`
336 to `Diagonal{T,V<:AbstractVector{T}}`, `Bidiagonal{T,V<:AbstractVector{T}}`,
337 `Tridiagonal{T,V<:AbstractVector{T}}` and `SymTridiagonal{T,V<:AbstractVector{T}}`
338 respectively ([#22718], [#22925], [#23035], [#23154]).
339
340 * The immediate supertype of `BitArray` is now simply `AbstractArray`. `BitArray` is no longer
341 considered a subtype of `DenseArray` and `StridedArray` ([#25858]).
342
343 * When called with an argument that contains `NaN` elements, `findmin` and `findmax` now return the
344 first `NaN` found and its corresponding index. Previously, `NaN` elements were ignored.
345 The new behavior matches that of `min`, `max`, `minimum`, and `maximum`.
346
347 * `isapprox(x,y)` now tests `norm(x-y) <= max(atol, rtol*max(norm(x), norm(y)))`
348 rather than `norm(x-y) <= atol + ...`, and `rtol` defaults to zero
349 if an `atol > 0` is specified ([#22742]).
350
351 * Spaces are no longer allowed between `@` and the name of a macro in a macro call ([#22868]).
352
353 * Juxtaposition of a non-literal with a macro call (`x@macro`) is no longer valid syntax ([#22868]).
354
355 * On a cluster, all files are now loaded from the local file system rather than node 1 ([#22588]).
356 To load the same file everywhere from node 1, one possible alternative is to broadcast a call to `include_string`:
357 `@everywhere include_string(Main, $(read("filename", String)), "filename")`.
358 Improving upon this API is left as an opportunity for packages.
359
360 * `randperm(n)` and `randcycle(n)` now always return a `Vector{Int}` (independent of
361 the type of `n`). Use the corresponding mutating functions `randperm!` and `randcycle!`
362 to control the array type ([#22723]).
363
364 * Hermitian now ignores any imaginary components in the diagonal instead of checking
365 the diagonal. ([#17367])
366
367 * Worker-worker connections are setup lazily for an `:all_to_all` topology. Use keyword
368 arg `lazy=false` to force all connections to be setup during a `addprocs` call. ([#22814])
369
370 * In `joinpath(a, b)` on Windows, if the drive specifications of `a` and `b` do not match,
371 `joinpath` now returns `b` instead of throwing an `ArgumentError`. `joinpath(path...)` is
372 defined to be left associative, so if any argument has a drive path which does not match
373 the drive of the join of the preceding paths, the prior ones are dropped. ([#20912])
374
375 * `^(A::AbstractMatrix{<:Integer}, p::Integer)` now throws a `DomainError`
376 if `p < 0`, unless `A == one(A)` or `A == -one(A)` (same as for
377 `^(A::Integer, p::Integer)`) ([#23366]).
378
379 * `^(A::AbstractMatrix{<:Integer}, p::Integer)` now promotes the element type in the same
380 way as `^(A::Integer, p::Integer)`. This means, for instance, that `[1 1; 0 1]^big(1)`
381 will return a `Matrix{BigInt}` instead of a `Matrix{Int}` ([#23366]).
382
383 * The element type of the input is now preserved in `unique`. Previously the element type
384 of the output was shrunk to fit the union of the type of each element in the input.
385 ([#22696])
386
387 * The `promote` function now raises an error if its arguments are of different types
388 and if attempting to convert them to a common type fails to change any of their types.
389 This avoids stack overflows in the common case of definitions like
390 `f(x, y) = f(promote(x, y)...)` ([#22801]).
391
392 * `indmin` and `indmax` have been renamed to `argmin` and `argmax`, respectively ([#25654]).
393
394 * `findmin`, `findmax`, `argmin`, and `argmax` used to always return linear indices.
395 They now return `CartesianIndex`es for all but 1-d arrays, and in general return
396 the `keys` of indexed collections (e.g. dictionaries) ([#22907]).
397
398 * The `openspecfun` library is no longer built and shipped with Julia, as it is no longer
399 used internally ([#22390]).
400
401 * All loaded packages used to have bindings in `Main` (e.g. `Main.Package`). This is no
402 longer the case; now bindings will only exist for packages brought into scope by
403 typing `using Package` or `import Package` ([#17997]).
404
405 * The rules for mixed-signedness integer arithmetic (e.g. `Int32(1) + UInt64(1)`) have been
406 simplified: if the arguments have different sizes (in bits), then the type of the larger
407 argument is used. If the arguments have the same size, the unsigned type is used ([#9292]).
408
409 * All command line arguments passed via `-e`, `-E`, and `-L` will be executed in the order
410 given on the command line ([#23665]).
411
412 * `I` now yields `UniformScaling{Bool}(true)` rather than `UniformScaling{Int64}(1)`
413 to better preserve types in operations involving `I` ([#24396]).
414
415 * The return type of `reinterpret` has changed to `ReinterpretArray`. `reinterpret` on sparse
416 arrays has been discontinued.
417
418 * `Base.find_in_path` is now `Base.find_package` or `Base.find_source_file` ([#24320]).
419
420 * `finalizer` now takes functions or pointers as its first argument, and the object being
421 finalized as its second (rather than the reverse). For the majority of use cases
422 deprecation warnings will be triggered. However, deprecation warnings will not trigger where
423 (1) the callable argument is not a subtype of `Function`; or (2) both arguments are
424 `Function`s or `Ptr{Cvoid}`s ([#24605]).
425
426 * The `kill` function now throws errors on user error (e.g. on permission
427 errors), but returns successfully if the process had previously exited.
428 Its return value has been removed. Use the `process_running` function
429 to determine if a process has already exited.
430
431 * The logging system has been redesigned - `info` and `warn` are deprecated
432 and replaced with the logging macros `@info`, `@warn`, `@debug` and
433 `@error`. The `logging` function is also deprecated and replaced with
434 `AbstractLogger` and the functions from the new standard `Logging` library.
435 ([#24490])
436
437 * The `RevString` type has been removed from the language; `reverse(::String)` returns
438 a `String` with code points (or fragments thereof) in reverse order. In general,
439 `reverse(s)` should return a string of the same type and encoding as `s` with code
440 points in reverse order; any string type overrides `reverse` to return a different
441 type of string must also override `reverseind` to compute reversed indices correctly.
442
443 * `eachindex(A, B...)` now requires that all inputs have the same number of elements.
444 When the chosen indexing is Cartesian, they must have the same axes.
445
446 * `AbstractRange` objects are now considered as equal to other `AbstractArray` objects
447 by `==` and `isequal` if all of their elements are equal ([#16401]).
448 This has required changing the hashing algorithm: ranges now use an O(N) fallback
449 instead of a O(1) specialized method unless they define the `Base.RangeStepStyle`
450 trait; see its documentation for details. Types which support subtraction (operator
451 `-`) must now implement `widen` for hashing to work inside heterogeneous arrays.
452
453 * `findn(x::AbstractArray)` has been deprecated in favor of `findall(!iszero, x)`, which
454 now returns cartesian indices for multidimensional arrays (see below, [#25532]).
455
456 * Broadcasting operations are no longer fused into a single operation by Julia's parser.
457 Instead, a lazy `Broadcasted` object is created to represent the fused expression and
458 then realized with `copy(bc::Broadcasted)` or `copyto!(dest, bc::Broadcasted)`
459 to evaluate the wrapper. Consequently, package authors generally need to specialize
460 `copy` and `copyto!` methods rather than `broadcast` and `broadcast!`. This also allows
461 for more customization and control of fused broadcasts. See the
462 [Interfaces chapter](https://docs.julialang.org/en/latest/manual/interfaces/#man-interfaces-broadcasting-1)
463 for more information.
464
465 * `find` has been renamed to `findall`. `findall`, `findfirst`, `findlast`, `findnext`
466 now take and/or return the same type of indices as `keys`/`pairs` for `AbstractArray`,
467 `AbstractDict`, `AbstractString`, `Tuple` and `NamedTuple` objects ([#24774], [#25545]).
468 In particular, this means that they use `CartesianIndex` objects for matrices
469 and higher-dimensional arrays instead of linear indices as was previously the case.
470 Use `LinearIndices(a)[findall(f, a)]` and similar constructs to compute linear indices.
471
472 * The `find*` functions, i.e. `findnext`, `findprev`, `findfirst`,
473 and `findlast`, as well as `indexin`, now return `nothing` when no match is found rather
474 than `0` or `0:-1` ([#25472], [#25662], [#26149])
475
476 * The `Base.HasShape` iterator trait has gained a type parameter `N` indicating the
477 number of dimensions, which must correspond to the length of the tuple returned by
478 `size` ([#25655]).
479
480 * `AbstractSet` objects are now considered equal by `==` and `isequal` if all of their
481 elements are equal ([#25368]). This has required changing the hashing algorithm
482 for `BitSet`.
483
484 * the default behavior of `titlecase` is changed in two ways ([#23393]):
485 + characters not starting a word are converted to lowercase;
486 a new keyword argument `strict` is added which
487 allows to get the old behavior when it's `false`.
488 + any non-letter character is considered as a word separator;
489 to get the old behavior (only "space" characters are considered as
490 word separators), use the keyword `wordsep=isspace`.
491
492 * `writedlm` in the standard library module DelimitedFiles now writes numeric values
493 using `print` rather than `print_shortest` ([#25745]).
494
495 * The `tempname` function used to create a file on Windows but not on other
496 platforms. It now never creates a file ([#9053]).
497
498 * The `fieldnames` and `propertynames` functions now return a tuple rather than
499 an array ([#25725]).
500
501 * `indexin` now returns the first rather than the last matching index ([#25998]).
502
503 * `parse(::Type, ::Char)` now uses a default base of 10, like other number parsing
504 methods, instead of 36 ([#26576]).
505
506 * `isequal` for `Ptr`s now compares element types; `==` still compares only addresses
507 ([#26858]).
508
509 * `widen` on 8- and 16-bit integer types now widens to 16- and 32-bit types, respectively. ([#28045]).
510
511 * `mv`,`cp`, `touch`, `mkdir`, `mkpath`, `chmod` and `chown` now return the path that was created/modified
512 rather than `nothing` ([#27071]).
513
514 * Regular expressions now default to UCP mode. Escape sequences such as `\w`
515 will now match based on unicode character properties, e.g. `r"\w+"` will
516 match `café` (not just `caf`). Add the `a` modifier (e.g. `r"\w+"a`) to
517 restore the previous behavior ([#27189]).
518
519 * `@sync` now waits only for *lexically* enclosed (i.e. visible directly in the source
520 text of its argument) `@async` expressions. If you need to wait for a task created by
521 a called function `f`, have `f` return the task and put `@async wait(f(...))` within
522 the `@sync` block.
523 This change makes `@schedule` redundant with `@async`, so `@schedule` has been
524 deprecated ([#27164]).
525
526 * `norm(A::AbstractMatrix, p=2)` computes no longer the operator/matrix norm but the `norm` of `A`
527 as for other iterables, i.e. as if it were a vector. Especially, `norm(A::AbstractMatrix)` is the
528 Frobenius norm. To compute the operator/matrix norm, use the new function `opnorm` ([#27401]).
529
530 * `dot(u, v)` now acts recursively. Instead of `sum(u[i]' * v[i] for i in ...)`, it computes
531 `sum(dot(u[i], v[i]) for i in ...)`, similarly to `vecdot` before ([#27401]).
532
533 * `Sys.CPU_CORES` has been renamed to `Sys.CPU_THREADS`; it still gives the number
534 of "logical cores" (including hyperthreading) rather than the number of physical
535 cores present on the CPU. Similarly, the environment variable `JULIA_CPU_CORES` is
536 deprecated in favor of `JULIA_CPU_THREADS` ([#27856]).
537
538 * `WeakKeyDict` does not convert keys on insertion anymore (#24941).
539
540 Library improvements
541 --------------------
542
543 * The function `thisind(s::AbstractString, i::Integer)` returns the largest valid index
544 less or equal than `i` in the string `s` or `0` if no such index exists ([#24414]).
545
546 * Support for Unicode 11 ([#28266]).
547
548 * `Char` is now a subtype of `AbstractChar`, and most of the functions that
549 take character arguments now accept any `AbstractChar` ([#26286]).
550
551 * `pathof(module)` returns the path a module was imported from ([#28310]).
552
553 * `bytes2hex` now accepts an optional `io` argument to output to a hexadecimal stream
554 without allocating a `String` first ([#27121]).
555
556 * `String(array)` now accepts an arbitrary `AbstractVector{UInt8}`. For `Vector`
557 inputs, it "steals" the memory buffer, leaving them with an empty buffer which
558 is guaranteed not to be shared with the `String` object. For other types of vectors
559 (in particular immutable vectors), a copy is made and the input is not truncated ([#26093]).
560
561 * `Irrational` is now a subtype of `AbstractIrrational` ([#24245]).
562
563 * Introduced the `empty` function, the functional pair to `empty!` which returns a new,
564 empty container ([#24390]).
565
566 * Jump to first/last history entries in the REPL via "Alt-<" and "Alt->" ([#22829]).
567
568 * REPL LaTeX-like tab completions have been simplified for several Unicode characters,
569 e.g. `𝔸` is now `\bbA` rather than `\BbbA` ([#25980]).
570
571 * The function `chop` now accepts two arguments `head` and `tail` allowing to specify
572 number of characters to remove from the head and tail of the string ([#24126]).
573
574 * `get(io, :color, false)` can now be used to query whether a stream `io` supports
575 [ANSI color codes](https://en.wikipedia.org/wiki/ANSI_escape_code) ([#25067]),
576 rather than using the undocumented `Base.have_color` global flag.
577
578 * `print_with_color` has been deprecated in favor of
579 `printstyled([io], xs...; bold=false, color=:normal)` for printing styled text ([#25522]).
580
581 * Functions `first` and `last` now accept `nchar` argument for `AbstractString`.
582 If this argument is used they return a string consisting of first/last `nchar`
583 characters from the original string ([#23960]).
584
585 * Expressions `x^-n` where `n` is an *integer literal* now correspond to `inv(x)^n`.
586 For example, `x^-1` is now essentially a synonym for `inv(x)`, and works
587 in a type-stable way even if `typeof(x) != typeof(inv(x))` ([#24240]).
588
589 * New `Iterators.reverse(itr)` for reverse-order iteration ([#24187]). Iterator
590 types `T` can implement `start` etc. for `Iterators.Reverse{T}` to support this.
591
592 * The functions `nextind` and `prevind` now accept `nchar` argument that indicates
593 the number of characters to move ([#23805]).
594
595 * The functions `strip`, `lstrip` and `rstrip` now return `SubString` ([#22496]).
596
597 * The functions `strwidth` and `charwidth` have been merged into `textwidth`([#20816]).
598
599 * The functions `base` and `digits` digits now accept a negative
600 base (like `ndigits` did) ([#21692]).
601
602 * The function `randn` now accepts complex arguments (`Complex{T <: AbstractFloat}`)
603 ([#21973]).
604
605 * `parse(Complex{T}, string)` can parse complex numbers in some common formats ([#24713]).
606
607 * The function `rand` can now pick up random elements from strings, associatives
608 and sets ([#22228], [#21960], [#18155], [#22224]).
609
610 * It's now possible to specify the characters to pick from in the `randstring` function ([#22222]).
611
612 * Allow multidimensional arrays in `shuffle` and `shuffle!` functions ([#22226]).
613
614 * Method lists are now printed as a numbered list. In addition, the source code of a
615 method can be opened in an editor by entering the corresponding number in the REPL
616 and pressing `^Q` ([#22007]).
617
618 * `getpeername` on a `TCPSocket` returns the address and port of the remote
619 endpoint of the TCP connection ([#21825]).
620
621 * `resize!` and `sizehint!` methods no longer over-reserve memory when the
622 requested array size is more than double of its current size ([#22038]).
623
624 * The `crc32c` function for CRC-32c checksums is now exported ([#22274]).
625
626 * `eye(::Type{Diagonal{T}}, m::Integer)` has been deprecated in favor of
627 `Diagonal{T}(I, m)` ([#24413]).
628
629 * The output of `versioninfo` is now controlled with keyword arguments ([#21974]).
630
631 * The function `LibGit2.set_remote_url` now always sets both the fetch and push URLs for a
632 git repo. Additionally, the argument order was changed to be consistent with the git
633 command line tool ([#22062]).
634
635 * Added `unique!` which is an inplace version of `unique` ([#20549]).
636
637 * `@test isequal(x, y)` and `@test isapprox(x, y)` now prints an evaluated expression when
638 the test fails ([#22296]).
639
640 * Uses of `Val{c}` in `Base` has been replaced with `Val{c}()`, which is now easily
641 accessible via the efficient constructor `Val(c)`. Functions are defined as
642 `f(::Val{c}) = ...` and called by `f(Val(c))`. Notable affected functions include:
643 `ntuple`, `Base.literal_pow`, `sqrtm`, `lufact`, `lufact!`, `qrfact`, `qrfact!`,
644 `cholfact`, `cholfact!`, `_broadcast!`, `reshape`, `cat` and `cat_t`.
645
646 * A new `@macroexpand1` macro for non recursive macro expansion ([#21662]).
647
648 * `Char`s can now be concatenated with `String`s and/or other `Char`s using `*` ([#22532]).
649
650 * `Diagonal`, `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` are now parameterized on
651 the type of the wrapped vectors, allowing `Diagonal`, `Bidiagonal`, `Tridiagonal` and
652 `SymTridiagonal` matrices with arbitrary `AbstractVector`s
653 ([#22718], [#22925], [#23035], [#23154]).
654
655 * Mutating versions of `randperm` and `randcycle` have been added:
656 `randperm!` and `randcycle!` ([#22723]).
657
658 * `BigFloat` random numbers can now be generated ([#22720]).
659
660 * The efficiency of random generation for MersenneTwister RNGs has been improved for
661 integers, `Float64` and ranges; as a result, given a seed, the produced stream of numbers
662 has changed ([#27560], [#25277], [#25197], [#25058], [#25047]).
663
664 * REPL Undo via Ctrl-/ and Ctrl-_
665
666 * `diagm` now accepts several diagonal index/vector `Pair`s ([#24047]).
667
668 * `isequal`, `==`, and `in` have one argument "curried" forms. For example `isequal(x)`
669 returns a function that compares its argument to `x` using `isequal` ([#26436]).
670
671 * `reinterpret` now works on any AbstractArray using the new `ReinterpretArray` type.
672 This supersedes the old behavior of reinterpret on Arrays. As a result, reinterpreting
673 arrays with different alignment requirements (removed in 0.6) is once again allowed ([#23750]).
674
675 * The `keys` of an `Associative` are now an `AbstractSet`. `Base.KeyIterator{<:Associative}`
676 has been changed to `KeySet{K, <:Associative{K}} <: AbstractSet{K}` ([#24580]).
677
678 * New function `ncodeunits(s::AbstractString)` gives the number of code units in a string.
679 The generic definition is constant time but calls `lastindex(s)` which may be inefficient.
680 Therefore custom string types may want to define direct `ncodeunits` methods.
681
682 * `reverseind(s::AbstractString, i::Integer)` now has an efficient generic fallback, so
683 custom string types do not need to provide their own efficient definitions. The generic
684 definition relies on `ncodeunits` however, so for optimal performance you may need to
685 define a custom method for that function.
686
687 * The global RNG is being re-seeded with its own seed at the beginning of each `@testset`,
688 and have its original state restored at the end ([#24445]). This is breaking for testsets
689 relying implicitly on the global RNG being in a specific state.
690
691 * `permutedims(m::AbstractMatrix)` is now short for `permutedims(m, (2,1))`, and is now a
692 more convenient way of making a "shallow transpose" of a 2D array. This is the
693 recommended approach for manipulating arrays of data, rather than the recursively
694 defined, linear-algebra function `transpose`. Similarly,
695 `permutedims(v::AbstractVector)` will create a row matrix ([#24839]).
696
697 * A new `replace(A, old=>new)` function is introduced to replace `old` by `new` in
698 collection `A`. There is also another method with a different API, and
699 a mutating variant, `replace!` ([#22324], [#25697], [#26206], [#27944]).
700
701 * Adding integers to `CartesianIndex` objects is now deprecated. Instead of
702 `i::Int + x::CartesianIndex`, use `i*one(x) + x` ([#26284]).
703
704 * `CartesianRange` changes ([#24715]):
705 - Inherits from `AbstractArray`, and linear indexing can be used to provide
706 linear-to-cartesian conversion ([#24715])
707 - It has a new constructor taking an array
708
709 * several missing set-like operations have been added ([#23528]):
710 `union`, `intersect`, `symdiff`, `setdiff` are now implemented for
711 all collections with arbitrary many arguments, as well as the
712 mutating counterparts (`union!` etc.). The performance is also
713 much better in many cases. Note that this change is slightly
714 breaking: all the non-mutating functions always return a new
715 object even if only one argument is passed. Moreover the semantics
716 of `intersect` and `symdiff` is changed for vectors:
717 + `intersect` doesn't preserve the multiplicity anymore (use `filter` for
718 the old behavior)
719 + `symdiff` has been made consistent with the corresponding methods for
720 other containers, by taking the multiplicity of the arguments into account.
721 Use `unique` to get the old behavior.
722
723 * The `linearindices` function has been deprecated in favor of the new
724 `LinearIndices` type, which additionally provides conversion from
725 cartesian indices to linear indices using the normal indexing operation.
726 ([#24715], [#26775]).
727
728 * `IdDict{K,V}` replaces `ObjectIdDict`. It has type parameters
729 like other `AbstractDict` subtypes and its constructors mirror the
730 ones of `Dict`. ([#25210])
731
732 * `IOBuffer` can take the `sizehint` keyword argument to suggest a capacity of
733 the buffer ([#25944]).
734
735 * `lstrip` and `rstrip` now accept a predicate function that defaults to `isspace`
736 ([#27309]).
737
738 * `trunc`, `floor`, `ceil`, and `round` specify `digits`, `sigdigits` and `base` using
739 keyword arguments. ([#26156], [#26670])
740
741 * `Sys.which()` provides a cross-platform method to find executable files, similar to
742 the Unix `which` command. ([#26559])
743
744 * Added an optimized method of `vecdot` for taking the Frobenius inner product
745 of sparse matrices. ([#27470])
746
747 * Added an optimized method of `kron` for taking the tensor product of two
748 `Diagonal` matrices. ([27581])
749
750 * An official API for extending `rand` is now defined ([#23964], [#25002]).
751
752 * The constructor `MersenneTwister()` is re-enabled, producing a randomly initialized RNG
753 (similar to `Random.seed!(MersenneTwister(0))`) ([#21909]).
754
755 * `BitSet` can now store any `Int` (instead of only positive ones) ([#25029]).
756
757 * The initial element `v0` in `reduce(op, v0, itr)` has been replaced with an `init`
758 optional keyword argument, as in `reduce(op, itr; init=v0)`. Similarly for `foldl`,
759 `foldr`, `mapreduce`, `mapfoldl`, `mapfoldr`, `accumulate` and `accumulate!`.
760 ([#27711], [#27859])
761
762 Compiler/Runtime improvements
763 -----------------------------
764
765 * The inlining heuristic now models the approximate runtime cost of
766 a method (using some strongly-simplifying assumptions). Functions
767 are inlined unless their estimated runtime cost substantially
768 exceeds the cost of setting up and issuing a subroutine
769 call. ([#22210], [#22732])
770
771 * Inference recursion-detection heuristics are now more precise,
772 allowing them to be triggered less often, but being more aggressive when they
773 are triggered to drive the inference computation to a solution ([#23912]).
774
775 * Inference now propagates constants inter-procedurally, and can compute
776 various constants expressions at compile-time ([#24362]).
777
778 * The LLVM SLP Vectorizer optimization pass is now enabled at the default
779 optimization level.
780
781 Deprecated or removed
782 ---------------------
783
784 * The `JULIA_HOME` environment variable has been renamed to `JULIA_BINDIR` and
785 `Base.JULIA_HOME` has been moved to `Sys.BINDIR` ([#20899]).
786
787 * The keyword `immutable` is fully deprecated to `struct`, and
788 `type` is fully deprecated to `mutable struct` ([#19157], [#20418]).
789
790 * `lufact`, `schurfact`, `lqfact`, `qrfact`, `ldltfact`, `svdfact`,
791 `bkfact`, `hessfact`, `eigfact`, and `cholfact` have respectively been
792 deprecated to `lu`, `schur`, `lq`, `qr`, `ldlt`, `svd`, `bunchkaufman`,
793 `hessenberg`, `eigen`, and `cholesky` ([#26997], [#27159], [#27212]).
794
795 * `lufact!`, `schurfact!`, `lqfact!`, `qrfact!`, `ldltfact!`, `svdfact!`,
796 `bkfact!`, `hessfact!`, and `eigfact!` have respectively been deprecated to
797 `lu!`, `schur!`, `lq!`, `qr!`, `ldlt!`, `svd!`, `bunchkaufman!`,
798 `hessenberg!`, and `eigen!` ([#26997], [#27159], [#27212]).
799
800 * `eig(A[, args...])` has been deprecated in favor of `eigen(A[, args...])`.
801 Whereas the former returns a tuple of arrays, the latter returns an `Eigen` object.
802 So for a direct replacement, use `(eigen(A[, args...])...,)`. But going forward,
803 consider using the direct result of `eigen(A[, args...])` instead, either
804 destructured into its components (`vals, vecs = eigen(A[, args...])`) or
805 as an `Eigen` object (`X = eigen(A[, args...])`) ([#26997], [#27159], [#27212]).
806
807 * `eig(A::AbstractMatrix, B::AbstractMatrix)` and `eig(A::Number, B::Number)`
808 have been deprecated in favor of `eigen(A, B)`. Whereas the former each return
809 a tuple of arrays, the latter returns a `GeneralizedEigen` object. So for a direct
810 replacement, use `(eigen(A, B)...,)`. But going forward, consider using the
811 direct result of `eigen(A, B)` instead, either destructured into its components
812 (`vals, vecs = eigen(A, B)`), or as a `GeneralizedEigen` object
813 (`X = eigen(A, B)`) ([#26997], [#27159], [#27212]).
814
815 * `ordschur(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})`
816 and `ordschur(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},
817 Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})` and their respective
818 inplace versions have been deprecated.
819 Use `ordschur(schur::Schur, select::Union{Vector{Bool},BitVector})` and
820 `ordschur(gschur::GeneralizedSchur, select::Union{Vector{Bool},BitVector})` instead
821 ([#28155]).
822
823 * Indexing into multidimensional arrays with more than one index but fewer indices than there are
824 dimensions is no longer permitted when those trailing dimensions have lengths greater than 1.
825 Instead, reshape the array or add trailing indices so the dimensionality and number of indices
826 match ([#14770], [#23628]).
827
828 * The use of a positional dimension argument has largely been deprecated in favor of a
829 `dims` keyword argument. This includes the functions `sum`, `prod`, `maximum`,
830 `minimum`, `all`, `any`, `findmax`, `findmin`, `mean`, `varm`, `std`, `var`, `cov`,
831 `cor`, `median`, `mapreducedim`, `reducedim`, `sort`, `accumulate`, `accumulate!`,
832 `cumsum`, `cumsum!`, `cumprod`, `cumprod!`, `flipdim`, `dropdims`, and `cat` ([#25501], [#26660], [#27100]).
833
834 * `indices(a)` and `indices(a,d)` have been deprecated in favor of `axes(a)` and
835 `axes(a, d)` ([#25057]).
836
837 * `EnvHash` has been renamed to `EnvDict` ([#24167]).
838
839 * Uninitialized `Array` constructors of the form
840 `Array[{T,N}](shape...)` have been deprecated in favor of equivalents
841 accepting `undef` (an alias for `UndefInitializer()`) as their first argument,
842 as in `Array[{T,N}](undef, shape...)`. For example,
843 `Vector(3)` is now `Vector(undef, 3)`, `Matrix{Int}((2, 4))` is now,
844 `Matrix{Int}(undef, (2, 4))`, and `Array{Float32,3}(11, 13, 17)` is now
845 `Array{Float32,3}(undef, 11, 13, 17)` ([#24781]).
846
847 * Previously `setindex!(A, x, I...)` (and the syntax `A[I...] = x`) supported two
848 different modes of operation when supplied with a set of non-scalar indices `I`
849 (e.g., at least one index is an `AbstractArray`) depending upon the value of `x`
850 on the right hand side. If `x` is an `AbstractArray`, its _contents_ are copied
851 elementwise into the locations in `A` selected by `I` and it must have the same
852 number of elements as `I` selects locations. Otherwise, if `x` is not an
853 `AbstractArray`, then its _value_ is implicitly broadcast to all locations to
854 all locations in `A` selected by `I`. This latter behavior—implicitly broadcasting
855 "scalar"-like values across many locations—is now deprecated in favor of explicitly
856 using the broadcasted assignment syntax `A[I...] .= x` or `fill!(view(A, I...), x)`
857 ([#26347]).
858
859 * `broadcast_getindex(A, I...)` and `broadcast_setindex!(A, v, I...)` are deprecated in
860 favor of `getindex.((A,), I...)` and `setindex!.((A,), v, I...)`, respectively ([#27075]).
861
862 * `LinAlg.fillslots!` has been renamed `LinAlg.fillstored!` ([#25030]).
863
864 * `fill!(A::Diagonal, x)` and `fill!(A::AbstractTriangular, x)` have been deprecated
865 in favor of `Base.LinAlg.fillstored!(A, x)` ([#24413]).
866
867 * `eye` has been deprecated in favor of `I` and `Matrix` constructors. Please see the
868 deprecation warnings for replacement details ([#24438]).
869
870 * `zeros(D::Diagonal[, opts...])` has been deprecated ([#24654]).
871
872 * Using Bool values directly as indices is now deprecated and will be an error in the future. Convert
873 them to `Int` before indexing if you intend to access index `1` for `true` and `0` for `false`.
874
875 * `slicedim(A, d, i)` has been deprecated in favor of `copy(selectdim(A, d, i))`. The new
876 `selectdim` function now always returns a view into `A`; in many cases the `copy` is
877 not necessary. Previously, `slicedim` on a vector `V` over dimension `d=1` and scalar
878 index `i` would return the just selected element (unless `V` was a `BitVector`). This
879 has now been made consistent: `selectdim` now always returns a view into the original
880 array, with a zero-dimensional view in this specific case ([#26009]).
881
882 * `whos` has been renamed `varinfo`, and now returns a markdown table instead of printing
883 output ([#12131]).
884
885 * Uninitialized `RowVector` constructors of the form `RowVector{T}(shape...)` have been
886 deprecated in favor of equivalents accepting `undef` (an alias for
887 `UndefInitializer()`) as their first argument, as in
888 `RowVector{T}(undef, shape...)`. For example, `RowVector{Int}(3)` is now
889 `RowVector{Int}(undef, 3)`, and `RowVector{Float32}((1, 4))` is now
890 `RowVector{Float32}(undef, (1, 4))` ([#24786]).
891
892 * `writecsv(io, a; opts...)` has been deprecated in favor of
893 `writedlm(io, a, ','; opts...)` ([#23529]).
894
895 * The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).
896
897 * `readcsv(io[, T::Type]; opts...)` has been deprecated in favor of
898 `readdlm(io, ','[, T]; opts...)` ([#23530]).
899
900 * `sparse(s::UniformScaling, m::Integer)` has been deprecated in favor of the
901 three-argument equivalent `sparse(s::UniformScaling, m, n)` ([#24472]).
902
903 * The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
904 in favor of using `Hermitian` (or `Symmetric`) views ([#22187], [#22188]).
905
906 * The `thin` keyword argument for orthogonal decomposition methods has
907 been deprecated in favor of `full`, which has the opposite meaning:
908 `thin == true` if and only if `full == false` ([#24279]).
909
910 * `isposdef(A::AbstractMatrix, UL::Symbol)` and `isposdef!(A::AbstractMatrix, UL::Symbol)`
911 have been deprecated in favor of `isposdef(Hermitian(A, UL))` and `isposdef!(Hermitian(A, UL))`
912 respectively ([#22245]).
913
914 * The `bkfact`/`bkfact!` methods that accepted `uplo` and `issymmetric` symbols have been deprecated
915 in favor of using `Hermitian` (or `Symmetric`) views ([#22605]).
916
917 * The function `current_module` is deprecated and replaced with `@__MODULE__`.
918 This caused the deprecation of some reflection methods (such as `macroexpand` and
919 `isconst`), which now require a module argument. And it caused the bugfix of other
920 default arguments to use the Main module (including `whos`, `which`) ([#22064]).
921
922 * `expand(ex)` and `expand(module, ex)` have been deprecated in favor of
923 `Meta.lower(module, ex)` ([#22064], [#24278]).
924
925 * `ones(A::AbstractArray[, opts...])` and `zeros(A::AbstractArray[, opts...])` methods
926 have been deprecated. For `zeros(A)`, consider `zero(A)`. For `ones(A)` or `zeros(A)`,
927 consider `ones(size(A))`, `zeros(size(A))`, `fill(v, size(A))` for `v` an appropriate
928 one or zero, `fill!(copy(A), {1|0})`, `fill!(similar(A), {1|0})`, or any of the preceding
929 with different element type and/or shape depending on `opts...`. Where strictly
930 necessary, consider `fill!(similar(A[, opts...]), {one(eltype(A)) | zero(eltype(A))})`.
931 For an algebraic multiplicative identity, consider `one(A)` ([#24656]).
932
933 * The `similar(dims->f(..., dims...), [T], axes...)` method to add offset array support
934 to a function `f` that would otherwise create a non-offset array has been deprecated.
935 Instead, call `f(..., axes...)` directly and, if needed, the offset array implementation
936 should add offset axis support to the function `f` directly ([#26733]).
937
938 * The functions `ones` and `zeros` used to accept any objects as dimensional arguments,
939 implicitly converting them to `Int`s. This is now deprecated; only `Integer`s or
940 `AbstractUnitRange`s are accepted as arguments. Instead, convert the arguments before
941 calling `ones` or `zeros` ([#26733]).
942
943 * The variadic `size(A, dim1, dim2, dims...)` method to return a tuple of multiple
944 dimension lengths of `A` has been deprecated ([#26862]).
945
946 * The `Operators` module is deprecated. Instead, import required operators explicitly
947 from `Base`, e.g. `import Base: +, -, *, /` ([#22251]).
948
949 * Bindings to the FFTW library have been removed from Base. The DFT framework for building FFT
950 implementations is now in AbstractFFTs.jl, the bindings to the FFTW library are in FFTW.jl,
951 and the Base signal processing functions which used FFTs are now in DSP.jl ([#21956]).
952
953 * The `corrected` positional argument to `cov` has been deprecated in favor of
954 a keyword argument with the same name ([#21709]).
955
956 * Omitting spaces around the `?` and the `:` tokens in a ternary expression has been deprecated.
957 Ternaries must now include some amount of whitespace, e.g. `x ? a : b` rather than
958 `x?a:b` ([#22523] and [#22712]).
959
960 * `?` can no longer be used as an identifier name ([#22712])
961
962 * The method `replace(s::AbstractString, pat, r, [count])` is deprecated
963 in favor of `replace(s::AbstractString, pat => r; [count])` ([#25165]).
964 Moreover, `count` cannot be negative anymore (use `typemax(Int)` instead ([#22325]).
965
966 * `read(io, type, dims)` is deprecated to `read!(io, Array{type}(undef, dims))` ([#21450]).
967
968 * `read(::IO, ::Ref)` is now a method of `read!`, since it mutates its `Ref` argument ([#21592]).
969
970 * `nb_available` is now `bytesavailable` ([#25634]).
971
972 * `skipchars(io::IO, predicate; linecomment=nothing)` is deprecated in favor of
973 `skipchars(predicate, io::IO; linecomment=nothing)` ([#25667]).
974
975 * `Bidiagonal` constructors now use a `Symbol` (`:U` or `:L`) for the upper/lower
976 argument, instead of a `Bool` or a `Char` ([#22703]).
977
978 * `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` constructors that automatically
979 converted the input vectors to the same type are deprecated in favor of explicit
980 conversion ([#22925], [#23035], [#23154].
981
982 * Calling `nfields` on a type to find out how many fields its instances have is deprecated.
983 Use `fieldcount` instead. Use `nfields` only to get the number of fields in a specific object ([#22350]).
984
985 * `fieldnames` now operates only on types. To get the names of fields in an object, use
986 `fieldnames(typeof(x))` ([#22350]).
987
988 * `InexactError`, `DomainError`, and `OverflowError` now take
989 arguments. `InexactError(func::Symbol, type, -3)` now prints as
990 "ERROR: InexactError: func(type, -3)", `DomainError(val,
991 [msg])` prints as "ERROR: DomainError with val:\nmsg",
992 and `OverflowError(msg)` prints as "ERROR: OverflowError: msg".
993 ([#20005], [#22751], [#22761])
994
995 * The operating system identification functions: `is_linux`, `is_bsd`, `is_apple`, `is_unix`,
996 and `is_windows`, have been deprecated in favor of `Sys.islinux`, `Sys.isbsd`, `Sys.isapple`,
997 `Sys.isunix`, and `Sys.iswindows`, respectively ([#22182]).
998
999 * The forms of `read`, `readstring`, and `eachline` that accepted both a `Cmd` object and an
1000 input stream are deprecated. Use e.g. `read(pipeline(stdin, cmd))` instead ([#22762]).
1001
1002 * The unexported type `AbstractIOBuffer` has been renamed to `GenericIOBuffer` ([#17360] [#22796]).
1003
1004 * `IOBuffer(data::AbstractVector{UInt8}, read::Bool, write::Bool, maxsize::Integer)`,
1005 `IOBuffer(read::Bool, write::Bool)`, and `IOBuffer(maxsize::Integer)` are
1006 deprecated in favor of constructors taking keyword arguments ([#25872]).
1007
1008 * `Display` has been renamed to `AbstractDisplay` ([#24831]).
1009
1010 * Remaining vectorized methods over `SparseVector`s, particularly `floor`, `ceil`,
1011 `trunc`, `round`, and most common transcendental functions such as `exp`, `log`, and
1012 `sin` variants, have been deprecated in favor of dot-syntax ([#22961]).
1013
1014 * The method `String(io::IOBuffer)` is deprecated to `String(take!(copy(io)))` ([#21438]).
1015
1016 * The function `readstring` is deprecated in favor of `read(io, String)` ([#22793])
1017
1018 * The function `showall` is deprecated. Showing entire values is the default, unless an
1019 `IOContext` specifying `:limit=>true` is in use ([#22847]).
1020
1021 * `issubtype` has been deprecated in favor of `<:` (which used to be an alias for `issubtype`).
1022
1023 * Calling `write` on non-isbits arrays is deprecated in favor of explicit loops or
1024 `serialize` ([#6466]).
1025
1026 * The default `startup.jl` file on Windows has been removed. Now must explicitly include the
1027 full path if you need access to executables or libraries in the `Sys.BINDIR` directory, e.g.
1028 `joinpath(Sys.BINDIR, "7z.exe")` for `7z.exe` ([#21540]).
1029
1030 * `sqrtm` has been deprecated in favor of `sqrt` ([#23504]).
1031
1032 * `expm` has been deprecated in favor of `exp` ([#23233]).
1033
1034 * `logm` has been deprecated in favor of `log` ([#23505]).
1035
1036 * `full` has been deprecated in favor of more specific, better defined alternatives.
1037 On structured matrices `A`, consider instead `Matrix(A)`, `Array(A)`,
1038 `SparseMatrixCSC(A)`, or `sparse(A)`. On sparse arrays `S`, consider instead
1039 `Vector(S)`, `Matrix(S)`, or `Array(S)` as appropriate. On factorizations `F`,
1040 consider instead `Matrix(F)`, `Array(F)`, `AbstractMatrix(F)`, or `AbstractArray(F)`.
1041 On implicit orthogonal factors `Q`, consider instead `Matrix(Q)` or `Array(Q)`; for
1042 implicit orthogonal factors that can be recovered in square or truncated form,
1043 see the deprecation message for square recovery instructions. On `Symmetric`,
1044 `Hermitian`, or `AbstractTriangular` matrices `A`, consider instead `Matrix(S)`,
1045 `Array(S)`, `SparseMatrixCSC(S)`, or `sparse(S)`. On `Symmetric` matrices `A`
1046 particularly, consider instead `LinAlg.copytri!(copy(parent(A)), A.uplo)`. On
1047 `Hermitian` matrices `A` particularly, consider instead
1048 `LinAlg.copytri!(copy(parent(A)), A.uplo, true)`. On `UpperTriangular` matrices `A`
1049 particularly, consider instead `triu!(copy(parent(A)))`. On `LowerTriangular` matrices
1050 `A` particularly, consider instead `tril!(copy(parent(A)))` ([#24250]).
1051
1052 * `speye` has been deprecated in favor of `I`, `sparse`, and `SparseMatrixCSC`
1053 constructor methods ([#24356]).
1054
1055 * Calling `union` with no arguments is deprecated; construct an empty set with an appropriate
1056 element type using `Set{T}()` instead ([#23144]).
1057
1058 * Vectorized `DateTime`, `Date`, and `format` methods have been deprecated in favor of
1059 dot-syntax ([#23207]).
1060
1061 * `Base.cpad` has been removed; use an appropriate combination of `rpad` and `lpad`
1062 instead ([#23187]).
1063
1064 * `ctranspose` and `ctranspose!` have been deprecated in favor of `adjoint` and `adjoint!`,
1065 respectively ([#23235]).
1066
1067 * `filter` and `filter!` on dictionaries now pass a single `key=>value` pair to the
1068 argument function, instead of two arguments ([#17886]).
1069
1070 * `rol`, `rol!`, `ror`, and `ror!` have been deprecated in favor of specialized methods for
1071 `circshift`/`circshift!` ([#23404]).
1072
1073 * `Base.SparseArrays.SpDiagIterator` has been removed ([#23261]).
1074
1075 * The function `cfunction`, has been deprecated in favor of a macro form `@cfunction`.
1076 Most existing uses can be upgraded simply by adding a `@`.
1077 The new syntax now additionally supports allocating closures at runtime,
1078 for dealing with C APIs that don't provide a separate `void* env`-type callback
1079 argument. ([#26486])
1080
1081 * `diagm(v::AbstractVector, k::Integer=0)` has been deprecated in favor of
1082 `diagm(k => v)` ([#24047]).
1083
1084 * `diagm(x::Number)` has been deprecated in favor of `fill(x, 1, 1)` ([#24047]).
1085
1086 * `diagm(A::SparseMatrixCSC)` has been deprecated in favor of
1087 `spdiagm(sparsevec(A))` ([#23341]).
1088
1089 * `diagm(A::BitMatrix)` has been deprecated, use `diagm(0 => vec(A))` or
1090 `BitMatrix(Diagonal(vec(A)))` instead ([#23373], [#24047]).
1091
1092 * `ℯ` (written as `\mscre<TAB>` or `\euler<TAB>`) is now the only (by default) exported
1093 name for Euler's number, and the type has changed from `Irrational{:e}` to
1094 `Irrational{:ℯ}` ([#23427]).
1095
1096 * The mathematical constants `π`, `pi`, `ℯ`, `e`, `γ`, `eulergamma`, `catalan`, `φ` and
1097 `golden` have been moved from `Base` to a new module; `Base.MathConstants`.
1098 Only `π`, `pi` and `ℯ` are now exported by default from `Base` ([#23427]).
1099
1100 * `eu` (previously an alias for `ℯ`) has been deprecated in favor of `ℯ` (or `MathConstants.e`) ([#23427]).
1101
1102 * `GMP.gmp_version()`, `GMP.GMP_VERSION`, `GMP.gmp_bits_per_limb()`, and `GMP.GMP_BITS_PER_LIMB`
1103 have been renamed to `GMP.version()`, `GMP.VERSION`, `GMP.bits_per_limb()`, and `GMP.BITS_PER_LIMB`,
1104 respectively. Similarly, `MPFR.get_version()`, has been renamed to `MPFR.version()` ([#23323]). Also,
1105 `LinAlg.LAPACK.laver()` has been renamed to `LinAlg.LAPACK.version()` and now returns a `VersionNumber`.
1106
1107 * `select`, `select!`, `selectperm` and `selectperm!` have been renamed respectively to
1108 `partialsort`, `partialsort!`, `partialsortperm` and `partialsortperm!` ([#23051]).
1109
1110 * The `Range` abstract type has been renamed to `AbstractRange` ([#23570]).
1111
1112 * `map` on dictionaries previously operated on `key=>value` pairs. This behavior is deprecated,
1113 and in the future `map` will operate only on values ([#5794]).
1114
1115 * `map` on sets previously returned a `Set`, possibly changing the order or number of elements. This
1116 behavior is deprecated and in the future `map` will preserve order and number of elements ([#26980]).
1117
1118 * Previously, broadcast defaulted to treating its arguments as scalars if they were not
1119 arrays. This behavior is deprecated, and in the future `broadcast` will default to
1120 iterating over all its arguments. Wrap arguments you wish to be treated as scalars with
1121 `Ref()` or a 1-tuple. Package developers can choose to allow a non-iterable type `T` to
1122 always behave as a scalar by implementing `broadcastable(x::T) = Ref(x)` ([#26212]).
1123
1124 * Automatically broadcasted `+` and `-` for `array + scalar`, `scalar - array`, and so-on have
1125 been deprecated due to inconsistency with linear algebra. Use `.+` and `.-` for these operations
1126 instead ([#22880], [#22932]).
1127
1128 * `flipbits!(B)` is deprecated in favor of using in-place broadcast to negate each element:
1129 `B .= .!B` ([#27067]).
1130
1131 * `isleaftype` is deprecated in favor of the simpler predicates `isconcretetype` and `isdispatchtuple`.
1132 Concrete types are those that might equal `typeof(x)` for some `x`;
1133 `isleaftype` included some types for which this is not true. Those are now categorized more precisely
1134 as "dispatch tuple types" and "!has_free_typevars" (not exported). ([#17086], [#25496])
1135
1136 * `contains(eq, itr, item)` is deprecated in favor of `any` with a predicate ([#23716]).
1137
1138 * `spdiagm(x::AbstractVector)` has been deprecated in favor of `sparse(Diagonal(x))`
1139 alternatively `spdiagm(0 => x)` ([#23757]).
1140
1141 * `spdiagm(x::AbstractVector, d::Integer)` and `spdiagm(x::Tuple{<:AbstractVector}, d::Tuple{<:Integer})`
1142 have been deprecated in favor of `spdiagm(d => x)` and `spdiagm(d[1] => x[1], d[2] => x[2], ...)`
1143 respectively. The new `spdiagm` implementation now always returns a square matrix ([#23757]).
1144
1145 * `spones(A::AbstractSparseArray)` has been deprecated in favor of
1146 `LinAlg.fillstored!(copy(A), 1)` ([#25037]).
1147
1148 * Constructors for `LibGit2.UserPasswordCredentials` and `LibGit2.SSHCredentials` which take a
1149 `prompt_if_incorrect` argument are deprecated. Instead, prompting behavior is controlled using
1150 the `allow_prompt` keyword in the `LibGit2.CredentialPayload` constructor ([#23690]).
1151
1152 * `gradient` is deprecated and will be removed in the next release ([#23816]).
1153
1154 * The timing functions `tic`, `toc`, and `toq` are deprecated in favor of `@time` and `@elapsed`
1155 ([#17046]).
1156
1157 * Methods of `findfirst`, `findnext`, `findlast`, and `findprev` that accept a value to
1158 search for are deprecated in favor of passing a predicate ([#19186], [#10593]).
1159
1160 * `find` functions now operate only on booleans by default. To look for non-zeros, use
1161 `x->x!=0` or `!iszero` ([#23120]).
1162
1163 * The ability of `reinterpret` to yield `Array`s of different type than the underlying storage
1164 has been removed. The `reinterpret` function is still available, but now returns a
1165 `ReinterpretArray`. The three argument form of `reinterpret` that implicitly reshapes
1166 has been deprecated ([#23750]).
1167
1168 * `bits` has been deprecated in favor of `bitstring` ([#24281], [#24263]).
1169
1170 * `num2hex` and `hex2num` have been deprecated in favor of `reinterpret` combined with `parse`/`hex` ([#22088]).
1171
1172 * `copy!` is deprecated for `AbstractSet` and `AbstractDict`, with the intention to re-enable
1173 it with a cleaner meaning in a future version ([#24844]).
1174
1175 * `copy!` (resp. `unsafe_copy!`) is deprecated for `AbstractArray` and is renamed `copyto!`
1176 (resp. `unsafe_copyto!`); it will be re-introduced with a different meaning in a future
1177 version ([#24808]).
1178
1179 * `a:b` is deprecated for constructing a `StepRange` when `a` and `b` have physical units
1180 (Dates and Times). Use `a:s:b`, where `s = Dates.Day(1)` or `s = Dates.Second(1)`.
1181
1182 * `trues(A::AbstractArray)` and `falses(A::AbstractArray)` are deprecated in favor of
1183 `trues(size(A))` and `falses(size(A))` respectively ([#24595]).
1184
1185 * `workspace` is discontinued, check out [Revise.jl](https://github.com/timholy/Revise.jl)
1186 for an alternative workflow ([#25046]).
1187
1188 * `cumsum`, `cumprod`, `accumulate`, their mutating versions, and `diff` all now require a `dim`
1189 argument instead of defaulting to using the first dimension unless there is only
1190 one dimension ([#24684], [#25457]).
1191
1192 * The `sum_kbn` and `cumsum_kbn` functions have been moved to the
1193 [KahanSummation](https://github.com/JuliaMath/KahanSummation.jl) package ([#24869]).
1194
1195 * `isnumber` has been renamed to `isnumeric` ([#25021]).
1196
1197 * `isalpha` has been renamed to `isletter` ([#26932]).
1198
1199 * `is_assigned_char` and `normalize_string` have been renamed to `isassigned` and
1200 `normalize`, and moved to the new `Unicode` standard library module.
1201 `graphemes` has also been moved to that module ([#25021]).
1202
1203 * Sparse array functionality has moved to the `SparseArrays` standard library module ([#25249]).
1204
1205 * Linear algebra functionality, and specifically the `LinAlg` module has moved to the
1206 `LinearAlgebra` standard library module ([#25571]).
1207
1208 * `@printf` and `@sprintf` have been moved to the `Printf` standard library ([#23929],[#25056]).
1209
1210 * The `Libdl` module has moved to the `Libdl` standard library module ([#25459]).
1211
1212 * The aliases `Complex32`, `Complex64` and `Complex128` have been deprecated in favor of `ComplexF16`,
1213 `ComplexF32` and `ComplexF64` respectively ([#24647]).
1214
1215 * `Base.parentindexes` and `SharedArrays.localindexes` have been renamed to `parentindices`
1216 and `localindices`, respectively. Similarly, the `indexes` field in the `SubArray` type
1217 has been renamed to `indices` without deprecation ([#25088]).
1218
1219 * `Associative` has been deprecated in favor of `AbstractDict` ([#25012]).
1220
1221 * `Void` has been renamed back to `Nothing` with an alias `Cvoid` for use when calling C
1222 with a return type of `Cvoid` or a return or argument type of `Ptr{Cvoid}` ([#25162]).
1223
1224 * `Nullable{T}` has been deprecated and moved to the Nullables package ([#23642]). Use
1225 `Union{T, Nothing}` instead, or `Union{Some{T}, Nothing}` if `nothing` is a possible
1226 value (i.e. `Nothing <: T`). `isnull(x)` can be replaced with `x === nothing` and
1227 `unsafe_get`/`get` can be dropped or replaced with `coalesce`.
1228 `NullException` has been removed.
1229
1230 * `unshift!` and `shift!` have been renamed to `pushfirst!` and `popfirst!` ([#23902])
1231
1232 * `ipermute!` has been deprecated in favor of `invpermute!` ([#25168]).
1233
1234 * `CartesianRange` has been renamed `CartesianIndices` ([#24715]).
1235
1236 * `sub2ind` and `ind2sub` are deprecated in favor of using `CartesianIndices` and `LinearIndices` ([#24715]).
1237
1238 * `getindex(F::Factorization, s::Symbol)` (usually seen as e.g. `F[:Q]`) is deprecated
1239 in favor of dot overloading (`getproperty`) so factors should now be accessed as e.g.
1240 `F.Q` instead of `F[:Q]` ([#25184]).
1241
1242 * `search` and `rsearch` have been deprecated in favor of `findfirst`/`findnext` and
1243 `findlast`/`findprev` respectively, in combination with curried `isequal` and `in`
1244 predicates for some methods ([#24673]).
1245
1246 * `search(buf::IOBuffer, delim::UInt8)` has been deprecated in favor of either `occursin(delim, buf)`
1247 (to test containment) or `readuntil(buf, delim)` (to read data up to `delim`) ([#26600]).
1248
1249 * `ismatch(regex, str)` has been deprecated in favor of `contains(str, regex)` ([#24673]).
1250
1251 * `matchall` has been deprecated in favor of `collect(m.match for m in eachmatch(r, s))` ([#26071]).
1252
1253 * `similar(::Associative)` has been deprecated in favor of `empty(::Associative)`, and
1254 `similar(::Associative, ::Pair{K, V})` has been deprecated in favour of
1255 `empty(::Associative, K, V)` ([#24390]).
1256
1257 * `findin(a, b)` has been deprecated in favor of `findall(in(b), a)` ([#24673]).
1258
1259 * `module_name` has been deprecated in favor of a new, general `nameof` function. Similarly,
1260 the unexported `Base.function_name` and `Base.datatype_name` have been deprecated in favor
1261 of `nameof` methods ([#25622]).
1262
1263 * The module `Random.dSFMT` is renamed `Random.DSFMT` ([#25567]).
1264
1265 * `Random.RandomDevice(unlimited::Bool)` (on non-Windows systems) is deprecated in favor of
1266 `Random.RandomDevice(; unlimited=unlimited)` ([#25668]).
1267
1268 * The generic implementations of `strides(::AbstractArray)` and `stride(::AbstractArray, ::Int)`
1269 have been deprecated. Subtypes of `AbstractArray` that implement the newly introduced strided
1270 array interface should define their own `strides` method ([#25321]).
1271
1272 * `module_parent`, `Base.datatype_module`, and `Base.function_module` have been deprecated
1273 in favor of `parentmodule` ([#TODO]).
1274
1275 * `rand(t::Tuple{Vararg{Int}})` is deprecated in favor of `rand(Float64, t)` or `rand(t...)`;
1276 `rand(::Tuple)` will have another meaning in the future ([#25429], [#25278]).
1277
1278 * `randjump`, which produced an array, is deprecated in favor of the
1279 scalar version `Future.randjump` used with `accumulate` ([#27746]).
1280
1281 * The `assert` function (and `@assert` macro) have been documented that they are not guaranteed to run under various optimization levels and should therefore not be used to e.g. verify passwords.
1282
1283 * `ObjectIdDict` has been deprecated in favor of `IdDict{Any,Any}` ([#25210]).
1284
1285 * `gc` and `gc_enable` have been deprecated in favor of `GC.gc` and `GC.enable` ([#25616]).
1286
1287 * `Base.@gc_preserve` has been deprecated in favor of `GC.@preserve` ([#25616]).
1288
1289 * `print_shortest` has been discontinued, but is still available in the `Base.Grisu`
1290 submodule ([#25745]).
1291
1292 * `scale!` has been deprecated in favor of `mul!`, `lmul!`, and `rmul!` ([#25701], [#25812]).
1293
1294 * The `remove_destination` keyword argument to `cp`, `mv`, and the unexported `cptree`
1295 has been renamed to `force` ([#25979]).
1296
1297 * `contains` has been deprecated in favor of a more general `occursin` function, which
1298 takes its arguments in reverse order from `contains` ([#26283]).
1299
1300 * `Regex` objects are no longer callable. Use `occursin` instead ([#26283]).
1301
1302 * The methods of `range` based on positional arguments have been deprecated in favor of
1303 keyword arguments ([#25896]).
1304
1305 * `linspace` has been deprecated in favor of `range` with `stop` and `length` keyword
1306 arguments ([#25896]).
1307
1308 * `LinSpace` has been renamed to `LinRange` ([#25896]).
1309
1310 * `logspace` has been deprecated to its definition ([#25896]).
1311
1312 * `endof(a)` has been renamed to `lastindex(a)`, and the `end` keyword in indexing expressions now
1313 lowers to either `lastindex(a)` (in the case with only one index) or `lastindex(a, d)` (in cases
1314 where there is more than one index and `end` appears at dimension `d`) ([#23554], [#25763]).
1315
1316 * `DateTime()`, `Date()`, and `Time()` have been deprecated, instead use `DateTime(1)`, `Date(1)`
1317 and `Time(0)` respectively ([#23724]).
1318
1319 * The fallback method `^(x, p::Integer)` is deprecated. If your type relied on this definition,
1320 add a method such as `^(x::MyType, p::Integer) = Base.power_by_squaring(x, p)` ([#23332]).
1321
1322 * `DevNull`, `STDIN`, `STDOUT`, and `STDERR` have been renamed to `devnull`, `stdin`, `stdout`,
1323 and `stderr`, respectively ([#25786]).
1324
1325 * `wait` and `fetch` on `Task` now resemble the interface of `Future`.
1326
1327 * `showcompact(io, x...)` has been deprecated in favor of
1328 `show(IOContext(io, :compact => true), x...)` ([#26080]).
1329 Use `sprint(show, x..., context=:compact => true)` instead of `sprint(showcompact, x...)`.
1330
1331 * `isupper`, `islower`, `ucfirst` and `lcfirst` have been deprecated in favor of `isuppercase`,
1332 `islowercase`, `uppercasefirst` and `lowercasefirst`, respectively ([#26442]).
1333
1334 * `signif` has been deprecated in favor of the `sigdigits` keyword argument to `round`.
1335
1336 * `Base.IntSet` has been deprecated in favor of `Base.BitSet` ([#24282]).
1337
1338 * `setrounding` has been deprecated for `Float32` and `Float64`, as the behaviour was too unreliable ([#26935]).
1339
1340 * `gamma`, `lgamma`, `beta`, `lbeta` and `lfact` have been moved to
1341 [SpecialFunctions.jl](https://github.com/JuliaMath/SpecialFunctions.jl) ([#27459], [#27473]).
1342
1343 * `atan2` is now a 2-argument method of `atan` ([#27248]).
1344
1345 * The functions `eigs` and `svds` have been moved to the `Arpack.jl` package ([#27616]).
1346
1347 * `vecdot` and `vecnorm` are deprecated in favor of `dot` and `norm`, respectively ([#27401]).
1348
1349 * `clipboard` has been moved to the `InteractiveUtils` standard library package
1350 (along with other utilities mostly used at the interactive prompt, such as `edit`
1351 and `less`) ([#27635]).
1352
1353 * `ndigits(n, b, [pad])` is deprecated in favor of `ndigits(n, base=b, pad=pad)` ([#27908]).
1354
1355 * `squeeze` is deprecated in favor of `dropdims`.
1356
1357 * `srand` is deprecated in favor of the unexported `Random.seed!` ([#27726]).
1358
1359 * `realmin`/`realmax` are deprecated in favor of `floatmin`/`floatmax` ([#28302]).
1360
1361 * `sortrows`/`sortcols` have been deprecated in favor of the more general `sortslices`.
1362
1363 * `nextpow2`/`prevpow2` have been deprecated in favor of the more general `nextpow`/`prevpow` functions.
1364
1365 Command-line option changes
1366 ---------------------------
1367
1368 * New option `--warn-overwrite={yes|no}` to control the warning for overwriting method
1369 definitions. The default is `no` ([#23002]).
1370
1371 * New option `--banner={yes,no}` allows suppressing or forcing the printing of the
1372 startup banner, overriding the default behavior (banner in REPL, no banner otherwise).
1373 The `--quiet` option implies `--banner=no` even in REPL mode but can be overridden by
1374 passing `--quiet` together with `--banner=yes` ([#23342]).
1375
1376 * The option `--precompiled` has been renamed to `--sysimage-native-code` ([#23054]).
1377
1378 * The option `--compilecache` has been renamed to `--compiled-modules` ([#23054]).
1379
1380 <!--- generated by NEWS-update.jl: -->
1381 [#330]: https://github.com/JuliaLang/julia/issues/330
1382 [#1974]: https://github.com/JuliaLang/julia/issues/1974
1383 [#4916]: https://github.com/JuliaLang/julia/issues/4916
1384 [#5148]: https://github.com/JuliaLang/julia/issues/5148
1385 [#5794]: https://github.com/JuliaLang/julia/issues/5794
1386 [#6080]: https://github.com/JuliaLang/julia/issues/6080
1387 [#6466]: https://github.com/JuliaLang/julia/issues/6466
1388 [#6614]: https://github.com/JuliaLang/julia/issues/6614
1389 [#8000]: https://github.com/JuliaLang/julia/issues/8000
1390 [#8470]: https://github.com/JuliaLang/julia/issues/8470
1391 [#9053]: https://github.com/JuliaLang/julia/issues/9053
1392 [#9292]: https://github.com/JuliaLang/julia/issues/9292
1393 [#10593]: https://github.com/JuliaLang/julia/issues/10593
1394 [#11310]: https://github.com/JuliaLang/julia/issues/11310
1395 [#12010]: https://github.com/JuliaLang/julia/issues/12010
1396 [#12131]: https://github.com/JuliaLang/julia/issues/12131
1397 [#13079]: https://github.com/JuliaLang/julia/issues/13079
1398 [#14770]: https://github.com/JuliaLang/julia/issues/14770
1399 [#15120]: https://github.com/JuliaLang/julia/issues/15120
1400 [#16356]: https://github.com/JuliaLang/julia/issues/16356
1401 [#16401]: https://github.com/JuliaLang/julia/issues/16401
1402 [#16937]: https://github.com/JuliaLang/julia/issues/16937
1403 [#17046]: https://github.com/JuliaLang/julia/issues/17046
1404 [#17086]: https://github.com/JuliaLang/julia/issues/17086
1405 [#17240]: https://github.com/JuliaLang/julia/issues/17240
1406 [#17360]: https://github.com/JuliaLang/julia/issues/17360
1407 [#17367]: https://github.com/JuliaLang/julia/issues/17367
1408 [#17886]: https://github.com/JuliaLang/julia/issues/17886
1409 [#17997]: https://github.com/JuliaLang/julia/issues/17997
1410 [#18155]: https://github.com/JuliaLang/julia/issues/18155
1411 [#18650]: https://github.com/JuliaLang/julia/issues/18650
1412 [#19089]: https://github.com/JuliaLang/julia/issues/19089
1413 [#19157]: https://github.com/JuliaLang/julia/issues/19157
1414 [#19186]: https://github.com/JuliaLang/julia/issues/19186
1415 [#19987]: https://github.com/JuliaLang/julia/issues/19987
1416 [#20005]: https://github.com/JuliaLang/julia/issues/20005
1417 [#20418]: https://github.com/JuliaLang/julia/issues/20418
1418 [#20549]: https://github.com/JuliaLang/julia/issues/20549
1419 [#20575]: https://github.com/JuliaLang/julia/issues/20575
1420 [#20816]: https://github.com/JuliaLang/julia/issues/20816
1421 [#20899]: https://github.com/JuliaLang/julia/issues/20899
1422 [#20912]: https://github.com/JuliaLang/julia/issues/20912
1423 [#20974]: https://github.com/JuliaLang/julia/issues/20974
1424 [#21359]: https://github.com/JuliaLang/julia/issues/21359
1425 [#21438]: https://github.com/JuliaLang/julia/issues/21438
1426 [#21450]: https://github.com/JuliaLang/julia/issues/21450
1427 [#21527]: https://github.com/JuliaLang/julia/issues/21527
1428 [#21540]: https://github.com/JuliaLang/julia/issues/21540
1429 [#21592]: https://github.com/JuliaLang/julia/issues/21592
1430 [#21662]: https://github.com/JuliaLang/julia/issues/21662
1431 [#21692]: https://github.com/JuliaLang/julia/issues/21692
1432 [#21697]: https://github.com/JuliaLang/julia/issues/21697
1433 [#21709]: https://github.com/JuliaLang/julia/issues/21709
1434 [#21746]: https://github.com/JuliaLang/julia/issues/21746
1435 [#21759]: https://github.com/JuliaLang/julia/issues/21759
1436 [#21774]: https://github.com/JuliaLang/julia/issues/21774
1437 [#21825]: https://github.com/JuliaLang/julia/issues/21825
1438 [#21909]: https://github.com/JuliaLang/julia/issues/21909
1439 [#21956]: https://github.com/JuliaLang/julia/issues/21956
1440 [#21960]: https://github.com/JuliaLang/julia/issues/21960
1441 [#21973]: https://github.com/JuliaLang/julia/issues/21973
1442 [#21974]: https://github.com/JuliaLang/julia/issues/21974
1443 [#22007]: https://github.com/JuliaLang/julia/issues/22007
1444 [#22038]: https://github.com/JuliaLang/julia/issues/22038
1445 [#22062]: https://github.com/JuliaLang/julia/issues/22062
1446 [#22064]: https://github.com/JuliaLang/julia/issues/22064
1447 [#22088]: https://github.com/JuliaLang/julia/issues/22088
1448 [#22089]: https://github.com/JuliaLang/julia/issues/22089
1449 [#22092]: https://github.com/JuliaLang/julia/issues/22092
1450 [#22182]: https://github.com/JuliaLang/julia/issues/22182
1451 [#22187]: https://github.com/JuliaLang/julia/issues/22187
1452 [#22188]: https://github.com/JuliaLang/julia/issues/22188
1453 [#22194]: https://github.com/JuliaLang/julia/issues/22194
1454 [#22210]: https://github.com/JuliaLang/julia/issues/22210
1455 [#22222]: https://github.com/JuliaLang/julia/issues/22222
1456 [#22224]: https://github.com/JuliaLang/julia/issues/22224
1457 [#22226]: https://github.com/JuliaLang/julia/issues/22226
1458 [#22228]: https://github.com/JuliaLang/julia/issues/22228
1459 [#22245]: https://github.com/JuliaLang/julia/issues/22245
1460 [#22251]: https://github.com/JuliaLang/julia/issues/22251
1461 [#22274]: https://github.com/JuliaLang/julia/issues/22274
1462 [#22281]: https://github.com/JuliaLang/julia/issues/22281
1463 [#22296]: https://github.com/JuliaLang/julia/issues/22296
1464 [#22314]: https://github.com/JuliaLang/julia/issues/22314
1465 [#22324]: https://github.com/JuliaLang/julia/issues/22324
1466 [#22325]: https://github.com/JuliaLang/julia/issues/22325
1467 [#22350]: https://github.com/JuliaLang/julia/issues/22350
1468 [#22390]: https://github.com/JuliaLang/julia/issues/22390
1469 [#22496]: https://github.com/JuliaLang/julia/issues/22496
1470 [#22511]: https://github.com/JuliaLang/julia/issues/22511
1471 [#22523]: https://github.com/JuliaLang/julia/issues/22523
1472 [#22532]: https://github.com/JuliaLang/julia/issues/22532
1473 [#22572]: https://github.com/JuliaLang/julia/issues/22572
1474 [#22588]: https://github.com/JuliaLang/julia/issues/22588
1475 [#22605]: https://github.com/JuliaLang/julia/issues/22605
1476 [#22666]: https://github.com/JuliaLang/julia/issues/22666
1477 [#22696]: https://github.com/JuliaLang/julia/issues/22696
1478 [#22703]: https://github.com/JuliaLang/julia/issues/22703
1479 [#22712]: https://github.com/JuliaLang/julia/issues/22712
1480 [#22718]: https://github.com/JuliaLang/julia/issues/22718
1481 [#22720]: https://github.com/JuliaLang/julia/issues/22720
1482 [#22723]: https://github.com/JuliaLang/julia/issues/22723
1483 [#22732]: https://github.com/JuliaLang/julia/issues/22732
1484 [#22742]: https://github.com/JuliaLang/julia/issues/22742
1485 [#22751]: https://github.com/JuliaLang/julia/issues/22751
1486 [#22761]: https://github.com/JuliaLang/julia/issues/22761
1487 [#22762]: https://github.com/JuliaLang/julia/issues/22762
1488 [#22789]: https://github.com/JuliaLang/julia/issues/22789
1489 [#22793]: https://github.com/JuliaLang/julia/issues/22793
1490 [#22796]: https://github.com/JuliaLang/julia/issues/22796
1491 [#22800]: https://github.com/JuliaLang/julia/issues/22800
1492 [#22801]: https://github.com/JuliaLang/julia/issues/22801
1493 [#22814]: https://github.com/JuliaLang/julia/issues/22814
1494 [#22825]: https://github.com/JuliaLang/julia/issues/22825
1495 [#22829]: https://github.com/JuliaLang/julia/issues/22829
1496 [#22847]: https://github.com/JuliaLang/julia/issues/22847
1497 [#22868]: https://github.com/JuliaLang/julia/issues/22868
1498 [#22880]: https://github.com/JuliaLang/julia/issues/22880
1499 [#22907]: https://github.com/JuliaLang/julia/issues/22907
1500 [#22925]: https://github.com/JuliaLang/julia/issues/22925
1501 [#22926]: https://github.com/JuliaLang/julia/issues/22926
1502 [#22932]: https://github.com/JuliaLang/julia/issues/22932
1503 [#22961]: https://github.com/JuliaLang/julia/issues/22961
1504 [#22984]: https://github.com/JuliaLang/julia/issues/22984
1505 [#23002]: https://github.com/JuliaLang/julia/issues/23002
1506 [#23035]: https://github.com/JuliaLang/julia/issues/23035
1507 [#23051]: https://github.com/JuliaLang/julia/issues/23051
1508 [#23054]: https://github.com/JuliaLang/julia/issues/23054
1509 [#23117]: https://github.com/JuliaLang/julia/issues/23117
1510 [#23120]: https://github.com/JuliaLang/julia/issues/23120
1511 [#23144]: https://github.com/JuliaLang/julia/issues/23144
1512 [#23154]: https://github.com/JuliaLang/julia/issues/23154
1513 [#23157]: https://github.com/JuliaLang/julia/issues/23157
1514 [#23168]: https://github.com/JuliaLang/julia/issues/23168
1515 [#23187]: https://github.com/JuliaLang/julia/issues/23187
1516 [#23207]: https://github.com/JuliaLang/julia/issues/23207
1517 [#23233]: https://github.com/JuliaLang/julia/issues/23233
1518 [#23235]: https://github.com/JuliaLang/julia/issues/23235
1519 [#23261]: https://github.com/JuliaLang/julia/issues/23261
1520 [#23323]: https://github.com/JuliaLang/julia/issues/23323
1521 [#23332]: https://github.com/JuliaLang/julia/issues/23332
1522 [#23341]: https://github.com/JuliaLang/julia/issues/23341
1523 [#23342]: https://github.com/JuliaLang/julia/issues/23342
1524 [#23354]: https://github.com/JuliaLang/julia/issues/23354
1525 [#23366]: https://github.com/JuliaLang/julia/issues/23366
1526 [#23373]: https://github.com/JuliaLang/julia/issues/23373
1527 [#23393]: https://github.com/JuliaLang/julia/issues/23393
1528 [#23404]: https://github.com/JuliaLang/julia/issues/23404
1529 [#23427]: https://github.com/JuliaLang/julia/issues/23427
1530 [#23504]: https://github.com/JuliaLang/julia/issues/23504
1531 [#23505]: https://github.com/JuliaLang/julia/issues/23505
1532 [#23519]: https://github.com/JuliaLang/julia/issues/23519
1533 [#23528]: https://github.com/JuliaLang/julia/issues/23528
1534 [#23529]: https://github.com/JuliaLang/julia/issues/23529
1535 [#23530]: https://github.com/JuliaLang/julia/issues/23530
1536 [#23554]: https://github.com/JuliaLang/julia/issues/23554
1537 [#23570]: https://github.com/JuliaLang/julia/issues/23570
1538 [#23628]: https://github.com/JuliaLang/julia/issues/23628
1539 [#23642]: https://github.com/JuliaLang/julia/issues/23642
1540 [#23665]: https://github.com/JuliaLang/julia/issues/23665
1541 [#23690]: https://github.com/JuliaLang/julia/issues/23690
1542 [#23716]: https://github.com/JuliaLang/julia/issues/23716
1543 [#23724]: https://github.com/JuliaLang/julia/issues/23724
1544 [#23750]: https://github.com/JuliaLang/julia/issues/23750
1545 [#23757]: https://github.com/JuliaLang/julia/issues/23757
1546 [#23805]: https://github.com/JuliaLang/julia/issues/23805
1547 [#23816]: https://github.com/JuliaLang/julia/issues/23816
1548 [#23885]: https://github.com/JuliaLang/julia/issues/23885
1549 [#23902]: https://github.com/JuliaLang/julia/issues/23902
1550 [#23912]: https://github.com/JuliaLang/julia/issues/23912
1551 [#23923]: https://github.com/JuliaLang/julia/issues/23923
1552 [#23929]: https://github.com/JuliaLang/julia/issues/23929
1553 [#23960]: https://github.com/JuliaLang/julia/issues/23960
1554 [#23964]: https://github.com/JuliaLang/julia/issues/23964
1555 [#24047]: https://github.com/JuliaLang/julia/issues/24047
1556 [#24126]: https://github.com/JuliaLang/julia/issues/24126
1557 [#24153]: https://github.com/JuliaLang/julia/issues/24153
1558 [#24167]: https://github.com/JuliaLang/julia/issues/24167
1559 [#24187]: https://github.com/JuliaLang/julia/issues/24187
1560 [#24221]: https://github.com/JuliaLang/julia/issues/24221
1561 [#24240]: https://github.com/JuliaLang/julia/issues/24240
1562 [#24245]: https://github.com/JuliaLang/julia/issues/24245
1563 [#24250]: https://github.com/JuliaLang/julia/issues/24250
1564 [#24263]: https://github.com/JuliaLang/julia/issues/24263
1565 [#24278]: https://github.com/JuliaLang/julia/issues/24278
1566 [#24279]: https://github.com/JuliaLang/julia/issues/24279
1567 [#24281]: https://github.com/JuliaLang/julia/issues/24281
1568 [#24282]: https://github.com/JuliaLang/julia/issues/24282
1569 [#24320]: https://github.com/JuliaLang/julia/issues/24320
1570 [#24356]: https://github.com/JuliaLang/julia/issues/24356
1571 [#24362]: https://github.com/JuliaLang/julia/issues/24362
1572 [#24390]: https://github.com/JuliaLang/julia/issues/24390
1573 [#24396]: https://github.com/JuliaLang/julia/issues/24396
1574 [#24404]: https://github.com/JuliaLang/julia/issues/24404
1575 [#24413]: https://github.com/JuliaLang/julia/issues/24413
1576 [#24414]: https://github.com/JuliaLang/julia/issues/24414
1577 [#24438]: https://github.com/JuliaLang/julia/issues/24438
1578 [#24445]: https://github.com/JuliaLang/julia/issues/24445
1579 [#24452]: https://github.com/JuliaLang/julia/issues/24452
1580 [#24472]: https://github.com/JuliaLang/julia/issues/24472
1581 [#24490]: https://github.com/JuliaLang/julia/issues/24490
1582 [#24580]: https://github.com/JuliaLang/julia/issues/24580
1583 [#24595]: https://github.com/JuliaLang/julia/issues/24595
1584 [#24605]: https://github.com/JuliaLang/julia/issues/24605
1585 [#24647]: https://github.com/JuliaLang/julia/issues/24647
1586 [#24653]: https://github.com/JuliaLang/julia/issues/24653
1587 [#24654]: https://github.com/JuliaLang/julia/issues/24654
1588 [#24656]: https://github.com/JuliaLang/julia/issues/24656
1589 [#24673]: https://github.com/JuliaLang/julia/issues/24673
1590 [#24679]: https://github.com/JuliaLang/julia/issues/24679
1591 [#24684]: https://github.com/JuliaLang/julia/issues/24684
1592 [#24713]: https://github.com/JuliaLang/julia/issues/24713
1593 [#24715]: https://github.com/JuliaLang/julia/issues/24715
1594 [#24774]: https://github.com/JuliaLang/julia/issues/24774
1595 [#24781]: https://github.com/JuliaLang/julia/issues/24781
1596 [#24785]: https://github.com/JuliaLang/julia/issues/24785
1597 [#24786]: https://github.com/JuliaLang/julia/issues/24786
1598 [#24808]: https://github.com/JuliaLang/julia/issues/24808
1599 [#24831]: https://github.com/JuliaLang/julia/issues/24831
1600 [#24839]: https://github.com/JuliaLang/julia/issues/24839
1601 [#24844]: https://github.com/JuliaLang/julia/issues/24844
1602 [#24869]: https://github.com/JuliaLang/julia/issues/24869
1603 [#25002]: https://github.com/JuliaLang/julia/issues/25002
1604 [#25012]: https://github.com/JuliaLang/julia/issues/25012
1605 [#25021]: https://github.com/JuliaLang/julia/issues/25021
1606 [#25029]: https://github.com/JuliaLang/julia/issues/25029
1607 [#25030]: https://github.com/JuliaLang/julia/issues/25030
1608 [#25037]: https://github.com/JuliaLang/julia/issues/25037
1609 [#25046]: https://github.com/JuliaLang/julia/issues/25046
1610 [#25047]: https://github.com/JuliaLang/julia/issues/25047
1611 [#25056]: https://github.com/JuliaLang/julia/issues/25056
1612 [#25057]: https://github.com/JuliaLang/julia/issues/25057
1613 [#25058]: https://github.com/JuliaLang/julia/issues/25058
1614 [#25067]: https://github.com/JuliaLang/julia/issues/25067
1615 [#25088]: https://github.com/JuliaLang/julia/issues/25088
1616 [#25162]: https://github.com/JuliaLang/julia/issues/25162
1617 [#25165]: https://github.com/JuliaLang/julia/issues/25165
1618 [#25168]: https://github.com/JuliaLang/julia/issues/25168
1619 [#25184]: https://github.com/JuliaLang/julia/issues/25184
1620 [#25197]: https://github.com/JuliaLang/julia/issues/25197
1621 [#25210]: https://github.com/JuliaLang/julia/issues/25210
1622 [#25231]: https://github.com/JuliaLang/julia/issues/25231
1623 [#25249]: https://github.com/JuliaLang/julia/issues/25249
1624 [#25277]: https://github.com/JuliaLang/julia/issues/25277
1625 [#25278]: https://github.com/JuliaLang/julia/issues/25278
1626 [#25311]: https://github.com/JuliaLang/julia/issues/25311
1627 [#25321]: https://github.com/JuliaLang/julia/issues/25321
1628 [#25368]: https://github.com/JuliaLang/julia/issues/25368
1629 [#25391]: https://github.com/JuliaLang/julia/issues/25391
1630 [#25424]: https://github.com/JuliaLang/julia/issues/25424
1631 [#25429]: https://github.com/JuliaLang/julia/issues/25429
1632 [#25457]: https://github.com/JuliaLang/julia/issues/25457
1633 [#25459]: https://github.com/JuliaLang/julia/issues/25459
1634 [#25472]: https://github.com/JuliaLang/julia/issues/25472
1635 [#25496]: https://github.com/JuliaLang/julia/issues/25496
1636 [#25501]: https://github.com/JuliaLang/julia/issues/25501
1637 [#25522]: https://github.com/JuliaLang/julia/issues/25522
1638 [#25532]: https://github.com/JuliaLang/julia/issues/25532
1639 [#25545]: https://github.com/JuliaLang/julia/issues/25545
1640 [#25564]: https://github.com/JuliaLang/julia/issues/25564
1641 [#25567]: https://github.com/JuliaLang/julia/issues/25567
1642 [#25571]: https://github.com/JuliaLang/julia/issues/25571
1643 [#25616]: https://github.com/JuliaLang/julia/issues/25616
1644 [#25622]: https://github.com/JuliaLang/julia/issues/25622
1645 [#25631]: https://github.com/JuliaLang/julia/issues/25631
1646 [#25633]: https://github.com/JuliaLang/julia/issues/25633
1647 [#25634]: https://github.com/JuliaLang/julia/issues/25634
1648 [#25654]: https://github.com/JuliaLang/julia/issues/25654
1649 [#25655]: https://github.com/JuliaLang/julia/issues/25655
1650 [#25662]: https://github.com/JuliaLang/julia/issues/25662
1651 [#25667]: https://github.com/JuliaLang/julia/issues/25667
1652 [#25668]: https://github.com/JuliaLang/julia/issues/25668
1653 [#25697]: https://github.com/JuliaLang/julia/issues/25697
1654 [#25701]: https://github.com/JuliaLang/julia/issues/25701
1655 [#25725]: https://github.com/JuliaLang/julia/issues/25725
1656 [#25745]: https://github.com/JuliaLang/julia/issues/25745
1657 [#25763]: https://github.com/JuliaLang/julia/issues/25763
1658 [#25786]: https://github.com/JuliaLang/julia/issues/25786
1659 [#25812]: https://github.com/JuliaLang/julia/issues/25812
1660 [#25815]: https://github.com/JuliaLang/julia/issues/25815
1661 [#25830]: https://github.com/JuliaLang/julia/issues/25830
1662 [#25845]: https://github.com/JuliaLang/julia/issues/25845
1663 [#25854]: https://github.com/JuliaLang/julia/issues/25854
1664 [#25858]: https://github.com/JuliaLang/julia/issues/25858
1665 [#25872]: https://github.com/JuliaLang/julia/issues/25872
1666 [#25896]: https://github.com/JuliaLang/julia/issues/25896
1667 [#25944]: https://github.com/JuliaLang/julia/issues/25944
1668 [#25947]: https://github.com/JuliaLang/julia/issues/25947
1669 [#25979]: https://github.com/JuliaLang/julia/issues/25979
1670 [#25980]: https://github.com/JuliaLang/julia/issues/25980
1671 [#25990]: https://github.com/JuliaLang/julia/issues/25990
1672 [#25998]: https://github.com/JuliaLang/julia/issues/25998
1673 [#26009]: https://github.com/JuliaLang/julia/issues/26009
1674 [#26071]: https://github.com/JuliaLang/julia/issues/26071
1675 [#26080]: https://github.com/JuliaLang/julia/issues/26080
1676 [#26093]: https://github.com/JuliaLang/julia/issues/26093
1677 [#26149]: https://github.com/JuliaLang/julia/issues/26149
1678 [#26154]: https://github.com/JuliaLang/julia/issues/26154
1679 [#26156]: https://github.com/JuliaLang/julia/issues/26156
1680 [#26161]: https://github.com/JuliaLang/julia/issues/26161
1681 [#26206]: https://github.com/JuliaLang/julia/issues/26206
1682 [#26212]: https://github.com/JuliaLang/julia/issues/26212
1683 [#26262]: https://github.com/JuliaLang/julia/issues/26262
1684 [#26283]: https://github.com/JuliaLang/julia/issues/26283
1685 [#26284]: https://github.com/JuliaLang/julia/issues/26284
1686 [#26286]: https://github.com/JuliaLang/julia/issues/26286
1687 [#26347]: https://github.com/JuliaLang/julia/issues/26347
1688 [#26436]: https://github.com/JuliaLang/julia/issues/26436
1689 [#26442]: https://github.com/JuliaLang/julia/issues/26442
1690 [#26486]: https://github.com/JuliaLang/julia/issues/26486
1691 [#26559]: https://github.com/JuliaLang/julia/issues/26559
1692 [#26576]: https://github.com/JuliaLang/julia/issues/26576
1693 [#26600]: https://github.com/JuliaLang/julia/issues/26600
1694 [#26660]: https://github.com/JuliaLang/julia/issues/26660
1695 [#26670]: https://github.com/JuliaLang/julia/issues/26670
1696 [#26733]: https://github.com/JuliaLang/julia/issues/26733
1697 [#26775]: https://github.com/JuliaLang/julia/issues/26775
1698 [#26858]: https://github.com/JuliaLang/julia/issues/26858
1699 [#26862]: https://github.com/JuliaLang/julia/issues/26862
1700 [#26932]: https://github.com/JuliaLang/julia/issues/26932
1701 [#26935]: https://github.com/JuliaLang/julia/issues/26935
1702 [#26980]: https://github.com/JuliaLang/julia/issues/26980
1703 [#26997]: https://github.com/JuliaLang/julia/issues/26997
1704 [#27067]: https://github.com/JuliaLang/julia/issues/27067
1705 [#27071]: https://github.com/JuliaLang/julia/issues/27071
1706 [#27075]: https://github.com/JuliaLang/julia/issues/27075
1707 [#27100]: https://github.com/JuliaLang/julia/issues/27100
1708 [#27121]: https://github.com/JuliaLang/julia/issues/27121
1709 [#27159]: https://github.com/JuliaLang/julia/issues/27159
1710 [#27164]: https://github.com/JuliaLang/julia/issues/27164
1711 [#27189]: https://github.com/JuliaLang/julia/issues/27189
1712 [#27212]: https://github.com/JuliaLang/julia/issues/27212
1713 [#27248]: https://github.com/JuliaLang/julia/issues/27248
1714 [#27309]: https://github.com/JuliaLang/julia/issues/27309
1715 [#27401]: https://github.com/JuliaLang/julia/issues/27401
1716 [#27447]: https://github.com/JuliaLang/julia/issues/27447
1717 [#27459]: https://github.com/JuliaLang/julia/issues/27459
1718 [#27470]: https://github.com/JuliaLang/julia/issues/27470
1719 [#27473]: https://github.com/JuliaLang/julia/issues/27473
1720 [#27554]: https://github.com/JuliaLang/julia/issues/27554
1721 [#27560]: https://github.com/JuliaLang/julia/issues/27560
1722 [#27616]: https://github.com/JuliaLang/julia/issues/27616
1723 [#27635]: https://github.com/JuliaLang/julia/issues/27635
1724 [#27641]: https://github.com/JuliaLang/julia/issues/27641
1725 [#27711]: https://github.com/JuliaLang/julia/issues/27711
1726 [#27726]: https://github.com/JuliaLang/julia/issues/27726
1727 [#27746]: https://github.com/JuliaLang/julia/issues/27746
1728 [#27856]: https://github.com/JuliaLang/julia/issues/27856
1729 [#27859]: https://github.com/JuliaLang/julia/issues/27859
1730 [#27908]: https://github.com/JuliaLang/julia/issues/27908
1731 [#27944]: https://github.com/JuliaLang/julia/issues/27944
1732 [#28045]: https://github.com/JuliaLang/julia/issues/28045
1733 [#28065]: https://github.com/JuliaLang/julia/issues/28065
1734 [#28155]: https://github.com/JuliaLang/julia/issues/28155
1735 [#28266]: https://github.com/JuliaLang/julia/issues/28266
1736 [#28302]: https://github.com/JuliaLang/julia/issues/28302
1737
01738 Julia v0.6.0 Release Notes
11739 ==========================
21740
0 Julia v0.7.0 Release Notes
0 Julia v1.0.0 Release Notes
11 ==========================
22
33 New language features
44 ---------------------
55
6 * Local variables can be tested for being defined
7 using the new `@isdefined variable` macro ([#22281]).
8
9 * Destructuring in function arguments: when an expression such as `(x, y)` is used as
10 a function argument name, the argument is unpacked into local variables `x` and `y`
11 as in the assignment `(x, y) = arg` ([#6614]).
12
13 * Named tuples, with the syntax `(a=1, b=2)`. These behave very similarly to tuples,
14 except components can also be accessed by name using dot syntax `t.a` ([#22194]).
15
16 * Keyword argument containers (`kw` in `f(; kw...)`) are now based on named tuples. Dictionary
17 functions like `haskey` and indexing can be used on them, and name-value pairs can be
18 iterated using `pairs(kw)`. `kw` can no longer contain multiple entries for the same
19 argument name ([#4916]).
20
21 * Custom infix operators can now be defined by appending Unicode
22 combining marks, primes, and sub/superscripts to other operators.
23 For example, `+̂ₐ″` is parsed as an infix operator with the same
24 precedence as `+` ([#22089]).
25
26 * The macro call syntax `@macroname[args]` is now available and is parsed
27 as `@macroname([args])` ([#23519]).
28
29 * The construct `if @generated ...; else ...; end` can be used to provide both
30 `@generated` and normal implementations of part of a function. Surrounding code
31 will be common to both versions ([#23168]).
32
33 * Added `⟂` (`\perp`) operator with comparison precedence ([#24404]).
34
35 * The `missing` singleton object (of type `Missing`) has been added to represent
36 missing values ([#24653]). It propagates through standard operators and mathematical functions,
37 and implements three-valued logic, similar to SQLs `NULL` and R's `NA`.
38
39 * Field access via dot-syntax can now be overloaded by adding methods to
40 `Base.getproperty` and `Base.setproperty!` ([#1974]), optionally along with
41 a corresponding `Base.propertynames` method for reflection ([#25311]).
42
43 * Values for `Enum`s can now be specified inside of a `begin` block when using the
44 `@enum` macro ([#25424]).
45
46 * Keyword arguments can be required: if a default value is omitted, then an
47 exception is thrown if the caller does not assign the keyword a value ([#25830]).
48
49 * The pair operator `=>` is now broadcastable as `.=>` which was previously a parsing error ([#27447])
50
516 Language changes
527 ----------------
53
54 * The syntax for parametric methods, `function f{T}(x::T)`, has been
55 changed to `function f(x::T) where {T}` ([#11310]).
56
57 * The fallback constructor that calls `convert` is deprecated. Instead, new types should
58 prefer to define constructors, and add `convert` methods that call those constructors
59 only as necessary ([#15120]).
60
61 * The syntax `1.+2` is deprecated, since it is ambiguous: it could mean either
62 `1 .+ 2` (the current meaning) or `1. + 2` ([#19089]).
63
64 * Mutable structs with no fields are no longer singletons; it is now possible to make
65 multiple instances of them that can be distinguished by `===` ([#25854]).
66 Zero-size immutable structs are still singletons.
67
68 * In string and character literals, backslash `\` may no longer
69 precede unrecognized escape characters ([#22800]).
70
71 * Juxtaposing binary, octal, and hexadecimal literals is deprecated, since it can lead to
72 confusing code such as `0xapi == 0xa * pi` ([#16356]).
73
74 * Numeric literal juxtaposition now has slighty lower precedence than unary operators,
75 so for example `√2x` parses as `(√2) * x` ([#27641]).
76
77 * Declaring arguments as `x::ANY` to avoid specialization has been replaced
78 by `@nospecialize x`. ([#22666]).
79
80 This can also be used in global scope, to apply to all subsequent method definitions
81 in the module (until `@specialize`). ([#28065])
82
83 * Keyword argument default values are now evaluated in successive scopes ---
84 the scope for each expression includes only previous keyword arguments, in
85 left-to-right order ([#17240]).
86
87 * The parsing of `1<<2*3` as `1<<(2*3)` is deprecated, and will change to
88 `(1<<2)*3` in a future version ([#13079]).
89
90 * The parsing of `<|` is now right associative. `|>` remains left associative ([#24153]).
91
92 * `:` now parses like other operators, as a call to a function named `:`, instead of
93 calling `colon` ([#25947]).
94
95 * `{ }` expressions now use `braces` and `bracescat` as expression heads instead
96 of `cell1d` and `cell2d`, and parse similarly to `vect` and `vcat` ([#8470]).
97
98 * Nested `if` expressions that arise from the keyword `elseif` now use `elseif`
99 as their expression head instead of `if` ([#21774]).
100
101 * `let` blocks now parse the same as `for` loops; the first argument is either an
102 assignment or `block` of assignments, and the second argument is a block of
103 statements ([#21774]).
104
105 * `do` syntax now parses to an expression with head `:do`, instead of as a function
106 call ([#21774]).
107
108 * Parsed and lowered forms of type definitions have been synchronized with their
109 new keywords ([#23157]). Expression heads are renamed as follows:
110
111 + `type` => `struct`
112
113 + `bitstype` => `primitive` (order of arguments is also reversed, to match syntax)
114
115 + `composite_type` => `struct_type`
116
117 + `bits_type` => `primitive_type`
118
119 * The `global` keyword now only introduces a new binding if one doesn't already exist
120 in the module.
121 This means that assignment to a global (`global sin = 3`) may now throw the error:
122 "cannot assign variable Base.sin from module Main", rather than emitting a warning.
123 Additionally, the new bindings are now created before the statement is executed.
124 For example, `f() = (global sin = "gluttony"; nothing)` will now resolve which module
125 contains `sin` eagerly, rather than delaying that decision until `f` is run. ([#22984]).
126
127 * `global const` declarations may no longer appear inside functions ([#12010]).
128
129 * Uninitialized `BitArray` constructors of the form `BitArray[{N}](shape...)` have been
130 deprecated in favor of equivalents accepting `undef` (an alias for
131 `UndefInitializer()`) as their first argument, as in
132 `BitArray[{N}](undef, shape...)`. For example, `BitVector(3)` is now
133 `BitVector(undef, 3)`, `BitMatrix((2, 4))` is now
134 `BitMatrix(undef, (2, 4))`, and `BitArray{3}(11, 13, 17)` is now
135 `BitArray{3}(undef, 11, 14, 17)` ([#24785]).
136
137 * Dispatch rules have been simplified:
138 method matching is now determined exclusively by subtyping;
139 the rule that method type parameters must also be captured has been removed.
140 Instead, attempting to access the unconstrained parameters will throw an `UndefVarError`.
141 Linting in package tests is recommended to confirm that the set of methods
142 which might throw `UndefVarError` when accessing the static parameters
143 (`need_to_handle_undef_sparam = Set{Any}(m.sig for m in Test.detect_unbound_args(Base, recursive=true))`)
144 is equal (`==`) to some known set (`expected = Set()`). ([#23117])
145
146 * `const` declarations on local variables were previously ignored. They now give a
147 warning, so that this syntax can be disallowed or given a new meaning in a
148 future version ([#5148]).
149
150 * Placing an expression after `catch`, as in `catch f(x)`, is deprecated.
151 Use `catch; f(x)` instead ([#19987]).
152
153 * In `for i = ...`, if a local variable `i` already existed it would be overwritten
154 during the loop. This behavior is deprecated, and in the future `for` loop variables
155 will always be new variables local to the loop ([#22314]).
156 The old behavior of overwriting an existing variable is available via `for outer i = ...`.
157
158 * In `for i in x`, `x` used to be evaluated in a new scope enclosing the `for` loop.
159 Now it is evaluated in the scope outside the `for` loop.
160
161 * In `for i in x, j in y`, all variables now have fresh bindings on each iteration of the
162 innermost loop. For example, an assignment to `i` will not be visible on the next `j`
163 loop iteration ([#330]).
164
165 * Variable bindings local to `while` loop bodies are now freshly allocated on each loop iteration,
166 matching the behavior of `for` loops.
167
168 * Prefix `&` for by-reference arguments to `ccall` has been deprecated in favor of
169 `Ref` argument types ([#6080]).
170
171 * The constructor `Ref(x::T)` now always returns a `Ref{T}` ([#21527]).
172
173 * All line numbers in ASTs are represented by `LineNumberNode`s; the `:line` expression
174 head is no longer used. `QuoteNode`s are also consistently used for quoted symbols instead
175 of the `:quote` expression head (though `:quote` `Expr`s are still used for quoted
176 expressions) ([#23885]).
177
178 * The `+` and `-` methods for `Number` and `UniformScaling` are not ambiguous anymore since `+`
179 and `-` no longer do automatic broadcasting. Hence, the methods for `UniformScaling` and `Number` are
180 no longer deprecated ([#23923]).
181
182 * The keyword `importall` is deprecated. Use `using` and/or individual `import` statements
183 instead ([#22789]).
184
185 * `reduce(+, [...])` and `reduce(*, [...])` no longer widen the iterated over arguments to
186 system word size. `sum` and `prod` still preserve this behavior. ([#22825])
187
188 * Like `_`, variable names consisting only of underscores can be assigned,
189 but accessing their values is deprecated ([#24221]).
190
191 * Raw string literal escaping rules have been changed to make it possible to write all strings.
192 The rule is that backslashes escape both quotes and other backslashes, but only when a sequence
193 of backslashes precedes a quote character. Thus, 2n backslashes followed by a quote encodes n
194 backslashes and the end of the literal while 2n+1 backslashes followed by a quote encodes n
195 backslashes followed by a quote character ([#22926]).
196
197 * `reprmime(mime, x)` has been renamed to `repr(mime, x)`, and along with `repr(x)`
198 and `sprint` it now accepts an optional `context` keyword for `IOContext` attributes.
199 `stringmime` has been moved to the Base64 stdlib package ([#25990]).
200
201 * The syntax `(x...)` for constructing a tuple is deprecated; use `(x...,)` instead ([#24452]).
202
203 * Non-parenthesized interpolated variables in strings, e.g. `"$x"`, must be followed
204 by a character that will never be an allowed identifier character (currently
205 operators, space/control characters, or common punctuation characters) ([#25231]).
206
207 * The syntax `using A.B` can now only be used when `A.B` is a module, and the syntax
208 `using A: B` can only be used for adding single bindings ([#8000]).
209
210 * `=>` now has its own precedence level, giving it strictly higher precedence than
211 `=` and `,` ([#25391]).
212
213 * The conditions under which unary operators followed by `(` are parsed as prefix function
214 calls have changed ([#26154]).
215
216 * `begin` is disallowed inside indexing expressions, in order to enable the syntax
217 `a[begin]` (for selecting the first element) in the future ([#23354]).
218
219 * Underscores for `_italics_` and `__bold__` are now supported by the Base Markdown
220 parser. ([#25564])
221
222 * `…` (`\dots`) and `⁝` (`\tricolon`) are now parsed as binary operators ([#26262]).
223
224 * Assignment syntax (`a=b`) inside square bracket expressions (e.g. `A[...]`, `[x, y]`)
225 is deprecated. It will likely be reclaimed in a later version for passing keyword
226 arguments. Note this does not affect updating operators like `+=` ([#25631]).
227
228 * `try` blocks without `catch` or `finally` are no longer allowed. An explicit empty
229 `catch` block should be written instead ([#27554]).
230
231 * `AbstractArray` types that use unconventional (not 1-based) indexing can now support
232 `size`, `length`, and `@inbounds`. To optionally enforce conventional indices,
233 you can `@assert !has_offset_axes(A)`.
234
235 * Module pre-compilation is now the default for code loading. Adding a
236 `__precompile__()` declaration is no longer necessary, although
237 `__precompile__(false)` can still be used to opt-out ([#26991]).
2388
2399 Breaking changes
24010 ----------------
24111
242 This section lists changes that do not have deprecation warnings.
243
244 * The package manager `Pkg` has been replaced with a new one. See the manual entries on
245 "Code Loading" and "Pkg" for documentation.
246
247 * `replace(s::AbstractString, pat=>repl)` for function `repl` arguments formerly
248 passed a substring to `repl` in all cases. It now passes substrings for
249 string patterns `pat`, but a `Char` for character patterns (when `pat` is a
250 `Char`, collection of `Char`, or a character predicate) ([#25815]).
251
252 * `readuntil` now does *not* include the delimiter in its result, matching the
253 behavior of `readline`. Pass `keep=true` to get the old behavior ([#25633]).
254
255 * `lu` methods now return decomposition objects such as `LU` rather than
256 tuples of arrays or tuples of numbers ([#26997], [#27159], [#27212]).
257
258 * `schur` methods now return decomposition objects such as `Schur` and
259 `GeneralizedSchur` rather than tuples of arrays ([#26997], [#27159], [#27212]).
260
261 * `lq` methods now return decomposition objects such as `LQ`
262 rather than tuples of arrays ([#26997], [#27159], [#27212]).
263
264 * `qr` methods now return decomposition objects such as `QR`, `QRPivoted`,
265 and `QRCompactWY` rather than tuples of arrays ([#26997], [#27159], [#27212]).
266
267 * `svd` methods now return decomposition objects such as `SVD` and
268 `GeneralizedSVD` rather than tuples of arrays or tuples of numbers ([#26997], [#27159], [#27212]).
269
270 * `countlines` now always counts the last non-empty line even if it does not
271 end with EOL, matching the behavior of `eachline` and `readlines` ([#25845]).
272
273 * `getindex(s::String, r::UnitRange{Int})` now throws `StringIndexError` if `last(r)`
274 is not a valid index into `s` ([#22572]).
275
276 * `ntuple(f, n::Integer)` throws `ArgumentError` if `n` is negative.
277 Previously an empty tuple was returned ([#21697]).
278
279 * `⋮`, `⋱`, `⋰`, and `⋯` are now parsed as binary operators, not ordinary
280 identifiers. `≔`, `≕`, and `⩴` now parse with assignment rather than comparison
281 precedence ([#26262]).
282
283 * Juxtaposing string literals (e.g. `"x"y`) is now a syntax error ([#20575]).
284
285 * `finalizer(function, object)` now returns `object` rather than `nothing` ([#24679]).
286
287 * The constructor of `SubString` now checks if the requested view range
288 is defined by valid indices in the parent `AbstractString` ([#22511]).
289
290 * Macro calls with `for` expressions are now parsed as generators inside
291 function argument lists ([#18650]). Examples:
292
293 + `sum(@inbounds a[i] for i = 1:n)` used to give a syntax error, but is now
294 parsed as `sum(@inbounds(a[i]) for i = 1:n)`.
295
296 + `sum(@m x for i = 1:n end)` used to parse the argument to `sum` as a 2-argument
297 call to macro `@m`, but now parses it as a generator plus a syntax error
298 for the dangling `end`.
299
300 * `@__DIR__` returns the current working directory rather than `nothing` when not run
301 from a file ([#21759]).
302
303 * `@__FILE__` and `@__DIR__` return information relative to the file that it was parsed from,
304 rather than from the task-local `SOURCE_PATH` global when it was expanded.
305
306 * All macros receive an extra argument `__source__::LineNumberNode` which describes the
307 parser location in the source file for the `@` of the macro call.
308 It can be accessed as a normal argument variable in the body of the macro.
309 This is implemented by inserting an extra leading argument into the
310 `Expr(:macrocall, :@name, LineNumberNode(...), args...)`
311 surface syntax. ([#21746])
312
313 * Passing the same keyword argument multiple times is now a syntax error ([#16937]).
314
315 * `getsockname` on a `TCPSocket` now returns the locally bound address and port
316 of the socket. Previously the address of the remote endpoint was being
317 returned ([#21825]).
318
319 * The `~/.juliarc.jl` file has been moved to `~/.julia/config/startup.jl` and
320 `/etc/julia/juliarc.jl` file has been renamed to `/etc/julia/startup.jl` ([#26161]).
321
322 * Using `ARGS` within `startup.jl` files or within a .jl file loaded with `--load` will no
323 longer contain the script name as the first argument. Instead, the script name will be
324 assigned to `PROGRAM_FILE`. ([#22092])
325
326 * The format for a `ClusterManager` specifying the cookie on the command line is now
327 `--worker=<cookie>`. `--worker <cookie>` will not work as it is now an optional argument.
328
329 * The representation of `CartesianRange` has changed to a
330 tuple-of-AbstractUnitRanges; the `start` and `stop` fields are no
331 longer present. Use `first(R)` and `last(R)` to obtain
332 start/stop. ([#20974])
333
334 * The `Diagonal`, `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` type definitions have
335 changed from `Diagonal{T}`, `Bidiagonal{T}`, `Tridiagonal{T}` and `SymTridiagonal{T}`
336 to `Diagonal{T,V<:AbstractVector{T}}`, `Bidiagonal{T,V<:AbstractVector{T}}`,
337 `Tridiagonal{T,V<:AbstractVector{T}}` and `SymTridiagonal{T,V<:AbstractVector{T}}`
338 respectively ([#22718], [#22925], [#23035], [#23154]).
339
340 * The immediate supertype of `BitArray` is now simply `AbstractArray`. `BitArray` is no longer
341 considered a subtype of `DenseArray` and `StridedArray` ([#25858]).
342
343 * When called with an argument that contains `NaN` elements, `findmin` and `findmax` now return the
344 first `NaN` found and its corresponding index. Previously, `NaN` elements were ignored.
345 The new behavior matches that of `min`, `max`, `minimum`, and `maximum`.
346
347 * `isapprox(x,y)` now tests `norm(x-y) <= max(atol, rtol*max(norm(x), norm(y)))`
348 rather than `norm(x-y) <= atol + ...`, and `rtol` defaults to zero
349 if an `atol > 0` is specified ([#22742]).
350
351 * Spaces are no longer allowed between `@` and the name of a macro in a macro call ([#22868]).
352
353 * Juxtaposition of a non-literal with a macro call (`x@macro`) is no longer valid syntax ([#22868]).
354
355 * On a cluster, all files are now loaded from the local file system rather than node 1 ([#22588]).
356 To load the same file everywhere from node 1, one possible alternative is to broadcast a call to `include_string`:
357 `@everywhere include_string(Main, $(read("filename", String)), "filename")`.
358 Improving upon this API is left as an opportunity for packages.
359
360 * `randperm(n)` and `randcycle(n)` now always return a `Vector{Int}` (independent of
361 the type of `n`). Use the corresponding mutating functions `randperm!` and `randcycle!`
362 to control the array type ([#22723]).
363
364 * Hermitian now ignores any imaginary components in the diagonal instead of checking
365 the diagonal. ([#17367])
366
367 * Worker-worker connections are setup lazily for an `:all_to_all` topology. Use keyword
368 arg `lazy=false` to force all connections to be setup during a `addprocs` call. ([#22814])
369
370 * In `joinpath(a, b)` on Windows, if the drive specifications of `a` and `b` do not match,
371 `joinpath` now returns `b` instead of throwing an `ArgumentError`. `joinpath(path...)` is
372 defined to be left associative, so if any argument has a drive path which does not match
373 the drive of the join of the preceding paths, the prior ones are dropped. ([#20912])
374
375 * `^(A::AbstractMatrix{<:Integer}, p::Integer)` now throws a `DomainError`
376 if `p < 0`, unless `A == one(A)` or `A == -one(A)` (same as for
377 `^(A::Integer, p::Integer)`) ([#23366]).
378
379 * `^(A::AbstractMatrix{<:Integer}, p::Integer)` now promotes the element type in the same
380 way as `^(A::Integer, p::Integer)`. This means, for instance, that `[1 1; 0 1]^big(1)`
381 will return a `Matrix{BigInt}` instead of a `Matrix{Int}` ([#23366]).
382
383 * The element type of the input is now preserved in `unique`. Previously the element type
384 of the output was shrunk to fit the union of the type of each element in the input.
385 ([#22696])
386
387 * The `promote` function now raises an error if its arguments are of different types
388 and if attempting to convert them to a common type fails to change any of their types.
389 This avoids stack overflows in the common case of definitions like
390 `f(x, y) = f(promote(x, y)...)` ([#22801]).
391
392 * `indmin` and `indmax` have been renamed to `argmin` and `argmax`, respectively ([#25654]).
393
394 * `findmin`, `findmax`, `argmin`, and `argmax` used to always return linear indices.
395 They now return `CartesianIndex`es for all but 1-d arrays, and in general return
396 the `keys` of indexed collections (e.g. dictionaries) ([#22907]).
397
398 * The `openspecfun` library is no longer built and shipped with Julia, as it is no longer
399 used internally ([#22390]).
400
401 * All loaded packages used to have bindings in `Main` (e.g. `Main.Package`). This is no
402 longer the case; now bindings will only exist for packages brought into scope by
403 typing `using Package` or `import Package` ([#17997]).
404
405 * The rules for mixed-signedness integer arithmetic (e.g. `Int32(1) + UInt64(1)`) have been
406 simplified: if the arguments have different sizes (in bits), then the type of the larger
407 argument is used. If the arguments have the same size, the unsigned type is used ([#9292]).
408
409 * All command line arguments passed via `-e`, `-E`, and `-L` will be executed in the order
410 given on the command line ([#23665]).
411
412 * `I` now yields `UniformScaling{Bool}(true)` rather than `UniformScaling{Int64}(1)`
413 to better preserve types in operations involving `I` ([#24396]).
414
415 * The return type of `reinterpret` has changed to `ReinterpretArray`. `reinterpret` on sparse
416 arrays has been discontinued.
417
418 * `Base.find_in_path` is now `Base.find_package` or `Base.find_source_file` ([#24320]).
419
420 * `finalizer` now takes functions or pointers as its first argument, and the object being
421 finalized as its second (rather than the reverse). For the majority of use cases
422 deprecation warnings will be triggered. However, deprecation warnings will not trigger where
423 (1) the callable argument is not a subtype of `Function`; or (2) both arguments are
424 `Function`s or `Ptr{Cvoid}`s ([#24605]).
425
426 * The `kill` function now throws errors on user error (e.g. on permission
427 errors), but returns successfully if the process had previously exited.
428 Its return value has been removed. Use the `process_running` function
429 to determine if a process has already exited.
430
431 * The logging system has been redesigned - `info` and `warn` are deprecated
432 and replaced with the logging macros `@info`, `@warn`, `@debug` and
433 `@error`. The `logging` function is also deprecated and replaced with
434 `AbstractLogger` and the functions from the new standard `Logging` library.
435 ([#24490])
436
437 * The `RevString` type has been removed from the language; `reverse(::String)` returns
438 a `String` with code points (or fragments thereof) in reverse order. In general,
439 `reverse(s)` should return a string of the same type and encoding as `s` with code
440 points in reverse order; any string type overrides `reverse` to return a different
441 type of string must also override `reverseind` to compute reversed indices correctly.
442
443 * `eachindex(A, B...)` now requires that all inputs have the same number of elements.
444 When the chosen indexing is Cartesian, they must have the same axes.
445
446 * `AbstractRange` objects are now considered as equal to other `AbstractArray` objects
447 by `==` and `isequal` if all of their elements are equal ([#16401]).
448 This has required changing the hashing algorithm: ranges now use an O(N) fallback
449 instead of a O(1) specialized method unless they define the `Base.RangeStepStyle`
450 trait; see its documentation for details. Types which support subtraction (operator
451 `-`) must now implement `widen` for hashing to work inside heterogeneous arrays.
452
453 * `findn(x::AbstractArray)` has been deprecated in favor of `findall(!iszero, x)`, which
454 now returns cartesian indices for multidimensional arrays (see below, [#25532]).
455
456 * Broadcasting operations are no longer fused into a single operation by Julia's parser.
457 Instead, a lazy `Broadcasted` object is created to represent the fused expression and
458 then realized with `copy(bc::Broadcasted)` or `copyto!(dest, bc::Broadcasted)`
459 to evaluate the wrapper. Consequently, package authors generally need to specialize
460 `copy` and `copyto!` methods rather than `broadcast` and `broadcast!`. This also allows
461 for more customization and control of fused broadcasts. See the
462 [Interfaces chapter](https://docs.julialang.org/en/latest/manual/interfaces/#man-interfaces-broadcasting-1)
463 for more information.
464
465 * `find` has been renamed to `findall`. `findall`, `findfirst`, `findlast`, `findnext`
466 now take and/or return the same type of indices as `keys`/`pairs` for `AbstractArray`,
467 `AbstractDict`, `AbstractString`, `Tuple` and `NamedTuple` objects ([#24774], [#25545]).
468 In particular, this means that they use `CartesianIndex` objects for matrices
469 and higher-dimensional arrays instead of linear indices as was previously the case.
470 Use `LinearIndices(a)[findall(f, a)]` and similar constructs to compute linear indices.
471
472 * The `find*` functions, i.e. `findnext`, `findprev`, `findfirst`,
473 and `findlast`, as well as `indexin`, now return `nothing` when no match is found rather
474 than `0` or `0:-1` ([#25472], [#25662], [#26149])
475
476 * The `Base.HasShape` iterator trait has gained a type parameter `N` indicating the
477 number of dimensions, which must correspond to the length of the tuple returned by
478 `size` ([#25655]).
479
480 * `AbstractSet` objects are now considered equal by `==` and `isequal` if all of their
481 elements are equal ([#25368]). This has required changing the hashing algorithm
482 for `BitSet`.
483
484 * the default behavior of `titlecase` is changed in two ways ([#23393]):
485 + characters not starting a word are converted to lowercase;
486 a new keyword argument `strict` is added which
487 allows to get the old behavior when it's `false`.
488 + any non-letter character is considered as a word separator;
489 to get the old behavior (only "space" characters are considered as
490 word separators), use the keyword `wordsep=isspace`.
491
492 * `writedlm` in the standard library module DelimitedFiles now writes numeric values
493 using `print` rather than `print_shortest` ([#25745]).
494
495 * The `tempname` function used to create a file on Windows but not on other
496 platforms. It now never creates a file ([#9053]).
497
498 * The `fieldnames` and `propertynames` functions now return a tuple rather than
499 an array ([#25725]).
500
501 * `indexin` now returns the first rather than the last matching index ([#25998]).
502
503 * `parse(::Type, ::Char)` now uses a default base of 10, like other number parsing
504 methods, instead of 36 ([#26576]).
505
506 * `isequal` for `Ptr`s now compares element types; `==` still compares only addresses
507 ([#26858]).
508
509 * `widen` on 8- and 16-bit integer types now widens to 16- and 32-bit types, respectively. ([#28045]).
510
511 * `mv`,`cp`, `touch`, `mkdir`, `mkpath`, `chmod` and `chown` now return the path that was created/modified
512 rather than `nothing` ([#27071]).
513
514 * Regular expressions now default to UCP mode. Escape sequences such as `\w`
515 will now match based on unicode character properties, e.g. `r"\w+"` will
516 match `café` (not just `caf`). Add the `a` modifier (e.g. `r"\w+"a`) to
517 restore the previous behavior ([#27189]).
518
519 * `@sync` now waits only for *lexically* enclosed (i.e. visible directly in the source
520 text of its argument) `@async` expressions. If you need to wait for a task created by
521 a called function `f`, have `f` return the task and put `@async wait(f(...))` within
522 the `@sync` block.
523 This change makes `@schedule` redundant with `@async`, so `@schedule` has been
524 deprecated ([#27164]).
525
526 * `norm(A::AbstractMatrix, p=2)` computes no longer the operator/matrix norm but the `norm` of `A`
527 as for other iterables, i.e. as if it were a vector. Especially, `norm(A::AbstractMatrix)` is the
528 Frobenius norm. To compute the operator/matrix norm, use the new function `opnorm` ([#27401]).
529
530 * `dot(u, v)` now acts recursively. Instead of `sum(u[i]' * v[i] for i in ...)`, it computes
531 `sum(dot(u[i], v[i]) for i in ...)`, similarly to `vecdot` before ([#27401]).
532
533 * `Sys.CPU_CORES` has been renamed to `Sys.CPU_THREADS`; it still gives the number
534 of "logical cores" (including hyperthreading) rather than the number of physical
535 cores present on the CPU. Similarly, the environment variable `JULIA_CPU_CORES` is
536 deprecated in favor of `JULIA_CPU_THREADS` ([#27856]).
537
538 * `WeakKeyDict` does not convert keys on insertion anymore (#24941).
539
54012 Library improvements
54113 --------------------
542
543 * The function `thisind(s::AbstractString, i::Integer)` returns the largest valid index
544 less or equal than `i` in the string `s` or `0` if no such index exists ([#24414]).
545
546 * Support for Unicode 11 ([#28266]).
547
548 * `Char` is now a subtype of `AbstractChar`, and most of the functions that
549 take character arguments now accept any `AbstractChar` ([#26286]).
550
551 * `pathof(module)` returns the path a module was imported from ([#28310]).
552
553 * `bytes2hex` now accepts an optional `io` argument to output to a hexadecimal stream
554 without allocating a `String` first ([#27121]).
555
556 * `String(array)` now accepts an arbitrary `AbstractVector{UInt8}`. For `Vector`
557 inputs, it "steals" the memory buffer, leaving them with an empty buffer which
558 is guaranteed not to be shared with the `String` object. For other types of vectors
559 (in particular immutable vectors), a copy is made and the input is not truncated ([#26093]).
560
561 * `Irrational` is now a subtype of `AbstractIrrational` ([#24245]).
562
563 * Introduced the `empty` function, the functional pair to `empty!` which returns a new,
564 empty container ([#24390]).
565
566 * Jump to first/last history entries in the REPL via "Alt-<" and "Alt->" ([#22829]).
567
568 * REPL LaTeX-like tab completions have been simplified for several Unicode characters,
569 e.g. `𝔸` is now `\bbA` rather than `\BbbA` ([#25980]).
570
571 * The function `chop` now accepts two arguments `head` and `tail` allowing to specify
572 number of characters to remove from the head and tail of the string ([#24126]).
573
574 * `get(io, :color, false)` can now be used to query whether a stream `io` supports
575 [ANSI color codes](https://en.wikipedia.org/wiki/ANSI_escape_code) ([#25067]),
576 rather than using the undocumented `Base.have_color` global flag.
577
578 * `print_with_color` has been deprecated in favor of
579 `printstyled([io], xs...; bold=false, color=:normal)` for printing styled text ([#25522]).
580
581 * Functions `first` and `last` now accept `nchar` argument for `AbstractString`.
582 If this argument is used they return a string consisting of first/last `nchar`
583 characters from the original string ([#23960]).
584
585 * Expressions `x^-n` where `n` is an *integer literal* now correspond to `inv(x)^n`.
586 For example, `x^-1` is now essentially a synonym for `inv(x)`, and works
587 in a type-stable way even if `typeof(x) != typeof(inv(x))` ([#24240]).
588
589 * New `Iterators.reverse(itr)` for reverse-order iteration ([#24187]). Iterator
590 types `T` can implement `start` etc. for `Iterators.Reverse{T}` to support this.
591
592 * The functions `nextind` and `prevind` now accept `nchar` argument that indicates
593 the number of characters to move ([#23805]).
594
595 * The functions `strip`, `lstrip` and `rstrip` now return `SubString` ([#22496]).
596
597 * The functions `strwidth` and `charwidth` have been merged into `textwidth`([#20816]).
598
599 * The functions `base` and `digits` digits now accept a negative
600 base (like `ndigits` did) ([#21692]).
601
602 * The function `randn` now accepts complex arguments (`Complex{T <: AbstractFloat}`)
603 ([#21973]).
604
605 * `parse(Complex{T}, string)` can parse complex numbers in some common formats ([#24713]).
606
607 * The function `rand` can now pick up random elements from strings, associatives
608 and sets ([#22228], [#21960], [#18155], [#22224]).
609
610 * It's now possible to specify the characters to pick from in the `randstring` function ([#22222]).
611
612 * Allow multidimensional arrays in `shuffle` and `shuffle!` functions ([#22226]).
613
614 * Method lists are now printed as a numbered list. In addition, the source code of a
615 method can be opened in an editor by entering the corresponding number in the REPL
616 and pressing `^Q` ([#22007]).
617
618 * `getpeername` on a `TCPSocket` returns the address and port of the remote
619 endpoint of the TCP connection ([#21825]).
620
621 * `resize!` and `sizehint!` methods no longer over-reserve memory when the
622 requested array size is more than double of its current size ([#22038]).
623
624 * The `crc32c` function for CRC-32c checksums is now exported ([#22274]).
625
626 * `eye(::Type{Diagonal{T}}, m::Integer)` has been deprecated in favor of
627 `Diagonal{T}(I, m)` ([#24413]).
628
629 * The output of `versioninfo` is now controlled with keyword arguments ([#21974]).
630
631 * The function `LibGit2.set_remote_url` now always sets both the fetch and push URLs for a
632 git repo. Additionally, the argument order was changed to be consistent with the git
633 command line tool ([#22062]).
634
635 * Added `unique!` which is an inplace version of `unique` ([#20549]).
636
637 * `@test isequal(x, y)` and `@test isapprox(x, y)` now prints an evaluated expression when
638 the test fails ([#22296]).
639
640 * Uses of `Val{c}` in `Base` has been replaced with `Val{c}()`, which is now easily
641 accessible via the efficient constructor `Val(c)`. Functions are defined as
642 `f(::Val{c}) = ...` and called by `f(Val(c))`. Notable affected functions include:
643 `ntuple`, `Base.literal_pow`, `sqrtm`, `lufact`, `lufact!`, `qrfact`, `qrfact!`,
644 `cholfact`, `cholfact!`, `_broadcast!`, `reshape`, `cat` and `cat_t`.
645
646 * A new `@macroexpand1` macro for non recursive macro expansion ([#21662]).
647
648 * `Char`s can now be concatenated with `String`s and/or other `Char`s using `*` ([#22532]).
649
650 * `Diagonal`, `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` are now parameterized on
651 the type of the wrapped vectors, allowing `Diagonal`, `Bidiagonal`, `Tridiagonal` and
652 `SymTridiagonal` matrices with arbitrary `AbstractVector`s
653 ([#22718], [#22925], [#23035], [#23154]).
654
655 * Mutating versions of `randperm` and `randcycle` have been added:
656 `randperm!` and `randcycle!` ([#22723]).
657
658 * `BigFloat` random numbers can now be generated ([#22720]).
659
660 * The efficiency of random generation for MersenneTwister RNGs has been improved for
661 integers, `Float64` and ranges; as a result, given a seed, the produced stream of numbers
662 has changed ([#27560], [#25277], [#25197], [#25058], [#25047]).
663
664 * REPL Undo via Ctrl-/ and Ctrl-_
665
666 * `diagm` now accepts several diagonal index/vector `Pair`s ([#24047]).
667
668 * `isequal`, `==`, and `in` have one argument "curried" forms. For example `isequal(x)`
669 returns a function that compares its argument to `x` using `isequal` ([#26436]).
670
671 * `reinterpret` now works on any AbstractArray using the new `ReinterpretArray` type.
672 This supersedes the old behavior of reinterpret on Arrays. As a result, reinterpreting
673 arrays with different alignment requirements (removed in 0.6) is once again allowed ([#23750]).
674
675 * The `keys` of an `Associative` are now an `AbstractSet`. `Base.KeyIterator{<:Associative}`
676 has been changed to `KeySet{K, <:Associative{K}} <: AbstractSet{K}` ([#24580]).
677
678 * New function `ncodeunits(s::AbstractString)` gives the number of code units in a string.
679 The generic definition is constant time but calls `lastindex(s)` which may be inefficient.
680 Therefore custom string types may want to define direct `ncodeunits` methods.
681
682 * `reverseind(s::AbstractString, i::Integer)` now has an efficient generic fallback, so
683 custom string types do not need to provide their own efficient definitions. The generic
684 definition relies on `ncodeunits` however, so for optimal performance you may need to
685 define a custom method for that function.
686
687 * The global RNG is being re-seeded with its own seed at the beginning of each `@testset`,
688 and have its original state restored at the end ([#24445]). This is breaking for testsets
689 relying implicitly on the global RNG being in a specific state.
690
691 * `permutedims(m::AbstractMatrix)` is now short for `permutedims(m, (2,1))`, and is now a
692 more convenient way of making a "shallow transpose" of a 2D array. This is the
693 recommended approach for manipulating arrays of data, rather than the recursively
694 defined, linear-algebra function `transpose`. Similarly,
695 `permutedims(v::AbstractVector)` will create a row matrix ([#24839]).
696
697 * A new `replace(A, old=>new)` function is introduced to replace `old` by `new` in
698 collection `A`. There is also another method with a different API, and
699 a mutating variant, `replace!` ([#22324], [#25697], [#26206], [#27944]).
700
701 * Adding integers to `CartesianIndex` objects is now deprecated. Instead of
702 `i::Int + x::CartesianIndex`, use `i*one(x) + x` ([#26284]).
703
704 * `CartesianRange` changes ([#24715]):
705 - Inherits from `AbstractArray`, and linear indexing can be used to provide
706 linear-to-cartesian conversion ([#24715])
707 - It has a new constructor taking an array
708
709 * several missing set-like operations have been added ([#23528]):
710 `union`, `intersect`, `symdiff`, `setdiff` are now implemented for
711 all collections with arbitrary many arguments, as well as the
712 mutating counterparts (`union!` etc.). The performance is also
713 much better in many cases. Note that this change is slightly
714 breaking: all the non-mutating functions always return a new
715 object even if only one argument is passed. Moreover the semantics
716 of `intersect` and `symdiff` is changed for vectors:
717 + `intersect` doesn't preserve the multiplicity anymore (use `filter` for
718 the old behavior)
719 + `symdiff` has been made consistent with the corresponding methods for
720 other containers, by taking the multiplicity of the arguments into account.
721 Use `unique` to get the old behavior.
722
723 * The `linearindices` function has been deprecated in favor of the new
724 `LinearIndices` type, which additionally provides conversion from
725 cartesian indices to linear indices using the normal indexing operation.
726 ([#24715], [#26775]).
727
728 * `IdDict{K,V}` replaces `ObjectIdDict`. It has type parameters
729 like other `AbstractDict` subtypes and its constructors mirror the
730 ones of `Dict`. ([#25210])
731
732 * `IOBuffer` can take the `sizehint` keyword argument to suggest a capacity of
733 the buffer ([#25944]).
734
735 * `lstrip` and `rstrip` now accept a predicate function that defaults to `isspace`
736 ([#27309]).
737
738 * `trunc`, `floor`, `ceil`, and `round` specify `digits`, `sigdigits` and `base` using
739 keyword arguments. ([#26156], [#26670])
740
741 * `Sys.which()` provides a cross-platform method to find executable files, similar to
742 the Unix `which` command. ([#26559])
743
744 * Added an optimized method of `vecdot` for taking the Frobenius inner product
745 of sparse matrices. ([#27470])
746
747 * Added an optimized method of `kron` for taking the tensor product of two
748 `Diagonal` matrices. ([27581])
749
750 * An official API for extending `rand` is now defined ([#23964], [#25002]).
751
752 * The constructor `MersenneTwister()` is re-enabled, producing a randomly initialized RNG
753 (similar to `Random.seed!(MersenneTwister(0))`) ([#21909]).
754
755 * `BitSet` can now store any `Int` (instead of only positive ones) ([#25029]).
756
757 * The initial element `v0` in `reduce(op, v0, itr)` has been replaced with an `init`
758 optional keyword argument, as in `reduce(op, itr; init=v0)`. Similarly for `foldl`,
759 `foldr`, `mapreduce`, `mapfoldl`, `mapfoldr`, `accumulate` and `accumulate!`.
760 ([#27711], [#27859])
76114
76215 Compiler/Runtime improvements
76316 -----------------------------
76417
765 * The inlining heuristic now models the approximate runtime cost of
766 a method (using some strongly-simplifying assumptions). Functions
767 are inlined unless their estimated runtime cost substantially
768 exceeds the cost of setting up and issuing a subroutine
769 call. ([#22210], [#22732])
770
771 * Inference recursion-detection heuristics are now more precise,
772 allowing them to be triggered less often, but being more aggressive when they
773 are triggered to drive the inference computation to a solution ([#23912]).
774
775 * Inference now propagates constants inter-procedurally, and can compute
776 various constants expressions at compile-time ([#24362]).
777
778 * The LLVM SLP Vectorizer optimization pass is now enabled at the default
779 optimization level.
780
78118 Deprecated or removed
78219 ---------------------
78320
784 * The `JULIA_HOME` environment variable has been renamed to `JULIA_BINDIR` and
785 `Base.JULIA_HOME` has been moved to `Sys.BINDIR` ([#20899]).
786
787 * The keyword `immutable` is fully deprecated to `struct`, and
788 `type` is fully deprecated to `mutable struct` ([#19157], [#20418]).
789
790 * `lufact`, `schurfact`, `lqfact`, `qrfact`, `ldltfact`, `svdfact`,
791 `bkfact`, `hessfact`, `eigfact`, and `cholfact` have respectively been
792 deprecated to `lu`, `schur`, `lq`, `qr`, `ldlt`, `svd`, `bunchkaufman`,
793 `hessenberg`, `eigen`, and `cholesky` ([#26997], [#27159], [#27212]).
794
795 * `lufact!`, `schurfact!`, `lqfact!`, `qrfact!`, `ldltfact!`, `svdfact!`,
796 `bkfact!`, `hessfact!`, and `eigfact!` have respectively been deprecated to
797 `lu!`, `schur!`, `lq!`, `qr!`, `ldlt!`, `svd!`, `bunchkaufman!`,
798 `hessenberg!`, and `eigen!` ([#26997], [#27159], [#27212]).
799
800 * `eig(A[, args...])` has been deprecated in favor of `eigen(A[, args...])`.
801 Whereas the former returns a tuple of arrays, the latter returns an `Eigen` object.
802 So for a direct replacement, use `(eigen(A[, args...])...,)`. But going forward,
803 consider using the direct result of `eigen(A[, args...])` instead, either
804 destructured into its components (`vals, vecs = eigen(A[, args...])`) or
805 as an `Eigen` object (`X = eigen(A[, args...])`) ([#26997], [#27159], [#27212]).
806
807 * `eig(A::AbstractMatrix, B::AbstractMatrix)` and `eig(A::Number, B::Number)`
808 have been deprecated in favor of `eigen(A, B)`. Whereas the former each return
809 a tuple of arrays, the latter returns a `GeneralizedEigen` object. So for a direct
810 replacement, use `(eigen(A, B)...,)`. But going forward, consider using the
811 direct result of `eigen(A, B)` instead, either destructured into its components
812 (`vals, vecs = eigen(A, B)`), or as a `GeneralizedEigen` object
813 (`X = eigen(A, B)`) ([#26997], [#27159], [#27212]).
814
815 * `ordschur(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})`
816 and `ordschur(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},
817 Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})` and their respective
818 inplace versions have been deprecated.
819 Use `ordschur(schur::Schur, select::Union{Vector{Bool},BitVector})` and
820 `ordschur(gschur::GeneralizedSchur, select::Union{Vector{Bool},BitVector})` instead
821 ([#28155]).
822
823 * Indexing into multidimensional arrays with more than one index but fewer indices than there are
824 dimensions is no longer permitted when those trailing dimensions have lengths greater than 1.
825 Instead, reshape the array or add trailing indices so the dimensionality and number of indices
826 match ([#14770], [#23628]).
827
828 * The use of a positional dimension argument has largely been deprecated in favor of a
829 `dims` keyword argument. This includes the functions `sum`, `prod`, `maximum`,
830 `minimum`, `all`, `any`, `findmax`, `findmin`, `mean`, `varm`, `std`, `var`, `cov`,
831 `cor`, `median`, `mapreducedim`, `reducedim`, `sort`, `accumulate`, `accumulate!`,
832 `cumsum`, `cumsum!`, `cumprod`, `cumprod!`, `flipdim`, `dropdims`, and `cat` ([#25501], [#26660], [#27100]).
833
834 * `indices(a)` and `indices(a,d)` have been deprecated in favor of `axes(a)` and
835 `axes(a, d)` ([#25057]).
836
837 * `EnvHash` has been renamed to `EnvDict` ([#24167]).
838
839 * Uninitialized `Array` constructors of the form
840 `Array[{T,N}](shape...)` have been deprecated in favor of equivalents
841 accepting `undef` (an alias for `UndefInitializer()`) as their first argument,
842 as in `Array[{T,N}](undef, shape...)`. For example,
843 `Vector(3)` is now `Vector(undef, 3)`, `Matrix{Int}((2, 4))` is now,
844 `Matrix{Int}(undef, (2, 4))`, and `Array{Float32,3}(11, 13, 17)` is now
845 `Array{Float32,3}(undef, 11, 13, 17)` ([#24781]).
846
847 * Previously `setindex!(A, x, I...)` (and the syntax `A[I...] = x`) supported two
848 different modes of operation when supplied with a set of non-scalar indices `I`
849 (e.g., at least one index is an `AbstractArray`) depending upon the value of `x`
850 on the right hand side. If `x` is an `AbstractArray`, its _contents_ are copied
851 elementwise into the locations in `A` selected by `I` and it must have the same
852 number of elements as `I` selects locations. Otherwise, if `x` is not an
853 `AbstractArray`, then its _value_ is implicitly broadcast to all locations to
854 all locations in `A` selected by `I`. This latter behavior—implicitly broadcasting
855 "scalar"-like values across many locations—is now deprecated in favor of explicitly
856 using the broadcasted assignment syntax `A[I...] .= x` or `fill!(view(A, I...), x)`
857 ([#26347]).
858
859 * `broadcast_getindex(A, I...)` and `broadcast_setindex!(A, v, I...)` are deprecated in
860 favor of `getindex.((A,), I...)` and `setindex!.((A,), v, I...)`, respectively ([#27075]).
861
862 * `LinAlg.fillslots!` has been renamed `LinAlg.fillstored!` ([#25030]).
863
864 * `fill!(A::Diagonal, x)` and `fill!(A::AbstractTriangular, x)` have been deprecated
865 in favor of `Base.LinAlg.fillstored!(A, x)` ([#24413]).
866
867 * `eye` has been deprecated in favor of `I` and `Matrix` constructors. Please see the
868 deprecation warnings for replacement details ([#24438]).
869
870 * `zeros(D::Diagonal[, opts...])` has been deprecated ([#24654]).
871
872 * Using Bool values directly as indices is now deprecated and will be an error in the future. Convert
873 them to `Int` before indexing if you intend to access index `1` for `true` and `0` for `false`.
874
875 * `slicedim(A, d, i)` has been deprecated in favor of `copy(selectdim(A, d, i))`. The new
876 `selectdim` function now always returns a view into `A`; in many cases the `copy` is
877 not necessary. Previously, `slicedim` on a vector `V` over dimension `d=1` and scalar
878 index `i` would return the just selected element (unless `V` was a `BitVector`). This
879 has now been made consistent: `selectdim` now always returns a view into the original
880 array, with a zero-dimensional view in this specific case ([#26009]).
881
882 * `whos` has been renamed `varinfo`, and now returns a markdown table instead of printing
883 output ([#12131]).
884
885 * Uninitialized `RowVector` constructors of the form `RowVector{T}(shape...)` have been
886 deprecated in favor of equivalents accepting `undef` (an alias for
887 `UndefInitializer()`) as their first argument, as in
888 `RowVector{T}(undef, shape...)`. For example, `RowVector{Int}(3)` is now
889 `RowVector{Int}(undef, 3)`, and `RowVector{Float32}((1, 4))` is now
890 `RowVector{Float32}(undef, (1, 4))` ([#24786]).
891
892 * `writecsv(io, a; opts...)` has been deprecated in favor of
893 `writedlm(io, a, ','; opts...)` ([#23529]).
894
895 * The method `srand(rng, filename, n=4)` has been deprecated ([#21359]).
896
897 * `readcsv(io[, T::Type]; opts...)` has been deprecated in favor of
898 `readdlm(io, ','[, T]; opts...)` ([#23530]).
899
900 * `sparse(s::UniformScaling, m::Integer)` has been deprecated in favor of the
901 three-argument equivalent `sparse(s::UniformScaling, m, n)` ([#24472]).
902
903 * The `cholfact`/`cholfact!` methods that accepted an `uplo` symbol have been deprecated
904 in favor of using `Hermitian` (or `Symmetric`) views ([#22187], [#22188]).
905
906 * The `thin` keyword argument for orthogonal decomposition methods has
907 been deprecated in favor of `full`, which has the opposite meaning:
908 `thin == true` if and only if `full == false` ([#24279]).
909
910 * `isposdef(A::AbstractMatrix, UL::Symbol)` and `isposdef!(A::AbstractMatrix, UL::Symbol)`
911 have been deprecated in favor of `isposdef(Hermitian(A, UL))` and `isposdef!(Hermitian(A, UL))`
912 respectively ([#22245]).
913
914 * The `bkfact`/`bkfact!` methods that accepted `uplo` and `issymmetric` symbols have been deprecated
915 in favor of using `Hermitian` (or `Symmetric`) views ([#22605]).
916
917 * The function `current_module` is deprecated and replaced with `@__MODULE__`.
918 This caused the deprecation of some reflection methods (such as `macroexpand` and
919 `isconst`), which now require a module argument. And it caused the bugfix of other
920 default arguments to use the Main module (including `whos`, `which`) ([#22064]).
921
922 * `expand(ex)` and `expand(module, ex)` have been deprecated in favor of
923 `Meta.lower(module, ex)` ([#22064], [#24278]).
924
925 * `ones(A::AbstractArray[, opts...])` and `zeros(A::AbstractArray[, opts...])` methods
926 have been deprecated. For `zeros(A)`, consider `zero(A)`. For `ones(A)` or `zeros(A)`,
927 consider `ones(size(A))`, `zeros(size(A))`, `fill(v, size(A))` for `v` an appropriate
928 one or zero, `fill!(copy(A), {1|0})`, `fill!(similar(A), {1|0})`, or any of the preceding
929 with different element type and/or shape depending on `opts...`. Where strictly
930 necessary, consider `fill!(similar(A[, opts...]), {one(eltype(A)) | zero(eltype(A))})`.
931 For an algebraic multiplicative identity, consider `one(A)` ([#24656]).
932
933 * The `similar(dims->f(..., dims...), [T], axes...)` method to add offset array support
934 to a function `f` that would otherwise create a non-offset array has been deprecated.
935 Instead, call `f(..., axes...)` directly and, if needed, the offset array implementation
936 should add offset axis support to the function `f` directly ([#26733]).
937
938 * The functions `ones` and `zeros` used to accept any objects as dimensional arguments,
939 implicitly converting them to `Int`s. This is now deprecated; only `Integer`s or
940 `AbstractUnitRange`s are accepted as arguments. Instead, convert the arguments before
941 calling `ones` or `zeros` ([#26733]).
942
943 * The variadic `size(A, dim1, dim2, dims...)` method to return a tuple of multiple
944 dimension lengths of `A` has been deprecated ([#26862]).
945
946 * The `Operators` module is deprecated. Instead, import required operators explicitly
947 from `Base`, e.g. `import Base: +, -, *, /` ([#22251]).
948
949 * Bindings to the FFTW library have been removed from Base. The DFT framework for building FFT
950 implementations is now in AbstractFFTs.jl, the bindings to the FFTW library are in FFTW.jl,
951 and the Base signal processing functions which used FFTs are now in DSP.jl ([#21956]).
952
953 * The `corrected` positional argument to `cov` has been deprecated in favor of
954 a keyword argument with the same name ([#21709]).
955
956 * Omitting spaces around the `?` and the `:` tokens in a ternary expression has been deprecated.
957 Ternaries must now include some amount of whitespace, e.g. `x ? a : b` rather than
958 `x?a:b` ([#22523] and [#22712]).
959
960 * `?` can no longer be used as an identifier name ([#22712])
961
962 * The method `replace(s::AbstractString, pat, r, [count])` is deprecated
963 in favor of `replace(s::AbstractString, pat => r; [count])` ([#25165]).
964 Moreover, `count` cannot be negative anymore (use `typemax(Int)` instead ([#22325]).
965
966 * `read(io, type, dims)` is deprecated to `read!(io, Array{type}(undef, dims))` ([#21450]).
967
968 * `read(::IO, ::Ref)` is now a method of `read!`, since it mutates its `Ref` argument ([#21592]).
969
970 * `nb_available` is now `bytesavailable` ([#25634]).
971
972 * `skipchars(io::IO, predicate; linecomment=nothing)` is deprecated in favor of
973 `skipchars(predicate, io::IO; linecomment=nothing)` ([#25667]).
974
975 * `Bidiagonal` constructors now use a `Symbol` (`:U` or `:L`) for the upper/lower
976 argument, instead of a `Bool` or a `Char` ([#22703]).
977
978 * `Bidiagonal`, `Tridiagonal` and `SymTridiagonal` constructors that automatically
979 converted the input vectors to the same type are deprecated in favor of explicit
980 conversion ([#22925], [#23035], [#23154].
981
982 * Calling `nfields` on a type to find out how many fields its instances have is deprecated.
983 Use `fieldcount` instead. Use `nfields` only to get the number of fields in a specific object ([#22350]).
984
985 * `fieldnames` now operates only on types. To get the names of fields in an object, use
986 `fieldnames(typeof(x))` ([#22350]).
987
988 * `InexactError`, `DomainError`, and `OverflowError` now take
989 arguments. `InexactError(func::Symbol, type, -3)` now prints as
990 "ERROR: InexactError: func(type, -3)", `DomainError(val,
991 [msg])` prints as "ERROR: DomainError with val:\nmsg",
992 and `OverflowError(msg)` prints as "ERROR: OverflowError: msg".
993 ([#20005], [#22751], [#22761])
994
995 * The operating system identification functions: `is_linux`, `is_bsd`, `is_apple`, `is_unix`,
996 and `is_windows`, have been deprecated in favor of `Sys.islinux`, `Sys.isbsd`, `Sys.isapple`,
997 `Sys.isunix`, and `Sys.iswindows`, respectively ([#22182]).
998
999 * The forms of `read`, `readstring`, and `eachline` that accepted both a `Cmd` object and an
1000 input stream are deprecated. Use e.g. `read(pipeline(stdin, cmd))` instead ([#22762]).
1001
1002 * The unexported type `AbstractIOBuffer` has been renamed to `GenericIOBuffer` ([#17360] [#22796]).
1003
1004 * `IOBuffer(data::AbstractVector{UInt8}, read::Bool, write::Bool, maxsize::Integer)`,
1005 `IOBuffer(read::Bool, write::Bool)`, and `IOBuffer(maxsize::Integer)` are
1006 deprecated in favor of constructors taking keyword arguments ([#25872]).
1007
1008 * `Display` has been renamed to `AbstractDisplay` ([#24831]).
1009
1010 * Remaining vectorized methods over `SparseVector`s, particularly `floor`, `ceil`,
1011 `trunc`, `round`, and most common transcendental functions such as `exp`, `log`, and
1012 `sin` variants, have been deprecated in favor of dot-syntax ([#22961]).
1013
1014 * The method `String(io::IOBuffer)` is deprecated to `String(take!(copy(io)))` ([#21438]).
1015
1016 * The function `readstring` is deprecated in favor of `read(io, String)` ([#22793])
1017
1018 * The function `showall` is deprecated. Showing entire values is the default, unless an
1019 `IOContext` specifying `:limit=>true` is in use ([#22847]).
1020
1021 * `issubtype` has been deprecated in favor of `<:` (which used to be an alias for `issubtype`).
1022
1023 * Calling `write` on non-isbits arrays is deprecated in favor of explicit loops or
1024 `serialize` ([#6466]).
1025
1026 * The default `startup.jl` file on Windows has been removed. Now must explicitly include the
1027 full path if you need access to executables or libraries in the `Sys.BINDIR` directory, e.g.
1028 `joinpath(Sys.BINDIR, "7z.exe")` for `7z.exe` ([#21540]).
1029
1030 * `sqrtm` has been deprecated in favor of `sqrt` ([#23504]).
1031
1032 * `expm` has been deprecated in favor of `exp` ([#23233]).
1033
1034 * `logm` has been deprecated in favor of `log` ([#23505]).
1035
1036 * `full` has been deprecated in favor of more specific, better defined alternatives.
1037 On structured matrices `A`, consider instead `Matrix(A)`, `Array(A)`,
1038 `SparseMatrixCSC(A)`, or `sparse(A)`. On sparse arrays `S`, consider instead
1039 `Vector(S)`, `Matrix(S)`, or `Array(S)` as appropriate. On factorizations `F`,
1040 consider instead `Matrix(F)`, `Array(F)`, `AbstractMatrix(F)`, or `AbstractArray(F)`.
1041 On implicit orthogonal factors `Q`, consider instead `Matrix(Q)` or `Array(Q)`; for
1042 implicit orthogonal factors that can be recovered in square or truncated form,
1043 see the deprecation message for square recovery instructions. On `Symmetric`,
1044 `Hermitian`, or `AbstractTriangular` matrices `A`, consider instead `Matrix(S)`,
1045 `Array(S)`, `SparseMatrixCSC(S)`, or `sparse(S)`. On `Symmetric` matrices `A`
1046 particularly, consider instead `LinAlg.copytri!(copy(parent(A)), A.uplo)`. On
1047 `Hermitian` matrices `A` particularly, consider instead
1048 `LinAlg.copytri!(copy(parent(A)), A.uplo, true)`. On `UpperTriangular` matrices `A`
1049 particularly, consider instead `triu!(copy(parent(A)))`. On `LowerTriangular` matrices
1050 `A` particularly, consider instead `tril!(copy(parent(A)))` ([#24250]).
1051
1052 * `speye` has been deprecated in favor of `I`, `sparse`, and `SparseMatrixCSC`
1053 constructor methods ([#24356]).
1054
1055 * Calling `union` with no arguments is deprecated; construct an empty set with an appropriate
1056 element type using `Set{T}()` instead ([#23144]).
1057
1058 * Vectorized `DateTime`, `Date`, and `format` methods have been deprecated in favor of
1059 dot-syntax ([#23207]).
1060
1061 * `Base.cpad` has been removed; use an appropriate combination of `rpad` and `lpad`
1062 instead ([#23187]).
1063
1064 * `ctranspose` and `ctranspose!` have been deprecated in favor of `adjoint` and `adjoint!`,
1065 respectively ([#23235]).
1066
1067 * `filter` and `filter!` on dictionaries now pass a single `key=>value` pair to the
1068 argument function, instead of two arguments ([#17886]).
1069
1070 * `rol`, `rol!`, `ror`, and `ror!` have been deprecated in favor of specialized methods for
1071 `circshift`/`circshift!` ([#23404]).
1072
1073 * `Base.SparseArrays.SpDiagIterator` has been removed ([#23261]).
1074
1075 * The function `cfunction`, has been deprecated in favor of a macro form `@cfunction`.
1076 Most existing uses can be upgraded simply by adding a `@`.
1077 The new syntax now additionally supports allocating closures at runtime,
1078 for dealing with C APIs that don't provide a separate `void* env`-type callback
1079 argument. ([#26486])
1080
1081 * `diagm(v::AbstractVector, k::Integer=0)` has been deprecated in favor of
1082 `diagm(k => v)` ([#24047]).
1083
1084 * `diagm(x::Number)` has been deprecated in favor of `fill(x, 1, 1)` ([#24047]).
1085
1086 * `diagm(A::SparseMatrixCSC)` has been deprecated in favor of
1087 `spdiagm(sparsevec(A))` ([#23341]).
1088
1089 * `diagm(A::BitMatrix)` has been deprecated, use `diagm(0 => vec(A))` or
1090 `BitMatrix(Diagonal(vec(A)))` instead ([#23373], [#24047]).
1091
1092 * `ℯ` (written as `\mscre<TAB>` or `\euler<TAB>`) is now the only (by default) exported
1093 name for Euler's number, and the type has changed from `Irrational{:e}` to
1094 `Irrational{:ℯ}` ([#23427]).
1095
1096 * The mathematical constants `π`, `pi`, `ℯ`, `e`, `γ`, `eulergamma`, `catalan`, `φ` and
1097 `golden` have been moved from `Base` to a new module; `Base.MathConstants`.
1098 Only `π`, `pi` and `ℯ` are now exported by default from `Base` ([#23427]).
1099
1100 * `eu` (previously an alias for `ℯ`) has been deprecated in favor of `ℯ` (or `MathConstants.e`) ([#23427]).
1101
1102 * `GMP.gmp_version()`, `GMP.GMP_VERSION`, `GMP.gmp_bits_per_limb()`, and `GMP.GMP_BITS_PER_LIMB`
1103 have been renamed to `GMP.version()`, `GMP.VERSION`, `GMP.bits_per_limb()`, and `GMP.BITS_PER_LIMB`,
1104 respectively. Similarly, `MPFR.get_version()`, has been renamed to `MPFR.version()` ([#23323]). Also,
1105 `LinAlg.LAPACK.laver()` has been renamed to `LinAlg.LAPACK.version()` and now returns a `VersionNumber`.
1106
1107 * `select`, `select!`, `selectperm` and `selectperm!` have been renamed respectively to
1108 `partialsort`, `partialsort!`, `partialsortperm` and `partialsortperm!` ([#23051]).
1109
1110 * The `Range` abstract type has been renamed to `AbstractRange` ([#23570]).
1111
1112 * `map` on dictionaries previously operated on `key=>value` pairs. This behavior is deprecated,
1113 and in the future `map` will operate only on values ([#5794]).
1114
1115 * `map` on sets previously returned a `Set`, possibly changing the order or number of elements. This
1116 behavior is deprecated and in the future `map` will preserve order and number of elements ([#26980]).
1117
1118 * Previously, broadcast defaulted to treating its arguments as scalars if they were not
1119 arrays. This behavior is deprecated, and in the future `broadcast` will default to
1120 iterating over all its arguments. Wrap arguments you wish to be treated as scalars with
1121 `Ref()` or a 1-tuple. Package developers can choose to allow a non-iterable type `T` to
1122 always behave as a scalar by implementing `broadcastable(x::T) = Ref(x)` ([#26212]).
1123
1124 * Automatically broadcasted `+` and `-` for `array + scalar`, `scalar - array`, and so-on have
1125 been deprecated due to inconsistency with linear algebra. Use `.+` and `.-` for these operations
1126 instead ([#22880], [#22932]).
1127
1128 * `flipbits!(B)` is deprecated in favor of using in-place broadcast to negate each element:
1129 `B .= .!B` ([#27067]).
1130
1131 * `isleaftype` is deprecated in favor of the simpler predicates `isconcretetype` and `isdispatchtuple`.
1132 Concrete types are those that might equal `typeof(x)` for some `x`;
1133 `isleaftype` included some types for which this is not true. Those are now categorized more precisely
1134 as "dispatch tuple types" and "!has_free_typevars" (not exported). ([#17086], [#25496])
1135
1136 * `contains(eq, itr, item)` is deprecated in favor of `any` with a predicate ([#23716]).
1137
1138 * `spdiagm(x::AbstractVector)` has been deprecated in favor of `sparse(Diagonal(x))`
1139 alternatively `spdiagm(0 => x)` ([#23757]).
1140
1141 * `spdiagm(x::AbstractVector, d::Integer)` and `spdiagm(x::Tuple{<:AbstractVector}, d::Tuple{<:Integer})`
1142 have been deprecated in favor of `spdiagm(d => x)` and `spdiagm(d[1] => x[1], d[2] => x[2], ...)`
1143 respectively. The new `spdiagm` implementation now always returns a square matrix ([#23757]).
1144
1145 * `spones(A::AbstractSparseArray)` has been deprecated in favor of
1146 `LinAlg.fillstored!(copy(A), 1)` ([#25037]).
1147
1148 * Constructors for `LibGit2.UserPasswordCredentials` and `LibGit2.SSHCredentials` which take a
1149 `prompt_if_incorrect` argument are deprecated. Instead, prompting behavior is controlled using
1150 the `allow_prompt` keyword in the `LibGit2.CredentialPayload` constructor ([#23690]).
1151
1152 * `gradient` is deprecated and will be removed in the next release ([#23816]).
1153
1154 * The timing functions `tic`, `toc`, and `toq` are deprecated in favor of `@time` and `@elapsed`
1155 ([#17046]).
1156
1157 * Methods of `findfirst`, `findnext`, `findlast`, and `findprev` that accept a value to
1158 search for are deprecated in favor of passing a predicate ([#19186], [#10593]).
1159
1160 * `find` functions now operate only on booleans by default. To look for non-zeros, use
1161 `x->x!=0` or `!iszero` ([#23120]).
1162
1163 * The ability of `reinterpret` to yield `Array`s of different type than the underlying storage
1164 has been removed. The `reinterpret` function is still available, but now returns a
1165 `ReinterpretArray`. The three argument form of `reinterpret` that implicitly reshapes
1166 has been deprecated ([#23750]).
1167
1168 * `bits` has been deprecated in favor of `bitstring` ([#24281], [#24263]).
1169
1170 * `num2hex` and `hex2num` have been deprecated in favor of `reinterpret` combined with `parse`/`hex` ([#22088]).
1171
1172 * `copy!` is deprecated for `AbstractSet` and `AbstractDict`, with the intention to re-enable
1173 it with a cleaner meaning in a future version ([#24844]).
1174
1175 * `copy!` (resp. `unsafe_copy!`) is deprecated for `AbstractArray` and is renamed `copyto!`
1176 (resp. `unsafe_copyto!`); it will be re-introduced with a different meaning in a future
1177 version ([#24808]).
1178
1179 * `a:b` is deprecated for constructing a `StepRange` when `a` and `b` have physical units
1180 (Dates and Times). Use `a:s:b`, where `s = Dates.Day(1)` or `s = Dates.Second(1)`.
1181
1182 * `trues(A::AbstractArray)` and `falses(A::AbstractArray)` are deprecated in favor of
1183 `trues(size(A))` and `falses(size(A))` respectively ([#24595]).
1184
1185 * `workspace` is discontinued, check out [Revise.jl](https://github.com/timholy/Revise.jl)
1186 for an alternative workflow ([#25046]).
1187
1188 * `cumsum`, `cumprod`, `accumulate`, their mutating versions, and `diff` all now require a `dim`
1189 argument instead of defaulting to using the first dimension unless there is only
1190 one dimension ([#24684], [#25457]).
1191
1192 * The `sum_kbn` and `cumsum_kbn` functions have been moved to the
1193 [KahanSummation](https://github.com/JuliaMath/KahanSummation.jl) package ([#24869]).
1194
1195 * `isnumber` has been renamed to `isnumeric` ([#25021]).
1196
1197 * `isalpha` has been renamed to `isletter` ([#26932]).
1198
1199 * `is_assigned_char` and `normalize_string` have been renamed to `isassigned` and
1200 `normalize`, and moved to the new `Unicode` standard library module.
1201 `graphemes` has also been moved to that module ([#25021]).
1202
1203 * Sparse array functionality has moved to the `SparseArrays` standard library module ([#25249]).
1204
1205 * Linear algebra functionality, and specifically the `LinAlg` module has moved to the
1206 `LinearAlgebra` standard library module ([#25571]).
1207
1208 * `@printf` and `@sprintf` have been moved to the `Printf` standard library ([#23929],[#25056]).
1209
1210 * The `Libdl` module has moved to the `Libdl` standard library module ([#25459]).
1211
1212 * The aliases `Complex32`, `Complex64` and `Complex128` have been deprecated in favor of `ComplexF16`,
1213 `ComplexF32` and `ComplexF64` respectively ([#24647]).
1214
1215 * `Base.parentindexes` and `SharedArrays.localindexes` have been renamed to `parentindices`
1216 and `localindices`, respectively. Similarly, the `indexes` field in the `SubArray` type
1217 has been renamed to `indices` without deprecation ([#25088]).
1218
1219 * `Associative` has been deprecated in favor of `AbstractDict` ([#25012]).
1220
1221 * `Void` has been renamed back to `Nothing` with an alias `Cvoid` for use when calling C
1222 with a return type of `Cvoid` or a return or argument type of `Ptr{Cvoid}` ([#25162]).
1223
1224 * `Nullable{T}` has been deprecated and moved to the Nullables package ([#23642]). Use
1225 `Union{T, Nothing}` instead, or `Union{Some{T}, Nothing}` if `nothing` is a possible
1226 value (i.e. `Nothing <: T`). `isnull(x)` can be replaced with `x === nothing` and
1227 `unsafe_get`/`get` can be dropped or replaced with `coalesce`.
1228 `NullException` has been removed.
1229
1230 * `unshift!` and `shift!` have been renamed to `pushfirst!` and `popfirst!` ([#23902])
1231
1232 * `ipermute!` has been deprecated in favor of `invpermute!` ([#25168]).
1233
1234 * `CartesianRange` has been renamed `CartesianIndices` ([#24715]).
1235
1236 * `sub2ind` and `ind2sub` are deprecated in favor of using `CartesianIndices` and `LinearIndices` ([#24715]).
1237
1238 * `getindex(F::Factorization, s::Symbol)` (usually seen as e.g. `F[:Q]`) is deprecated
1239 in favor of dot overloading (`getproperty`) so factors should now be accessed as e.g.
1240 `F.Q` instead of `F[:Q]` ([#25184]).
1241
1242 * `search` and `rsearch` have been deprecated in favor of `findfirst`/`findnext` and
1243 `findlast`/`findprev` respectively, in combination with curried `isequal` and `in`
1244 predicates for some methods ([#24673]).
1245
1246 * `search(buf::IOBuffer, delim::UInt8)` has been deprecated in favor of either `occursin(delim, buf)`
1247 (to test containment) or `readuntil(buf, delim)` (to read data up to `delim`) ([#26600]).
1248
1249 * `ismatch(regex, str)` has been deprecated in favor of `contains(str, regex)` ([#24673]).
1250
1251 * `matchall` has been deprecated in favor of `collect(m.match for m in eachmatch(r, s))` ([#26071]).
1252
1253 * `similar(::Associative)` has been deprecated in favor of `empty(::Associative)`, and
1254 `similar(::Associative, ::Pair{K, V})` has been deprecated in favour of
1255 `empty(::Associative, K, V)` ([#24390]).
1256
1257 * `findin(a, b)` has been deprecated in favor of `findall(in(b), a)` ([#24673]).
1258
1259 * `module_name` has been deprecated in favor of a new, general `nameof` function. Similarly,
1260 the unexported `Base.function_name` and `Base.datatype_name` have been deprecated in favor
1261 of `nameof` methods ([#25622]).
1262
1263 * The module `Random.dSFMT` is renamed `Random.DSFMT` ([#25567]).
1264
1265 * `Random.RandomDevice(unlimited::Bool)` (on non-Windows systems) is deprecated in favor of
1266 `Random.RandomDevice(; unlimited=unlimited)` ([#25668]).
1267
1268 * The generic implementations of `strides(::AbstractArray)` and `stride(::AbstractArray, ::Int)`
1269 have been deprecated. Subtypes of `AbstractArray` that implement the newly introduced strided
1270 array interface should define their own `strides` method ([#25321]).
1271
1272 * `module_parent`, `Base.datatype_module`, and `Base.function_module` have been deprecated
1273 in favor of `parentmodule` ([#TODO]).
1274
1275 * `rand(t::Tuple{Vararg{Int}})` is deprecated in favor of `rand(Float64, t)` or `rand(t...)`;
1276 `rand(::Tuple)` will have another meaning in the future ([#25429], [#25278]).
1277
1278 * `randjump`, which produced an array, is deprecated in favor of the
1279 scalar version `Future.randjump` used with `accumulate` ([#27746]).
1280
1281 * The `assert` function (and `@assert` macro) have been documented that they are not guaranteed to run under various optimization levels and should therefore not be used to e.g. verify passwords.
1282
1283 * `ObjectIdDict` has been deprecated in favor of `IdDict{Any,Any}` ([#25210]).
1284
1285 * `gc` and `gc_enable` have been deprecated in favor of `GC.gc` and `GC.enable` ([#25616]).
1286
1287 * `Base.@gc_preserve` has been deprecated in favor of `GC.@preserve` ([#25616]).
1288
1289 * `print_shortest` has been discontinued, but is still available in the `Base.Grisu`
1290 submodule ([#25745]).
1291
1292 * `scale!` has been deprecated in favor of `mul!`, `lmul!`, and `rmul!` ([#25701], [#25812]).
1293
1294 * The `remove_destination` keyword argument to `cp`, `mv`, and the unexported `cptree`
1295 has been renamed to `force` ([#25979]).
1296
1297 * `contains` has been deprecated in favor of a more general `occursin` function, which
1298 takes its arguments in reverse order from `contains` ([#26283]).
1299
1300 * `Regex` objects are no longer callable. Use `occursin` instead ([#26283]).
1301
1302 * The methods of `range` based on positional arguments have been deprecated in favor of
1303 keyword arguments ([#25896]).
1304
1305 * `linspace` has been deprecated in favor of `range` with `stop` and `length` keyword
1306 arguments ([#25896]).
1307
1308 * `LinSpace` has been renamed to `LinRange` ([#25896]).
1309
1310 * `logspace` has been deprecated to its definition ([#25896]).
1311
1312 * `endof(a)` has been renamed to `lastindex(a)`, and the `end` keyword in indexing expressions now
1313 lowers to either `lastindex(a)` (in the case with only one index) or `lastindex(a, d)` (in cases
1314 where there is more than one index and `end` appears at dimension `d`) ([#23554], [#25763]).
1315
1316 * `DateTime()`, `Date()`, and `Time()` have been deprecated, instead use `DateTime(1)`, `Date(1)`
1317 and `Time(0)` respectively ([#23724]).
1318
1319 * The fallback method `^(x, p::Integer)` is deprecated. If your type relied on this definition,
1320 add a method such as `^(x::MyType, p::Integer) = Base.power_by_squaring(x, p)` ([#23332]).
1321
1322 * `DevNull`, `STDIN`, `STDOUT`, and `STDERR` have been renamed to `devnull`, `stdin`, `stdout`,
1323 and `stderr`, respectively ([#25786]).
1324
1325 * `wait` and `fetch` on `Task` now resemble the interface of `Future`.
1326
1327 * `showcompact(io, x...)` has been deprecated in favor of
1328 `show(IOContext(io, :compact => true), x...)` ([#26080]).
1329 Use `sprint(show, x..., context=:compact => true)` instead of `sprint(showcompact, x...)`.
1330
1331 * `isupper`, `islower`, `ucfirst` and `lcfirst` have been deprecated in favor of `isuppercase`,
1332 `islowercase`, `uppercasefirst` and `lowercasefirst`, respectively ([#26442]).
1333
1334 * `signif` has been deprecated in favor of the `sigdigits` keyword argument to `round`.
1335
1336 * `Base.IntSet` has been deprecated in favor of `Base.BitSet` ([#24282]).
1337
1338 * `setrounding` has been deprecated for `Float32` and `Float64`, as the behaviour was too unreliable ([#26935]).
1339
1340 * `gamma`, `lgamma`, `beta`, `lbeta` and `lfact` have been moved to
1341 [SpecialFunctions.jl](https://github.com/JuliaMath/SpecialFunctions.jl) ([#27459], [#27473]).
1342
1343 * `atan2` is now a 2-argument method of `atan` ([#27248]).
1344
1345 * The functions `eigs` and `svds` have been moved to the `Arpack.jl` package ([#27616]).
1346
1347 * `vecdot` and `vecnorm` are deprecated in favor of `dot` and `norm`, respectively ([#27401]).
1348
1349 * `clipboard` has been moved to the `InteractiveUtils` standard library package
1350 (along with other utilities mostly used at the interactive prompt, such as `edit`
1351 and `less`) ([#27635]).
1352
1353 * `ndigits(n, b, [pad])` is deprecated in favor of `ndigits(n, base=b, pad=pad)` ([#27908]).
1354
1355 * `squeeze` is deprecated in favor of `dropdims`.
1356
1357 * `srand` is deprecated in favor of the unexported `Random.seed!` ([#27726]).
1358
1359 * `realmin`/`realmax` are deprecated in favor of `floatmin`/`floatmax` ([#28302]).
1360
1361 * `sortrows`/`sortcols` have been deprecated in favor of the more general `sortslices`.
1362
1363 * `nextpow2`/`prevpow2` have been deprecated in favor of the more general `nextpow`/`prevpow` functions.
21 The old package manager (now called `OldPkg`) has been moved to a
22 separate repository at https://github.com/JuliaArchive/OldPkg.jl ([#27930])
136423
136524 Command-line option changes
136625 ---------------------------
136726
1368 * New option `--warn-overwrite={yes|no}` to control the warning for overwriting method
1369 definitions. The default is `no` ([#23002]).
1370
1371 * New option `--banner={yes,no}` allows suppressing or forcing the printing of the
1372 startup banner, overriding the default behavior (banner in REPL, no banner otherwise).
1373 The `--quiet` option implies `--banner=no` even in REPL mode but can be overridden by
1374 passing `--quiet` together with `--banner=yes` ([#23342]).
1375
1376 * The option `--precompiled` has been renamed to `--sysimage-native-code` ([#23054]).
1377
1378 * The option `--compilecache` has been renamed to `--compiled-modules` ([#23054]).
1379
138027 <!--- generated by NEWS-update.jl: -->
1381 [#330]: https://github.com/JuliaLang/julia/issues/330
1382 [#1974]: https://github.com/JuliaLang/julia/issues/1974
1383 [#4916]: https://github.com/JuliaLang/julia/issues/4916
1384 [#5148]: https://github.com/JuliaLang/julia/issues/5148
1385 [#5794]: https://github.com/JuliaLang/julia/issues/5794
1386 [#6080]: https://github.com/JuliaLang/julia/issues/6080
1387 [#6466]: https://github.com/JuliaLang/julia/issues/6466
1388 [#6614]: https://github.com/JuliaLang/julia/issues/6614
1389 [#8000]: https://github.com/JuliaLang/julia/issues/8000
1390 [#8470]: https://github.com/JuliaLang/julia/issues/8470
1391 [#9053]: https://github.com/JuliaLang/julia/issues/9053
1392 [#9292]: https://github.com/JuliaLang/julia/issues/9292
1393 [#10593]: https://github.com/JuliaLang/julia/issues/10593
1394 [#11310]: https://github.com/JuliaLang/julia/issues/11310
1395 [#12010]: https://github.com/JuliaLang/julia/issues/12010
1396 [#12131]: https://github.com/JuliaLang/julia/issues/12131
1397 [#13079]: https://github.com/JuliaLang/julia/issues/13079
1398 [#14770]: https://github.com/JuliaLang/julia/issues/14770
1399 [#15120]: https://github.com/JuliaLang/julia/issues/15120
1400 [#16356]: https://github.com/JuliaLang/julia/issues/16356
1401 [#16401]: https://github.com/JuliaLang/julia/issues/16401
1402 [#16937]: https://github.com/JuliaLang/julia/issues/16937
1403 [#17046]: https://github.com/JuliaLang/julia/issues/17046
1404 [#17086]: https://github.com/JuliaLang/julia/issues/17086
1405 [#17240]: https://github.com/JuliaLang/julia/issues/17240
1406 [#17360]: https://github.com/JuliaLang/julia/issues/17360
1407 [#17367]: https://github.com/JuliaLang/julia/issues/17367
1408 [#17886]: https://github.com/JuliaLang/julia/issues/17886
1409 [#17997]: https://github.com/JuliaLang/julia/issues/17997
1410 [#18155]: https://github.com/JuliaLang/julia/issues/18155
1411 [#18650]: https://github.com/JuliaLang/julia/issues/18650
1412 [#19089]: https://github.com/JuliaLang/julia/issues/19089
1413 [#19157]: https://github.com/JuliaLang/julia/issues/19157
1414 [#19186]: https://github.com/JuliaLang/julia/issues/19186
1415 [#19987]: https://github.com/JuliaLang/julia/issues/19987
1416 [#20005]: https://github.com/JuliaLang/julia/issues/20005
1417 [#20418]: https://github.com/JuliaLang/julia/issues/20418
1418 [#20549]: https://github.com/JuliaLang/julia/issues/20549
1419 [#20575]: https://github.com/JuliaLang/julia/issues/20575
1420 [#20816]: https://github.com/JuliaLang/julia/issues/20816
1421 [#20899]: https://github.com/JuliaLang/julia/issues/20899
1422 [#20912]: https://github.com/JuliaLang/julia/issues/20912
1423 [#20974]: https://github.com/JuliaLang/julia/issues/20974
1424 [#21359]: https://github.com/JuliaLang/julia/issues/21359
1425 [#21438]: https://github.com/JuliaLang/julia/issues/21438
1426 [#21450]: https://github.com/JuliaLang/julia/issues/21450
1427 [#21527]: https://github.com/JuliaLang/julia/issues/21527
1428 [#21540]: https://github.com/JuliaLang/julia/issues/21540
1429 [#21592]: https://github.com/JuliaLang/julia/issues/21592
1430 [#21662]: https://github.com/JuliaLang/julia/issues/21662
1431 [#21692]: https://github.com/JuliaLang/julia/issues/21692
1432 [#21697]: https://github.com/JuliaLang/julia/issues/21697
1433 [#21709]: https://github.com/JuliaLang/julia/issues/21709
1434 [#21746]: https://github.com/JuliaLang/julia/issues/21746
1435 [#21759]: https://github.com/JuliaLang/julia/issues/21759
1436 [#21774]: https://github.com/JuliaLang/julia/issues/21774
1437 [#21825]: https://github.com/JuliaLang/julia/issues/21825
1438 [#21909]: https://github.com/JuliaLang/julia/issues/21909
1439 [#21956]: https://github.com/JuliaLang/julia/issues/21956
1440 [#21960]: https://github.com/JuliaLang/julia/issues/21960
1441 [#21973]: https://github.com/JuliaLang/julia/issues/21973
1442 [#21974]: https://github.com/JuliaLang/julia/issues/21974
1443 [#22007]: https://github.com/JuliaLang/julia/issues/22007
1444 [#22038]: https://github.com/JuliaLang/julia/issues/22038
1445 [#22062]: https://github.com/JuliaLang/julia/issues/22062
1446 [#22064]: https://github.com/JuliaLang/julia/issues/22064
1447 [#22088]: https://github.com/JuliaLang/julia/issues/22088
1448 [#22089]: https://github.com/JuliaLang/julia/issues/22089
1449 [#22092]: https://github.com/JuliaLang/julia/issues/22092
1450 [#22182]: https://github.com/JuliaLang/julia/issues/22182
1451 [#22187]: https://github.com/JuliaLang/julia/issues/22187
1452 [#22188]: https://github.com/JuliaLang/julia/issues/22188
1453 [#22194]: https://github.com/JuliaLang/julia/issues/22194
1454 [#22210]: https://github.com/JuliaLang/julia/issues/22210
1455 [#22222]: https://github.com/JuliaLang/julia/issues/22222
1456 [#22224]: https://github.com/JuliaLang/julia/issues/22224
1457 [#22226]: https://github.com/JuliaLang/julia/issues/22226
1458 [#22228]: https://github.com/JuliaLang/julia/issues/22228
1459 [#22245]: https://github.com/JuliaLang/julia/issues/22245
1460 [#22251]: https://github.com/JuliaLang/julia/issues/22251
1461 [#22274]: https://github.com/JuliaLang/julia/issues/22274
1462 [#22281]: https://github.com/JuliaLang/julia/issues/22281
1463 [#22296]: https://github.com/JuliaLang/julia/issues/22296
1464 [#22314]: https://github.com/JuliaLang/julia/issues/22314
1465 [#22324]: https://github.com/JuliaLang/julia/issues/22324
1466 [#22325]: https://github.com/JuliaLang/julia/issues/22325
1467 [#22350]: https://github.com/JuliaLang/julia/issues/22350
1468 [#22390]: https://github.com/JuliaLang/julia/issues/22390
1469 [#22496]: https://github.com/JuliaLang/julia/issues/22496
1470 [#22511]: https://github.com/JuliaLang/julia/issues/22511
1471 [#22523]: https://github.com/JuliaLang/julia/issues/22523
1472 [#22532]: https://github.com/JuliaLang/julia/issues/22532
1473 [#22572]: https://github.com/JuliaLang/julia/issues/22572
1474 [#22588]: https://github.com/JuliaLang/julia/issues/22588
1475 [#22605]: https://github.com/JuliaLang/julia/issues/22605
1476 [#22666]: https://github.com/JuliaLang/julia/issues/22666
1477 [#22696]: https://github.com/JuliaLang/julia/issues/22696
1478 [#22703]: https://github.com/JuliaLang/julia/issues/22703
1479 [#22712]: https://github.com/JuliaLang/julia/issues/22712
1480 [#22718]: https://github.com/JuliaLang/julia/issues/22718
1481 [#22720]: https://github.com/JuliaLang/julia/issues/22720
1482 [#22723]: https://github.com/JuliaLang/julia/issues/22723
1483 [#22732]: https://github.com/JuliaLang/julia/issues/22732
1484 [#22742]: https://github.com/JuliaLang/julia/issues/22742
1485 [#22751]: https://github.com/JuliaLang/julia/issues/22751
1486 [#22761]: https://github.com/JuliaLang/julia/issues/22761
1487 [#22762]: https://github.com/JuliaLang/julia/issues/22762
1488 [#22789]: https://github.com/JuliaLang/julia/issues/22789
1489 [#22793]: https://github.com/JuliaLang/julia/issues/22793
1490 [#22796]: https://github.com/JuliaLang/julia/issues/22796
1491 [#22800]: https://github.com/JuliaLang/julia/issues/22800
1492 [#22801]: https://github.com/JuliaLang/julia/issues/22801
1493 [#22814]: https://github.com/JuliaLang/julia/issues/22814
1494 [#22825]: https://github.com/JuliaLang/julia/issues/22825
1495 [#22829]: https://github.com/JuliaLang/julia/issues/22829
1496 [#22847]: https://github.com/JuliaLang/julia/issues/22847
1497 [#22868]: https://github.com/JuliaLang/julia/issues/22868
1498 [#22880]: https://github.com/JuliaLang/julia/issues/22880
1499 [#22907]: https://github.com/JuliaLang/julia/issues/22907
1500 [#22925]: https://github.com/JuliaLang/julia/issues/22925
1501 [#22926]: https://github.com/JuliaLang/julia/issues/22926
1502 [#22932]: https://github.com/JuliaLang/julia/issues/22932
1503 [#22961]: https://github.com/JuliaLang/julia/issues/22961
1504 [#22984]: https://github.com/JuliaLang/julia/issues/22984
1505 [#23002]: https://github.com/JuliaLang/julia/issues/23002
1506 [#23035]: https://github.com/JuliaLang/julia/issues/23035
1507 [#23051]: https://github.com/JuliaLang/julia/issues/23051
1508 [#23054]: https://github.com/JuliaLang/julia/issues/23054
1509 [#23117]: https://github.com/JuliaLang/julia/issues/23117
1510 [#23120]: https://github.com/JuliaLang/julia/issues/23120
1511 [#23144]: https://github.com/JuliaLang/julia/issues/23144
1512 [#23154]: https://github.com/JuliaLang/julia/issues/23154
1513 [#23157]: https://github.com/JuliaLang/julia/issues/23157
1514 [#23168]: https://github.com/JuliaLang/julia/issues/23168
1515 [#23187]: https://github.com/JuliaLang/julia/issues/23187
1516 [#23207]: https://github.com/JuliaLang/julia/issues/23207
1517 [#23233]: https://github.com/JuliaLang/julia/issues/23233
1518 [#23235]: https://github.com/JuliaLang/julia/issues/23235
1519 [#23261]: https://github.com/JuliaLang/julia/issues/23261
1520 [#23323]: https://github.com/JuliaLang/julia/issues/23323
1521 [#23332]: https://github.com/JuliaLang/julia/issues/23332
1522 [#23341]: https://github.com/JuliaLang/julia/issues/23341
1523 [#23342]: https://github.com/JuliaLang/julia/issues/23342
1524 [#23354]: https://github.com/JuliaLang/julia/issues/23354
1525 [#23366]: https://github.com/JuliaLang/julia/issues/23366
1526 [#23373]: https://github.com/JuliaLang/julia/issues/23373
1527 [#23393]: https://github.com/JuliaLang/julia/issues/23393
1528 [#23404]: https://github.com/JuliaLang/julia/issues/23404
1529 [#23427]: https://github.com/JuliaLang/julia/issues/23427
1530 [#23504]: https://github.com/JuliaLang/julia/issues/23504
1531 [#23505]: https://github.com/JuliaLang/julia/issues/23505
1532 [#23519]: https://github.com/JuliaLang/julia/issues/23519
1533 [#23528]: https://github.com/JuliaLang/julia/issues/23528
1534 [#23529]: https://github.com/JuliaLang/julia/issues/23529
1535 [#23530]: https://github.com/JuliaLang/julia/issues/23530
1536 [#23554]: https://github.com/JuliaLang/julia/issues/23554
1537 [#23570]: https://github.com/JuliaLang/julia/issues/23570
1538 [#23628]: https://github.com/JuliaLang/julia/issues/23628
1539 [#23642]: https://github.com/JuliaLang/julia/issues/23642
1540 [#23665]: https://github.com/JuliaLang/julia/issues/23665
1541 [#23690]: https://github.com/JuliaLang/julia/issues/23690
1542 [#23716]: https://github.com/JuliaLang/julia/issues/23716
1543 [#23724]: https://github.com/JuliaLang/julia/issues/23724
1544 [#23750]: https://github.com/JuliaLang/julia/issues/23750
1545 [#23757]: https://github.com/JuliaLang/julia/issues/23757
1546 [#23805]: https://github.com/JuliaLang/julia/issues/23805
1547 [#23816]: https://github.com/JuliaLang/julia/issues/23816
1548 [#23885]: https://github.com/JuliaLang/julia/issues/23885
1549 [#23902]: https://github.com/JuliaLang/julia/issues/23902
1550 [#23912]: https://github.com/JuliaLang/julia/issues/23912
1551 [#23923]: https://github.com/JuliaLang/julia/issues/23923
1552 [#23929]: https://github.com/JuliaLang/julia/issues/23929
1553 [#23960]: https://github.com/JuliaLang/julia/issues/23960
1554 [#23964]: https://github.com/JuliaLang/julia/issues/23964
1555 [#24047]: https://github.com/JuliaLang/julia/issues/24047
1556 [#24126]: https://github.com/JuliaLang/julia/issues/24126
1557 [#24153]: https://github.com/JuliaLang/julia/issues/24153
1558 [#24167]: https://github.com/JuliaLang/julia/issues/24167
1559 [#24187]: https://github.com/JuliaLang/julia/issues/24187
1560 [#24221]: https://github.com/JuliaLang/julia/issues/24221
1561 [#24240]: https://github.com/JuliaLang/julia/issues/24240
1562 [#24245]: https://github.com/JuliaLang/julia/issues/24245
1563 [#24250]: https://github.com/JuliaLang/julia/issues/24250
1564 [#24263]: https://github.com/JuliaLang/julia/issues/24263
1565 [#24278]: https://github.com/JuliaLang/julia/issues/24278
1566 [#24279]: https://github.com/JuliaLang/julia/issues/24279
1567 [#24281]: https://github.com/JuliaLang/julia/issues/24281
1568 [#24282]: https://github.com/JuliaLang/julia/issues/24282
1569 [#24320]: https://github.com/JuliaLang/julia/issues/24320
1570 [#24356]: https://github.com/JuliaLang/julia/issues/24356
1571 [#24362]: https://github.com/JuliaLang/julia/issues/24362
1572 [#24390]: https://github.com/JuliaLang/julia/issues/24390
1573 [#24396]: https://github.com/JuliaLang/julia/issues/24396
1574 [#24404]: https://github.com/JuliaLang/julia/issues/24404
1575 [#24413]: https://github.com/JuliaLang/julia/issues/24413
1576 [#24414]: https://github.com/JuliaLang/julia/issues/24414
1577 [#24438]: https://github.com/JuliaLang/julia/issues/24438
1578 [#24445]: https://github.com/JuliaLang/julia/issues/24445
1579 [#24452]: https://github.com/JuliaLang/julia/issues/24452
1580 [#24472]: https://github.com/JuliaLang/julia/issues/24472
1581 [#24490]: https://github.com/JuliaLang/julia/issues/24490
1582 [#24580]: https://github.com/JuliaLang/julia/issues/24580
1583 [#24595]: https://github.com/JuliaLang/julia/issues/24595
1584 [#24605]: https://github.com/JuliaLang/julia/issues/24605
1585 [#24647]: https://github.com/JuliaLang/julia/issues/24647
1586 [#24653]: https://github.com/JuliaLang/julia/issues/24653
1587 [#24654]: https://github.com/JuliaLang/julia/issues/24654
1588 [#24656]: https://github.com/JuliaLang/julia/issues/24656
1589 [#24673]: https://github.com/JuliaLang/julia/issues/24673
1590 [#24679]: https://github.com/JuliaLang/julia/issues/24679
1591 [#24684]: https://github.com/JuliaLang/julia/issues/24684
1592 [#24713]: https://github.com/JuliaLang/julia/issues/24713
1593 [#24715]: https://github.com/JuliaLang/julia/issues/24715
1594 [#24774]: https://github.com/JuliaLang/julia/issues/24774
1595 [#24781]: https://github.com/JuliaLang/julia/issues/24781
1596 [#24785]: https://github.com/JuliaLang/julia/issues/24785
1597 [#24786]: https://github.com/JuliaLang/julia/issues/24786
1598 [#24808]: https://github.com/JuliaLang/julia/issues/24808
1599 [#24831]: https://github.com/JuliaLang/julia/issues/24831
1600 [#24839]: https://github.com/JuliaLang/julia/issues/24839
1601 [#24844]: https://github.com/JuliaLang/julia/issues/24844
1602 [#24869]: https://github.com/JuliaLang/julia/issues/24869
1603 [#25002]: https://github.com/JuliaLang/julia/issues/25002
1604 [#25012]: https://github.com/JuliaLang/julia/issues/25012
1605 [#25021]: https://github.com/JuliaLang/julia/issues/25021
1606 [#25029]: https://github.com/JuliaLang/julia/issues/25029
1607 [#25030]: https://github.com/JuliaLang/julia/issues/25030
1608 [#25037]: https://github.com/JuliaLang/julia/issues/25037
1609 [#25046]: https://github.com/JuliaLang/julia/issues/25046
1610 [#25047]: https://github.com/JuliaLang/julia/issues/25047
1611 [#25056]: https://github.com/JuliaLang/julia/issues/25056
1612 [#25057]: https://github.com/JuliaLang/julia/issues/25057
1613 [#25058]: https://github.com/JuliaLang/julia/issues/25058
1614 [#25067]: https://github.com/JuliaLang/julia/issues/25067
1615 [#25088]: https://github.com/JuliaLang/julia/issues/25088
1616 [#25162]: https://github.com/JuliaLang/julia/issues/25162
1617 [#25165]: https://github.com/JuliaLang/julia/issues/25165
1618 [#25168]: https://github.com/JuliaLang/julia/issues/25168
1619 [#25184]: https://github.com/JuliaLang/julia/issues/25184
1620 [#25197]: https://github.com/JuliaLang/julia/issues/25197
1621 [#25210]: https://github.com/JuliaLang/julia/issues/25210
1622 [#25231]: https://github.com/JuliaLang/julia/issues/25231
1623 [#25249]: https://github.com/JuliaLang/julia/issues/25249
1624 [#25277]: https://github.com/JuliaLang/julia/issues/25277
1625 [#25278]: https://github.com/JuliaLang/julia/issues/25278
1626 [#25311]: https://github.com/JuliaLang/julia/issues/25311
1627 [#25321]: https://github.com/JuliaLang/julia/issues/25321
1628 [#25368]: https://github.com/JuliaLang/julia/issues/25368
1629 [#25391]: https://github.com/JuliaLang/julia/issues/25391
1630 [#25424]: https://github.com/JuliaLang/julia/issues/25424
1631 [#25429]: https://github.com/JuliaLang/julia/issues/25429
1632 [#25457]: https://github.com/JuliaLang/julia/issues/25457
1633 [#25459]: https://github.com/JuliaLang/julia/issues/25459
1634 [#25472]: https://github.com/JuliaLang/julia/issues/25472
1635 [#25496]: https://github.com/JuliaLang/julia/issues/25496
1636 [#25501]: https://github.com/JuliaLang/julia/issues/25501
1637 [#25522]: https://github.com/JuliaLang/julia/issues/25522
1638 [#25532]: https://github.com/JuliaLang/julia/issues/25532
1639 [#25545]: https://github.com/JuliaLang/julia/issues/25545
1640 [#25564]: https://github.com/JuliaLang/julia/issues/25564
1641 [#25567]: https://github.com/JuliaLang/julia/issues/25567
1642 [#25571]: https://github.com/JuliaLang/julia/issues/25571
1643 [#25616]: https://github.com/JuliaLang/julia/issues/25616
1644 [#25622]: https://github.com/JuliaLang/julia/issues/25622
1645 [#25631]: https://github.com/JuliaLang/julia/issues/25631
1646 [#25633]: https://github.com/JuliaLang/julia/issues/25633
1647 [#25634]: https://github.com/JuliaLang/julia/issues/25634
1648 [#25654]: https://github.com/JuliaLang/julia/issues/25654
1649 [#25655]: https://github.com/JuliaLang/julia/issues/25655
1650 [#25662]: https://github.com/JuliaLang/julia/issues/25662
1651 [#25667]: https://github.com/JuliaLang/julia/issues/25667
1652 [#25668]: https://github.com/JuliaLang/julia/issues/25668
1653 [#25697]: https://github.com/JuliaLang/julia/issues/25697
1654 [#25701]: https://github.com/JuliaLang/julia/issues/25701
1655 [#25725]: https://github.com/JuliaLang/julia/issues/25725
1656 [#25745]: https://github.com/JuliaLang/julia/issues/25745
1657 [#25763]: https://github.com/JuliaLang/julia/issues/25763
1658 [#25786]: https://github.com/JuliaLang/julia/issues/25786
1659 [#25812]: https://github.com/JuliaLang/julia/issues/25812
1660 [#25815]: https://github.com/JuliaLang/julia/issues/25815
1661 [#25830]: https://github.com/JuliaLang/julia/issues/25830
1662 [#25845]: https://github.com/JuliaLang/julia/issues/25845
1663 [#25854]: https://github.com/JuliaLang/julia/issues/25854
1664 [#25858]: https://github.com/JuliaLang/julia/issues/25858
1665 [#25872]: https://github.com/JuliaLang/julia/issues/25872
1666 [#25896]: https://github.com/JuliaLang/julia/issues/25896
1667 [#25944]: https://github.com/JuliaLang/julia/issues/25944
1668 [#25947]: https://github.com/JuliaLang/julia/issues/25947
1669 [#25979]: https://github.com/JuliaLang/julia/issues/25979
1670 [#25980]: https://github.com/JuliaLang/julia/issues/25980
1671 [#25990]: https://github.com/JuliaLang/julia/issues/25990
1672 [#25998]: https://github.com/JuliaLang/julia/issues/25998
1673 [#26009]: https://github.com/JuliaLang/julia/issues/26009
1674 [#26071]: https://github.com/JuliaLang/julia/issues/26071
1675 [#26080]: https://github.com/JuliaLang/julia/issues/26080
1676 [#26093]: https://github.com/JuliaLang/julia/issues/26093
1677 [#26149]: https://github.com/JuliaLang/julia/issues/26149
1678 [#26154]: https://github.com/JuliaLang/julia/issues/26154
1679 [#26156]: https://github.com/JuliaLang/julia/issues/26156
1680 [#26161]: https://github.com/JuliaLang/julia/issues/26161
1681 [#26206]: https://github.com/JuliaLang/julia/issues/26206
1682 [#26212]: https://github.com/JuliaLang/julia/issues/26212
1683 [#26262]: https://github.com/JuliaLang/julia/issues/26262
1684 [#26283]: https://github.com/JuliaLang/julia/issues/26283
1685 [#26284]: https://github.com/JuliaLang/julia/issues/26284
1686 [#26286]: https://github.com/JuliaLang/julia/issues/26286
1687 [#26347]: https://github.com/JuliaLang/julia/issues/26347
1688 [#26436]: https://github.com/JuliaLang/julia/issues/26436
1689 [#26442]: https://github.com/JuliaLang/julia/issues/26442
1690 [#26486]: https://github.com/JuliaLang/julia/issues/26486
1691 [#26559]: https://github.com/JuliaLang/julia/issues/26559
1692 [#26576]: https://github.com/JuliaLang/julia/issues/26576
1693 [#26600]: https://github.com/JuliaLang/julia/issues/26600
1694 [#26660]: https://github.com/JuliaLang/julia/issues/26660
1695 [#26670]: https://github.com/JuliaLang/julia/issues/26670
1696 [#26733]: https://github.com/JuliaLang/julia/issues/26733
1697 [#26775]: https://github.com/JuliaLang/julia/issues/26775
1698 [#26858]: https://github.com/JuliaLang/julia/issues/26858
1699 [#26862]: https://github.com/JuliaLang/julia/issues/26862
1700 [#26932]: https://github.com/JuliaLang/julia/issues/26932
1701 [#26935]: https://github.com/JuliaLang/julia/issues/26935
1702 [#26980]: https://github.com/JuliaLang/julia/issues/26980
1703 [#26991]: https://github.com/JuliaLang/julia/issues/26991
1704 [#26997]: https://github.com/JuliaLang/julia/issues/26997
1705 [#27067]: https://github.com/JuliaLang/julia/issues/27067
1706 [#27071]: https://github.com/JuliaLang/julia/issues/27071
1707 [#27075]: https://github.com/JuliaLang/julia/issues/27075
1708 [#27100]: https://github.com/JuliaLang/julia/issues/27100
1709 [#27121]: https://github.com/JuliaLang/julia/issues/27121
1710 [#27159]: https://github.com/JuliaLang/julia/issues/27159
1711 [#27164]: https://github.com/JuliaLang/julia/issues/27164
1712 [#27189]: https://github.com/JuliaLang/julia/issues/27189
1713 [#27212]: https://github.com/JuliaLang/julia/issues/27212
1714 [#27248]: https://github.com/JuliaLang/julia/issues/27248
1715 [#27309]: https://github.com/JuliaLang/julia/issues/27309
1716 [#27401]: https://github.com/JuliaLang/julia/issues/27401
1717 [#27447]: https://github.com/JuliaLang/julia/issues/27447
1718 [#27459]: https://github.com/JuliaLang/julia/issues/27459
1719 [#27470]: https://github.com/JuliaLang/julia/issues/27470
1720 [#27473]: https://github.com/JuliaLang/julia/issues/27473
1721 [#27554]: https://github.com/JuliaLang/julia/issues/27554
1722 [#27560]: https://github.com/JuliaLang/julia/issues/27560
1723 [#27616]: https://github.com/JuliaLang/julia/issues/27616
1724 [#27635]: https://github.com/JuliaLang/julia/issues/27635
1725 [#27641]: https://github.com/JuliaLang/julia/issues/27641
1726 [#27711]: https://github.com/JuliaLang/julia/issues/27711
1727 [#27726]: https://github.com/JuliaLang/julia/issues/27726
1728 [#27746]: https://github.com/JuliaLang/julia/issues/27746
1729 [#27856]: https://github.com/JuliaLang/julia/issues/27856
1730 [#27859]: https://github.com/JuliaLang/julia/issues/27859
1731 [#27908]: https://github.com/JuliaLang/julia/issues/27908
1732 [#27944]: https://github.com/JuliaLang/julia/issues/27944
1733 [#28045]: https://github.com/JuliaLang/julia/issues/28045
1734 [#28065]: https://github.com/JuliaLang/julia/issues/28065
1735 [#28155]: https://github.com/JuliaLang/julia/issues/28155
1736 [#28266]: https://github.com/JuliaLang/julia/issues/28266
1737 [#28302]: https://github.com/JuliaLang/julia/issues/28302
1738 [#28310]: https://github.com/JuliaLang/julia/issues/28310
28 [#27930]: https://github.com/JuliaLang/julia/issues/27930
0 0.7.0
0 1.0.0
6262 - usr\bin\julia -e "Base.require(Main, :InteractiveUtils).versioninfo()"
6363 - usr\bin\julia --sysimage-native-code=no -e "true"
6464 - cd julia-* && .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl all &&
65 .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl LibGit2/online OldPkg/pkg Pkg/pkg download
65 .\bin\julia.exe --check-bounds=yes share\julia\test\runtests.jl LibGit2/online Pkg/pkg download
6666 - cd ..
6767 - usr\bin\julia usr\share\julia\test\embedding\embedding-test.jl test\embedding\embedding.exe
1313 convert(::Type{T}, a::T) where {T<:AbstractArray} = a
1414 convert(::Type{AbstractArray{T}}, a::AbstractArray) where {T} = AbstractArray{T}(a)
1515 convert(::Type{AbstractArray{T,N}}, a::AbstractArray{<:Any,N}) where {T,N} = AbstractArray{T,N}(a)
16
17 if nameof(@__MODULE__) === :Base # avoid method overwrite
18 # catch undefined constructors before the deprecation kicks in
19 # TODO: remove when deprecation is removed
20 function (::Type{T})(arg) where {T<:AbstractArray}
21 throw(MethodError(T, (arg,)))
22 end
23 end
2416
2517 """
2618 size(A::AbstractArray, [dim])
20192011 """
20202012 map(f, A) = collect(Generator(f,A))
20212013
2014 map(f, ::AbstractDict) = error("map is not defined on dictionaries")
2015 map(f, ::AbstractSet) = error("map is not defined on sets")
2016
20222017 ## 2 argument
20232018 function map!(f::F, dest::AbstractArray, A::AbstractArray, B::AbstractArray) where F
20242019 for (i, j, k) in zip(eachindex(dest), eachindex(A), eachindex(B))
348348 """
349349 function filter!(f, d::AbstractDict)
350350 badkeys = Vector{keytype(d)}()
351 try
352 for pair in d
353 # don't delete!(d, k) here, since dictionary types
354 # may not support mutation during iteration
355 f(pair) || push!(badkeys, pair.first)
356 end
357 catch e
358 return filter!_dict_deprecation(e, f, d)
351 for pair in d
352 # don't delete!(d, k) here, since dictionary types
353 # may not support mutation during iteration
354 f(pair) || push!(badkeys, pair.first)
359355 end
360356 for k in badkeys
361357 delete!(d, k)
364360 end
365361
366362 function filter_in_one_pass!(f, d::AbstractDict)
367 try
368 for pair in d
369 if !f(pair)
370 delete!(d, pair.first)
371 end
372 end
373 catch e
374 return filter!_dict_deprecation(e, f, d)
375 end
376 return d
377 end
378
379 function filter!_dict_deprecation(e, f, d::AbstractDict)
380 if isa(e, MethodError) && e.f === f
381 depwarn("In `filter!(f, dict)`, `f` is now passed a single pair instead of two arguments.", :filter!)
382 badkeys = Vector{keytype(d)}()
383 for (k,v) in d
384 # don't delete!(d, k) here, since dictionary types
385 # may not support mutation during iteration
386 f(k, v) || push!(badkeys, k)
387 end
388 for k in badkeys
389 delete!(d, k)
390 end
391 else
392 rethrow(e)
363 for pair in d
364 if !f(pair)
365 delete!(d, pair.first)
366 end
393367 end
394368 return d
395369 end
579553 try
580554 dict_with_eltype((K, V) -> IdDict{K, V}, kv, eltype(kv))
581555 catch e
582 if !applicable(start, kv) || !all(x->isa(x,Union{Tuple,Pair}),kv)
556 if !applicable(iterate, kv) || !all(x->isa(x,Union{Tuple,Pair}),kv)
583557 throw(ArgumentError(
584558 "IdDict(kv): kv needs to be an iterator of tuples or pairs"))
585559 else
8585 4 9 15
8686 ```
8787 """
88 function cumsum(A::AbstractArray{T}; dims::Union{Nothing,Integer}=nothing) where T
89 if dims === nothing
90 depwarn("`cumsum(A::AbstractArray)` is deprecated, use `cumsum(A, dims=1)` instead.", :cumsum)
91 dims = 1
92 end
88 function cumsum(A::AbstractArray{T}; dims::Integer) where T
9389 out = similar(A, promote_op(add_sum, T, T))
9490 cumsum!(out, A, dims=dims)
9591 end
161157 4 20 120
162158 ```
163159 """
164 function cumprod(A::AbstractArray; dims::Union{Nothing,Integer}=nothing)
165 if dims === nothing
166 depwarn("`cumprod(A::AbstractArray)` is deprecated, use `cumprod(A, dims=1)` instead.", :cumprod)
167 dims = 1
168 end
160 function cumprod(A::AbstractArray; dims::Integer)
169161 return accumulate(mul_prod, A, dims=dims)
170162 end
171163
16051605 function findnext(A, start)
16061606 l = last(keys(A))
16071607 i = start
1608 warned = false
16091608 while i <= l
1610 a = A[i]
1611 if !warned && !(a isa Bool)
1612 depwarn("In the future `findnext` will only work on boolean collections. Use `findnext(x->x!=0, A, start)` instead.", :findnext)
1613 warned = true
1614 end
1615 if a != 0
1609 if A[i]
16161610 return i
16171611 end
16181612 i = nextind(A, i)
16541648 ```
16551649 """
16561650 function findfirst(A)
1657 warned = false
16581651 for (i, a) in pairs(A)
1659 if !warned && !(a isa Bool)
1660 depwarn("In the future `findfirst` will only work on boolean collections. Use `findfirst(x->x!=0, A)` instead.", :findfirst)
1661 warned = true
1662 end
1663 if a != 0
1652 if a
16641653 return i
16651654 end
16661655 end
16941683 CartesianIndex(1, 1)
16951684 ```
16961685 """
1697 @inline findnext(testf::Function, A, start) = findnext_internal(testf, A, start)
1698
1699 function findnext_internal(testf::Function, A, start)
1686 function findnext(testf::Function, A, start)
17001687 l = last(keys(A))
17011688 i = start
17021689 while i <= l
17881775 """
17891776 function findprev(A, start)
17901777 i = start
1791 warned = false
17921778 while i >= first(keys(A))
1793 a = A[i]
1794 if !warned && !(a isa Bool)
1795 depwarn("In the future `findprev` will only work on boolean collections. Use `findprev(x->x!=0, A, start)` instead.", :findprev)
1796 warned = true
1797 end
1798 a != 0 && return i
1779 A[i] && return i
17991780 i = prevind(A, i)
18001781 end
18011782 return nothing
18361817 ```
18371818 """
18381819 function findlast(A)
1839 warned = false
18401820 for (i, a) in Iterators.reverse(pairs(A))
1841 if !warned && !(a isa Bool)
1842 depwarn("In the future `findlast` will only work on boolean collections. Use `findlast(x->x!=0, A)` instead.", :findlast)
1843 warned = true
1844 end
1845 if a != 0
1821 if a
18461822 return i
18471823 end
18481824 end
18841860 CartesianIndex(2, 1)
18851861 ```
18861862 """
1887 @inline findprev(testf::Function, A, start) = findprev_internal(testf, A, start)
1888
1889 function findprev_internal(testf::Function, A, start)
1863 function findprev(testf::Function, A, start)
18901864 i = start
18911865 while i >= first(keys(A))
18921866 testf(A[i]) && return i
20302004 ```
20312005 """
20322006 function findall(A)
2033 if !(eltype(A) === Bool) && !all(x -> x isa Bool, A)
2034 depwarn("In the future `findall(A)` will only work on boolean collections. Use `findall(x->x!=0, A)` instead.", :find)
2035 end
2036 collect(first(p) for p in pairs(A) if last(p) != 0)
2007 collect(first(p) for p in pairs(A) if last(p))
20372008 end
20382009 # Allocating result upfront is faster (possible only when collection can be iterated twice)
20392010 function findall(A::AbstractArray{Bool})
141141
142142 export
143143 # key types
144 Any, DataType, Vararg, ANY, NTuple,
144 Any, DataType, Vararg, NTuple,
145145 Tuple, Type, UnionAll, TypeVar, Union, Nothing, Cvoid,
146146 AbstractArray, DenseArray, NamedTuple,
147147 # special objects
601601 ```
602602 """
603603 broadcastable(x::Union{Symbol,AbstractString,Function,UndefInitializer,Nothing,RoundingMode,Missing,Val}) = Ref(x)
604 broadcastable(x::Ptr) = Ref{Ptr}(x) # Cannot use Ref(::Ptr) until ambiguous deprecation goes through
604 broadcastable(x::Ptr) = Ref(x)
605605 broadcastable(::Type{T}) where {T} = Ref{Type{T}}(T)
606606 broadcastable(x::Union{AbstractArray,Number,Ref,Tuple,Broadcasted}) = x
607 # In the future, default to collecting arguments. TODO: uncomment once deprecations are removed
608 # broadcastable(x) = collect(x)
609 # broadcastable(::Union{AbstractDict, NamedTuple}) = error("intentionally unimplemented to allow development in 1.x")
607 # Default to collecting iterables — which will error for non-iterables
608 broadcastable(x) = collect(x)
609 broadcastable(::Union{AbstractDict, NamedTuple}) = throw(ArgumentError("broadcasting over dictionaries and `NamedTuple`s is reserved"))
610610
611611 ## Computation of inferred result type, for empty and concretely inferred cases only
612612 _broadcast_getindex_eltype(bc::Broadcasted) = Base._return_type(bc.f, eltypes(bc.args))
10781078 Expr(x.head, x.args[1], dotargs[2])
10791079 else
10801080 if x.head == :&& || x.head == :||
1081 Base.depwarn("""
1082 using $(x.head) expressions in @. is deprecated; in the future it will
1083 become elementwise. Break the expression into smaller parts instead.""", nothing)
1081 error("""
1082 Using `&&` and `||` is disallowed in `@.` expressions.
1083 Use `&` or `|` for elementwise logical operations.
1084 """)
10841085 end
10851086 head = string(x.head)
10861087 if last(head) == '=' && first(head) != '.'
8989 end
9090
9191 function display_error(io::IO, er, bt)
92 if !isempty(bt)
93 st = stacktrace(bt)
94 if !isempty(st)
95 io = redirect(io, log_error_to, st[1])
96 end
97 end
9892 printstyled(io, "ERROR: "; bold=true, color=Base.error_color())
9993 # remove REPL-related frames from interactive printing
10094 eval_ind = findlast(addr->ip_matches_func(addr, :eval), bt)
161155 ccall(:jl_parse_input_line, Any, (Ptr{UInt8}, Csize_t, Ptr{UInt8}, Csize_t),
162156 s, sizeof(s), filename, sizeof(filename))
163157 end
164 end
165 if ex isa Symbol && all(isequal('_'), string(ex))
166 # remove with 0.7 deprecation
167 Meta.lower(Main, ex) # to get possible warning about using _ as an rvalue
168158 end
169159 return ex
170160 end
396386 baremodule MainInclude
397387 include(fname::AbstractString) = Main.Base.include(Main, fname)
398388 eval(x) = Core.eval(Main, x)
399 Main.Base.@deprecate eval(m, x) Core.eval(m, x)
400389 end
401390
402391 """
44 #############
55
66 const CoreNumType = Union{Int32, Int64, Float32, Float64}
7
8 const DEPRECATED_SYM = Symbol("deprecated.jl")
97
108 const _REF_NAME = Ref.body.name
119
198196 end
199197
200198 function abstract_call_method(method::Method, @nospecialize(sig), sparams::SimpleVector, sv::InferenceState)
201 # TODO: remove with 0.7 deprecations
202 if method.file === DEPRECATED_SYM && method.sig == (Tuple{Type{T},Any} where T)
203 return Any, false, nothing
204 end
205199 if method.name === :depwarn && isdefined(Main, :Base) && method.module === Main.Base
206200 return Any, false, nothing
207201 end
310304 # if sig changed, may need to recompute the sparams environment
311305 if isa(method.sig, UnionAll) && isempty(sparams)
312306 recomputed = ccall(:jl_type_intersection_with_env, Any, (Any, Any), sig, method.sig)::SimpleVector
313 sig = recomputed[1]
314 if !isa(unwrap_unionall(sig), DataType) # probably Union{}
315 return Any, false, nothing
316 end
307 #@assert recomputed[1] !== Bottom
308 # We must not use `sig` here, since that may re-introduce structural complexity that
309 # our limiting heuristic sought to eliminate. The alternative would be to not increment depth over covariant contexts,
310 # but we prefer to permit inference of tuple-destructuring, so we don't do that right now
311 # For example, with a signature such as `Tuple{T, Ref{T}} where {T <: S}`
312 # we might want to limit this to `Tuple{S, Ref}`, while type-intersection can instead give us back the original type
313 # (which moves `S` back up to a lower comparison depth)
314 # Optionally, we could try to drive this to a fixed point, but I think this is getting too complex,
315 # and this would only cause more questions and more problems
316 # (the following is only an example, most of the statements are probable in the wrong order):
317 # newsig = sig
318 # seen = IdSet()
319 # while !(newsig in seen)
320 # push!(seen, newsig)
321 # lsig = length((unwrap_unionall(sig)::DataType).parameters)
322 # newsig = limit_type_size(newsig, sig, sv.linfo.specTypes, sv.params.TUPLE_COMPLEXITY_LIMIT_DEPTH, lsig)
323 # recomputed = ccall(:jl_type_intersection_with_env, Any, (Any, Any), newsig, method.sig)::SimpleVector
324 # newsig = recomputed[2]
325 # end
326 # sig = ?
317327 sparams = recomputed[2]::SimpleVector
318328 end
319329
999999 # Check for a number of functions known to be pure
10001000 function ispuretopfunction(@nospecialize(f))
10011001 return istopfunction(f, :typejoin) ||
1002 istopfunction(f, :isbits) ||
10021003 istopfunction(f, :isbitstype) ||
10031004 istopfunction(f, :promote_type)
10041005 end
10211022 val = etype.val
10221023 is_inlineable_constant(val) || return nothing
10231024 if ispuretopfunction(f) ||
1024 (istopfunction(f, :isbits) && length(atypes)>1 &&
1025 typeintersect(widenconst(atypes[2]),Type) === Bottom) ||
10261025 (isa(f, IntrinsicFunction) ? is_pure_intrinsic_optim(f) :
1027 contains_is(_PURE_BUILTINS, f))
1026 contains_is(_PURE_BUILTINS, f))
10281027 return quoted(val)
10291028 elseif contains_is(_PURE_OR_ERROR_BUILTINS, f)
10301029 if _builtin_nothrow(f, atypes[2:end], etype)
253253 end
254254 a1 = unwrap_unionall(a1)
255255 if isa(a1, DataType) && !a1.abstract
256 if a1 <: Array # TODO update when deprecation is removed
257 elseif a1 === Module
256 if a1 === Module
258257 length(args) == 2 || return Bottom
259258 sym = args[2]
260259 Symbol <: widenconst(sym) || return Bottom
288287 end
289288 Bool
290289 end
291 # TODO change INT_INF to 2 when deprecation is removed
292 add_tfunc(isdefined, 1, INT_INF, isdefined_tfunc, 1)
290
291 add_tfunc(isdefined, 1, 2, isdefined_tfunc, 1)
293292 function sizeof_nothrow(@nospecialize(x))
294293 if isa(x, Const)
295294 if !isa(x, Type)
328327 return Int
329328 end
330329 add_tfunc(Core.sizeof, 1, 1, sizeof_tfunc, 0)
331 old_nfields(@nospecialize x) = length((isa(x, DataType) ? x : typeof(x)).types)
332330 add_tfunc(nfields, 1, 1,
333331 function (@nospecialize(x),)
334 isa(x, Const) && return Const(old_nfields(x.val))
335 isa(x, Conditional) && return Const(old_nfields(Bool))
336 if isType(x)
337 # TODO: remove with deprecation in builtins.c for nfields(::Type)
338 p = x.parameters[1]
339 issingletontype(p) && return Const(old_nfields(p))
340 elseif isa(x, DataType) && !x.abstract && !(x.name === Tuple.name && isvatuple(x)) && x !== DataType
332 isa(x, Const) && return Const(nfields(x.val))
333 isa(x, Conditional) && return Const(0)
334 if isa(x, DataType) && !x.abstract && !(x.name === Tuple.name && isvatuple(x))
341335 if !(x.name === _NAMEDTUPLE_NAME && !isconcretetype(x))
342336 return Const(length(x.types))
343337 end
2828 # try to find `type` somewhere in `comparison` type
2929 # at a minimum nesting depth of `mindepth`
3030 function is_derived_type(@nospecialize(t), @nospecialize(c), mindepth::Int)
31 if mindepth > 0
32 mindepth -= 1
33 end
3431 if t === c
35 return mindepth == 0
32 return mindepth <= 1
3633 end
3734 if isa(c, Union)
3835 # see if it is one of the elements of the union
39 return is_derived_type(t, c.a, mindepth + 1) || is_derived_type(t, c.b, mindepth + 1)
36 return is_derived_type(t, c.a, mindepth) || is_derived_type(t, c.b, mindepth)
4037 elseif isa(c, UnionAll)
4138 # see if it is derived from the body
42 return is_derived_type(t, c.var.ub, mindepth) || is_derived_type(t, c.body, mindepth + 1)
39 # also handle the var here, since this construct bounds the mindepth to the smallest possible value
40 return is_derived_type(t, c.var.ub, mindepth) || is_derived_type(t, c.body, mindepth)
4341 elseif isa(c, DataType)
42 if mindepth > 0
43 mindepth -= 1
44 end
4445 if isa(t, DataType)
4546 # see if it is one of the supertypes of a parameter
4647 super = supertype(c)
9192 elseif is_derived_type_from_any(unwrap_unionall(t), sources, depth)
9293 return t # t isn't something new
9394 end
94 if isa(t, TypeVar)
95 if isa(c, TypeVar)
96 if t.ub === c.ub && t.lb === c.lb
97 return t
98 end
99 end
95 # peel off (and ignore) wrappers - they contribute no useful information, so we don't need to consider their size
96 # first attempt to turn `c` into a type that contributes meaningful information
97 # by peeling off meaningless non-matching wrappers of comparison one at a time
98 # then unwrap `t`
99 if isa(c, TypeVar)
100 if isa(t, TypeVar) && t.ub === c.ub && (t.lb === Union{} || t.lb === c.lb)
101 return t # it's ok to change the name, or widen `lb` to Union{}, so we can handle this immediately here
102 end
103 return _limit_type_size(t, c.ub, sources, depth, allowed_tuplelen)
104 end
105 if isa(c, UnionAll)
106 return _limit_type_size(t, c.body, sources, depth, allowed_tuplelen)
107 end
108 if isa(t, UnionAll)
109 tbody = _limit_type_size(t.body, c, sources, depth, allowed_tuplelen)
110 tbody === t.body && return t
111 return UnionAll(t.var, tbody)
112 elseif isa(t, TypeVar)
113 # don't have a matching TypeVar in comparison, so we keep just the upper bound
114 return _limit_type_size(t.ub, c, sources, depth, allowed_tuplelen)
100115 elseif isa(t, Union)
101116 if isa(c, Union)
102117 a = _limit_type_size(t.a, c.a, sources, depth, allowed_tuplelen)
103118 b = _limit_type_size(t.b, c.b, sources, depth, allowed_tuplelen)
104119 return Union{a, b}
105120 end
106 elseif isa(t, UnionAll)
107 if isa(c, UnionAll)
108 tv = t.var
109 cv = c.var
110 if tv.ub === cv.ub
111 if tv.lb === cv.lb
112 return UnionAll(tv, _limit_type_size(t.body, c.body, sources, depth + 1, allowed_tuplelen))
113 end
114 ub = tv.ub
115 else
116 ub = _limit_type_size(tv.ub, cv.ub, sources, depth + 1, 0)
117 end
118 if tv.lb === cv.lb
119 lb = tv.lb
120 else
121 # note: lower bounds need to be widened by making them lower
122 lb = Bottom
123 end
124 v2 = TypeVar(tv.name, lb, ub)
125 return UnionAll(v2, _limit_type_size(t{v2}, c{v2}, sources, depth, allowed_tuplelen))
126 end
127 tbody = _limit_type_size(t.body, c, sources, depth, allowed_tuplelen)
128 tbody === t.body && return t
129 return UnionAll(t.var, tbody)
130 elseif isa(c, UnionAll)
131 # peel off non-matching wrapper of comparison
132 return _limit_type_size(t, c.body, sources, depth, allowed_tuplelen)
133121 elseif isa(t, DataType)
134122 if isa(c, DataType)
135123 tP = t.parameters
4747 function valid_tparam(@nospecialize(x))
4848 if isa(x, Tuple)
4949 for t in x
50 isa(t, Symbol) || isbitstype(typeof(t)) || return false
50 isa(t, Symbol) || isbits(t) || return false
5151 end
5252 return true
5353 end
54 return isa(x, Symbol) || isbitstype(typeof(x))
54 return isa(x, Symbol) || isbits(x)
5555 end
5656
5757 # return an upper-bound on type `a` with type `b` removed
33 println(xs...) = println(stdout::IO, xs...)
44 println(io::IO) = print(io, '\n')
55
6 struct DevNullStream <: IO end
7 const devnull = DevNullStream()
8 isreadable(::DevNullStream) = false
9 iswritable(::DevNullStream) = true
10 isopen(::DevNullStream) = true
11 read(::DevNullStream, ::Type{UInt8}) = throw(EOFError())
12 write(::DevNullStream, ::UInt8) = 1
13 unsafe_write(::DevNullStream, ::Ptr{UInt8}, n::UInt)::Int = n
14 close(::DevNullStream) = nothing
15 flush(::DevNullStream) = nothing
16 wait_connected(::DevNullStream) = nothing
17 wait_readnb(::DevNullStream) = wait()
18 wait_readbyte(::DevNullStream) = wait()
19 wait_close(::DevNullStream) = wait()
20 eof(::DevNullStream) = true
6 struct DevNull <: IO end
7 const devnull = DevNull()
8 isreadable(::DevNull) = false
9 iswritable(::DevNull) = true
10 isopen(::DevNull) = true
11 read(::DevNull, ::Type{UInt8}) = throw(EOFError())
12 write(::DevNull, ::UInt8) = 1
13 unsafe_write(::DevNull, ::Ptr{UInt8}, n::UInt)::Int = n
14 close(::DevNull) = nothing
15 flush(::DevNull) = nothing
16 wait_connected(::DevNull) = nothing
17 wait_readnb(::DevNull) = wait()
18 wait_readbyte(::DevNull) = wait()
19 wait_close(::DevNull) = wait()
20 eof(::DevNull) = true
2121
2222 let CoreIO = Union{Core.CoreSTDOUT, Core.CoreSTDERR}
2323 global write, unsafe_write
8686 for i = 1:(length(x)::Int)
8787 if ccall(:jl_array_isassigned, Cint, (Any, Csize_t), x, i-1) != 0
8888 xi = ccall(:jl_arrayref, Any, (Any, Csize_t), x, i-1)
89 if !isbitstype(typeof(xi))
89 if !isbits(xi)
9090 xi = deepcopy_internal(xi, stackdict)
9191 end
9292 ccall(:jl_arrayset, Cvoid, (Any, Any, Csize_t), dest, xi, i-1)
151151 Expr(:call, :deprecate, __module__, Expr(:quote, old), 2))
152152 end
153153
154
155 # BEGIN 0.6 deprecations
156
157 # removing the .op deprecations breaks a few things. TODO: fix
158 # deprecations for uses of old dot operators (.* etc) as objects, rather than
159 # just calling them infix.
160 for op in (:(!=), :≠, :+, :-, :*, :/, :÷, :%, :<, :(<=), :≤, :(==), :>, :>=, :≥, :\, :^, ://, :>>, :<<)
161 dotop = Symbol('.', op)
162 # define as const dotop = (a,b) -> ...
163 # to work around syntax deprecation for dotop(a,b) = ...
164 @eval const $dotop = (a,b) -> begin
165 depwarn(string($(string(dotop)), " is no longer a function object, use `broadcast(",$op,", ...)` instead."),
166 $(QuoteNode(dotop)))
167 broadcast($op, a, b)
168 end
169 @eval export $dotop
170 end
171
172 # Deprecate promote_eltype_op (#19814, #19937)
173 _promote_eltype_op(::Any) = Any
174 _promote_eltype_op(op, A) = (@_inline_meta; promote_op(op, eltype(A)))
175 _promote_eltype_op(op, A, B) = (@_inline_meta; promote_op(op, eltype(A), eltype(B)))
176 _promote_eltype_op(op, A, B, C, D...) = (@_inline_meta; _promote_eltype_op(op, eltype(A), _promote_eltype_op(op, B, C, D...)))
177 @inline function promote_eltype_op(args...)
178 depwarn("""
179 `promote_eltype_op` is deprecated and should not be used.
180 See https://github.com/JuliaLang/julia/issues/19669.""",
181 :promote_eltype_op)
182 _promote_eltype_op(args...)
183 end
184
185 # END 0.6 deprecations
186
187154 # BEGIN 0.7 deprecations
188155
189 # TODO: remove warning for using `_` in parse_input_line in base/client.jl
190
191 @deprecate issubtype (<:)
192
193 @deprecate union() Set()
194
195 # 12807
196 start(::Union{Process, ProcessChain}) = 1
197 done(::Union{Process, ProcessChain}, i::Int) = (i == 3)
198 next(p::Union{Process, ProcessChain}, i::Int) = (getindex(p, i), i + 1)
199 @noinline function getindex(p::Union{Process, ProcessChain}, i::Int)
200 depwarn("`open(cmd)` now returns only a Process<:IO object.", :getindex)
201 return i == 1 ? getfield(p, p.openstream) : p
202 end
203
204 # also remove all support machinery in src for current_module when removing this deprecation
205 # and make Base.include an error
206 _current_module() = ccall(:jl_get_current_module, Ref{Module}, ())
207 @noinline function binding_module(s::Symbol)
208 depwarn("`binding_module(symbol)` is deprecated, use `binding_module(module, symbol)` instead.", :binding_module)
209 return binding_module(_current_module(), s)
210 end
211 export expand
212 @noinline function expand(@nospecialize(x))
213 depwarn("`expand(x)` is deprecated, use `Meta.lower(module, x)` instead.", :expand)
214 return Meta.lower(_current_module(), x)
215 end
216 @noinline function macroexpand(@nospecialize(x))
217 depwarn("`macroexpand(x)` is deprecated, use `macroexpand(module, x)` instead.", :macroexpand)
218 return macroexpand(_current_module(), x)
219 end
220 @noinline function isconst(s::Symbol)
221 depwarn("`isconst(symbol)` is deprecated, use `isconst(module, symbol)` instead.", :isconst)
222 return isconst(_current_module(), s)
223 end
224 @noinline function include_string(txt::AbstractString, fname::AbstractString)
225 depwarn("`include_string(string, fname)` is deprecated, use `include_string(module, string, fname)` instead.", :include_string)
226 return include_string(_current_module(), txt, fname)
227 end
228 @noinline function include_string(txt::AbstractString)
229 depwarn("`include_string(string)` is deprecated, use `include_string(module, string)` instead.", :include_string)
230 return include_string(_current_module(), txt, "string")
231 end
232
233 """
234 current_module() -> Module
235
236 Get the *dynamically* current `Module`, which is the `Module` code is currently being read
237 from. In general, this is not the same as the module containing the call to this function.
238
239 DEPRECATED: use `@__MODULE__` instead
240 """
241 @noinline function current_module()
242 depwarn("`current_module()` is deprecated, use `@__MODULE__` instead.", :current_module)
243 return _current_module()
244 end
245 export current_module
246
247 @deprecate_binding colon (:)
248
249 module Operators
250 for op in [:!, :(!=), :(!==), :%, :&, :*, :+, :-, :/, ://, :<, :<:, :<<, :(<=),
251 :<|, :(==), :(===), :>, :>:, :(>=), :>>, :>>>, :\, :^,
252 :adjoint, :getindex, :hcat, :hvcat, :setindex!, :transpose, :vcat,
253 :xor, :|, :|>, :~, :×, :÷, :∈, :∉, :∋, :∌, :∘, :√, :∛, :∩, :∪, :≠, :≤,
254 :≥, :⊆, :⊈, :⊊, :⊻, :⋅]
255 if isdefined(Base, op)
256 @eval Base.@deprecate_binding $op Base.$op
257 end
258 end
259 Base.@deprecate_binding colon (:)
260 end
261 export Operators
262
263 # PR #21956
264 # This mimics the structure as it was defined in Base to avoid directly breaking code
265 # that assumes this structure
266 module DFT
267 for f in [:bfft, :bfft!, :brfft, :dct, :dct!, :fft, :fft!, :fftshift, :idct, :idct!,
268 :ifft, :ifft!, :ifftshift, :irfft, :plan_bfft, :plan_bfft!, :plan_brfft,
269 :plan_dct, :plan_dct!, :plan_fft, :plan_fft!, :plan_idct, :plan_idct!,
270 :plan_ifft, :plan_ifft!, :plan_irfft, :plan_rfft, :rfft]
271 pkg = endswith(String(f), "shift") ? "AbstractFFTs" : "FFTW"
272 @eval Base.@deprecate_moved $f $pkg
273 end
274 module FFTW
275 for f in [:r2r, :r2r!, :plan_r2r, :plan_r2r!]
276 @eval Base.@deprecate_moved $f "FFTW"
277 end
278 end
279 Base.deprecate(DFT, :FFTW, 2)
280 export FFTW
281 end
282 using .DFT
283 for f in filter(s -> isexported(DFT, s), names(DFT, all = true))
284 @eval export $f
285 end
286 module DSP
287 for f in [:conv, :conv2, :deconv, :filt, :filt!, :xcorr]
288 @eval Base.@deprecate_moved $f "DSP"
289 end
290 end
291 deprecate(Base, :DSP, 2)
292 using .DSP
293 export conv, conv2, deconv, filt, filt!, xcorr
294
295 # PR #22325
296 # TODO: when this replace is removed from deprecated.jl:
297 # 1) rename the function replace_new from strings/util.jl to replace
298 # 2) update the replace(s::AbstractString, pat, f) method, below replace_new
299 # (see instructions there)
300 function replace(s::AbstractString, pat, f, n::Integer)
301 if n <= 0
302 depwarn(string("`replace(s, pat, r, count)` with `count <= 0` is deprecated, use ",
303 "`replace(s, pat=>r, count=typemax(Int))` or `replace(s, pat=>r)` instead."),
304 :replace)
305 replace(s, pat=>f)
306 else
307 depwarn(string("`replace(s, pat, r, count)` is deprecated, use ",
308 "`replace(s, pat=>r, count=count)`"),
309 :replace)
310 replace(String(s), pat=>f, count=n)
311 end
312 end
313
314 @deprecate replace(s::AbstractString, pat, f) replace(s, pat=>f)
315
316 # PR #22475
317 @deprecate ntuple(f, ::Type{Val{N}}) where {N} ntuple(f, Val(N))
318 @deprecate fill_to_length(t, val, ::Type{Val{N}}) where {N} fill_to_length(t, val, Val(N)) false
319 @deprecate literal_pow(a, b, ::Type{Val{N}}) where {N} literal_pow(a, b, Val(N)) false
320 @eval IteratorsMD @deprecate split(t, V::Type{Val{n}}) where {n} split(t, Val(n)) false
321 @deprecate cat(::Type{Val{N}}, A::AbstractArray...) where {N} cat(A..., dims=Val(N))
322 @deprecate cat_t(::Type{Val{N}}, ::Type{T}, A, B) where {N,T} cat_t(T, A, B, dims=Val(N)) false
323 @deprecate reshape(A::AbstractArray, ::Type{Val{N}}) where {N} reshape(A, Val(N))
324
325 # Issue #27100
326 @deprecate cat(dims, As...) cat(As..., dims=dims)
327 @deprecate cat_t(dims, ::Type{T}, As...) where {T} cat_t(T, As...; dims=dims) false
328 # Disambiguate — this isn't deprecated but it needs to be supported
329 cat_t(::Type{T}, ::Type{S}, As...; dims=dims) where {T,S} = _cat_t(dims, T, S, As...)
330
331
332 @deprecate read(s::IO, x::Ref) read!(s, x)
333
334 @deprecate read(s::IO, t::Type, d1::Int, dims::Int...) read!(s, Array{t}(undef, d1, dims...))
335 @deprecate read(s::IO, t::Type, d1::Integer, dims::Integer...) read!(s, Array{t}(undef, d1, dims...))
336 @deprecate read(s::IO, t::Type, dims::Dims) read!(s, Array{t}(undef, dims))
337
338 function CartesianIndices(start::CartesianIndex{N}, stop::CartesianIndex{N}) where N
339 inds = map((f,l)->f:l, start.I, stop.I)
340 depwarn("the internal representation of CartesianIndices has changed, use `CartesianIndices($inds)` (or other more appropriate AbstractUnitRange type) instead.", :CartesianIndices)
341 CartesianIndices(inds)
342 end
343
344 # PR #20005
345 function InexactError()
346 depwarn("InexactError now supports arguments, use `InexactError(funcname::Symbol, ::Type, value)` instead.", :InexactError)
347 InexactError(:none, Any, nothing)
348 end
349
350 # PR #22751
351 function DomainError()
352 depwarn("DomainError now supports arguments, use `DomainError(value)` or `DomainError(value, msg)` instead.", :DomainError)
353 DomainError(nothing)
354 end
355
356 # PR #22761
357 function OverflowError()
358 depwarn("OverflowError now supports a message string, use `OverflowError(msg)` instead.", :OverflowError)
359 OverflowError("")
360 end
361
362 @deprecate fieldnames(v) fieldnames(typeof(v))
363 # nfields(::Type) deprecation in builtins.c: update nfields tfunc in compiler/tfuncs.jl when it is removed.
364 # also replace `_nfields` with `nfields` in summarysize.c when this is removed.
365
366 # ::ANY is deprecated in src/method.c
367 # also remove all instances of `jl_ANY_flag` in src/
368
369 # issue #13079
370 # in julia-parser.scm:
371 # move prec-bitshift after prec-rational
372 # remove parse-with-chains-warn and bitshift-warn
373 # update precedence table in doc/src/manual/mathematical-operations.md
374
375 # PR #22182
376 @deprecate is_apple Sys.isapple
377 @deprecate is_bsd Sys.isbsd
378 @deprecate is_linux Sys.islinux
379 @deprecate is_unix Sys.isunix
380 @deprecate is_windows Sys.iswindows
381
382 @deprecate read(cmd::AbstractCmd, stdin::Redirectable) read(pipeline(stdin, cmd))
383 @deprecate readstring(cmd::AbstractCmd, stdin::Redirectable) readstring(pipeline(stdin, cmd))
384 @deprecate eachline(cmd::AbstractCmd, stdin; kw...) eachline(pipeline(stdin, cmd), kw...)
385
386 @deprecate showall(x) show(x)
387 @deprecate showall(io, x) show(IOContext(io, :limit => false), x)
388
389 @deprecate_binding AbstractIOBuffer GenericIOBuffer false
390
391 @deprecate String(io::GenericIOBuffer) String(take!(copy(io)))
392
393 @deprecate readstring(s::IO) read(s, String)
394 @deprecate readstring(filename::AbstractString) read(filename, String)
395 @deprecate readstring(cmd::AbstractCmd) read(cmd, String)
396
397 @deprecate_binding UVError IOError false
398
399 # issue #11310
400 # remove "parametric method syntax" deprecation in julia-syntax.scm
401
402 @deprecate momenttype(::Type{T}) where {T} typeof((zero(T)*zero(T) + zero(T)*zero(T))/2) false
403
404 # issue #6466
405 # `write` on non-isbits arrays is deprecated in io.jl.
406
407 # PR #23187
408 @deprecate cpad(s, n::Integer, p=" ") rpad(lpad(s, div(n+textwidth(s), 2), p), n, p) false
409
410 # PR #22088
411 function hex2num(s::AbstractString)
412 depwarn("`hex2num(s)` is deprecated. Use `reinterpret(Float64, parse(UInt64, s, base = 16))` instead.", :hex2num)
413 if length(s) <= 4
414 return reinterpret(Float16, parse(UInt16, s, base = 16))
415 end
416 if length(s) <= 8
417 return reinterpret(Float32, parse(UInt32, s, base = 16))
418 end
419 return reinterpret(Float64, parse(UInt64, s, base = 16))
420 end
421 export hex2num
422
423 @deprecate num2hex(x::Union{Float16,Float32,Float64}) string(reinterpret(Unsigned, x), base = 16, pad = sizeof(x)*2)
424 @deprecate num2hex(n::Integer) string(n, base = 16, pad = sizeof(n)*2)
425
426 # PR #22742: change in isapprox semantics
427 @deprecate rtoldefault(x,y) rtoldefault(x,y,0) false
428
429 # PR #23235
430 @deprecate ctranspose adjoint
431 @deprecate ctranspose! adjoint!
432
433 function convert(::Union{Type{Vector{UInt8}}, Type{Array{UInt8}}}, s::AbstractString)
434 depwarn("Strings can no longer be `convert`ed to byte arrays. Use `unsafe_wrap` or `codeunits` instead.", :Type)
435 unsafe_wrap(Vector{UInt8}, String(s))
436 end
437 function (::Type{Vector{UInt8}})(s::String)
438 depwarn("Vector{UInt8}(s::String) will copy data in the future. To avoid copying, use `unsafe_wrap` or `codeunits` instead.", :Type)
439 unsafe_wrap(Vector{UInt8}, s)
440 end
441 function (::Type{Array{UInt8}})(s::String)
442 depwarn("Array{UInt8}(s::String) will copy data in the future. To avoid copying, use `unsafe_wrap` or `codeunits` instead.", :Type)
443 unsafe_wrap(Vector{UInt8}, s)
444 end
445
446 @deprecate convert(::Type{Vector{Char}}, s::AbstractString) Vector{Char}(s)
447 @deprecate convert(::Type{Symbol}, s::AbstractString) Symbol(s)
448 @deprecate convert(::Type{String}, s::Symbol) String(s)
449 @deprecate convert(::Type{String}, v::Vector{UInt8}) String(v)
450 @deprecate convert(::Type{S}, g::Unicode.GraphemeIterator) where {S<:AbstractString} convert(S, g.s)
451 @deprecate convert(::Type{String}, v::AbstractVector{Char}) String(v)
452
453 @deprecate convert(::Type{Libc.FILE}, s::IO) Libc.FILE(s)
454 @deprecate convert(::Type{VersionNumber}, v::Integer) VersionNumber(v)
455 @deprecate convert(::Type{VersionNumber}, v::Tuple) VersionNumber(v)
456 @deprecate convert(::Type{VersionNumber}, v::AbstractString) VersionNumber(v)
457
458 @deprecate (convert(::Type{Integer}, x::Enum{T}) where {T<:Integer}) Integer(x)
459 @deprecate (convert(::Type{T}, x::Enum{T2}) where {T<:Integer,T2<:Integer}) T(x)
460
461 function (::Type{T})(arg) where {T}
462 if applicable(convert, T, arg)
463 sig = which(convert, (Type{T}, typeof(arg))).sig
464 if sig == (Tuple{typeof(convert),Type{S},Number} where S<:Number) ||
465 sig == (Tuple{typeof(convert),Type{S},AbstractArray} where S<:AbstractArray)
466 # matches a catch-all converter; will stack overflow
467 throw(MethodError(T, (arg,)))
468 end
469 # if `convert` call would not work, just let the method error happen
470 depwarn("Constructors no longer fall back to `convert`. A constructor `$T(::$(typeof(arg)))` should be defined instead.", :Type)
471 end
472 convert(T, arg)::T
473 end
474 # related items to remove in: abstractarray.jl, dates/periods.jl, compiler.jl
475 # also remove all uses of is_default_method
476
477 @deprecate convert(::Type{UInt128}, u::UUID) UInt128(u)
478 @deprecate convert(::Type{UUID}, s::AbstractString) UUID(s)
479
480 # Issue #19923
481 @deprecate ror circshift
482 @deprecate ror! circshift!
483 @deprecate rol(B, i) circshift(B, -i)
484 @deprecate rol!(dest, src, i) circshift!(dest, src, -i)
485 @deprecate rol!(B, i) circshift!(B, -i)
486
487 # issue #5148, PR #23259
488 # warning for `const` on locals should be changed to an error in julia-syntax.scm
489
490 # issue #22789
491 # remove code for `importall` in src/
492
493 # issue #17886
494 # deprecations for filter[!] with 2-arg functions are in abstractdict.jl
495
496 # PR #23066
497 @deprecate cfunction(f, r, a::Tuple) cfunction(f, r, Tuple{a...})
498 @noinline function cfunction(f, r, a)
499 @nospecialize(f, r, a)
500 depwarn("The function `cfunction` is now written as a macro `@cfunction`.", :cfunction)
501 return ccall(:jl_function_ptr, Ptr{Cvoid}, (Any, Any, Any), f, r, a)
502 end
503 export cfunction
504
505 # PR 23341
506 @eval GMP @deprecate gmp_version() version() false
507 @eval GMP @Base.deprecate_binding GMP_VERSION VERSION false
508 @eval GMP @deprecate gmp_bits_per_limb() bits_per_limb() false
509 @eval GMP @Base.deprecate_binding GMP_BITS_PER_LIMB BITS_PER_LIMB false
510 @eval MPFR @deprecate get_version() version() false
511
512 # PR #23427
513 @deprecate_binding e ℯ true ", use ℯ (\\euler) or `Base.MathConstants.e`"
514 @deprecate_binding eu ℯ true ", use ℯ (\\euler) or `Base.MathConstants.e`"
515 @deprecate_binding γ MathConstants.γ
516 @deprecate_binding eulergamma MathConstants.eulergamma
517 @deprecate_binding catalan MathConstants.catalan
518 @deprecate_binding φ MathConstants.φ
519 @deprecate_binding golden MathConstants.golden
520
521 # PR #23271
522 # TODO: rename Base._IOContext to IOContext when this deprecation is deleted
523 function IOContext(io::IO; kws...)
524 if isempty(kws) # Issue #25638
525 _IOContext(io)
526 else
527 depwarn("`IOContext(io, k=v, ...)` is deprecated, use `IOContext(io, :k => v, ...)` instead.", :IOContext)
528 IOContext(io, (k=>v for (k, v) in pairs(kws))...)
529 end
530 end
531
532 @deprecate IOContext(io::IO, key, value) IOContext(io, key=>value)
533
534 # PR #23485
535 export countnz
536 function countnz(x)
537 depwarn("`countnz(x)` is deprecated, use either `count(!iszero, x)` or `count(t -> t != 0, x)` instead.", :countnz)
538 return count(t -> t != 0, x)
539 end
540
541 # issue #14470
542 # TODO: More deprecations must be removed in src/cgutils.cpp:emit_array_nd_index()
543 # TODO: Re-enable the disabled tests marked PLI
544 # On the Julia side, this definition will gracefully supersede the new behavior (already coded)
545 @inline function checkbounds_indices(::Type{Bool}, IA::Tuple{Any,Vararg{Any}}, ::Tuple{})
546 any(x->unsafe_length(x)==0, IA) && return false
547 any(x->unsafe_length(x)!=1, IA) && return _depwarn_for_trailing_indices(IA)
548 return true
549 end
550 function _depwarn_for_trailing_indices(n::Integer) # Called by the C boundscheck
551 depwarn("omitting indices for non-singleton trailing dimensions is deprecated. Add `1`s as trailing indices or use `reshape(A, Val($n))` to make the dimensionality of the array match the number of indices.", (:getindex, :setindex!, :view))
552 true
553 end
554 function _depwarn_for_trailing_indices(t::Tuple)
555 depwarn("omitting indices for non-singleton trailing dimensions is deprecated. Add `$(join(map(first, t),','))` as trailing indices or use `reshape` to make the dimensionality of the array match the number of indices.", (:getindex, :setindex!, :view))
556 true
557 end
558
559 # issue #22791
560 @deprecate select partialsort
561 @deprecate select! partialsort!
562 @deprecate selectperm partialsortperm
563 @deprecate selectperm! partialsortperm!
564
565 # `initialized` keyword arg to `sort` is deprecated in sort.jl
566
567 @deprecate promote_noncircular promote false
568
569 import .Iterators.enumerate
570
571 @deprecate enumerate(i::IndexLinear, A::AbstractArray) pairs(i, A)
572 @deprecate enumerate(i::IndexCartesian, A::AbstractArray) pairs(i, A)
573
574 @deprecate_binding Range AbstractRange
575
576 # issue #5794
577 @deprecate map(f, d::T) where {T<:AbstractDict} T( f(p) for p in pairs(d) )
578 # issue #26359 - map over sets
579 @deprecate map(f, s::AbstractSet) Set( f(v) for v in s )
580
581 # issue #17086
582 @deprecate isleaftype isconcretetype
583 @deprecate isabstract isabstracttype
584
585 # PR #22932
586 @deprecate +(a::Number, b::AbstractArray) a .+ b
587 @deprecate +(a::AbstractArray, b::Number) a .+ b
588 @deprecate -(a::Number, b::AbstractArray) a .- b
589 @deprecate -(a::AbstractArray, b::Number) a .- b
590
591 @deprecate(ind2sub(dims::NTuple{N,Integer}, idx::CartesianIndex{N}) where N, Tuple(idx))
592
593 @deprecate contains(eq::Function, itr, x) any(y->eq(y,x), itr)
594
595 # PR #23690
596 # `SSHCredential` and `UserPasswordCredential` constructors using `prompt_if_incorrect`
597 # are deprecated in stdlib/LibGit2/types.jl.
598
599 # deprecate ones/zeros methods accepting an array as first argument
600 function ones(a::AbstractArray, ::Type{T}, dims::Tuple) where {T}
601 depwarn(string("`ones(a::AbstractArray, ::Type{T}, dims::Tuple) where T` is ",
602 "deprecated, use `fill!(similar(a, T, dims), 1)` instead, or ",
603 "`fill!(similar(a, T, dims), one(T))` where necessary."), :ones)
604 return fill!(similar(a, T, dims), one(T))
605 end
606 function ones(a::AbstractArray, ::Type{T}, dims...) where {T}
607 depwarn(string("`ones(a::AbstractArray, ::Type{T}, dims...) where T` is ",
608 "deprecated, use `fill!(similar(a, T, dims...), 1)` instead, or ",
609 "`fill!(similar(a, T, dims...), one(T))` where necessary."), :ones)
610 return fill!(similar(a, T, dims...), one(T))
611 end
612 function ones(a::AbstractArray, ::Type{T}) where {T}
613 depwarn(string("`ones(a::AbstractArray, ::Type{T}) where T` is deprecated, ",
614 "use `fill!(similar(a, T), 1)` instead, or `fill!(similar(a, T), one(T))` ",
615 "where necessary."), :ones)
616 return fill!(similar(a, T), one(T))
617 end
618 function ones(a::AbstractArray)
619 depwarn(string("`ones(a::AbstractArray)` is deprecated, consider ",
620 "`fill(1, size(a))`, `fill!(copy(a), 1)`, or `fill!(similar(a), 1)`. Where ",
621 "necessary, use `fill!(similar(a), one(eltype(a)))`."), :ones)
622 return fill!(similar(a), one(eltype(a)))
623 end
624
625 function zeros(a::AbstractArray, ::Type{T}, dims::Tuple) where {T}
626 depwarn(string("`zeros(a::AbstractArray, ::Type{T}, dims::Tuple) where T` is ",
627 "deprecated, use `fill!(similar(a, T, dims), 0)` instead, or ",
628 "`fill!(similar(a, T, dims), zero(T))` where necessary."), :zeros)
629 return fill!(similar(a, T, dims), zero(T))
630 end
631 function zeros(a::AbstractArray, ::Type{T}, dims...) where {T}
632 depwarn(string("`zeros(a::AbstractArray, ::Type{T}, dims...) where T` is ",
633 "deprecated, use `fill!(similar(a, T, dims...), 0)` instead, or ",
634 "`fill!(similar(a, T, dims...), zero(T))` where necessary."), :zeros)
635 return fill!(similar(a, T, dims...), zero(T))
636 end
637 function zeros(a::AbstractArray, ::Type{T}) where {T}
638 depwarn(string("`zeros(a::AbstractArray, ::Type{T}) where T` is deprecated, ",
639 "use `fill!(similar(a, T), 0)` instead, or `fill!(similar(a, T), zero(T))` ",
640 "where necessary."), :zeros)
641 return fill!(similar(a, T), zero(T))
642 end
643 function zeros(a::AbstractArray)
644 depwarn(string("`zeros(a::AbstractArray)` is deprecated, consider `zero(a)`, ",
645 "`fill(0, size(a))`, `fill!(copy(a), 0)`, or ",
646 "`fill!(similar(a), 0)`. Where necessary, use ",
647 "`fill!(similar(a), zero(eltype(a)))`."), :zeros)
648 return fill!(similar(a), zero(eltype(a)))
649 end
650
651 export tic, toq, toc
652 function tic()
653 depwarn("`tic()` is deprecated, use `@time`, `@elapsed`, or calls to `time_ns()` instead.", :tic)
654 t0 = time_ns()
655 task_local_storage(:TIMERS, (t0, get(task_local_storage(), :TIMERS, ())))
656 return t0
657 end
658
659 function _toq()
660 t1 = time_ns()
661 timers = get(task_local_storage(), :TIMERS, ())
662 if timers === ()
663 error("`toc()` without `tic()`")
664 end
665 t0 = timers[1]::UInt64
666 task_local_storage(:TIMERS, timers[2])
667 (t1-t0)/1e9
668 end
669
670 function toq()
671 depwarn("`toq()` is deprecated, use `@elapsed` or calls to `time_ns()` instead.", :toq)
672 return _toq()
673 end
674
675 function toc()
676 depwarn("`toc()` is deprecated, use `@time`, `@elapsed`, or calls to `time_ns()` instead.", :toc)
677 t = _toq()
678 println("elapsed time: ", t, " seconds")
679 return t
680 end
681
682 # A[I...] .= with scalar indices should modify the element at A[I...]
683 function Broadcast.dotview(A::AbstractArray, args::Number...)
684 depwarn("the behavior of `A[I...] .= X` with scalar indices will change in the future. Use `A[I...] = X` instead.", :broadcast!)
685 view(A, args...)
686 end
687 Broadcast.dotview(A::AbstractArray{<:AbstractArray}, args::Integer...) = getindex(A, args...)
688 # Upon removing deprecations, also enable the @testset "scalar .=" in test/broadcast.jl
689
690 # indexing with A[true] will throw an argument error in the future
691 function to_index(i::Bool)
692 depwarn("indexing with Bool values is deprecated. Convert the index to an integer first with `Int(i)`.", (:getindex, :setindex!, :view))
693 convert(Int,i)::Int
694 end
695 # After deprecation is removed, enable the @testset "indexing by Bool values" in test/arrayops.jl
696 # Also un-comment the new definition in base/indices.jl
697
698 # Broadcast no longer defaults to treating its arguments as scalar (#)
699 @noinline function Broadcast.broadcastable(x)
700 depwarn("""
701 broadcast will default to iterating over its arguments in the future. Wrap arguments of
702 type `x::$(typeof(x))` with `Ref(x)` to ensure they broadcast as "scalar" elements.
703 """, (:broadcast, :broadcast!))
704 return Ref{typeof(x)}(x)
705 end
706 @eval Base.Broadcast Base.@deprecate_binding Scalar DefaultArrayStyle{0} false
707 # After deprecation is removed, enable the fallback broadcastable definitions in base/broadcast.jl
708
709 # deprecate BitArray{...}(shape...) constructors to BitArray{...}(undef, shape...) equivalents
710 @deprecate BitArray{N}(dims::Vararg{Int,N}) where {N} BitArray{N}(undef, dims)
711 @deprecate BitArray(dims::NTuple{N,Int}) where {N} BitArray(undef, dims...)
712 @deprecate BitArray(dims::Integer...) BitArray(undef, dims)
713
714 ## deprecate full
715 export full
716 # full no-op fallback
717 function full(A::AbstractArray)
718 depwarn(string(
719 "The no-op `full(A::AbstractArray)` fallback has been deprecated, and no more ",
720 "specific `full` method for $(typeof(A)) exists. Furthermore, `full` in general ",
721 "has been deprecated.\n\n",
722 "To replace `full(A)`, as appropriate consider disambiguating with a concrete ",
723 "array constructor (e.g. `Array(A)`), with an abstract array constructor (e.g.`AbstractArray(A)`), ",
724 "instead `convert`ing to an array type (e.g `convert(Array, A)`, `convert(AbstractArray, A)`), ",
725 "or using another such operation that addresses your specific use case."), :full)
726 return A
727 end
728
729 # issue #20816
730 @deprecate strwidth textwidth
731 @deprecate charwidth textwidth
732
733 @deprecate find(x::Number) findall(!iszero, x)
734 @deprecate findnext(A, v, i::Integer) something(findnext(isequal(v), A, i), 0)
735 @deprecate findfirst(A, v) something(findfirst(isequal(v), A), 0)
736 @deprecate findprev(A, v, i::Integer) something(findprev(isequal(v), A, i), 0)
737 @deprecate findlast(A, v) something(findlast(isequal(v), A), 0)
738 # to fix ambiguities introduced by deprecations
739 # TODO: also remove find*_internal in array.jl
740 findnext(pred::Function, A, i::Integer) = findnext_internal(pred, A, i)
741 findprev(pred::Function, A, i::Integer) = findprev_internal(pred, A, i)
742 # also remove deprecation warnings in find* functions in array.jl, sparse/sparsematrix.jl,
743 # and sparse/sparsevector.jl.
744
745 # issue #22849
746 @deprecate reinterpret(::Type{T}, a::Array{S}, dims::NTuple{N,Int}) where {T, S, N} reshape(reinterpret(T, vec(a)), dims)
747 @deprecate reinterpret(::Type{T}, a::ReinterpretArray{S}, dims::NTuple{N,Int}) where {T, S, N} reshape(reinterpret(T, vec(a)), dims)
748
749 # issue #24006
750 @deprecate linearindices(s::AbstractString) eachindex(s)
751
752 # deprecate Array(shape...)-like constructors to Array(undef, shape...) equivalents
753 # --> former primitive constructors
754 @deprecate Array{T,1}(m::Int) where {T} Array{T,1}(undef, m)
755 @deprecate Array{T,2}(m::Int, n::Int) where {T} Array{T,2}(undef, m, n)
756 @deprecate Array{T,3}(m::Int, n::Int, o::Int) where {T} Array{T,3}(undef, m, n, o)
757 @deprecate Array{T,N}(d::Vararg{Int,N}) where {T,N} Array{T,N}(undef, d)
758 @deprecate Array{T,N}(d::NTuple{N,Int}) where {T,N} Array{T,N}(undef, d)
759 @deprecate Array{T}(m::Int) where {T} Array{T}(undef, m)
760 @deprecate Array{T}(m::Int, n::Int) where {T} Array{T}(undef, m, n)
761 @deprecate Array{T}(m::Int, n::Int, o::Int) where {T} Array{T}(undef, m, n, o)
762 @deprecate Array{T}(d::NTuple{N,Int}) where {T,N} Array{T}(undef, d)
763 # --> former convenience constructors
764 @deprecate Vector{T}(m::Integer) where {T} Vector{T}(undef, m)
765 @deprecate Matrix{T}(m::Integer, n::Integer) where {T} Matrix{T}(undef, m, n)
766 @deprecate Array{T}(m::Integer) where {T} Array{T}(undef, m)
767 @deprecate Array{T}(m::Integer, n::Integer) where {T} Array{T}(undef, m, n)
768 @deprecate Array{T}(m::Integer, n::Integer, o::Integer) where {T} Array{T}(undef, m, n, o)
769 @deprecate Array{T}(d::Integer...) where {T} Array{T}(undef, d)
770 @deprecate Vector(m::Integer) Vector(undef, m)
771 @deprecate Matrix(m::Integer, n::Integer) Matrix(undef, m, n)
772
773 # deprecate IntSet to BitSet
774 @deprecate_binding IntSet BitSet
775
776 # Issue 24219
777 @deprecate float(x::AbstractString) parse(Float64, x)
778 @deprecate float(a::AbstractArray{<:AbstractString}) parse.(Float64, a)
779
780 # deprecate bits to bitstring (#24263, #24281)
781 @deprecate bits bitstring
782
783 # issue #24167
784 @deprecate EnvHash EnvDict
785
786 # issue #24349
787 @deprecate parse(str::AbstractString; kwargs...) Meta.parse(str; kwargs...)
788 @deprecate parse(str::AbstractString, pos::Int, ; kwargs...) Meta.parse(str, pos; kwargs...)
789 @deprecate_binding ParseError Meta.ParseError
790
791 # issue #20899
792 # TODO: delete JULIA_HOME deprecation in src/init.c
793
794 # cumsum and cumprod have deprecations in multidimensional.jl
795 # when the message is removed, the `dims` keyword argument should become required.
796
797 # issue #16307
798 @deprecate finalizer(o, f::Function) finalizer(f, o)
799 # This misses other callables but they are very rare in the wild
800 @deprecate finalizer(o, f::Ptr{Cvoid}) finalizer(f, o)
801
802 # Avoid ambiguity, can remove when deprecations are removed:
803 # This is almost certainly going to be a silent failure for code that is not updated.
804 finalizer(f::Ptr{Cvoid}, o::Ptr{Cvoid}) = invoke(finalizer, Tuple{Ptr{Cvoid}, Any}, f, o)
805 finalizer(f::Ptr{Cvoid}, o::Function) = invoke(finalizer, Tuple{Ptr{Cvoid}, Any}, f, o)
806
807 # Broadcast extension API (#23939)
808 @eval Broadcast begin
809 Base.@deprecate_binding containertype combine_styles false
810 Base.@deprecate_binding _containertype BroadcastStyle false
811 Base.@deprecate_binding promote_containertype BroadcastStyle false
812 Base.@deprecate_binding broadcast_c! broadcast! false ", `broadcast_c!(f, ::Type, ::Type, C, As...)` should become `broadcast!(f, C, As...)` (see the manual chapter Interfaces)"
813 Base.@deprecate_binding broadcast_c broadcast false ", `broadcast_c(f, ::Type{C}, As...)` should become `broadcast(f, C, nothing, nothing, As...))` (see the manual chapter Interfaces)"
814 Base.@deprecate_binding broadcast_t broadcast false ", `broadcast_t(f, ::Type{ElType}, shape, iter, As...)` should become `broadcast(f, Broadcast.DefaultArrayStyle{N}(), ElType, shape, As...))` (see the manual chapter Interfaces)"
815 end
816
817
818 ### deprecations for lazier, less jazzy linalg transition in the next several blocks ###
819 # TODOs re. .' deprecation
820 # (1) remove .' deprecation from src/julia-syntax.scm around line 2346
821 # (2) remove .' documentation from base/docs/basedocs.jl around line 255
822 # (3) remove .'-involving code from base/show.jl around line 1277
823 # (4) remove .'-involving test from test/deprecation_exec.jl around line 178
824 # (5) remove .'-related code from src/ast.scm and src/julia-parser.scm
825
826 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/operators.jl, to deprecate
827 @deprecate Ac_ldiv_Bt(a,b) (\)(adjoint(a), transpose(b))
828 @deprecate At_ldiv_Bt(a,b) (\)(transpose(a), transpose(b))
829 @deprecate A_ldiv_Bt(a,b) (\)(a, transpose(b))
830 @deprecate At_ldiv_B(a,b) (\)(transpose(a), b)
831 @deprecate Ac_ldiv_Bc(a,b) (\)(adjoint(a), adjoint(b))
832 @deprecate A_ldiv_Bc(a,b) (\)(a, adjoint(b))
833 @deprecate Ac_ldiv_B(a,b) (\)(adjoint(a), b)
834 @deprecate At_rdiv_Bt(a,b) (/)(transpose(a), transpose(b))
835 @deprecate A_rdiv_Bt(a,b) (/)(a, transpose(b))
836 @deprecate At_rdiv_B(a,b) (/)(transpose(a), b)
837 @deprecate Ac_rdiv_Bc(a,b) (/)(adjoint(a), adjoint(b))
838 @deprecate A_rdiv_Bc(a,b) (/)(a, adjoint(b))
839 @deprecate Ac_rdiv_B(a,b) (/)(adjoint(a), b)
840 @deprecate At_mul_Bt(a,b) (*)(transpose(a), transpose(b))
841 @deprecate A_mul_Bt(a,b) (*)(a, transpose(b))
842 @deprecate At_mul_B(a,b) (*)(transpose(a), b)
843 @deprecate Ac_mul_Bc(a,b) (*)(adjoint(a), adjoint(b))
844 @deprecate A_mul_Bc(a,b) (*)(a, adjoint(b))
845 @deprecate Ac_mul_B(a,b) (*)(adjoint(a), b)
846
847 # issue #24822
848 @deprecate_binding Display AbstractDisplay
849
850 # 24595
851 @deprecate falses(A::AbstractArray) falses(size(A))
852 @deprecate trues(A::AbstractArray) trues(size(A))
853
854 # issue #24794
855 @deprecate linspace(start, stop) range(start, stop=stop, length=50)
856 @deprecate logspace(start, stop) exp10.(range(start, stop=stop, length=50))
857
858 # 24490 - warnings and messages
859 const log_info_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}()
860 const log_warn_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}()
861 const log_error_to = Dict{Tuple{Union{Module,Nothing},Union{Symbol,Nothing}},IO}()
862
863 function _redirect(io::IO, log_to::Dict, sf::StackTraces.StackFrame)
864 (sf.linfo isa Core.MethodInstance) || return io
865 mod = sf.linfo.def
866 isa(mod, Method) && (mod = mod.module)
867 fun = sf.func
868 if haskey(log_to, (mod,fun))
869 return log_to[(mod,fun)]
870 elseif haskey(log_to, (mod,nothing))
871 return log_to[(mod,nothing)]
872 elseif haskey(log_to, (nothing,nothing))
873 return log_to[(nothing,nothing)]
874 else
875 return io
876 end
877 end
878
879 function _redirect(io::IO, log_to::Dict, fun::Symbol)
880 clos = string("#",fun,"#")
881 kw = string("kw##",fun)
882 local sf
883 break_next_frame = false
884 for trace in backtrace()
885 stack::Vector{StackFrame} = StackTraces.lookup(trace)
886 filter!(frame -> !frame.from_c, stack)
887 for frame in stack
888 (frame.linfo isa Core.MethodInstance) || continue
889 sf = frame
890 break_next_frame && (@goto skip)
891 mod = frame.linfo.def
892 isa(mod, Method) && (mod = mod.module)
893 mod === Base || continue
894 sff = string(frame.func)
895 if frame.func == fun || startswith(sff, clos) || startswith(sff, kw)
896 break_next_frame = true
897 end
898 end
899 end
900 @label skip
901 _redirect(io, log_to, sf)
902 end
903
904 @inline function redirect(io::IO, log_to::Dict, arg::Union{Symbol,StackTraces.StackFrame})
905 if isempty(log_to)
906 return io
907 else
908 if length(log_to)==1 && haskey(log_to,(nothing,nothing))
909 return log_to[(nothing,nothing)]
910 else
911 return _redirect(io, log_to, arg)
912 end
913 end
914 end
915
916 """
917 logging(io [, m [, f]][; kind=:all])
918 logging([; kind=:all])
919
920 Stream output of informational, warning, and/or error messages to `io`,
921 overriding what was otherwise specified. Optionally, divert stream only for
922 module `m`, or specifically function `f` within `m`. `kind` can be `:all` (the
923 default), `:info`, `:warn`, or `:error`. See `Base.log_{info,warn,error}_to`
924 for the current set of redirections. Call `logging` with no arguments (or just
925 the `kind`) to reset everything.
926 """
927 function logging(io::IO, m::Union{Module,Nothing}=nothing, f::Union{Symbol,Nothing}=nothing;
928 kind::Symbol=:all)
929 depwarn("""`logging()` is deprecated, use `with_logger` instead to capture
930 messages from `Base`.""", :logging)
931 (kind==:all || kind==:info) && (log_info_to[(m,f)] = io)
932 (kind==:all || kind==:warn) && (log_warn_to[(m,f)] = io)
933 (kind==:all || kind==:error) && (log_error_to[(m,f)] = io)
934 nothing
935 end
936
937 function logging(; kind::Symbol=:all)
938 depwarn("""`logging()` is deprecated, use `with_logger` instead to capture
939 messages from `Base`.""", :logging)
940 (kind==:all || kind==:info) && empty!(log_info_to)
941 (kind==:all || kind==:warn) && empty!(log_warn_to)
942 (kind==:all || kind==:error) && empty!(log_error_to)
943 nothing
944 end
945
946 """
947 info([io, ] msg..., [prefix="INFO: "])
948
949 Display an informational message.
950 Argument `msg` is a string describing the information to be displayed.
951 The `prefix` keyword argument can be used to override the default
952 prepending of `msg`.
953
954 # Examples
955 ```jldoctest
956 julia> info("hello world")
957 INFO: hello world
958
959 julia> info("hello world"; prefix="MY INFO: ")
960 MY INFO: hello world
961 ```
962
963 See also [`logging`](@ref).
964 """
965 function info(io::IO, msg...; prefix="INFO: ")
966 depwarn("`info()` is deprecated, use `@info` instead.", :info)
967 buf = IOBuffer()
968 iob = redirect(IOContext(buf, io), log_info_to, :info)
969 printstyled(iob, prefix; bold=true, color=info_color())
970 printstyled(iob, chomp(string(msg...)), '\n', color=info_color())
971 print(io, String(take!(buf)))
972 return
973 end
974 info(msg...; prefix="INFO: ") = info(stderr, msg..., prefix=prefix)
975
976 # print a warning only once
977
978 const have_warned = Set()
979
980 warn_once(io::IO, msg...) = warn(io, msg..., once=true)
981 warn_once(msg...) = warn(stderr, msg..., once=true)
982
983 """
984 warn([io, ] msg..., [prefix="WARNING: ", once=false, key=nothing, bt=nothing, filename=nothing, lineno::Int=0])
985
986 Display a warning. Argument `msg` is a string describing the warning to be
987 displayed. Set `once` to true and specify a `key` to only display `msg` the
988 first time `warn` is called. If `bt` is not `nothing` a backtrace is displayed.
989 If `filename` is not `nothing` both it and `lineno` are displayed.
990
991 See also [`logging`](@ref).
992 """
993 function warn(io::IO, msg...;
994 prefix="WARNING: ", once=false, key=nothing, bt=nothing,
995 filename=nothing, lineno::Int=0)
996 depwarn("`warn()` is deprecated, use `@warn` instead.", :warn)
997 str = chomp(string(msg...))
998 if once
999 if key === nothing
1000 key = str
1001 end
1002 (key in have_warned) && return
1003 push!(have_warned, key)
1004 end
1005 buf = IOBuffer()
1006 iob = redirect(IOContext(buf, io), log_warn_to, :warn)
1007 printstyled(iob, prefix; bold=true, color=warn_color())
1008 printstyled(iob, str, color=warn_color())
1009 if bt !== nothing
1010 show_backtrace(iob, bt)
1011 end
1012 if filename !== nothing
1013 print(iob, "\nin expression starting at $filename:$lineno")
1014 end
1015 println(iob)
1016 print(io, String(take!(buf)))
1017 return
1018 end
1019
1020 """
1021 warn(msg)
1022
1023 Display a warning. Argument `msg` is a string describing the warning to be displayed.
1024
1025 # Examples
1026 ```jldoctest
1027 julia> warn("Beep Beep")
1028 WARNING: Beep Beep
1029 ```
1030 """
1031 warn(msg...; kw...) = warn(stderr, msg...; kw...)
1032
1033 warn(io::IO, err::Exception; prefix="ERROR: ", kw...) =
1034 warn(io, sprint(showerror, err), prefix=prefix; kw...)
1035
1036 warn(err::Exception; prefix="ERROR: ", kw...) =
1037 warn(stderr, err, prefix=prefix; kw...)
1038
1039 info(io::IO, err::Exception; prefix="ERROR: ", kw...) =
1040 info(io, sprint(showerror, err), prefix=prefix; kw...)
1041
1042 info(err::Exception; prefix="ERROR: ", kw...) =
1043 info(stderr, err, prefix=prefix; kw...)
1044
1045 # issue #25082
1046 @deprecate_binding Void Nothing
1047
1048 # #24844
1049 @deprecate copy!(dest::AbstractSet, src) union!(dest, src)
1050
1051 function copy!(dest::AbstractSet, src::AbstractSet)
1052 depwarn("`copy!(dst::AbstractSet, src::AbstractSet)` is deprecated. " *
1053 "You can either use `union!(dst, src)` or `Future.copy!(dst, src)` instead.", :copy!)
1054 union!(dest, src)
1055 end
1056
1057 @deprecate copy!(dest::AbstractDict, src) foldl(push!, dest, src)
1058
1059 function copy!(dest::AbstractDict, src::AbstractDict)
1060 depwarn("`copy!(dst::AbstractDict, src::AbstractDict)` is deprecated. " *
1061 "You can either use `merge!(dst, src)` or `Future.copy!(dst, src)` instead.", :copy!)
1062 foldl(push!, dest, src)
1063 end
1064
1065 # 24808
1066 @deprecate copy!(dest::Union{AbstractArray,IndexStyle}, args...) copyto!(dest, args...)
1067
1068 function copy!(dest::AbstractArray, src::AbstractArray)
1069 depwarn("`copy!(dst::AbstractArray, src::AbstractArray)` is deprecated. " *
1070 "You can either use `copyto!(dst, src)` or `Future.copy!(dst, src)` instead.", :copy!)
1071 copyto!(dest, src)
1072 end
1073
1074 @deprecate unsafe_copy!(dest, args...) unsafe_copyto!(dest, args...)
1075
1076 # issue #24019
1077 @deprecate similar(a::AbstractDict) empty(a)
1078 @deprecate similar(a::AbstractDict, ::Type{Pair{K,V}}) where {K, V} empty(a, K, V)
1079
1080 # 25224
1081 @deprecate similar(s::AbstractSet) empty(s)
1082 @deprecate similar(s::AbstractSet, ::Type{T}) where {T} empty(s, T)
1083
1084 # issue #24804
1085 @deprecate_moved sum_kbn "KahanSummation"
1086 @deprecate_moved cumsum_kbn "KahanSummation"
1087
1088 @deprecate isalnum(c::Char) isletter(c) || isnumeric(c)
1089 @deprecate isgraph(c::Char) isprint(c) && !isspace(c)
1090 @deprecate isnumber(c::Char) isnumeric(c)
1091
1092 # PR #24647
1093 @deprecate_binding Complex32 ComplexF16
1094 @deprecate_binding Complex64 ComplexF32
1095 @deprecate_binding Complex128 ComplexF64
1096
1097 # PR #24999
1098 @deprecate ind2chr(s::AbstractString, i::Integer) length(s, 1, i)
1099 @deprecate chr2ind(s::AbstractString, n::Integer) nextind(s, 0, n)
1100
1101 # Associative -> AbstractDict (#25012)
1102 @deprecate_binding Associative AbstractDict
1103
1104 @deprecate_binding KeyIterator KeySet false
1105
1106 # issue #25016
1107 @deprecate lpad(s, n::Integer, p) lpad(string(s), n, string(p))
1108 @deprecate rpad(s, n::Integer, p) rpad(string(s), n, string(p))
1109
1110 # PR #25011
1111 @deprecate push!(env::EnvDict, k::AbstractString, v) push!(env, k=>v)
1112
1113 # issue #24868
1114 @deprecate sprint(size::Integer, f::Function, args...; env=nothing) sprint(f, args...; context=env, sizehint=size)
1115
1116 # PR #25057
1117 @deprecate indices(a) axes(a)
1118 @deprecate indices(a, d) axes(a, d)
1119
1120 # And similar _indices names in Broadcast
1121 @eval Broadcast Base.@deprecate_binding broadcast_indices broadcast_axes true
1122 @eval Broadcast Base.@deprecate_binding check_broadcast_indices check_broadcast_axes false
1123
1124 # PR #25046
1125 export reload, workspace
1126 reload(name::AbstractString) = error("`reload($(repr(name)))` is discontinued, consider Revise.jl for an alternative workflow.")
1127 workspace() = error("`workspace()` is discontinued, consider Revise.jl for an alternative workflow.")
1128
1129 # Issue #12902
1130 @deprecate parentindexes parentindices
1131
1132 # Issue #23902
1133 @deprecate unshift! pushfirst!
1134 @deprecate shift! popfirst!
1135
1136 # Issue #23642
1137 @deprecate_moved Nullable "Nullables"
1138 @deprecate_moved NullException "Nullables"
1139 @deprecate_moved isnull "Nullables"
1140 @deprecate_moved unsafe_get "Nullables"
1141
1142 # sub2ind and ind2sub deprecation (PR #24715)
1143 _ind2sub_depwarn(x, y) = "`ind2sub($x, $y)` is deprecated, use `Tuple(CartesianIndices($x)[$y])` for a direct replacement. In many cases, the conversion to `Tuple` is not necessary."
1144 function ind2sub(A::AbstractArray, ind)
1145 depwarn(_ind2sub_depwarn("A", "ind"), :ind2sub)
1146 Tuple(CartesianIndices(A)[ind])
1147 end
1148 function ind2sub(::Tuple{}, ind::Integer)
1149 depwarn(_ind2sub_depwarn("()", "ind"), :ind2sub)
1150 Tuple(CartesianIndices(())[ind])
1151 end
1152 function ind2sub(dims::Tuple{Vararg{Integer,N}} where N, ind::Integer)
1153 depwarn(_ind2sub_depwarn("dims", "ind"), :ind2sub)
1154 Tuple(CartesianIndices(dims)[ind])
1155 end
1156 function ind2sub(inds::Tuple{Base.OneTo}, ind::Integer)
1157 depwarn(_ind2sub_depwarn("inds", "ind"), :ind2sub)
1158 Tuple(CartesianIndices(inds)[ind])
1159 end
1160 function ind2sub(inds::Tuple{AbstractUnitRange}, ind::Integer)
1161 depwarn(_ind2sub_depwarn("inds", "ind"), :ind2sub)
1162 Tuple(CartesianIndices(inds)[ind])
1163 end
1164 function ind2sub(inds::Tuple{Vararg{AbstractUnitRange,N}} where N, ind::Integer)
1165 depwarn(_ind2sub_depwarn("inds", "ind"), :ind2sub)
1166 Tuple(CartesianIndices(inds)[ind])
1167 end
1168 function ind2sub(inds::Union{DimsInteger{N},Indices{N}} where N, ind::AbstractVector{<:Integer})
1169 depwarn(_ind2sub_depwarn("inds", "ind"), :ind2sub)
1170 Tuple(CartesianIndices(inds)[ind])
1171 end
1172
1173 @deprecate sub2ind(A::AbstractArray, I...) LinearIndices(A)[I...]
1174 @deprecate sub2ind(dims::Tuple{}) LinearIndices(dims)[]
1175 @deprecate sub2ind(dims::DimsInteger) LinearIndices(dims)[]
1176 @deprecate sub2ind(dims::Indices) LinearIndices(dims)[]
1177 @deprecate sub2ind(dims::Tuple{}, I::Integer...) LinearIndices(dims)[I...]
1178 @deprecate sub2ind(dims::DimsInteger, I::Integer...) LinearIndices(dims)[I...]
1179 @deprecate sub2ind(inds::Indices, I::Integer...) LinearIndices(inds)[I...]
1180 @deprecate sub2ind(inds::Tuple{OneTo}, I::Integer...) LinearIndices(inds)[I...]
1181 @deprecate sub2ind(inds::Tuple{OneTo}, i::Integer) LinearIndices(inds)[i]
1182 @deprecate sub2ind(inds::Tuple{OneTo}, I1::AbstractVector{T}, I::AbstractVector{T}...) where {T<:Integer} LinearIndices(inds)[CartesianIndex.(I1, I...)]
1183 @deprecate sub2ind(inds::Union{DimsInteger,Indices}, I1::AbstractVector{T}, I::AbstractVector{T}...) where {T<:Integer} LinearIndices(inds)[CartesianIndex.(I1, I...)]
1184
1185 # PR #25113
1186 @deprecate_binding CartesianRange CartesianIndices
1187
1188 # PR 21527
1189 @deprecate Ref(x::AbstractArray) Ref(x, 1)
1190 @deprecate Ref(x::Ptr) Ref(x, 1)
1191 @deprecate Ref(x::Ref) x # or perhaps, `convert(Ref, x)`
1192
1193 # Issues #17812 Remove default stride implementation
1194 function strides(a::AbstractArray)
1195 depwarn("""
1196 The default `strides(a::AbstractArray)` implementation is deprecated for general arrays.
1197 Specialize `strides(::$(typeof(a).name))` if `$(typeof(a).name)` indeed uses a strided representation in memory.
1198 Warning: inappropriately implementing this method for an array type that does not use strided
1199 storage may lead to incorrect results or segfaults.
1200 """, :strides)
1201 size_to_strides(1, size(a)...)
1202 end
1203
1204 @deprecate substrides(s, parent, dim, I::Tuple) substrides(parent, strides(parent), I)
1205
1206 # Issue #26072 Also remove default Base.elsize implementation
1207 function elsize(t::Type{<:AbstractArray{T}}) where T
1208 depwarn("""
1209 The default `Base.elsize(::Type{<:AbstractArray})` implementation is deprecated for general arrays.
1210 Specialize `Base.elsize(::Type{<:$(t.name)})` if `$(t.name)` indeed has a known representation
1211 in memory such that it represents the distance between two contiguous elements.
1212 Warning: inappropriately implementing this method may lead to incorrect results or segfaults.
1213 """, :elsize)
1214 sizeof(T)
1215 end
1216
1217
1218 @deprecate lexcmp(x::AbstractArray, y::AbstractArray) cmp(x, y)
1219 @deprecate lexcmp(x::Real, y::Real) cmp(isless, x, y)
1220 @deprecate lexcmp(x::Complex, y::Complex) cmp((real(x),imag(x)), (real(y),imag(y)))
1221 @deprecate lexcmp(x, y) cmp(x, y)
1222
1223 @deprecate lexless isless
1224
1225 @deprecate(
1226 open(filename::AbstractString, read::Bool, write::Bool, create::Bool, truncate::Bool, append::Bool),
1227 open(filename, read = read, write = write, create = create, truncate = truncate, append = append)
1228 )
1229 @deprecate(
1230 open(f::Function, filename::AbstractString, read::Bool, write::Bool, create::Bool, truncate::Bool, append::Bool),
1231 open(f, filename, read = read, write = write, create = create, truncate = truncate, append = append)
1232 )
1233
1234 @deprecate_binding iteratorsize IteratorSize
1235 @deprecate_binding iteratoreltype IteratorEltype
1236
1237 # issue #25440
1238 @deprecate_binding TypeOrder OrderStyle
1239 @deprecate_binding TypeArithmetic ArithmeticStyle
1240 @deprecate_binding TypeRangeStep RangeStepStyle
1241 @deprecate_binding HasOrder Ordered
1242 @deprecate_binding ArithmeticOverflows ArithmeticWraps
1243
1244 @deprecate search(str::Union{String,SubString}, re::Regex, idx::Integer) something(findnext(re, str, idx), 0:-1)
1245 @deprecate search(s::AbstractString, r::Regex, idx::Integer) something(findnext(r, s, idx), 0:-1)
1246 @deprecate search(s::AbstractString, r::Regex) something(findfirst(r, s), 0:-1)
1247 @deprecate search(s::AbstractString, c::Char, i::Integer) something(findnext(isequal(c), s, i), 0)
1248 @deprecate search(s::AbstractString, c::Char) something(findfirst(isequal(c), s), 0)
1249 @deprecate search(a::ByteArray, b::Union{Int8,UInt8}, i::Integer) something(findnext(isequal(b), a, i), 0)
1250 @deprecate search(a::ByteArray, b::Union{Int8,UInt8}) something(findfirst(isequal(b), a), 0)
1251 @deprecate search(a::String, b::Union{Int8,UInt8}, i::Integer) something(findnext(isequal(b), unsafe_wrap(Vector{UInt8}, a), i), 0)
1252 @deprecate search(a::String, b::Union{Int8,UInt8}) something(findfirst(isequal(b), unsafe_wrap(Vector{UInt8}, a)), 0)
1253 @deprecate search(a::ByteArray, b::Char, i::Integer) something(findnext(isequal(UInt8(b)), a, i), 0)
1254 @deprecate search(a::ByteArray, b::Char) something(findfirst(isequal(UInt8(b)), a), 0)
1255
1256 @deprecate search(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}, i::Integer) something(findnext(in(c), s, i), 0)
1257 @deprecate search(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}) something(findfirst(in(c), s), 0)
1258 @deprecate search(s::AbstractString, t::AbstractString, i::Integer) something(findnext(t, s, i), 0:-1)
1259 @deprecate search(s::AbstractString, t::AbstractString) something(findfirst(t, s), 0:-1)
1260
1261 @deprecate rsearch(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}, i::Integer) something(findprev(in(c), s, i), 0)
1262 @deprecate rsearch(s::AbstractString, c::Union{Tuple{Vararg{Char}},AbstractVector{Char},Set{Char}}) something(findlast(in(c), s), 0)
1263 @deprecate rsearch(s::AbstractString, t::AbstractString, i::Integer) something(findprev(t, s, i), 0:-1)
1264 @deprecate rsearch(s::AbstractString, t::AbstractString) something(findlast(t, s), 0:-1)
1265
1266 @deprecate rsearch(str::Union{String,SubString}, re::Regex, idx::Integer) something(findprev(re, str, idx), 0:-1)
1267 @deprecate rsearch(str::Union{String,SubString}, re::Regex) something(findlast(re, str), 0:-1)
1268 @deprecate rsearch(s::AbstractString, r::Regex, idx::Integer) something(findprev(r, s, idx), 0:-1)
1269 @deprecate rsearch(s::AbstractString, r::Regex) something(findlast(r, s), 0:-1)
1270 @deprecate rsearch(s::AbstractString, c::Char, i::Integer) something(findprev(isequal(c), s, i), 0)
1271 @deprecate rsearch(s::AbstractString, c::Char) something(findlast(isequal(c), s), 0)
1272 @deprecate rsearch(a::Union{String,ByteArray}, b::Union{Int8,UInt8}, i::Integer = lastindex(a)) something(findprev(isequal(b), a, i), 0)
1273 @deprecate rsearch(a::String, b::Union{Int8,UInt8}, i::Integer = lastindex(a)) something(findprev(isequal(Char(b)), a, i), 0)
1274 @deprecate rsearch(a::ByteArray, b::Char, i::Integer = lastindex(a)) something(findprev(isequal(UInt8(b)), a, i), 0)
1275
1276 @deprecate searchindex(s::AbstractString, t::AbstractString) first(something(findfirst(t, s), 0:-1))
1277 @deprecate searchindex(s::AbstractString, t::AbstractString, i::Integer) first(something(findnext(t, s, i), 0:-1))
1278 @deprecate rsearchindex(s::AbstractString, t::AbstractString) first(something(findlast(t, s), 0:-1))
1279 @deprecate rsearchindex(s::AbstractString, t::AbstractString, i::Integer) first(something(findprev(t, s, i), 0:-1))
1280
1281 @deprecate searchindex(s::AbstractString, c::Char) something(findfirst(isequal(c), s), 0)
1282 @deprecate searchindex(s::AbstractString, c::Char, i::Integer) something(findnext(isequal(c), s, i), 0)
1283 @deprecate rsearchindex(s::AbstractString, c::Char) something(findlast(isequal(c), s), 0)
1284 @deprecate rsearchindex(s::AbstractString, c::Char, i::Integer) something(findprev(isequal(c), s, i), 0)
1285
1286 @deprecate ismatch(r::Regex, s::AbstractString) occursin(r, s)
1287
1288 @deprecate findin(a, b) findall(in(b), a)
1289
1290 @deprecate find findall
1291 @deprecate find(A::AbstractVector) findall(A)
1292 @deprecate find(A::AbstractArray) LinearIndices(A)[findall(A)]
1293 @deprecate find(f::Function, A::AbstractVector) findall(f, A)
1294 @deprecate find(f::Function, A::AbstractArray) LinearIndices(A)[findall(f, A)]
1295
1296 @deprecate findn(x::AbstractVector) (findall(!iszero, x),)
1297 @deprecate findn(x::AbstractMatrix) (I = findall(!iszero, x); (getindex.(I, 1), getindex.(I, 2)))
1298 @deprecate findn(x::AbstractArray{T, N}) where {T, N} (I = findall(!iszero, x); ntuple(i -> getindex.(I, i), N))
1299
1300 @deprecate catch_stacktrace(c_funcs::Bool) stacktrace(catch_backtrace(), c_funcs)
1301 @deprecate catch_stacktrace() stacktrace(catch_backtrace())
1302
1303 @deprecate method_exists(f, t) hasmethod(f, t)
1304 @deprecate method_exists(f, t, world) hasmethod(f, t, world = world)
1305
1306 @deprecate object_id objectid
1307
1308 @deprecate gc GC.gc
1309 @deprecate gc_enable GC.enable
1310 @eval @deprecate $(Symbol("@gc_preserve")) GC.$(Symbol("@preserve")) false
1311
1312 @deprecate nb_available bytesavailable
1313
1314 @deprecate skipchars(io::IO, predicate; linecomment=nothing) skipchars(predicate, io, linecomment=linecomment)
1315 # this method is to avoid ambiguity, delete at the same time as deprecation of skipchars above:
1316 skipchars(::IO, ::IO; linecomment=nothing) = throw(ArgumentError("the first argument of `skipchars` must be callable"))
1317
1318 # Issue #25745
1319 @deprecate print_shortest Base.Grisu.print_shortest
1320
1321 # issue #9053
1322 if Sys.iswindows()
1323 function Filesystem.tempname(uunique::UInt32)
1324 error("`tempname(::UInt32)` is discontinued.")
1325 end
1326 end
1327
1328 """
1329 readandwrite(command)
1330
1331 Starts running a command asynchronously, and returns a tuple (stdout,stdin,process) of the
1332 output stream and input stream of the process, and the process object itself.
1333 """
1334 function readandwrite(cmds::AbstractCmd)
1335 depwarn("""`readandwrite(::Cmd)` is deprecated in favor of `open(::Cmd, \"r+\").
1336 You may read/write the returned process object for access to stdio.""",
1337 :readandwrite)
1338 processes = open(cmds, "r+")
1339 return (processes.out, processes.in, processes)
1340 end
1341 export readandwrite
1342
1343 @deprecate module_parent(m::Module) parentmodule(m)
1344 @deprecate datatype_module(t::DataType) parentmodule(t) false
1345 @deprecate datatype_module(t::UnionAll) parentmodule(t) false
1346 @deprecate function_module(f::Function) parentmodule(f) false
1347 @deprecate function_module(f, t) parentmodule(f, t) false
1348
1349 # PR #25622
1350 @deprecate module_name(m::Module) nameof(m)
1351 @deprecate function_name(f::Function) nameof(f) false
1352 @deprecate datatype_name(t::DataType) nameof(t) false
1353 @deprecate datatype_name(t::UnionAll) nameof(t) false
1354
1355 # issue #25501
1356 @deprecate sum(a::AbstractArray, dims) sum(a, dims=dims)
1357 @deprecate sum(f, a::AbstractArray, dims) sum(f, a, dims=dims)
1358 @deprecate prod(a::AbstractArray, dims) prod(a, dims=dims)
1359 @deprecate prod(f, a::AbstractArray, dims) prod(f, a, dims=dims)
1360 @deprecate maximum(a::AbstractArray, dims) maximum(a, dims=dims)
1361 @deprecate maximum(f, a::AbstractArray, dims) maximum(f, a, dims=dims)
1362 @deprecate minimum(a::AbstractArray, dims) minimum(a, dims=dims)
1363 @deprecate minimum(f, a::AbstractArray, dims) minimum(f, a, dims=dims)
1364 @deprecate all(a::AbstractArray, dims) all(a, dims=dims)
1365 @deprecate all(f, a::AbstractArray, dims) all(f, a, dims=dims)
1366 @deprecate any(a::AbstractArray, dims) any(a, dims=dims)
1367 @deprecate any(f, a::AbstractArray, dims) any(f, a, dims=dims)
1368 @deprecate findmax(A::AbstractArray, dims) findmax(A, dims=dims)
1369 @deprecate findmin(A::AbstractArray, dims) findmin(A, dims=dims)
1370 @deprecate extrema(A::AbstractArray, dims) extrema(A, dims=dims)
1371
1372 @deprecate mapreducedim(f, op, A::AbstractArray, dims) mapreduce(f, op, A, dims=dims)
1373 @deprecate mapreducedim(f, op, A::AbstractArray, dims, v0) mapreduce(f, op, A, init=v0, dims=dims)
1374 @deprecate reducedim(op, A::AbstractArray, dims) reduce(op, A, dims=dims)
1375 @deprecate reducedim(op, A::AbstractArray, dims, v0) reduce(op, A, init=v0, dims=dims)
1376 @deprecate mapslices(op, A::AbstractArray, dims) mapslices(op, A, dims=dims)
1377
1378 @deprecate sort(A::AbstractArray, dim::Integer; kwargs...) sort(A; kwargs..., dims=dim)
1379
1380 @deprecate accumulate(op, A, dim::Integer) accumulate(op, A, dims=dim)
1381 @deprecate accumulate!(op, B, A, dim::Integer) accumulate!(op, B, A, dims=dim)
1382 @deprecate cumsum(A::AbstractArray, dim::Integer) cumsum(A, dims=dim)
1383 @deprecate cumsum!(B, A, dim::Integer) cumsum!(B, A, dims=dim)
1384 @deprecate cumsum!(out, A::AbstractVector, dim::Integer) cumsum!(out, A, dims=dim)
1385 @deprecate cumprod(A::AbstractArray, dim::Integer) cumprod(A, dims=dim)
1386 @deprecate cumprod!(B, A, dim::Integer) cumprod!(B, A, dims=dim)
1387
1388 @deprecate flipdim(A, d) reverse(A, dims=d)
1389
1390 @deprecate squeeze(args...; kwargs...) dropdims(args...; kwargs...)
1391 @deprecate dropdims(A, dims) dropdims(A, dims=dims)
1392
1393 @deprecate diff(A::AbstractMatrix, dim::Integer) diff(A, dims=dim)
1394 @deprecate unique(A::AbstractArray, dim::Int) unique(A, dims=dim)
1395
1396 # PR #25196
1397 @deprecate_binding ObjectIdDict IdDict{Any,Any}
1398
1399 @deprecate quit() exit()
1400
1401 # PR #25654
1402 @deprecate indmin argmin
1403 @deprecate indmax argmax
1404
1405 # PR #25896
1406 @deprecate range(start, length) range(start, length=length)
1407 @deprecate range(start, step, length) range(start, step=step, length=length)
1408 @deprecate linspace(start, stop, length::Integer) range(start, stop=stop, length=length)
1409 @deprecate linspace(start, stop, length::Real) range(start, stop=stop, length=Int(length))
1410 @deprecate_binding LinSpace LinRange
1411 @deprecate logspace(start, stop, n; base=10) base.^range(start, stop=stop, length=n)
1412
1413 @deprecate runtests(tests, ncores; kw...) runtests(tests; ncores = ncores, kw...) false
1414 @deprecate code_lowered(f, types, generated) code_lowered(f, types, generated = generated)
1415
1416 # PR 25458
1417 @deprecate endof(a) lastindex(a)
1418 function firstindex(a)
1419 depwarn("if appropriate you should implement `firstindex` for type $(typeof(a)), which might just return 1", :firstindex)
1420 1
1421 end
1422
1423 # PR 25763
1424 function lastindex(a, n)
1425 depwarn("if appropriate you should implement `lastindex(a, n)` for type $(typeof(a))`, which might just return `last(axes(a, n))`", :lastindex)
1426 last(axes(a, n))
1427 end
1428
1429 @deprecate_binding repmat repeat
1430
1431 @deprecate Timer(timeout, repeat) Timer(timeout, interval = repeat)
1432 @deprecate Timer(callback, delay, repeat) Timer(callback, delay, interval = repeat)
1433 @deprecate names(m, all) names(m, all = all)
1434 @deprecate names(m, all, imported) names(m, all = all, imported = imported)
1435 @deprecate eachmatch(re, str, overlap) eachmatch(re, str, overlap = overlap)
1436 @deprecate matchall(re, str, overlap) collect(m.match for m in eachmatch(re, str, overlap = overlap))
1437 @deprecate chop(s, head) chop(s, head = head)
1438 @deprecate chop(s, head, tail) chop(s, head = head, tail = tail)
1439 @deprecate tryparse(T::Type{<:Integer}, s, base) tryparse(T, s, base = base)
1440 @deprecate parse(T::Type{<:Integer}, s, base) parse(T, s, base = base)
1441 @eval Filesystem @deprecate mkdir(path, mode) mkdir(path, mode = mode)
1442 @eval Filesystem @deprecate mkpath(path, mode) mkpath(path, mode = mode)
1443 @deprecate countlines(x, eol) countlines(x, eol = eol)
1444 @deprecate PipeBuffer(data, maxsize) PipeBuffer(data, maxsize = maxsize)
1445 @deprecate unsafe_wrap(T, pointer, dims, own) unsafe_wrap(T, pointer, dims, own = own)
1446 @deprecate digits(n, base) digits(n, base = base)
1447 @deprecate digits(n, base, pad) digits(n, base = base, pad = pad)
1448 @deprecate digits(T::Type{<:Integer}, n, base) digits(T, n, base = base)
1449 @deprecate digits(T::Type{<:Integer}, n, base, pad) digits(T, n, base = base, pad = pad)
1450
1451 #27908
1452 @deprecate ndigits(n, base) ndigits(n, base=base)
1453 @deprecate ndigits(n, base, pad) ndigits(n, base=base, pad=pad)
1454
1455 @deprecate print_with_color(color, args...; kwargs...) printstyled(args...; kwargs..., color=color)
1456
1457 @deprecate base(b, n) string(n, base = b)
1458 @deprecate base(b, n, pad) string(n, base = b, pad = pad)
1459 @deprecate bin(n) string(n, base = 2)
1460 @deprecate bin(n, pad) string(n, base = 2, pad = pad)
1461 @deprecate oct(n) string(n, base = 8)
1462 @deprecate oct(n, pad) string(n, base = 8, pad = pad)
1463 @deprecate dec(n) string(n)
1464 @deprecate dec(n, pad) string(n, pad = pad)
1465 @deprecate hex(n) string(n, base = 16)
1466 @deprecate hex(n, pad) string(n, base = 16, pad = pad)
1467 @deprecate bin(n::Char) string(UInt32(n), base = 2)
1468 @deprecate bin(n::Char, pad) string(UInt32(n), base = 2, pad = pad)
1469 @deprecate oct(n::Char) string(UInt32(n), base = 8)
1470 @deprecate oct(n::Char, pad) string(UInt32(n), base = 8, pad = pad)
1471 @deprecate dec(n::Char) string(UInt32(n))
1472 @deprecate dec(n::Char, pad) string(UInt32(n), pad = pad)
1473 @deprecate hex(n::Char) string(UInt32(n), base = 16)
1474 @deprecate hex(n::Char, pad) string(UInt32(n), base = 16, pad = pad)
1475
1476 @deprecate which(s::Symbol) which(Main, s)
1477
1478 @deprecate IOBuffer(data::AbstractVector{UInt8}, read::Bool, write::Bool=false, maxsize::Integer=typemax(Int)) IOBuffer(data, read=read, write=write, maxsize=maxsize)
1479 @deprecate IOBuffer(read::Bool, write::Bool) IOBuffer(read=read, write=write)
1480 @deprecate IOBuffer(maxsize::Integer) IOBuffer(read=true, write=true, maxsize=maxsize)
1481
1482 @deprecate reprmime(mime, x) repr(mime, x)
1483 @deprecate mimewritable(mime, x) showable(mime, x)
1484
1485 # PR #26284
1486 @deprecate (+)(i::Integer, index::CartesianIndex) (i*one(index) + index)
1487 @deprecate (+)(index::CartesianIndex, i::Integer) (index + i*one(index))
1488 @deprecate (-)(i::Integer, index::CartesianIndex) (i*one(index) - index)
1489 @deprecate (-)(index::CartesianIndex, i::Integer) (index - i*one(index))
1490
1491 # PR #23332
1492 @deprecate ^(x, p::Integer) Base.power_by_squaring(x,p)
1493
1494 # Issue #25979
1495 # The `remove_destination` keyword to `cp`, `mv`, and the unexported `cptree` has been
1496 # renamed to `force`. To remove this deprecation, remove the `remove_destination` keyword
1497 # argument from the function signatures as well as the internal logic that deals with the
1498 # renaming. These live in base/file.jl.
1499
1500 # issue #25928
1501 @deprecate wait(t::Task) fetch(t)
1502
1503 # issue #18326
1504 @deprecate slicedim(A::AbstractArray, d::Integer, i) copy(selectdim(A, d, i))
1505 @deprecate slicedim(A::BitVector, d::Integer, i::Number) copy(selectdim(A, d, i))
1506 function slicedim(A::AbstractVector, d::Integer, i::Number)
1507 if d == 1
1508 # slicedim would have returned a scalar value, selectdim always returns views
1509 depwarn("`slicedim(A::AbstractVector, d::Integer, i)` is deprecated, use `selectdim(A, d, i)[]` instead.", :slicedim)
1510 selectdim(A, d, i)[]
1511 else
1512 depwarn("`slicedim(A::AbstractArray, d::Integer, i)` is deprecated, use `copy(selectdim(A, d, i))` instead.", :slicedim)
1513 copy(selectdim(A, d, i))
1514 end
1515 end
1516
1517 # PR #26347: Deprecate implicit scalar broadcasting in setindex!
1518 _axes(::Ref) = ()
1519 _axes(x) = axes(x)
1520 setindex_shape_check(X::Base.Iterators.Repeated, I...) = nothing
1521 function deprecate_scalar_setindex_broadcast_message(v, I...)
1522 value = (_axes(Base.Broadcast.broadcastable(v)) == () ? "x" : "(x,)")
1523 "using `A[I...] = x` to implicitly broadcast `x` across many locations is deprecated. Use `A[I...] .= $value` instead."
1524 end
1525 deprecate_scalar_setindex_broadcast_message(v, ::Colon, ::Vararg{Colon}) =
1526 "using `A[:] = x` to implicitly broadcast `x` across many locations is deprecated. Use `fill!(A, x)` instead."
1527
1528 function _iterable(v, I...)
1529 depwarn(deprecate_scalar_setindex_broadcast_message(v, I...), :setindex!)
1530 Iterators.repeated(v)
1531 end
1532 function setindex!(B::BitArray, x, I0::Union{Colon,UnitRange{Int}}, I::Union{Int,UnitRange{Int},Colon}...)
1533 depwarn(deprecate_scalar_setindex_broadcast_message(x, I0, I...), :setindex!)
1534 B[I0, I...] .= (x,)
1535 B
1536 end
1537
1538
1539 # PR #26283
1540 @deprecate contains(haystack, needle) occursin(needle, haystack)
1541 @deprecate contains(s::AbstractString, r::Regex, offset::Integer) occursin(r, s, offset=offset)
1542 function (r::Regex)(s)
1543 depwarn("`(r::Regex)(s)` is deprecated, use `occursin(r, s)` instead.", :Regex)
1544 occursin(r, s)
1545 end
1546
1547 # Issue #25786
1548 @deprecate_binding DevNull devnull
1549 # TODO: When these are removed, also remove the uppercase variants in libuv.jl and stream.jl
1550 @deprecate_binding STDIN stdin true nothing false
1551 @deprecate_binding STDOUT stdout true nothing false
1552 @deprecate_binding STDERR stderr true nothing false
1553
1554 # PR 25062
1555 @deprecate(link_pipe(pipe; julia_only_read = true, julia_only_write = true),
1556 link_pipe!(pipe, reader_supports_async = julia_only_read, writer_supports_async = julia_only_write),
1557 false)
1558
1559 # PR 26156
1560 @deprecate trunc(x::Number, digits) trunc(x; digits=digits)
1561 @deprecate floor(x::Number, digits) floor(x; digits=digits)
1562 @deprecate ceil(x::Number, digits) ceil(x; digits=digits)
1563 @deprecate round(x::Number, digits) round(x; digits=digits)
1564 @deprecate signif(x::Number, digits) round(x; sigdigits=digits)
1565
1566 @deprecate trunc(x::Number, digits, base) trunc(x; digits=digits, base = base)
1567 @deprecate floor(x::Number, digits, base) floor(x; digits=digits, base = base)
1568 @deprecate ceil(x::Number, digits, base) ceil(x; digits=digits, base = base)
1569 @deprecate round(x::Number, digits, base) round(x; digits=digits, base = base)
1570 @deprecate signif(x::Number, digits, base) round(x; sigdigits=digits, base = base)
1571
1572 # issue #25965
1573 @deprecate spawn(cmds::AbstractCmd) run(cmds, wait = false)
1574
1575 # Remember to delete the module when removing this
1576 @eval Base.Math module JuliaLibm
1577 Base.@deprecate log Base.log
1578 end
1579
1580 # PR 27856
1581 @eval Base.Sys Base.@deprecate_binding CPU_CORES CPU_THREADS true nothing false
1582 # TODO: delete deprecation code in sysimg.jl and sysinfo.jl
1583
1584 # PR 26071
1585 @deprecate(matchall(r::Regex, s::AbstractString; overlap::Bool = false),
1586 collect(m.match for m in eachmatch(r, s, overlap = overlap)))
1587
1588 # remove depwarn for `diff` in multidimensional.jl
1589 # @deprecate diff(A::AbstractMatrix) diff(A, dims=1)
1590
1591 # PR 26194
1592 export assert
1593 function assert(x)
1594 depwarn("`assert` is deprecated, use `@assert` instead.", :assert)
1595 @assert x ""
1596 end
1597
1598 # Issue #26248
1599 @deprecate conj(x) x
1600
1601 # PR #26436
1602 @deprecate equalto(x) isequal(x)
1603 @deprecate(occursin(x), in(x))
1604 @deprecate_binding EqualTo Base.Fix2{typeof(isequal)} false
1605 @deprecate_binding OccursIn Base.Fix2{typeof(in)} false
1606
1607 # Remove ambiguous CartesianIndices and LinearIndices constructors that are ambiguous between an axis and an array (#26448)
1608 @eval IteratorsMD begin
1609 import Base: LinearIndices
1610 @deprecate CartesianIndices(inds::Vararg{AbstractUnitRange{Int},N}) where {N} CartesianIndices(inds)
1611 @deprecate CartesianIndices(inds::Vararg{AbstractUnitRange{<:Integer},N}) where {N} CartesianIndices(inds)
1612 @deprecate LinearIndices(inds::Vararg{AbstractUnitRange{Int},N}) where {N} LinearIndices(inds)
1613 @deprecate LinearIndices(inds::Vararg{AbstractUnitRange{<:Integer},N}) where {N} LinearIndices(inds)
1614 # preserve the case with N = 1 (only needed as long as the above deprecations are here)
1615 CartesianIndices(inds::AbstractUnitRange{Int}) = CartesianIndices(axes(inds))
1616 CartesianIndices(inds::AbstractUnitRange{<:Integer}) = CartesianIndices(axes(inds))
1617 LinearIndices(inds::AbstractUnitRange{Int}) = LinearIndices(axes(inds))
1618 LinearIndices(inds::AbstractUnitRange{<:Integer}) = LinearIndices(axes(inds))
1619 end
1620
1621 # rename uninitialized
1622 @deprecate_binding uninitialized undef
1623 @deprecate_binding Uninitialized UndefInitializer
1624
1625 # remove broadcast MatrixStyle and VectorStyle (Issue #26430)
1626 @eval Broadcast Base.@deprecate_binding MatrixStyle DefaultArrayStyle{2} false
1627 @eval Broadcast Base.@deprecate_binding VectorStyle DefaultArrayStyle{1} false
1628
1629 @deprecate Crand Libc.rand false
1630 @deprecate Csrand Libc.srand false
1631
1632 # Deprecate `similar(f, axes)` (PR #26733)
1633 @noinline function similar(f, shape::Tuple)
1634 depwarn("using similar(f, shape) to call `f` with axes `shape` is deprecated; call `f` directly and/or add methods such that it supports axes", :similar)
1635 f(to_shape(shape))
1636 end
1637 @noinline function similar(f, dims::DimOrInd...)
1638 depwarn("using similar(f, shape...) to call `f` with axes `shape` is deprecated; call `f` directly and/or add methods such that it supports axes", :similar)
1639 f(to_shape(dims))
1640 end
1641 # Deprecate non-integer/axis arguments to zeros/ones to match fill/trues/falses
1642 @deprecate zeros(::Type{T}, dims...) where {T} zeros(T, convert(Dims, dims)...)
1643 @deprecate zeros(dims...) zeros(convert(Dims, dims)...)
1644 @deprecate zeros(::Type{T}, dims::NTuple{N, Any}) where {T, N} zeros(T, convert(Dims, dims))
1645 @deprecate zeros(dims::Tuple) zeros(convert(Dims, dims))
1646 @deprecate ones(::Type{T}, dims...) where {T} ones(T, convert(Dims, dims)...)
1647 @deprecate ones(dims...) ones(convert(Dims, dims)...)
1648 @deprecate ones(::Type{T}, dims::NTuple{N, Any}) where {T, N} ones(T, convert(Dims, dims))
1649 @deprecate ones(dims::Tuple) ones(convert(Dims, dims))
1650
1651 # Deprecate varargs size: PR #26862
1652 @deprecate size(x, d1::Integer, d2::Integer) (size(x, d1), size(x, d2))
1653 @deprecate size(x, d1::Integer, d2::Integer, dx::Integer...) map(dim->size(x, dim), (d1, d2, dx...))
1654
1655 @deprecate showcompact(x) show(IOContext(stdout, :compact => true), x)
1656 @deprecate showcompact(io, x) show(IOContext(io, :compact => true), x)
1657 @deprecate sprint(::typeof(showcompact), args...) sprint(show, args...; context=:compact => true)
1658
1659 # PR 27075
1660 @deprecate broadcast_getindex(A, I...) getindex.((A,), I...)
1661 @deprecate broadcast_setindex!(A, v, I...) setindex!.((A,), v, I...)
1662
1663 @deprecate isupper isuppercase
1664 @deprecate islower islowercase
1665 @deprecate ucfirst uppercasefirst
1666 @deprecate lcfirst lowercasefirst
1667
1668 # Issue #26932
1669 @deprecate isalpha isletter
1670
1671 function search(buf::IOBuffer, delim::UInt8)
1672 Base.depwarn("search(buf::IOBuffer, delim::UInt8) is deprecated: use occursin(delim, buf) or readuntil(buf, delim) instead", :search)
1673 p = pointer(buf.data, buf.ptr)
1674 q = GC.@preserve buf ccall(:memchr,Ptr{UInt8},(Ptr{UInt8},Int32,Csize_t),p,delim,bytesavailable(buf))
1675 q == C_NULL && return nothing
1676 return Int(q-p+1)
1677 end
1678
1679 # Issue #27067
1680 @deprecate flipbits!(B::BitArray) B .= .!B
1681
1682 @deprecate linearindices(x::AbstractArray) LinearIndices(x)
1683
1684 # PR #26647
1685 # The `keep` argument in `split` and `rpslit` has been renamed to `keepempty`.
1686 # To remove this deprecation, remove the `keep` argument from the function signatures as well as
1687 # the internal logic that deals with the renaming. These live in base/strings/util.jl.
1688
1689 # when this is removed, `isbitstype(typeof(x))` can be replaced with `isbits(x)`
1690 @deprecate isbits(@nospecialize(t::Type)) isbitstype(t)
1691
1692 # Special string deprecation
1693 @deprecate start(s::AbstractString) firstindex(s)
1694 @deprecate next(s::AbstractString, i::Integer) iterate(s, i)
1695 @deprecate done(s::AbstractString, i::Integer) i > ncodeunits(s)
1696
1697 function Rounding.setrounding(::Type{T}, r::RoundingMode) where {T<:Union{Float32,Float64}}
1698 depwarn("""`setrounding` for `Float32` and `Float64` has been deprecated, and will not be available in future versions.""", :setrounding)
1699 Rounding.setrounding_raw(T, Rounding.to_fenv(r))
1700 end
1701
1702 # PR #25168
1703 @deprecate ipermute!(a, p::AbstractVector) invpermute!(a, p)
1704
1705 # #27140, #27152
1706 @deprecate_moved linreg "StatsBase"
1707
1708 # ?? more special functions to SpecialFunctions.jl
1709 @deprecate_moved gamma "SpecialFunctions"
1710 @deprecate_moved lgamma "SpecialFunctions"
1711 @deprecate_moved beta "SpecialFunctions"
1712 @deprecate_moved lbeta "SpecialFunctions"
1713 @deprecate_moved lfact "SpecialFunctions"
1714 function factorial(x::Number)
1715 error("""factorial(x::Number) has been moved to the package SpecialFunctions.jl.
1716 Run `Pkg.add("SpecialFunctions")` to install it, restart Julia,
1717 and then run `using SpecialFunctions` to load it.
1718 """)
1719 end
1720
1721 # issue #27093
1722 # in src/jlfrontend.scm a call to `@deprecate` is generated for per-module `eval(m, x)`
1723 @eval Core Main.Base.@deprecate(eval(e), Core.eval(Main, e))
1724
1725 @eval @deprecate $(Symbol("@schedule")) $(Symbol("@async"))
1726
1727 @deprecate atan2(y, x) atan(y, x)
1728
1729 @deprecate_moved eigs "Arpack"
1730 @deprecate_moved svds "Arpack"
1731
1732 # PR #27711
1733 function reduce(op, v0, itr; dims=nothing)
1734 if dims === nothing
1735 depwarn("`reduce(op, v0, itr)` is deprecated, use `reduce(op, itr; init=v0)` instead", :reduce)
1736 return reduce(op, itr, init=v0)
1737 else # deprecate the old deprecation
1738 depwarn("`reduce(op, v0, itr; dims=dims)` is deprecated, use `reduce(op, itr; init=v0, dims=dims)` instead", :reduce)
1739 return reduce(op, itr; init=v0, dims=dims)
1740 end
1741 end
1742 @deprecate foldl(op, v0, itr) foldl(op, itr; init=v0)
1743 @deprecate foldr(op, v0, itr) foldr(op, itr; init=v0)
1744 function mapreduce(f, op, v0, itr; dims=nothing)
1745 if dims === nothing
1746 depwarn("`mapreduce(f, op, v0, itr)` is deprecated, use `mapreduce(f, op, itr; init=v0)` instead", :mapreduce)
1747 return mapreduce(f, op, itr; init=v0)
1748 else # deprecate the old deprecation
1749 depwarn("`mapreduce(f, op, v0, itr; dims=dims)` is deprecated, use `mapreduce(f, op, itr; init=v0, dims=dims)` instead", :mapreduce)
1750 return mapreduce(f, op, itr; init=v0, dims=dims)
1751 end
1752 end
1753 @deprecate mapfoldl(f, op, v0, itr) mapfoldl(f, op, itr; init=v0)
1754 @deprecate mapfoldr(f, op, v0, itr) mapfoldr(f, op, itr; init=v0)
1755
1756
1757 @deprecate startswith(a::Vector{UInt8}, b::Vector{UInt8}) length(a) >= length(b) && view(a, 1:length(b)) == b
1758
1759 # PR #27859
1760 @deprecate accumulate(op, v0, x::AbstractVector) accumulate(op, x; init=v0)
1761 @deprecate accumulate!(op, y, v0, x::AbstractVector) accumulate!(op, y, x; init=v0)
1762
1763 # issue 27352
1764 function print(io::IO, ::Nothing)
1765 depwarn("Calling `print` on `nothing` is deprecated; use `show`, `repr`, or custom output instead.", :print)
1766 show(io, nothing)
1767 end
1768
1769 @deprecate indices1 axes1
1770 @deprecate _length length
1771
1772 # PR #28223
1773 @deprecate code_llvm_raw(f, types=Tuple) code_llvm(f, types; raw=true)
1774
1775 # PR #28302
1776 @deprecate realmin floatmin
1777 @deprecate realmax floatmax
1778
1779 @deprecate sortrows(A::AbstractMatrix; kws...) sortslices(A, dims=1, kws...)
1780 @deprecate sortcols(A::AbstractMatrix; kws...) sortslices(A, dims=2, kws...)
1781
1782 # PR #28304
1783 @deprecate nextpow2(x) nextpow(2, x)
1784 @deprecate prevpow2(x) prevpow(2, x)
156 function promote_eltype_op end
1785157
1786158 # END 0.7 deprecations
1787159
255255 ```
256256 """
257257 kw"'"
258
259 """
260 .'
261
262 The transposition operator, see [`transpose`](@ref).
263
264 # Examples
265 ```jldoctest
266 julia> A = [1.0 -2.0im; 4.0im 2.0]
267 2×2 Array{Complex{Float64},2}:
268 1.0+0.0im -0.0-2.0im
269 0.0+4.0im 2.0+0.0im
270
271 julia> A.'
272 2×2 Array{Complex{Float64},2}:
273 1.0+0.0im 0.0+4.0im
274 -0.0-2.0im 2.0+0.0im
275 ```
276 """
277 kw".'"
278258
279259 """
280260 const
186186 else
187187 print(io, "Cannot `convert` an object of type ", arg_types_param[2], " to an object of type ", T)
188188 end
189 elseif isempty(methods(f)) && !isa(f, Function)
189 elseif isempty(methods(f)) && isa(f, DataType) && f.abstract
190 print(io, "no constructors have been defined for $f")
191 elseif isempty(methods(f)) && !isa(f, Function) && !isa(f, Type)
190192 print(io, "objects of type $ft are not callable")
191193 else
192194 if ft <: Function && isempty(ft.parameters) &&
195197 f_is_function = true
196198 print(io, "no method matching ", name)
197199 elseif isa(f, Type)
198 if isa(f, DataType) && f.abstract
199 # Print a more appropriate message if the only method
200 # on the type is the default one from sysimg.jl.
201 ms = methods(f)
202 if length(ms) == 1
203 m = first(ms)
204 if Base.is_default_method(m)
205 print(io, "no constructors have been defined for $f")
206 return
207 end
208 end
209 end
210200 print(io, "no method matching ", f)
211201 else
212202 print(io, "no method matching (::", ft, ")")
327317 iob = IOContext(buf, io)
328318 tv = Any[]
329319 sig0 = method.sig
330 if Base.is_default_method(method)
331 continue
332 end
333320 while isa(sig0, UnionAll)
334321 push!(tv, sig0.var)
335322 sig0 = sig0.body
634621 return ret
635622 end
636623
637 """
638 Determines whether a method is the default method which is provided to all types from sysimg.jl.
639 Such a method is usually undesirable to be displayed to the user in the REPL.
640 """
641 function is_default_method(m::Method)
642 return m.module == Base && m.sig == Tuple{Type{T},Any} where T
643 end
644
645624 @noinline function throw_eachindex_mismatch(::IndexLinear, A...)
646625 throw(DimensionMismatch("all inputs to eachindex must have the same indices, got $(join(LinearIndices.(A), ", ", " and "))"))
647626 end
324324 unsigned(x::Int) = reinterpret(UInt, x)
325325 signed(x::UInt) = reinterpret(Int, x)
326326
327 # conversions used by ccall
328 ptr_arg_cconvert(::Type{Ptr{T}}, x) where {T} = cconvert(T, x)
329 ptr_arg_unsafe_convert(::Type{Ptr{T}}, x) where {T} = unsafe_convert(T, x)
330 ptr_arg_unsafe_convert(::Type{Ptr{Cvoid}}, x) = x
331
332327 """
333328 cconvert(T,x)
334329
694689 Core._apply_latest(inner)
695690 end
696691
697 # iteration protocol
698
699 """
700 next(iter, state) -> item, state
701
702 For a given iterable object and iteration state, return the current item and the next iteration state.
703
704 # Examples
705 ```jldoctest
706 julia> next(1:5, 3)
707 (3, 4)
708
709 julia> next(1:5, 5)
710 (5, 6)
711 ```
712 """
713 function next end
714
715 """
716 start(iter) -> state
717
718 Get initial iteration state for an iterable object.
719
720 # Examples
721 ```jldoctest
722 julia> start(1:5)
723 1
724
725 julia> start([1;2;3])
726 1
727
728 julia> start([4;2;3])
729 1
730 ```
731 """
732 function start end
733
734692 """
735693 isempty(collection) -> Bool
736694
841799 """
842800 function iterate end
843801
844 # Compatibility with old iteration protocol
845 function iterate(x, state)
846 @_inline_meta
847 done(x, state) && return nothing
848 return next(x, state)
849 end
850 const old_iterate_line_prev = (@__LINE__)
851 function iterate(x)
852 r = iterate(x, start(x))
853 depwarn("The start/next/done iteration protocol is deprecated. Implement `iterate(::$(typeof(x)))`.", :start)
854 r
855 end
856
857 struct LegacyIterationCompat{I,T,S}
858 done::Bool
859 nextval::T
860 state::S
861 LegacyIterationCompat{I,T,S}() where {I,T,S} = new{I,T,S}(true)
862 LegacyIterationCompat{I,T,S}(nextval::T, state::S) where {I,T,S} = new{I,T,S}(false, nextval, state)
863 end
864
865 function has_non_default_iterate(T)
866 world = ccall(:jl_get_world_counter, UInt, ())
867 mt = Base._methods(iterate, Tuple{T}, -1, world)
868 # Check if this is the above method
869 if (mt[1][3].file == @__FILE_SYMBOL__) && (mt[1][3].line == old_iterate_line_prev + 2)
870 return false
871 end
872 return true
873 end
874
875 const compat_start_line_prev = (@__LINE__)
876 function start(itr::T) where {T}
877 has_non_default_iterate(T) || throw(MethodError(iterate, (itr,)))
878 depwarn("The start/next/done iteration protocol is deprecated. Use `iterate` instead.", :start)
879 y = iterate(itr)
880 y === nothing && return LegacyIterationCompat{T, Union{}, Union{}}()
881 val, state = y
882 LegacyIterationCompat{T, typeof(val), typeof(state)}(val, state)
883 end
884
885 function next(itr::I, state::LegacyIterationCompat{I,T,S}) where {I,T,S}
886 val, state = state.nextval, state.state
887 y = iterate(itr, state)
888 if y === nothing
889 return (val, LegacyIterationCompat{I,T,S}())
890 end
891 nextval, state = y
892 val, LegacyIterationCompat{I, typeof(nextval), typeof(state)}(nextval, state)
893 end
894
895 done(itr::I, state::LegacyIterationCompat{I,T,S}) where {I,T,S} = (@_inline_meta; state.done)
896 # This is necessary to support the above compatibility layer,
897 # eventually, this should just check for applicability of `iterate`
898802 function isiterable(T)::Bool
899 if !has_non_default_iterate(T)
900 world = ccall(:jl_get_world_counter, UInt, ())
901 mt = Base._methods(start, Tuple{T}, -1, world)
902 # Check if this is the fallback start method
903 if (mt[1][3].file == @__FILE_SYMBOL__) && (mt[1][3].line == compat_start_line_prev + 2)
904 return false
905 end
906 end
907 return true
908 end
909
910 # This is required to avoid massive performance problems
911 # due to the start(s::AbstractString) deprecation.
912 iterate(s::AbstractString) = iterate(s, firstindex(s))
803 return hasmethod(iterate, Tuple{T})
804 end
2828 can be used to determine success or failure.
2929 * [`Task`](@ref): Wait for a `Task` to finish. If the task fails with an exception, the
3030 exception is propagated (re-thrown in the task that called `wait`).
31 * `RawFD`: Wait for changes on a file descriptor (see the `FileWatching` package).
31 * [`RawFD`](@ref): Wait for changes on a file descriptor (see the `FileWatching` package).
3232
3333 If no argument is passed, the task blocks for an undefined period. A task can only be
3434 restarted by an explicit call to [`schedule`](@ref) or [`yieldto`](@ref).
123123 InvalidStateException,
124124 KeyError,
125125 MissingException,
126 ParseError,
127126 SystemError,
128127 StringIndexError,
129128
410409 rot180,
411410 rotl90,
412411 rotr90,
413 shuffle,
414 shuffle!,
415412 size,
416413 selectdim,
417414 sort!,
606603 summary,
607604
608605 # logging
609 info,
610 logging,
611 warn,
612606 @debug,
613607 @info,
614608 @warn,
623617 set_zero_subnormals,
624618
625619 # iteration
626 done,
627 next,
628 start,
629620 iterate,
630621
631622 enumerate, # re-exported from Iterators
296296 end
297297
298298 function cptree(src::AbstractString, dst::AbstractString; force::Bool=false,
299 follow_symlinks::Bool=false,
300 remove_destination::Union{Bool,Nothing}=nothing)
301 # TODO: Remove after 0.7
302 if remove_destination !== nothing
303 Base.depwarn("The `remove_destination` keyword argument is deprecated; use " *
304 "`force` instead", :cptree)
305 force = remove_destination
306 end
299 follow_symlinks::Bool=false)
307300 isdir(src) || throw(ArgumentError("'$src' is not a directory. Use `cp(src, dst)`"))
308301 checkfor_mv_cp_cptree(src, dst, "copying"; force=force)
309302 mkdir(dst)
332325 Return `dst`.
333326 """
334327 function cp(src::AbstractString, dst::AbstractString; force::Bool=false,
335 follow_symlinks::Bool=false,
336 remove_destination::Union{Bool,Nothing}=nothing)
337 # TODO: Remove after 0.7
338 if remove_destination !== nothing
339 Base.depwarn("The `remove_destination` keyword argument is deprecated; use " *
340 "`force` instead", :cp)
341 force = remove_destination
342 end
328 follow_symlinks::Bool=false)
343329 checkfor_mv_cp_cptree(src, dst, "copying"; force=force)
344330 if !follow_symlinks && islink(src)
345331 symlink(readlink(src), dst)
386372
387373 ```
388374 """
389 function mv(src::AbstractString, dst::AbstractString; force::Bool=false,
390 remove_destination::Union{Bool,Nothing}=nothing)
391 # TODO: Remove after 0.7
392 if remove_destination !== nothing
393 Base.depwarn("The `remove_destination` keyword argument is deprecated; use " *
394 "`force` instead", :mv)
395 force = remove_destination
396 end
375 function mv(src::AbstractString, dst::AbstractString; force::Bool=false)
397376 checkfor_mv_cp_cptree(src, dst, "moving"; force=force)
398377 rename(src, dst)
399378 dst
230230 `Int`s.
231231 """
232232 to_index(i::Integer) = convert(Int,i)::Int
233 # TODO: Enable this new definition after the deprecations introduced in 0.7 are removed
234 # to_index(i::Bool) = throw(ArgumentError("invalid index: $i of type $(typeof(i))"))
233 to_index(i::Bool) = throw(ArgumentError("invalid index: $i of type $(typeof(i))"))
235234 to_index(I::AbstractArray{Bool}) = LogicalIndex(I)
236235 to_index(I::AbstractArray) = I
237236 to_index(I::AbstractArray{<:Union{AbstractArray, Colon}}) =
234234 readuntil(io::AbstractPipe, arg::AbstractVector; kw...) = readuntil(pipe_reader(io), arg; kw...)
235235 readuntil_vector!(io::AbstractPipe, target::AbstractVector, keep::Bool, out) = readuntil_vector!(pipe_reader(io), target, keep, out)
236236
237 readavailable(io::AbstractPipe) = readavailable(pipe_reader(io))
238
239 isreadable(io::AbstractPipe) = isreadable(pipe_reader(io))
237 for f in (
238 # peek/mark interface
239 :peek, :mark, :unmark, :reset, :ismarked,
240 # Simple reader functions
241 :readavailable, :isreadable)
242 @eval $(f)(io::AbstractPipe) = $(f)(pipe_reader(io))
243 end
244
240245 iswritable(io::AbstractPipe) = iswritable(pipe_writer(io))
241246 isopen(io::AbstractPipe) = isopen(pipe_writer(io)) || isopen(pipe_reader(io))
242247 close(io::AbstractPipe) = (close(pipe_writer(io)); close(pipe_reader(io)))
354359 julia> rm("my_file.txt")
355360 ```
356361 """
357 function readline(filename::AbstractString; chomp=nothing, keep::Bool=false)
358 if chomp !== nothing
359 keep = !chomp
360 depwarn("The `chomp=$chomp` argument to `readline` is deprecated in favor of `keep=$keep`.", :readline)
361 end
362 function readline(filename::AbstractString; keep::Bool=false)
362363 open(filename) do f
363364 readline(f, keep=keep)
364365 end
365366 end
366367
367 function readline(s::IO=stdin; chomp=nothing, keep::Bool=false)
368 if chomp !== nothing
369 keep = !chomp
370 depwarn("The `chomp=$chomp` argument to `readline` is deprecated in favor of `keep=$keep`.", :readline)
371 end
368 function readline(s::IO=stdin; keep::Bool=false)
372369 line = readuntil(s, 0x0a, keep=true)
373370 i = length(line)
374371 if keep || i == 0 || line[i] != 0x0a
520517
521518 function write(s::IO, A::AbstractArray)
522519 if !isbitstype(eltype(A))
523 depwarn("Calling `write` on non-isbits arrays is deprecated. Use a loop or `serialize` instead.", :write)
520 error("`write` is not supported on non-isbits arrays")
524521 end
525522 nb = 0
526523 for a in A
533530 if isbitstype(eltype(a))
534531 return GC.@preserve a unsafe_write(s, pointer(a), sizeof(a))
535532 else
536 depwarn("Calling `write` on non-isbits arrays is deprecated. Use a loop or `serialize` instead.", :write)
537 nb = 0
538 for b in a
539 nb += write(s, b)
540 end
541 return nb
533 error("`write` is not supported on non-isbits arrays")
542534 end
543535 end
544536
874866 julia> rm("my_file.txt");
875867 ```
876868 """
877 function eachline(stream::IO=stdin; chomp=nothing, keep::Bool=false)
878 if chomp !== nothing
879 keep = !chomp
880 depwarn("The `chomp=$chomp` argument to `eachline` is deprecated in favor of `keep=$keep`.", :eachline)
881 end
869 function eachline(stream::IO=stdin; keep::Bool=false)
882870 EachLine(stream, keep=keep)::EachLine
883871 end
884872
885 function eachline(filename::AbstractString; chomp=nothing, keep::Bool=false)
886 if chomp !== nothing
887 keep = !chomp
888 depwarn("The `chomp=$chomp` argument to `eachline` is deprecated in favor of `keep=$keep`.", :eachline)
889 end
873 function eachline(filename::AbstractString; keep::Bool=false)
890874 s = open(filename)
891875 EachLine(s, ondone=()->close(s), keep=keep)::EachLine
892876 end
424424 ccall(:jl_readuntil, Ref{String}, (Ptr{Cvoid}, UInt8, UInt8, UInt8), s.ios, delim, 1, !keep)
425425 end
426426
427 function readline(s::IOStream; chomp=nothing, keep::Bool=false)
428 if chomp !== nothing
429 keep = !chomp
430 depwarn("The `chomp=$chomp` argument to `readline` is deprecated in favor of `keep=$keep`.", :readline)
431 end
427 function readline(s::IOStream; keep::Bool=false)
432428 ccall(:jl_readuntil, Ref{String}, (Ptr{Cvoid}, UInt8, UInt8, UInt8), s.ios, '\n', 1, keep ? 0 : 2)
433429 end
434430
495495
496496 @propagate_inbounds iterate(i::Rest, st=i.st) = iterate(i.itr, st)
497497 isdone(i::Rest, st...) = isdone(i.itr, st...)
498 @propagate_inbounds iterate(i::Rest{I,S}, st::S=i.st) where {I,S<:Base.LegacyIterationCompat{I}} =
499 done(i.itr, st) ? nothing : next(i.itr, st)
500498
501499 eltype(::Type{<:Rest{I}}) where {I} = eltype(I)
502500 IteratorEltype(::Type{<:Rest{I}}) where {I} = IteratorEltype(I)
1818 ## RawFD ##
1919
2020 # Wrapper for an OS file descriptor (on both Unix and Windows)
21 """
22 RawFD
23
24 Primitive type which wraps the native OS file descriptor.
25 `RawFD`s can be passed to methods like [`stat`](@ref) to
26 discover information about the underlying file, and can
27 also be used to open streams, with the `RawFD` describing
28 the OS file backing the stream.
29 """
2130 primitive type RawFD 32 end
2231 RawFD(fd::Integer) = bitcast(RawFD, Cint(fd))
2332 RawFD(fd::RawFD) = fd
119119 global stdin = init_stdio(ccall(:jl_stdin_stream, Ptr{Cvoid}, ()))
120120 global stdout = init_stdio(ccall(:jl_stdout_stream, Ptr{Cvoid}, ()))
121121 global stderr = init_stdio(ccall(:jl_stderr_stream, Ptr{Cvoid}, ()))
122 global STDIN = stdin
123 global STDOUT = stdout
124 global STDERR = stderr
125122 end
126123
127124 """
10691069 Expr(:toplevel,
10701070 :(const ARGS = $args),
10711071 :(eval(x) = $(Expr(:core, :eval))(__anon__, x)),
1072 :(@deprecate eval(m, x) Core.eval(m, x)),
10731072 :(include(x) = $(Expr(:top, :include))(__anon__, x)),
10741073 :(include($path))))
10751074 end
340340 handle_message(logger, Error, msg, _module, :logevent_error, id, filepath, line; exception=(err,catch_backtrace()))
341341 catch err2
342342 try
343 # Give up and write to STDERR, in three independent calls to
343 # Give up and write to stderr, in three independent calls to
344344 # increase the odds of it getting through.
345345 print(stderr, "Exception handling log message: ")
346346 println(stderr, err)
180180 BigFloat(x, prec::Int, rounding::RoundingMode)
181181
182182 Create a representation of `x` as a [`BigFloat`](@ref) with precision `prec` and
183 rounding mode `rounding`.
183 [`Rounding Mode`](@ref Base.Rounding.RoundingMode) `rounding`.
184184 """
185185 function BigFloat(x, prec::Int, rounding::RoundingMode)
186186 setrounding(BigFloat, rounding) do
192192 BigFloat(x, rounding::RoundingMode)
193193
194194 Create a representation of `x` as a [`BigFloat`](@ref) with the current global precision
195 and rounding mode `rounding`.
195 and [`Rounding Mode`](@ref Base.Rounding.RoundingMode) `rounding`.
196196 """
197197 function BigFloat(x::Union{Integer, AbstractFloat, String}, rounding::RoundingMode)
198198 BigFloat(x, precision(BigFloat), rounding)
631631 A
632632 end
633633
634 _iterable(X::AbstractArray, I...) = X
635634 @generated function _unsafe_setindex!(::IndexStyle, A::AbstractArray, x, I::Union{Real,AbstractArray}...)
636635 N = length(I)
637636 quote
638 x′ = unalias(A, _iterable(x, I...))
637 x′ = unalias(A, x)
639638 @nexprs $N d->(I_d = unalias(A, I[d]))
640639 idxlens = @ncall $N index_lengths I
641640 @ncall $N setindex_shape_check x′ (d->idxlens[d])
683682 12
684683 ```
685684 """
686 function diff(A::AbstractMatrix; dims::Union{Integer,Nothing}=nothing)
687 if dims === nothing
688 depwarn("`diff(A::AbstractMatrix)` is deprecated, use `diff(A, dims=1)` instead.", :diff)
689 dims = 1
690 end
685 function diff(A::AbstractMatrix; dims::Integer)
691686 if dims == 1
692687 [A[i+1,j] - A[i,j] for i=1:size(A,1)-1, j=1:size(A,2)]
693688 elseif dims == 2
144144 end
145145 end
146146
147 rawhandle(::DevNullStream) = C_NULL
147 rawhandle(::DevNull) = C_NULL
148148 rawhandle(x::OS_HANDLE) = x
149149 if OS_HANDLE !== RawFD
150150 rawhandle(x::RawFD) = Libc._get_osfhandle(x)
305305 termsignal::Int32
306306 exitnotify::Condition
307307 closenotify::Condition
308 openstream::Symbol # for open(cmd) deprecation
309308 function Process(cmd::Cmd, handle::Ptr{Cvoid},
310309 in::Union{Redirectable, Ptr{Cvoid}},
311310 out::Union{Redirectable, Ptr{Cvoid}},
335334 in::Redirectable
336335 out::Redirectable
337336 err::Redirectable
338 openstream::Symbol # for open(cmd) deprecation
339337 ProcessChain(stdios::StdIOSet) = new(Process[], stdios[1], stdios[2], stdios[3])
340 ProcessChain(chain::ProcessChain, openstream::Symbol) = new(chain.processes, chain.in, chain.out, chain.err, openstream) # for open(cmd) deprecation
341338 end
342339 pipe_reader(p::ProcessChain) = p.out
343340 pipe_writer(p::ProcessChain) = p.in
550547 _spawn(cmds::AbstractCmd, args...; chain::Union{ProcessChain, Nothing}=nothing) =
551548 _spawn(cmds, spawn_opts_swallow(args...)...; chain=chain)
552549
553 function eachline(cmd::AbstractCmd; chomp=nothing, keep::Bool=false)
554 if chomp !== nothing
555 keep = !chomp
556 depwarn("The `chomp=$chomp` argument to `eachline` is deprecated in favor of `keep=$keep`.", :eachline)
557 end
550 function eachline(cmd::AbstractCmd; keep::Bool=false)
558551 _stdout = Pipe()
559552 processes = _spawn(cmd, (devnull, _stdout, stderr))
560553 close(_stdout.in)
599592 out = Pipe()
600593 processes = _spawn(cmds, (in,out,stderr))
601594 close(out.in)
602 if isa(processes, ProcessChain) # for open(cmd) deprecation
603 processes = ProcessChain(processes, :out)
604 else
605 processes.openstream = :out
606 end
607595 elseif write
608596 in = Pipe()
609597 out = other
610598 processes = _spawn(cmds, (in,out,stderr))
611599 close(in.out)
612 if isa(processes, ProcessChain) # for open(cmd) deprecation
613 processes = ProcessChain(processes, :in)
614 else
615 processes.openstream = :in
616 end
617600 else
618601 processes = _spawn(cmds)
619602 end
3636 - [`RoundNearestTiesAway`](@ref)
3737 - [`RoundNearestTiesUp`](@ref)
3838 - [`RoundToZero`](@ref)
39 - `RoundFromZero` ([`BigFloat`](@ref) only)
39 - [`RoundFromZero`](@ref) ([`BigFloat`](@ref) only)
4040 - [`RoundUp`](@ref)
4141 - [`RoundDown`](@ref)
4242 """
7171 """
7272 const RoundDown = RoundingMode{:Down}()
7373
74 """
75 RoundFromZero
76
77 Rounds away from zero.
78 This rounding mode may only be used with `T == BigFloat` inputs to [`round`](@ref).
79
80 # Examples
81 ```jldoctest
82 julia> BigFloat("1.0000000000000001", 5, RoundFromZero)
83 1.06
84 ```
85 """
7486 const RoundFromZero = RoundingMode{:FromZero}() # mpfr only
7587
7688 """
115127 arithmetic functions ([`+`](@ref), [`-`](@ref), [`*`](@ref),
116128 [`/`](@ref) and [`sqrt`](@ref)) and type conversion. Other numerical
117129 functions may give incorrect or invalid values when using rounding modes other than the
118 default `RoundNearest`.
130 default [`RoundNearest`](@ref).
119131
120132 Note that this is currently only supported for `T == BigFloat`.
121133 """
205217 """
206218 get_zero_subnormals() -> Bool
207219
208 Returns `false` if operations on subnormal floating-point values ("denormals") obey rules
220 Return `false` if operations on subnormal floating-point values ("denormals") obey rules
209221 for IEEE arithmetic, and `true` if they might be converted to zeros.
210222 """
211223 get_zero_subnormals() = ccall(:jl_get_zero_subnormals,Int32,())!=0
185185
186186 convert(::Type{IOContext}, io::IO) = IOContext(unwrapcontext(io)...)
187187
188 # rename to IOContext when deprecation of `IOContext(io::IO; kws...)` is removed
189 _IOContext(io::IO) = convert(IOContext, io)
188 IOContext(io::IO) = convert(IOContext, io)
190189
191190 function IOContext(io::IO, KV::Pair)
192191 io0, d = unwrapcontext(io)
563562 end
564563
565564 show(io::IO, ::Nothing) = print(io, "nothing")
565 print(io::IO, ::Nothing) = throw(ArgumentError("`nothing` should not be printed; use `show`, `repr`, or custom output instead."))
566566 show(io::IO, b::Bool) = print(io, b ? "true" : "false")
567567 show(io::IO, n::Signed) = (write(io, string(n)); nothing)
568568 show(io::IO, n::Unsigned) = print(io, "0x", string(n, pad = sizeof(n)<<1, base = 16))
760760 const expr_infix_wide = Set{Symbol}([
761761 :(=), :(+=), :(-=), :(*=), :(/=), :(\=), :(^=), :(&=), :(|=), :(÷=), :(%=), :(>>>=), :(>>=), :(<<=),
762762 :(.=), :(.+=), :(.-=), :(.*=), :(./=), :(.\=), :(.^=), :(.&=), :(.|=), :(.÷=), :(.%=), :(.>>>=), :(.>>=), :(.<<=),
763 :(&&), :(||), :(<:), :($=), :(⊻=)]) # `$=` should be removed after deprecation is removed, issue #18977
763 :(&&), :(||), :(<:), :($=), :(⊻=)])
764764 const expr_infix = Set{Symbol}([:(:), :(->), Symbol("::")])
765765 const expr_infix_any = union(expr_infix, expr_infix_wide)
766766 const expr_calls = Dict(:call => ('(',')'), :calldecl => ('(',')'),
14001400 parens && print(io, ")")
14011401
14021402 # transpose
1403 elseif (head === Symbol('\'') || head === Symbol(".'")) && length(args) == 1
1403 elseif head === Symbol('\'') && length(args) == 1
14041404 if isa(args[1], Symbol)
14051405 show_unquoted(io, args[1])
14061406 else
55 const Base = parentmodule(@__MODULE__)
66 using .Base.Order
77 using .Base: copymutable, LinearIndices, length, (:),
8 eachindex, axes, first, last, similar, start, next, done, zip, OrdinalRange,
8 eachindex, axes, first, last, similar, zip, OrdinalRange,
99 AbstractVector, @inbounds, AbstractRange, @eval, @inline, Vector, @noinline,
1010 AbstractMatrix, AbstractUnitRange, isless, identity, eltype, >, <, <=, >=, |, +, -, *, !,
1111 extrema, sub_with_overflow, add_with_overflow, oneunit, div, getindex, setindex!,
901901 lt=isless,
902902 by=identity,
903903 rev::Union{Bool,Nothing}=nothing,
904 order::Ordering=Forward,
905 initialized::Union{Bool,Nothing}=nothing)
904 order::Ordering=Forward)
906905 dim = dims
907 if initialized !== nothing
908 Base.depwarn("`initialized` keyword argument is deprecated", :sort)
909 end
910906 order = ord(lt,by,rev,order)
911907 n = length(axes(A, dim))
912908 if dim != 1
2323 # . +- Process (not exported)
2424 # . +- ProcessChain (not exported)
2525 # +- BufferStream
26 # +- DevNullStream (not exported)
26 # +- DevNull (not exported)
2727 # +- Filesystem.File
2828 # +- LibuvStream (not exported)
2929 # . +- PipeEndpoint (not exported)
910910 (:stderr, true, 2, :jl_uv_stderr))
911911 f = Symbol("redirect_", lowercase(string(x)))
912912 _f = Symbol("_", f)
913 Ux = Symbol(uppercase(string(x)))
914913 @eval begin
915914 function ($_f)(stream)
916 global $x, $Ux
915 global $x
917916 posix_fd = _fd(stream)
918917 @static if Sys.iswindows()
919918 ccall(:SetStdHandle, stdcall, Int32, (Int32, OS_HANDLE),
920919 $(-10 - unix_fd), Libc._get_osfhandle(posix_fd))
921920 end
922921 dup(posix_fd, RawFD($unix_fd))
923 $Ux = $x = stream
922 $x = stream
924923 nothing
925924 end
926925 function ($f)(handle::Union{LibuvStream, IOStream})
301301 function split end
302302
303303 function split(str::T, splitter;
304 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
305 if keep !== nothing
306 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :split)
307 keepempty = keep
308 end
304 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
309305 _split(str, splitter, limit, keepempty, T <: SubString ? T[] : SubString{T}[])
310306 end
311307 function split(str::T, splitter::Union{Tuple{Vararg{<:AbstractChar}},AbstractVector{<:AbstractChar},Set{<:AbstractChar}};
312 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
313 if keep !== nothing
314 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :split)
315 keepempty = keep
316 end
308 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
317309 _split(str, in(splitter), limit, keepempty, T <: SubString ? T[] : SubString{T}[])
318310 end
319311 function split(str::T, splitter::AbstractChar;
320 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
321 if keep !== nothing
322 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :split)
323 keepempty = keep
324 end
312 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
325313 _split(str, isequal(splitter), limit, keepempty, T <: SubString ? T[] : SubString{T}[])
326314 end
327315
387375 function rsplit end
388376
389377 function rsplit(str::T, splitter;
390 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
391 if keep !== nothing
392 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :rsplit)
393 keepempty = keep
394 end
378 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
395379 _rsplit(str, splitter, limit, keepempty, T <: SubString ? T[] : SubString{T}[])
396380 end
397381 function rsplit(str::T, splitter::Union{Tuple{Vararg{<:AbstractChar}},AbstractVector{<:AbstractChar},Set{<:AbstractChar}};
398 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
399 if keep !== nothing
400 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :rsplit)
401 keepempty = keep
402 end
382 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
403383 _rsplit(str, in(splitter), limit, keepempty, T <: SubString ? T[] : SubString{T}[])
404384 end
405385 function rsplit(str::T, splitter::AbstractChar;
406 limit::Integer=0, keepempty::Bool=true, keep::Union{Nothing,Bool}=nothing) where {T<:AbstractString}
407 if keep !== nothing
408 Base.depwarn("The `keep` keyword argument is deprecated; use `keepempty` instead", :rsplit)
409 keepempty = keep
410 end
386 limit::Integer=0, keepempty::Bool=true) where {T<:AbstractString}
411387 _rsplit(str, isequal(splitter), limit, keepempty, T <: SubString ? T[] : SubString{T}[])
412388 end
413389
66 exclude::Any
77 chargeall::Any
88 end
9
10 _nfields(@nospecialize x) = length(typeof(x).types)
119
1210 """
1311 Base.summarysize(obj; exclude=Union{...}, chargeall=Union{...}) -> Int
4240 val = x[i]
4341 end
4442 else
45 nf = _nfields(x)
43 nf = nfields(x)
4644 ft = typeof(x).types
4745 if !isbitstype(ft[i]) && isdefined(x, i)
4846 val = getfield(x, i)
6967 # and so is somewhat approximate.
7068 key = ccall(:jl_value_ptr, Ptr{Cvoid}, (Any,), obj)
7169 haskey(ss.seen, key) ? (return 0) : (ss.seen[key] = true)
72 if _nfields(obj) > 0
70 if nfields(obj) > 0
7371 push!(ss.frontier_x, obj)
7472 push!(ss.frontier_i, 1)
7573 end
8886 key = pointer_from_objref(obj)
8987 haskey(ss.seen, key) ? (return 0) : (ss.seen[key] = true)
9088 size::Int = 7 * Core.sizeof(Int) + 6 * Core.sizeof(Int32)
91 size += 4 * _nfields(obj) + ifelse(Sys.WORD_SIZE == 64, 4, 0)
89 size += 4 * nfields(obj) + ifelse(Sys.WORD_SIZE == 64, 4, 0)
9290 size += ss(obj.parameters)::Int
9391 size += ss(obj.types)::Int
9492 return size
3636 elseif INCLUDE_STATE === 2
3737 result = _include(Base, path)
3838 else
39 # to help users avoid error (accidentally evaluating into Base), this is deprecated
40 depwarn("Base.include(string) is deprecated, use `include(fname)` or `Base.include(@__MODULE__, fname)` instead.", :include)
41 result = include_relative(_current_module(), path)
39 # to help users avoid error (accidentally evaluating into Base), this is not allowed
40 error("Base.include(string) is discontinued, use `include(fname)` or `Base.include(@__MODULE__, fname)` instead.")
4241 end
4342 result
4443 end
461460 if cpu_threads > 8 # always at most 8
462461 ENV["OPENBLAS_NUM_THREADS"] = "8"
463462 elseif haskey(ENV, "JULIA_CPU_THREADS") # or exactly as specified
464 ENV["OPENBLAS_NUM_THREADS"] = cpu_threads
465 elseif haskey(ENV, "JULIA_CPU_CORES") # TODO: delete in 1.0 (deprecation)
466 Core.print("JULIA_CPU_CORES is deprecated, use JULIA_CPU_THREADS instead.\n")
467463 ENV["OPENBLAS_NUM_THREADS"] = cpu_threads
468464 end # otherwise, trust that openblas will pick CPU_THREADS anyways, without any intervention
469465 end
515511 :Random,
516512 :UUIDs,
517513 :Future,
518 :OldPkg,
519514 :LinearAlgebra,
520515 :SparseArrays,
521516 :SuiteSparse,
546541
547542 print_time("Stdlibs total", Base.tot_time_stdlib[])
548543 end
549
550 @eval Base begin
551 @deprecate_binding Test root_module(Base, :Test) true ", run `using Test` instead"
552 @deprecate_binding Mmap root_module(Base, :Mmap) true ", run `using Mmap` instead"
553 @deprecate_binding Profile root_module(Base, :Profile) true ", run `using Profile` instead"
554 @deprecate_binding Dates root_module(Base, :Dates) true ", run `using Dates` instead"
555 @deprecate_binding Distributed root_module(Base, :Distributed) true ", run `using Distributed` instead"
556 @deprecate_binding Random root_module(Base, :Random) true ", run `using Random` instead"
557 @deprecate_binding Serializer root_module(Base, :Serialization) true ", run `using Serialization` instead"
558 @deprecate_binding Libdl root_module(Base, :Libdl) true ", run `using Libdl` instead"
559 @deprecate_binding Markdown root_module(Base, :Markdown) true ", run `using Markdown` instead"
560
561 # PR #25249
562 @deprecate_binding SparseArrays root_module(Base, :SparseArrays) true ", run `using SparseArrays` instead"
563 @deprecate_binding(AbstractSparseArray, root_module(Base, :SparseArrays).AbstractSparseArray, true,
564 ", run `using SparseArrays` to load sparse array functionality")
565 @deprecate_binding(AbstractSparseMatrix, root_module(Base, :SparseArrays).AbstractSparseMatrix, true,
566 ", run `using SparseArrays` to load sparse array functionality")
567 @deprecate_binding(AbstractSparseVector, root_module(Base, :SparseArrays).AbstractSparseVector, true,
568 ", run `using SparseArrays` to load sparse array functionality")
569 @deprecate_binding(SparseMatrixCSC, root_module(Base, :SparseArrays).SparseMatrixCSC, true,
570 ", run `using SparseArrays` to load sparse array functionality")
571 @deprecate_binding(SparseVector, root_module(Base, :SparseArrays).SparseVector, true,
572 ", run `using SparseArrays` to load sparse array functionality")
573
574 @deprecate_binding(SharedArray, root_module(Base, :SharedArrays).SharedArray, true,
575 ", run `using SharedArrays` to load shared array functionality")
576
577 # PR #25571
578 @deprecate_binding LinAlg root_module(Base, :LinearAlgebra) true ", run `using LinearAlgebra` instead"
579 @deprecate_binding(I, root_module(Base, :LinearAlgebra).I, true,
580 ", run `using LinearAlgebra` to load linear algebra functionality.")
581
582 # PR 25544
583 @deprecate_binding REPL root_module(Base, :REPL) true ", run `using REPL` instead"
584 @deprecate_binding LineEdit root_module(Base, :REPL).LineEdit true ", use `REPL.LineEdit` instead"
585 @deprecate_binding REPLCompletions root_module(Base, :REPL).REPLCompletions true ", use `REPL.REPLCompletions` instead"
586 @deprecate_binding Terminals root_module(Base, :REPL).Terminals true ", use `REPL.Terminals` instead"
587
588 @deprecate_binding Pkg root_module(Base, :Pkg) true ", run `using Pkg` instead"
589 @deprecate_binding LibGit2 root_module(Base, :LibGit2) true ", run `import LibGit2` instead"
590
591 @eval @deprecate_binding $(Symbol("@doc_str")) getfield(root_module(Base, :Markdown), Symbol("@doc_str")) true ", use `Markdown` instead"
592
593 @deprecate_stdlib readdlm DelimitedFiles true
594 @deprecate_stdlib writedlm DelimitedFiles true
595 @deprecate_stdlib readcsv DelimitedFiles true
596 @deprecate_stdlib writecsv DelimitedFiles true
597
598 @eval @deprecate_stdlib $(Symbol("@profile")) Profile true
599
600 @deprecate_stdlib base64encode Base64 true
601 @deprecate_stdlib base64decode Base64 true
602 @deprecate_stdlib Base64EncodePipe Base64 true
603 @deprecate_stdlib Base64DecodePipe Base64 true
604 @deprecate_stdlib stringmime Base64 true
605
606 @deprecate_stdlib poll_fd FileWatching true
607 @deprecate_stdlib poll_file FileWatching true
608 @deprecate_stdlib PollingFileWatcher FileWatching true
609 @deprecate_stdlib watch_file FileWatching true
610 @deprecate_stdlib FileMonitor FileWatching true
611
612 @eval @deprecate_stdlib $(Symbol("@spawn")) Distributed true
613 @eval @deprecate_stdlib $(Symbol("@spawnat")) Distributed true
614 @eval @deprecate_stdlib $(Symbol("@fetch")) Distributed true
615 @eval @deprecate_stdlib $(Symbol("@fetchfrom")) Distributed true
616 @eval @deprecate_stdlib $(Symbol("@everywhere")) Distributed true
617 @eval @deprecate_stdlib $(Symbol("@parallel")) Distributed true
618
619 @deprecate_stdlib addprocs Distributed true
620 @deprecate_stdlib CachingPool Distributed true
621 @deprecate_stdlib clear! Distributed true
622 @deprecate_stdlib ClusterManager Distributed true
623 @deprecate_stdlib default_worker_pool Distributed true
624 @deprecate_stdlib init_worker Distributed true
625 @deprecate_stdlib interrupt Distributed true
626 @deprecate_stdlib launch Distributed true
627 @deprecate_stdlib manage Distributed true
628 @deprecate_stdlib myid Distributed true
629 @deprecate_stdlib nprocs Distributed true
630 @deprecate_stdlib nworkers Distributed true
631 @deprecate_stdlib pmap Distributed true
632 @deprecate_stdlib procs Distributed true
633 @deprecate_stdlib remote Distributed true
634 @deprecate_stdlib remotecall Distributed true
635 @deprecate_stdlib remotecall_fetch Distributed true
636 @deprecate_stdlib remotecall_wait Distributed true
637 @deprecate_stdlib remote_do Distributed true
638 @deprecate_stdlib rmprocs Distributed true
639 @deprecate_stdlib workers Distributed true
640 @deprecate_stdlib WorkerPool Distributed true
641 @deprecate_stdlib RemoteChannel Distributed true
642 @deprecate_stdlib Future Distributed true
643 @deprecate_stdlib WorkerConfig Distributed true
644 @deprecate_stdlib RemoteException Distributed true
645 @deprecate_stdlib ProcessExitedException Distributed true
646
647 @deprecate_stdlib crc32c CRC32c true
648
649 @deprecate_stdlib DateTime Dates true
650 @deprecate_stdlib DateFormat Dates true
651 @eval @deprecate_stdlib $(Symbol("@dateformat_str")) Dates true
652 @deprecate_stdlib now Dates true
653
654 @eval @deprecate_stdlib $(Symbol("@printf")) Printf true
655 @eval @deprecate_stdlib $(Symbol("@sprintf")) Printf true
656
657 # PR #24874
658 @deprecate_stdlib rand! Random true
659 @deprecate_stdlib srand Random true
660 @deprecate_stdlib AbstractRNG Random true
661 @deprecate_stdlib randcycle Random true
662 @deprecate_stdlib randcycle! Random true
663 @deprecate_stdlib randperm Random true
664 @deprecate_stdlib randperm! Random true
665 @deprecate_stdlib shuffle Random true
666 @deprecate_stdlib shuffle! Random true
667 @deprecate_stdlib randsubseq Random true
668 @deprecate_stdlib randsubseq! Random true
669 @deprecate_stdlib randstring Random true
670 @deprecate_stdlib MersenneTwister Random true
671 @deprecate_stdlib RandomDevice Random true
672 @deprecate_stdlib randn! Random true
673 @deprecate_stdlib randexp Random true
674 @deprecate_stdlib randexp! Random true
675 @deprecate_stdlib bitrand Random true
676 @deprecate_stdlib randjump Random true
677 @deprecate_stdlib GLOBAL_RNG Random false
678
679 @deprecate_stdlib serialize Serialization true
680 @deprecate_stdlib deserialize Serialization true
681 @deprecate_stdlib AbstractSerializer Serialization true
682 @deprecate_stdlib SerializationState Serialization true
683
684 # PR #25249: SparseArrays to stdlib
685 ## the Base.SparseArrays module itself and exported types are deprecated in base/sysimg.jl
686 ## functions that were re-exported from Base
687 @deprecate_stdlib nonzeros SparseArrays true
688 @deprecate_stdlib permute SparseArrays true
689 @deprecate_stdlib blkdiag SparseArrays true blockdiag
690 @deprecate_stdlib dropzeros SparseArrays true
691 @deprecate_stdlib dropzeros! SparseArrays true
692 @deprecate_stdlib issparse SparseArrays true
693 @deprecate_stdlib sparse SparseArrays true
694 @deprecate_stdlib sparsevec SparseArrays true
695 @deprecate_stdlib spdiagm SparseArrays true
696 @deprecate_stdlib sprand SparseArrays true
697 @deprecate_stdlib sprandn SparseArrays true
698 @deprecate_stdlib spzeros SparseArrays true
699 @deprecate_stdlib rowvals SparseArrays true
700 @deprecate_stdlib nzrange SparseArrays true
701 @deprecate_stdlib nnz SparseArrays true
702 @deprecate_stdlib findnz SparseArrays true
703 ## functions that were exported from Base.SparseArrays but not from Base
704 @deprecate_stdlib droptol! SparseArrays false
705 ## deprecated functions that are moved to stdlib/SparseArrays/src/deprecated.jl
706 @deprecate_stdlib spones SparseArrays true
707 @deprecate_stdlib speye SparseArrays true
708
709 # PR #25571: LinearAlgebra to stdlib
710 @deprecate_stdlib BLAS LinearAlgebra true
711 ## functions that were re-exported from Base
712 @deprecate_stdlib bkfact! LinearAlgebra true
713 @deprecate_stdlib bkfact LinearAlgebra true
714 @deprecate_stdlib chol LinearAlgebra true
715 @deprecate_stdlib cholfact! LinearAlgebra true
716 @deprecate_stdlib cholfact LinearAlgebra true
717 @deprecate_stdlib cond LinearAlgebra true
718 @deprecate_stdlib condskeel LinearAlgebra true
719 @deprecate_stdlib cross LinearAlgebra true
720 @deprecate_stdlib adjoint! LinearAlgebra true
721 # @deprecate_stdlib adjoint LinearAlgebra true
722 @deprecate_stdlib det LinearAlgebra true
723 @deprecate_stdlib diag LinearAlgebra true
724 @deprecate_stdlib diagind LinearAlgebra true
725 @deprecate_stdlib diagm LinearAlgebra true
726 @deprecate_stdlib dot LinearAlgebra true
727 @deprecate_stdlib eig LinearAlgebra true
728 @deprecate_stdlib eigfact! LinearAlgebra true
729 @deprecate_stdlib eigfact LinearAlgebra true
730 @deprecate_stdlib eigmax LinearAlgebra true
731 @deprecate_stdlib eigmin LinearAlgebra true
732 @deprecate_stdlib eigvals LinearAlgebra true
733 @deprecate_stdlib eigvals! LinearAlgebra true
734 @deprecate_stdlib eigvecs LinearAlgebra true
735 @deprecate_stdlib factorize LinearAlgebra true
736 @deprecate_stdlib givens LinearAlgebra true
737 @deprecate_stdlib hessfact! LinearAlgebra true
738 @deprecate_stdlib hessfact LinearAlgebra true
739 @deprecate_stdlib isdiag LinearAlgebra true
740 @deprecate_stdlib ishermitian LinearAlgebra true
741 @deprecate_stdlib isposdef! LinearAlgebra true
742 @deprecate_stdlib isposdef LinearAlgebra true
743 @deprecate_stdlib issymmetric LinearAlgebra true
744 @deprecate_stdlib istril LinearAlgebra true
745 @deprecate_stdlib istriu LinearAlgebra true
746 # @deprecate_stdlib kron LinearAlgebra true
747 @deprecate_stdlib ldltfact LinearAlgebra true
748 @deprecate_stdlib ldltfact! LinearAlgebra true
749 @deprecate_stdlib logabsdet LinearAlgebra true
750 @deprecate_stdlib logdet LinearAlgebra true
751 @deprecate_stdlib lu LinearAlgebra true
752 @deprecate_stdlib lufact! LinearAlgebra true
753 @deprecate_stdlib lufact LinearAlgebra true
754 @deprecate_stdlib lyap LinearAlgebra true
755 @deprecate_stdlib norm LinearAlgebra true
756 @deprecate_stdlib normalize LinearAlgebra true
757 @deprecate_stdlib normalize! LinearAlgebra true
758 @deprecate_stdlib nullspace LinearAlgebra true
759 @deprecate_stdlib ordschur! LinearAlgebra true
760 @deprecate_stdlib ordschur LinearAlgebra true
761 @deprecate_stdlib pinv LinearAlgebra true
762 @deprecate_stdlib qr LinearAlgebra true
763 @deprecate_stdlib qrfact! LinearAlgebra true
764 @deprecate_stdlib qrfact LinearAlgebra true
765 @deprecate_stdlib lq LinearAlgebra true
766 @deprecate_stdlib lqfact! LinearAlgebra true
767 @deprecate_stdlib lqfact LinearAlgebra true
768 @deprecate_stdlib rank LinearAlgebra true
769 @deprecate_stdlib scale! LinearAlgebra true
770 @deprecate_stdlib schur LinearAlgebra true
771 @deprecate_stdlib schurfact! LinearAlgebra true
772 @deprecate_stdlib schurfact LinearAlgebra true
773 @deprecate_stdlib svd LinearAlgebra true
774 @deprecate_stdlib svdfact! LinearAlgebra true
775 @deprecate_stdlib svdfact LinearAlgebra true
776 @deprecate_stdlib svdvals! LinearAlgebra true
777 @deprecate_stdlib svdvals LinearAlgebra true
778 @deprecate_stdlib sylvester LinearAlgebra true
779 @deprecate_stdlib trace LinearAlgebra true tr
780 @deprecate_stdlib transpose! LinearAlgebra true
781 # @deprecate_stdlib transpose LinearAlgebra true
782 @deprecate_stdlib tril! LinearAlgebra true
783 @deprecate_stdlib tril LinearAlgebra true
784 @deprecate_stdlib triu! LinearAlgebra true
785 @deprecate_stdlib triu LinearAlgebra true
786 @deprecate_stdlib vecdot LinearAlgebra true
787 @deprecate_stdlib vecnorm LinearAlgebra true
788 @deprecate_stdlib $(:⋅) LinearAlgebra true
789 @deprecate_stdlib $(:×) LinearAlgebra true
790
791 ## types that were re-exported from Base
792 @deprecate_stdlib Diagonal LinearAlgebra true
793 @deprecate_stdlib Bidiagonal LinearAlgebra true
794 @deprecate_stdlib Tridiagonal LinearAlgebra true
795 @deprecate_stdlib SymTridiagonal LinearAlgebra true
796 @deprecate_stdlib UpperTriangular LinearAlgebra true
797 @deprecate_stdlib LowerTriangular LinearAlgebra true
798 @deprecate_stdlib Symmetric LinearAlgebra true
799 @deprecate_stdlib Hermitian LinearAlgebra true
800 @deprecate_stdlib Factorization LinearAlgebra true
801 @deprecate_stdlib UniformScaling LinearAlgebra true
802 @deprecate_stdlib Adjoint LinearAlgebra true
803 @deprecate_stdlib Transpose LinearAlgebra true
804
805 ## functions that were exported from Base.LinAlg but not from Base
806 @deprecate_stdlib axpy! LinearAlgebra false
807 @deprecate_stdlib axpby! LinearAlgebra false
808 @deprecate_stdlib copy_transpose! LinearAlgebra false
809 @deprecate_stdlib issuccess LinearAlgebra false
810 @deprecate_stdlib transpose_type LinearAlgebra false
811 @deprecate_stdlib A_mul_B! LinearAlgebra false
812 @deprecate_stdlib A_mul_Bt! LinearAlgebra false
813 @deprecate_stdlib At_mul_B! LinearAlgebra false
814 @deprecate_stdlib At_mul_Bt! LinearAlgebra false
815 @deprecate_stdlib A_mul_Bc! LinearAlgebra false
816 @deprecate_stdlib Ac_mul_B! LinearAlgebra false
817 @deprecate_stdlib Ac_mul_Bc! LinearAlgebra false
818 @deprecate_stdlib A_ldiv_B! LinearAlgebra false
819 @deprecate_stdlib At_ldiv_B! LinearAlgebra false
820 @deprecate_stdlib Ac_ldiv_B! LinearAlgebra false
821
822 ## types that were exported from Base.LinAlg but not from Base
823 @deprecate_stdlib BunchKaufman LinearAlgebra false
824 @deprecate_stdlib Cholesky LinearAlgebra false
825 @deprecate_stdlib CholeskyPivoted LinearAlgebra false
826 @deprecate_stdlib Eigen LinearAlgebra false
827 @deprecate_stdlib GeneralizedEigen LinearAlgebra false
828 @deprecate_stdlib GeneralizedSVD LinearAlgebra false
829 @deprecate_stdlib GeneralizedSchur LinearAlgebra false
830 @deprecate_stdlib Hessenberg LinearAlgebra false
831 @deprecate_stdlib LU LinearAlgebra false
832 @deprecate_stdlib LDLt LinearAlgebra false
833 @deprecate_stdlib QR LinearAlgebra false
834 @deprecate_stdlib QRPivoted LinearAlgebra false
835 @deprecate_stdlib LQ LinearAlgebra false
836 @deprecate_stdlib Schur LinearAlgebra false
837 @deprecate_stdlib SVD LinearAlgebra false
838
839 ## deprecated functions that are moved to stdlib/LinearAlgebra/src/deprecated.jl
840 @deprecate_stdlib eye LinearAlgebra true
841 @deprecate_stdlib sqrtm LinearAlgebra true
842 @deprecate_stdlib expm LinearAlgebra true
843 @deprecate_stdlib expm! LinearAlgebra true
844 @deprecate_stdlib logm LinearAlgebra true
845 @deprecate_stdlib gradient LinearAlgebra true
846 @deprecate_stdlib ConjArray LinearAlgebra true
847 @deprecate_stdlib ConjVector LinearAlgebra true
848 @deprecate_stdlib ConjMatrix LinearAlgebra true
849 @deprecate_stdlib RowVector LinearAlgebra true
850
851 # PR #25021
852 @deprecate_stdlib normalize_string Unicode true
853 @deprecate_stdlib graphemes Unicode true
854 @deprecate_stdlib is_assigned_char Unicode true
855
856 @deprecate_stdlib whos InteractiveUtils true
857 @deprecate_stdlib subtypes InteractiveUtils true
858 @deprecate_stdlib apropos InteractiveUtils true
859 @deprecate_stdlib edit InteractiveUtils true
860 @deprecate_stdlib less InteractiveUtils true
861 @deprecate_stdlib code_llvm InteractiveUtils true
862 @deprecate_stdlib code_native InteractiveUtils true
863 @deprecate_stdlib code_warntype InteractiveUtils true
864 @deprecate_stdlib methodswith InteractiveUtils true
865 @deprecate_stdlib varinfo InteractiveUtils true
866 @deprecate_stdlib versioninfo InteractiveUtils true
867 @deprecate_stdlib peakflops InteractiveUtils true
868 @deprecate_stdlib clipboard InteractiveUtils true
869 @eval @deprecate_stdlib $(Symbol("@which")) InteractiveUtils true
870 @eval @deprecate_stdlib $(Symbol("@edit")) InteractiveUtils true
871 @eval @deprecate_stdlib $(Symbol("@less")) InteractiveUtils true
872 @eval @deprecate_stdlib $(Symbol("@functionloc")) InteractiveUtils true
873 @eval @deprecate_stdlib $(Symbol("@code_typed")) InteractiveUtils true
874 @eval @deprecate_stdlib $(Symbol("@code_warntype")) InteractiveUtils true
875 @eval @deprecate_stdlib $(Symbol("@code_lowered")) InteractiveUtils true
876 @eval @deprecate_stdlib $(Symbol("@code_llvm")) InteractiveUtils true
877 @eval @deprecate_stdlib $(Symbol("@code_native")) InteractiveUtils true
878
879 @eval @deprecate_stdlib $(Symbol("@ip_str")) Sockets true
880 @deprecate_stdlib IPAddr Sockets true
881 @deprecate_stdlib IPv4 Sockets true
882 @deprecate_stdlib IPv6 Sockets true
883 @deprecate_stdlib accept Sockets true
884 @deprecate_stdlib connect Sockets true
885 @deprecate_stdlib getaddrinfo Sockets true
886 @deprecate_stdlib getalladdrinfo Sockets true
887 @deprecate_stdlib getnameinfo Sockets true
888 @deprecate_stdlib getipaddr Sockets true
889 @deprecate_stdlib getpeername Sockets true
890 @deprecate_stdlib getsockname Sockets true
891 @deprecate_stdlib listen Sockets true
892 @deprecate_stdlib listenany Sockets true
893 @deprecate_stdlib recv Sockets true
894 @deprecate_stdlib recvfrom Sockets true
895 @deprecate_stdlib send Sockets true
896 @deprecate_stdlib TCPSocket Sockets true
897 @deprecate_stdlib UDPSocket Sockets true
898
899 @deprecate_stdlib cor Statistics true
900 @deprecate_stdlib cov Statistics true
901 @deprecate_stdlib std Statistics true
902 @deprecate_stdlib stdm Statistics true
903 @deprecate_stdlib var Statistics true
904 @deprecate_stdlib varm Statistics true
905 @deprecate_stdlib mean! Statistics true
906 @deprecate_stdlib mean Statistics true
907 @deprecate_stdlib median! Statistics true
908 @deprecate_stdlib median Statistics true
909 @deprecate_stdlib middle Statistics true
910 @deprecate_stdlib quantile! Statistics true
911 @deprecate_stdlib quantile Statistics true
912 end
913544 end
914545
915546 # Clear global state
9191 env_threads = nothing
9292 if haskey(ENV, "JULIA_CPU_THREADS")
9393 env_threads = ENV["JULIA_CPU_THREADS"]
94 elseif haskey(ENV, "JULIA_CPU_CORES") # TODO: delete in 1.0 (deprecation)
95 Core.print("JULIA_CPU_CORES is deprecated, use JULIA_CPU_THREADS instead.\n")
96 env_threads = ENV["JULIA_CPU_CORES"]
9794 end
9895 global CPU_THREADS = if env_threads !== nothing
9996 env_threads = tryparse(Int, env_threads)
105102 else
106103 Int(ccall(:jl_cpu_threads, Int32, ()))
107104 end
108 global CPU_CORES = CPU_THREADS # TODO: delete in 1.0 (deprecation)
109105 global SC_CLK_TCK = ccall(:jl_SC_CLK_TCK, Clong, ())
110106 global CPU_NAME = ccall(:jl_get_cpu_name, Ref{String}, ())
111107 global JIT = ccall(:jl_get_JIT, Ref{String}, ())
177177 end
178178
179179 # NOTE: you can only wait for scheduled tasks
180 # TODO: rename to wait for 1.0
181 function _wait(t::Task)
180 function wait(t::Task)
182181 if !istaskdone(t)
183182 if t.donenotify === nothing
184183 t.donenotify = Condition()
192191 end
193192 end
194193
195 _wait(not_a_task) = wait(not_a_task)
196
197194 """
198195 fetch(t::Task)
199196
201198 exception, the exception is propagated (re-thrown in the task that called fetch).
202199 """
203200 function fetch(t::Task)
204 _wait(t)
201 wait(t)
205202 task_result(t)
206203 end
207204
212209 c_ex = CompositeException()
213210 for r in refs
214211 try
215 _wait(r)
212 wait(r)
216213 catch ex
217214 if !isa(r, Task) || (isa(r, Task) && !istaskfailed(r))
218215 rethrow(ex)
277277 commit_string = "$(branch)/$(commit) (fork: $(distance) commits, $(days) $(unit))"
278278 end
279279 end
280 commit_date = !isempty(GIT_VERSION_INFO.date_string) ? " ($(GIT_VERSION_INFO.date_string))" : ""
280
281 commit_date = isempty(Base.GIT_VERSION_INFO.date_string) ? "" : " ($(split(Base.GIT_VERSION_INFO.date_string)[1]))"
281282
282283 if get(io, :color, false)
283284 c = text_colors
289290 d4 = c[:bold] * c[:magenta] # fourth dot
290291
291292 print(io,""" $(d3)_$(tx)
292 $(d1)_$(tx) $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | A fresh approach to technical computing
293 $(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) | Documentation: https://docs.julialang.org
293 $(d1)_$(tx) $(jl)_$(tx) $(d2)_$(d3)(_)$(d4)_$(tx) | Documentation: https://docs.julialang.org
294 $(d1)(_)$(jl) | $(d2)(_)$(tx) $(d4)(_)$(tx) |
294295 $(jl)_ _ _| |_ __ _$(tx) | Type \"?\" for help, \"]?\" for Pkg help.
295296 $(jl)| | | | | | |/ _` |$(tx) |
296297 $(jl)| | |_| | | | (_| |$(tx) | Version $(VERSION)$(commit_date)
297298 $(jl)_/ |\\__'_|_|_|\\__'_|$(tx) | $(commit_string)
298 $(jl)|__/$(tx) | $(Sys.MACHINE)
299 $(jl)|__/$(tx) |
299300
300301 """)
301302 else
302303 print(io,"""
303304 _
304 _ _ _(_)_ | A fresh approach to technical computing
305 (_) | (_) (_) | Documentation: https://docs.julialang.org
305 _ _ _(_)_ | Documentation: https://docs.julialang.org
306 (_) | (_) (_) |
306307 _ _ _| |_ __ _ | Type \"?\" for help, \"]?\" for Pkg help.
307308 | | | | | | |/ _` | |
308309 | | |_| | | | (_| | | Version $(VERSION)$(commit_date)
309310 _/ |\\__'_|_|_|\\__'_| | $(commit_string)
310 |__/ | $(Sys.MACHINE)
311 |__/ |
311312
312313 """)
313314 end
450450 precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Array{Any, 1}})
451451 precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Int64})
452452 precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, String})
453 precompile(Tuple{typeof(Base.show), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, typeof(OldPkg.dir)})
454453 precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.MIME{Symbol("text/plain")}, Array{Float64, 1}})
455454 precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.MIME{Symbol("text/plain")}, Array{Float64, 2}})
456455 precompile(Tuple{typeof(Base.show), Base.IOContext{REPL.Terminals.TTYTerminal}, Base.MIME{Symbol("text/plain")}, Array{Int64, 1}})
474473 precompile(Tuple{typeof(Base.sizeof), String})
475474 precompile(Tuple{typeof(Base.skip_deleted_floor!), Base.Dict{Symbol, Any}})
476475 precompile(Tuple{typeof(Base.sort!), Array{Int64, 1}, Base.Sort.QuickSortAlg, Base.Order.Perm{Base.Order.ForwardOrdering, Array{Tuple{Float64, Int64}, 1}}})
477 precompile(Tuple{typeof(Base.start), Nothing})
478476 precompile(Tuple{typeof(Base.startswith), Base.SubString{String}, String})
479477 precompile(Tuple{typeof(Base.startswith), String, Char})
480478 precompile(Tuple{typeof(Base.stream_wait), Base.Timer, Base.Condition})
605603 precompile(Tuple{typeof(Markdown.terminline), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, String})
606604 precompile(Tuple{typeof(Markdown.terminline_string), Base.IOContext{Base.GenericIOBuffer{Array{UInt8, 1}}}, Array{Any, 1}})
607605 precompile(Tuple{typeof(Markdown.terminline_string), Base.IOContext{REPL.Terminals.TTYTerminal}, Array{Any, 1}})
608 precompile(Tuple{typeof(OldPkg.dir)})
609606 precompile(Tuple{typeof(Pkg.REPLMode.create_mode), REPL.LineEditREPL, REPL.LineEdit.Prompt})
610607 precompile(Tuple{typeof(Pkg.REPLMode.repl_init), REPL.LineEditREPL})
611608 precompile(Tuple{typeof(REPL.LineEdit.accept_result), REPL.LineEdit.MIState, REPL.LineEdit.PrefixHistoryPrompt})
243243 Base.kill(::Base.Process, ::Integer)
244244 Base.Sys.set_process_title
245245 Base.Sys.get_process_title
246 Base.readandwrite
247246 Base.ignorestatus
248247 Base.detach
249248 Base.Cmd
1111 Base.Filesystem.readlink
1212 Base.Filesystem.chmod
1313 Base.Filesystem.chown
14 Base.RawFD
1415 Base.stat
1516 Base.Filesystem.lstat
1617 Base.Filesystem.ctime
118118 Base.Rounding.RoundNearestTiesAway
119119 Base.Rounding.RoundNearestTiesUp
120120 Base.Rounding.RoundToZero
121 Base.Rounding.RoundFromZero
121122 Base.Rounding.RoundUp
122123 Base.Rounding.RoundDown
123124 Base.round(::Complex{<: AbstractFloat}, ::RoundingMode, ::RoundingMode)
119119 over `$EDITOR`. If none of these environment variables is set, then the editor
120120 is taken to be `open` on Windows and OS X, or `/etc/alternatives/editor` if it
121121 exists, or `emacs` otherwise.
122
123 !!! note
124
125 `$JULIA_EDITOR` is *not* used in the determination of the editor for
126 `OldPkg.edit`: this function checks `$VISUAL` and `$EDITOR` alone.
127122
128123 ## Parallelization
129124
355355 |:-------------- |:------------------------------------------------------------------------------------------------- |:-------------------------- |
356356 | Syntax | `.` followed by `::` | Left |
357357 | Exponentiation | `^` | Right |
358 | Unary | `+ - √` | Right[^1] |
358 | Unary | `+ - √` | Right[^1] |
359 | Bitshifts | `<< >> >>>` | Left |
359360 | Fractions | `//` | Left |
360 | Multiplication | `* / % & \ ÷` | Left[^2] |
361 | Bitshifts | `<< >> >>>` | Left |
362 | Addition | `+ - \| ⊻` | Left[^2] |
361 | Multiplication | `* / % & \ ÷` | Left[^2] |
362 | Addition | `+ - \| ⊻` | Left[^2] |
363363 | Syntax | `: ..` | Left |
364364 | Syntax | `\|>` | Left |
365365 | Syntax | `<\|` | Right |
656656
657657 ```jldoctest pointtype
658658 julia> Point{Float64}(1.0)
659 ERROR: MethodError: Cannot `convert` an object of type Float64 to an object of type Point{Float64}
659 ERROR: MethodError: no method matching Point{Float64}(::Float64)
660660 [...]
661661
662662 julia> Point{Float64}(1.0,2.0,3.0)
2929 jl_sym_t *empty_sym; jl_sym_t *top_sym;
3030 jl_sym_t *module_sym; jl_sym_t *slot_sym;
3131 jl_sym_t *export_sym; jl_sym_t *import_sym;
32 jl_sym_t *importall_sym; jl_sym_t *toplevel_sym;
33 jl_sym_t *quote_sym; jl_sym_t *amp_sym;
32 jl_sym_t *toplevel_sym; jl_sym_t *quote_sym;
3433 jl_sym_t *line_sym; jl_sym_t *jl_incomplete_sym;
3534 jl_sym_t *goto_sym; jl_sym_t *goto_ifnot_sym;
3635 jl_sym_t *return_sym; jl_sym_t *unreachable_sym;
333332 export_sym = jl_symbol("export");
334333 import_sym = jl_symbol("import");
335334 using_sym = jl_symbol("using");
336 importall_sym = jl_symbol("importall");
337335 assign_sym = jl_symbol("=");
338336 method_sym = jl_symbol("method");
339337 exc_sym = jl_symbol("the_exception");
343341 const_sym = jl_symbol("const");
344342 global_sym = jl_symbol("global");
345343 thunk_sym = jl_symbol("thunk");
346 amp_sym = jl_symbol("&");
347344 abstracttype_sym = jl_symbol("abstract_type");
348345 primtype_sym = jl_symbol("primitive_type");
349346 structtype_sym = jl_symbol("struct_type");
6161 (deparse (cadr (cadr (caddr e)))))
6262 (else
6363 (string #\( (deparse (caddr e)) #\))))))
64 ((memq (car e) '(... |'| |.'|))
64 ((memq (car e) '(... |'|))
6565 (string (deparse (cadr e)) (car e)))
6666 ((or (syntactic-op? (car e)) (eq? (car e) '|<:|) (eq? (car e) '|>:|))
6767 (if (length= e 2)
8080 (string #\( (deparse (caddr e)) " " (cadr e) " " (deparse (cadddr e)) #\) ))
8181 (else
8282 (deparse-prefix-call (cadr e) (cddr e) #\( #\)))))
83 (($ &) (if (pair? (cadr e))
83 (($ &) (if (and (pair? (cadr e)) (not (eq? (caadr e) 'outerref)))
8484 (string (car e) "(" (deparse (cadr e)) ")")
8585 (string (car e) (deparse (cadr e)))))
8686 ((|::|) (if (length= e 2)
199199 (string.join (map deparse (cdr (cadddr e))) "\n") "\n"
200200 "end"))
201201 ;; misc syntax forms
202 ((import importall using)
202 ((import using)
203203 (define (deparse-path e)
204204 (cond ((and (pair? e) (eq? (car e) '|.|))
205205 (let loop ((lst (cdr e))
377377 (symbol (string.sub str 1 (length str)))))
378378
379379 ; convert '.xx to 'xx, and (|.| _ '.xx) to (|.| _ 'xx), and otherwise return #f
380 (define (maybe-undotop e)
380 ;; raise an error for using .op as a function name
381 (define (check-dotop e)
381382 (if (symbol? e)
382383 (let ((str (string e)))
383384 (if (and (eqv? (string.char str 0) #\.)
384385 (not (eq? e '|.|))
385386 (not (eqv? (string.char str 1) #\.)))
386 (symbol (string.sub str 1 (length str)))
387 #f))
387 (error (string "invalid function name \"" e "\""))))
388388 (if (pair? e)
389389 (if (eq? (car e) '|.|)
390 (let ((op (maybe-undotop (caddr e))))
391 (if op
392 (list '|.| (cadr e) op)
393 #f))
390 (check-dotop (caddr e))
394391 (if (quoted? e)
395 (let ((op (maybe-undotop (cadr e))))
396 (if op (list (car e) op) #f))
397 #f))
398 #f)))
392 (check-dotop (cadr e))))))
393 e)
399394
400395 (define (vararg? x) (and (pair? x) (eq? (car x) '...)))
401396 (define (varargexpr? x) (and
407402 (pair? (caddr x))
408403 (length> (caddr x) 1)
409404 (eq? (cadr (caddr x)) 'Vararg)))))
410 (define (trans? x) (and (pair? x) (eq? (car x) '|.'|)))
411 (define (ctrans? x) (and (pair? x) (eq? (car x) '|'|)))
412405 (define (linenum? x) (and (pair? x) (eq? (car x) 'line)))
413406
414407 (define (make-assignment l r) `(= ,l ,r))
293293 }
294294 if (dt == jl_typename_type)
295295 return ((jl_typename_t*)v)->hash;
296 #ifdef _P64
297 if (v == jl_ANY_flag)
298 return 0x31c472f68ee30bddULL;
299 #else
300 if (v == jl_ANY_flag)
301 return 0x8ee30bdd;
302 #endif
303296 if (dt == jl_string_type) {
304297 #ifdef _P64
305298 return memhash_seed(jl_string_data(v), jl_string_len(v), 0xedc3b677);
607600 JL_DLLEXPORT jl_value_t *jl_toplevel_eval_in(jl_module_t *m, jl_value_t *ex)
608601 {
609602 jl_ptls_t ptls = jl_get_ptls_states();
610 if (m == NULL)
611 m = jl_main_module;
612 if (jl_is_symbol(ex))
613 return jl_eval_global_var(m, (jl_sym_t*)ex);
614603 if (ptls->in_pure_callback)
615604 jl_error("eval cannot be used in a generated function");
616605 jl_value_t *v = NULL;
649638 {
650639 jl_module_t *m = NULL;
651640 jl_sym_t *s = NULL;
652 JL_NARGSV(isdefined, 1);
653 if (nargs == 1) {
654 JL_TYPECHK(isdefined, symbol, args[0]);
655 s = (jl_sym_t*)args[0];
656 }
657 if (nargs != 2) {
658 JL_NARGS(isdefined, 1, 1);
659 jl_depwarn("`isdefined(:symbol)` is deprecated, "
660 "use `@isdefined symbol` instead",
661 (jl_value_t*)jl_symbol("isdefined"));
662 jl_ptls_t ptls = jl_get_ptls_states();
663 m = ptls->current_module;
664 }
665 else {
666 if (!jl_is_module(args[0])) {
667 jl_datatype_t *vt = (jl_datatype_t*)jl_typeof(args[0]);
668 assert(jl_is_datatype(vt));
669 size_t idx;
670 if (jl_is_long(args[1])) {
671 idx = jl_unbox_long(args[1])-1;
672 if (idx >= jl_datatype_nfields(vt))
673 return jl_false;
674 }
675 else {
676 JL_TYPECHK(isdefined, symbol, args[1]);
677 idx = jl_field_index(vt, (jl_sym_t*)args[1], 0);
678 if ((int)idx == -1)
679 return jl_false;
680 }
681 return jl_field_isdefined(args[0], idx) ? jl_true : jl_false;
682 }
683 JL_TYPECHK(isdefined, module, args[0]);
684 JL_TYPECHK(isdefined, symbol, args[1]);
685 m = (jl_module_t*)args[0];
686 s = (jl_sym_t*)args[1];
687 }
688 assert(s);
641 JL_NARGS(isdefined, 2, 2);
642 if (!jl_is_module(args[0])) {
643 jl_datatype_t *vt = (jl_datatype_t*)jl_typeof(args[0]);
644 assert(jl_is_datatype(vt));
645 size_t idx;
646 if (jl_is_long(args[1])) {
647 idx = jl_unbox_long(args[1])-1;
648 if (idx >= jl_datatype_nfields(vt))
649 return jl_false;
650 }
651 else {
652 JL_TYPECHK(isdefined, symbol, args[1]);
653 idx = jl_field_index(vt, (jl_sym_t*)args[1], 0);
654 if ((int)idx == -1)
655 return jl_false;
656 }
657 return jl_field_isdefined(args[0], idx) ? jl_true : jl_false;
658 }
659 JL_TYPECHK(isdefined, module, args[0]);
660 JL_TYPECHK(isdefined, symbol, args[1]);
661 m = (jl_module_t*)args[0];
662 s = (jl_sym_t*)args[1];
689663 return jl_boundp(m, s) ? jl_true : jl_false;
690664 }
691665
862836 {
863837 JL_NARGS(nfields, 1, 1);
864838 jl_value_t *x = args[0];
865 if (jl_is_datatype(x))
866 jl_depwarn("`nfields(::DataType)` is deprecated, use `fieldcount` instead",
867 (jl_value_t*)jl_symbol("nfields"));
868 else
869 x = jl_typeof(x);
870 return jl_box_long(jl_field_count(x));
839 return jl_box_long(jl_field_count(jl_typeof(x)));
871840 }
872841
873842 // apply_type -----------------------------------------------------------------
967936 jl_value_t *argtypes = args[3];
968937 jl_value_t *kws = jl_get_keyword_sorter(func);
969938 JL_GC_PUSH1(&argtypes);
970 if (jl_is_tuple(argtypes)) {
971 jl_depwarn("`invoke(f, (types...), ...)` is deprecated, "
972 "use `invoke(f, Tuple{types...}, ...)` instead",
973 (jl_value_t*)jl_symbol("invoke"));
974 argtypes = (jl_value_t*)jl_apply_tuple_type_v((jl_value_t**)jl_data_ptr(argtypes),
975 jl_nfields(argtypes));
976 }
977939 if (jl_is_tuple_type(argtypes)) {
978940 // construct a tuple type for invoking a keyword sorter by putting the kw container type
979941 // and the type of the function at the front.
13271289
13281290 add_builtin("AbstractString", (jl_value_t*)jl_abstractstring_type);
13291291 add_builtin("String", (jl_value_t*)jl_string_type);
1330
1331 add_builtin("ANY", jl_ANY_flag);
13321292 }
13331293
13341294 #ifdef __cplusplus
15591559 // Julia (expression) value of current parameter
15601560 jl_value_t *argi = ccallarg(i);
15611561
1562 // pass the address of the argument rather than the argument itself
1563 if (jl_is_expr(argi) && ((jl_expr_t*)argi)->head == amp_sym) {
1564 addressOf.push_back(true);
1565 argi = jl_exprarg(argi, 0);
1566 }
1567 else {
1568 addressOf.push_back(false);
1569 }
1562 addressOf.push_back(false);
15701563
15711564 argv[i] = emit_expr(ctx, argi);
15721565 }
18781878 ctx.builder.CreateCondBr(ctx.builder.CreateICmpULT(last_index, last_dimension), endBB, failBB);
18791879 } else {
18801880 // There were fewer indices than dimensions; check the last remaining index
1881 BasicBlock *depfailBB = BasicBlock::Create(jl_LLVMContext, "dimsdepfail"); // REMOVE AFTER 0.7
1882 BasicBlock *depwarnBB = BasicBlock::Create(jl_LLVMContext, "dimsdepwarn"); // REMOVE AFTER 0.7
18831881 BasicBlock *checktrailingdimsBB = BasicBlock::Create(jl_LLVMContext, "dimsib");
18841882 assert(nd >= 0);
18851883 Value *last_index = ii;
18921890 for (size_t k = nidxs+1; k < (size_t)nd; k++) {
18931891 BasicBlock *dimsokBB = BasicBlock::Create(jl_LLVMContext, "dimsok");
18941892 Value *dim = emit_arraysize_for_unsafe_dim(ctx, ainfo, ex, k, nd);
1895 ctx.builder.CreateCondBr(ctx.builder.CreateICmpEQ(dim, ConstantInt::get(T_size, 1)), dimsokBB, depfailBB); // s/depfailBB/failBB/ AFTER 0.7
1893 ctx.builder.CreateCondBr(ctx.builder.CreateICmpEQ(dim, ConstantInt::get(T_size, 1)), dimsokBB, failBB);
18961894 ctx.f->getBasicBlockList().push_back(dimsokBB);
18971895 ctx.builder.SetInsertPoint(dimsokBB);
18981896 }
18991897 Value *dim = emit_arraysize_for_unsafe_dim(ctx, ainfo, ex, nd, nd);
1900 ctx.builder.CreateCondBr(ctx.builder.CreateICmpEQ(dim, ConstantInt::get(T_size, 1)), endBB, depfailBB); // s/depfailBB/failBB/ AFTER 0.7
1901
1902 // Remove after 0.7: Ensure no dimensions were 0 and depwarn
1903 ctx.f->getBasicBlockList().push_back(depfailBB);
1904 ctx.builder.SetInsertPoint(depfailBB);
1905 Value *total_length = emit_arraylen(ctx, ainfo);
1906 ctx.builder.CreateCondBr(ctx.builder.CreateICmpULT(i, total_length), depwarnBB, failBB);
1907
1908 ctx.f->getBasicBlockList().push_back(depwarnBB);
1909 ctx.builder.SetInsertPoint(depwarnBB);
1910 ctx.builder.CreateCall(prepare_call(jldepwarnpi_func), ConstantInt::get(T_size, nidxs));
1911 ctx.builder.CreateBr(endBB);
1898 ctx.builder.CreateCondBr(ctx.builder.CreateICmpEQ(dim, ConstantInt::get(T_size, 1)), endBB, failBB);
19121899 }
19131900
19141901 ctx.f->getBasicBlockList().push_back(failBB);
326326 static Function *expect_func;
327327 static Function *jldlsym_func;
328328 static Function *jltypeassert_func;
329 static Function *jldepwarnpi_func;
330329 //static Function *jlgetnthfield_func;
331330 static Function *jlgetnthfieldchecked_func;
332331 //static Function *jlsetnthfield_func;
70557054
70567055 jlapply2va_func = jlcall_func_to_llvm("jl_apply_2va", &jl_apply_2va, m);
70577056
7058 std::vector<Type*> argsdepwarnpi(0);
7059 argsdepwarnpi.push_back(T_size);
7060 jldepwarnpi_func = Function::Create(FunctionType::get(T_void, argsdepwarnpi, false),
7061 Function::ExternalLinkage,
7062 "jl_depwarn_partial_indexing", m);
7063 add_named_global(jldepwarnpi_func, &jl_depwarn_partial_indexing);
7064
7065
70667057 std::vector<Type *> agargs(0);
70677058 agargs.push_back(T_pprjlvalue);
70687059 agargs.push_back(T_uint32);
31793179 jl_pointer_type, jl_vararg_type, jl_abstractarray_type, jl_void_type,
31803180 jl_densearray_type, jl_function_type, jl_typename_type,
31813181 jl_builtin_type, jl_task_type, jl_uniontype_type, jl_typetype_type,
3182 jl_ANY_flag, jl_array_any_type, jl_intrinsic_type,
3182 jl_array_any_type, jl_intrinsic_type,
31833183 jl_abstractslot_type, jl_methtable_type, jl_typemap_level_type,
31843184 jl_voidpointer_type, jl_newvarnode_type, jl_abstractstring_type,
31853185 jl_array_symbol_type, jl_anytuple_type, jl_tparam0(jl_anytuple_type),
22662266 if (jl_cfunction_list != NULL)
22672267 gc_mark_queue_obj(gc_cache, sp, jl_cfunction_list);
22682268 gc_mark_queue_obj(gc_cache, sp, jl_anytuple_type_type);
2269 gc_mark_queue_obj(gc_cache, sp, jl_ANY_flag);
22702269 for (size_t i = 0; i < N_CALL_CACHE; i++)
22712270 if (call_cache[i])
22722271 gc_mark_queue_obj(gc_cache, sp, call_cache[i]);
558558 if (!jl_options.julia_bindir) {
559559 jl_options.julia_bindir = getenv("JULIA_BINDIR");
560560 if (!jl_options.julia_bindir) {
561 char *julia_bindir = getenv("JULIA_HOME");
562 if (julia_bindir) {
563 jl_depwarn(
564 "`JULIA_HOME` environment variable is renamed to `JULIA_BINDIR`",
565 (jl_value_t*)jl_symbol("JULIA_HOME"));
566 jl_options.julia_bindir = julia_bindir;
567 }
568 }
569 if (!jl_options.julia_bindir) {
570561 jl_options.julia_bindir = dirname(free_path);
571562 }
572563 }
108108
109109 (define (toplevel-only-expr? e)
110110 (and (pair? e)
111 (or (memq (car e) '(toplevel line module import importall using export
111 (or (memq (car e) '(toplevel line module import using export
112112 error incomplete))
113113 (and (eq? (car e) 'global) (every symbol? (cdr e))
114114 (every (lambda (x) (not (memq x '(true false)))) (cdr e))))))
116116 (define (expand-toplevel-expr e)
117117 (cond ((or (atom? e) (toplevel-only-expr? e))
118118 (if (underscore-symbol? e)
119 (syntax-deprecation "underscores as an rvalue" "" #f))
119 (error "all-underscore identifier used as rvalue"))
120120 e)
121121 (else
122122 (let ((last *in-expand*))
139139 (block
140140 ,loc
141141 (call (core eval) ,name ,x)))
142 (if (&& (call (top isdefined) (core Main) (quote Base))
143 (call (top isdefined) (|.| (core Main) (quote Base)) (quote @deprecate)))
144 (call eval
145 (quote
146 (macrocall (|.| (|.| (core Main) (quote Base)) (quote @deprecate))
147 (line 0 none)
148 (call eval m x)
149 (call (|.| Core (quote eval)) m x) ; should be (core eval), but format as Core.eval(m, x) for deprecation warning
150 false))))
151142 (= (call include ,x)
152143 (block
153144 ,loc
266257 ((length= lno 2) `(,(cadr lno) none))
267258 (else (cdr lno))))
268259
260 (define (format-loc lno)
261 (let* ((lf (extract-line-file lno)) (line (car lf)) (file (cadr lf)))
262 (format-file-line file line #f)))
263
264 (define (format-file-line file line exactloc)
265 (if (or (= line 0) (eq? file 'none))
266 ""
267 (string (if exactloc " at " " around ") file ":" line)))
268
269269 (define (format-syntax-deprecation what instead file line exactloc)
270270 (string "Deprecated syntax `" what "`"
271 (if (or (= line 0) (eq? file 'none))
272 ""
273 (string (if exactloc " at " " around ") file ":" line))
271 (format-file-line file line exactloc)
274272 "."
275273 (if (equal? instead "") ""
276 (string #\newline "Use `" instead "` instead."))))
274 (string #\newline "Use `" instead "` instead."))))
277275
278276 ; Corresponds to --depwarn 0="no", 1="yes", 2="error"
279277 (define *depwarn-opt* 1)
189189 { "print", required_argument, 0, 'E' },
190190 { "load", required_argument, 0, 'L' },
191191 { "sysimage", required_argument, 0, 'J' },
192 { "precompiled", required_argument, 0, opt_use_precompiled }, // deprecated
193192 { "sysimage-native-code", required_argument, 0, opt_sysimage_native_code },
194 { "compilecache", required_argument, 0, opt_use_compilecache }, // deprecated
195193 { "compiled-modules", required_argument, 0, opt_compiled_modules },
196194 { "cpu-target", required_argument, 0, 'C' },
197195 { "procs", required_argument, 0, 'p' },
198 { "machinefile", required_argument, 0, opt_machinefile }, // deprecated
199196 { "machine-file", required_argument, 0, opt_machine_file },
200197 { "project", optional_argument, 0, opt_project },
201198 { "color", required_argument, 0, opt_color },
357354 else
358355 jl_errorf("julia: invalid argument to --banner={yes|no|auto} (%s)", optarg);
359356 break;
360 case opt_use_precompiled:
361 jl_printf(JL_STDOUT, "WARNING: julia --precompiled option is deprecated, use --sysimage-native-code instead.\n");
362 // fall through
363357 case opt_sysimage_native_code:
364358 if (!strcmp(optarg,"yes"))
365359 jl_options.use_sysimage_native_code = JL_OPTIONS_USE_SYSIMAGE_NATIVE_CODE_YES;
368362 else
369363 jl_errorf("julia: invalid argument to --sysimage-native-code={yes|no} (%s)", optarg);
370364 break;
371 case opt_use_compilecache:
372 jl_printf(JL_STDOUT, "WARNING: julia --compilecache option is deprecated, use --compiled-modules instead.\n");
373 // fall through
374365 case opt_compiled_modules:
375366 if (!strcmp(optarg,"yes"))
376367 jl_options.use_compiled_modules = JL_OPTIONS_USE_COMPILED_MODULES_YES;
396387 jl_options.nprocs = (int)nprocs;
397388 }
398389 break;
399 case opt_machinefile:
400 jl_printf(JL_STDOUT, "WARNING: julia --machinefile option is deprecated, use --machine-file instead.\n");
401 // fall through
402390 case opt_machine_file:
403391 jl_options.machine_file = strdup(optarg);
404392 if (!jl_options.machine_file)
7474 JL_DLLEXPORT jl_value_t *jl_false;
7575
7676 jl_unionall_t *jl_typetype_type;
77 jl_value_t *jl_ANY_flag;
7877
7978 jl_unionall_t *jl_array_type;
8079 jl_typename_t *jl_array_typename;
21672166 (jl_unionall_t*)jl_new_struct(jl_unionall_type, typetype_tvar,
21682167 jl_apply_type1((jl_value_t*)jl_type_type, (jl_value_t*)typetype_tvar));
21692168
2170 jl_ANY_flag = (jl_value_t*)tvar("ANY");
2171
21722169 jl_abstractstring_type = jl_new_abstracttype((jl_value_t*)jl_symbol("AbstractString"), core, jl_any_type, jl_emptysvec);
21732170 jl_string_type = jl_new_datatype(jl_symbol("String"), core, jl_abstractstring_type, jl_emptysvec,
21742171 jl_emptysvec, jl_emptysvec, 0, 1, 0);
1818 (define prec-lazy-and '(&&))
1919 (define prec-comparison
2020 (append! '(|<:| |>:| in isa)
21 (add-dots '(> < >= ≥ <= ≤ == === ≡ != ≠ !== ≢ ∈ ∉ ∋ ∌ ⊆ ⊈ ⊂ ⊄ ⊊ ∝ ∊ ∍ ∥ ∦ ∷ ∺ ∻ ∽ ∾ ≁ ≃ ≄ ≅ ≆ ≇ ≈ ≉ ≊ ≋ ≌ ≍ ≎ ≐ ≑ ≒ ≓ ≖ ≗ ≘ ≙ ≚ ≛ ≜ ≝ ≞ ≟ ≣ ≦ ≧ ≨ ≩ ≪ ≫ ≬ ≭ ≮ ≯ ≰ ≱ ≲ ≳ ≴ ≵ ≶ ≷ ≸ ≹ ≺ ≻ ≼ ≽ ≾ ≿ ⊀ ⊁ ⊃ ⊅ ⊇ ⊉ ⊋ ⊏ ⊐ ⊑ ⊒ ⊜ ⊩ ⊬ ⊮ ⊰ ⊱ ⊲ ⊳ ⊴ ⊵ ⊶ ⊷ ⋍ ⋐ ⋑ ⋕ ⋖ ⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟ ⋠ ⋡ ⋢ ⋣ ⋤ ⋥ ⋦ ⋧ ⋨ ⋩ ⋪ ⋫ ⋬ ⋭ ⋲ ⋳ ⋴ ⋵ ⋶ ⋷ ⋸ ⋹ ⋺ ⋻ ⋼ ⋽ ⋾ ⋿ ⟈ ⟉ ⟒ ⦷ ⧀ ⧁ ⧡ ⧣ ⧤ ⧥ ⩦ ⩧ ⩪ ⩫ ⩬ ⩭ ⩮ ⩯ ⩰ ⩱ ⩲ ⩳ ⩵ ⩶ ⩷ ⩸ ⩹ ⩺ ⩻ ⩼ ⩽ ⩾ ⩿ ⪀ ⪁ ⪂ ⪃ ⪄ ⪅ ⪆ ⪇ ⪈ ⪉ ⪊ ⪋ ⪌ ⪍ ⪎ ⪏ ⪐ ⪑ ⪒ ⪓ ⪔ ⪕ ⪖ ⪗ ⪘ ⪙ ⪚ ⪛ ⪜ ⪝ ⪞ ⪟ ⪠ ⪡ ⪢ ⪣ ⪤ ⪥ ⪦ ⪧ ⪨ ⪩ ⪪ ⪫ ⪬ ⪭ ⪮ ⪯ ⪰ ⪱ ⪲ ⪳ ⪴ ⪵ ⪶ ⪷ ⪸ ⪹ ⪺ ⪻ ⪼ ⪽ ⪾ ⪿ ⫀ ⫁ ⫂ ⫃ ⫄ ⫅ ⫆ ⫇ ⫈ ⫉ ⫊ ⫋ ⫌ ⫍ ⫎ ⫏ ⫐ ⫑ ⫒ ⫓ ⫔ ⫕ ⫖ ⫗ ⫘ ⫙ ⫷ ⫸ ⫹ ⫺ ⊢ ⊣ ⟂))))
21 (add-dots '(> < >= ≥ <= ≤ == === ≡ != ≠ !== ≢ ∈ ∉ ∋ ∌ ⊆ ⊈ ⊂ ⊄ ⊊ ∝ ∊ ∍ ∥ ∦ ∷ ∺ ∻ ∽ ∾ ≁ ≃ ≂ ≄ ≅ ≆ ≇ ≈ ≉ ≊ ≋ ≌ ≍ ≎ ≐ ≑ ≒ ≓ ≖ ≗ ≘ ≙ ≚ ≛ ≜ ≝ ≞ ≟ ≣ ≦ ≧ ≨ ≩ ≪ ≫ ≬ ≭ ≮ ≯ ≰ ≱ ≲ ≳ ≴ ≵ ≶ ≷ ≸ ≹ ≺ ≻ ≼ ≽ ≾ ≿ ⊀ ⊁ ⊃ ⊅ ⊇ ⊉ ⊋ ⊏ ⊐ ⊑ ⊒ ⊜ ⊩ ⊬ ⊮ ⊰ ⊱ ⊲ ⊳ ⊴ ⊵ ⊶ ⊷ ⋍ ⋐ ⋑ ⋕ ⋖ ⋗ ⋘ ⋙ ⋚ ⋛ ⋜ ⋝ ⋞ ⋟ ⋠ ⋡ ⋢ ⋣ ⋤ ⋥ ⋦ ⋧ ⋨ ⋩ ⋪ ⋫ ⋬ ⋭ ⋲ ⋳ ⋴ ⋵ ⋶ ⋷ ⋸ ⋹ ⋺ ⋻ ⋼ ⋽ ⋾ ⋿ ⟈ ⟉ ⟒ ⦷ ⧀ ⧁ ⧡ ⧣ ⧤ ⧥ ⩦ ⩧ ⩪ ⩫ ⩬ ⩭ ⩮ ⩯ ⩰ ⩱ ⩲ ⩳ ⩵ ⩶ ⩷ ⩸ ⩹ ⩺ ⩻ ⩼ ⩽ ⩾ ⩿ ⪀ ⪁ ⪂ ⪃ ⪄ ⪅ ⪆ ⪇ ⪈ ⪉ ⪊ ⪋ ⪌ ⪍ ⪎ ⪏ ⪐ ⪑ ⪒ ⪓ ⪔ ⪕ ⪖ ⪗ ⪘ ⪙ ⪚ ⪛ ⪜ ⪝ ⪞ ⪟ ⪠ ⪡ ⪢ ⪣ ⪤ ⪥ ⪦ ⪧ ⪨ ⪩ ⪪ ⪫ ⪬ ⪭ ⪮ ⪯ ⪰ ⪱ ⪲ ⪳ ⪴ ⪵ ⪶ ⪷ ⪸ ⪹ ⪺ ⪻ ⪼ ⪽ ⪾ ⪿ ⫀ ⫁ ⫂ ⫃ ⫄ ⫅ ⫆ ⫇ ⫈ ⫉ ⫊ ⫋ ⫌ ⫍ ⫎ ⫏ ⫐ ⫑ ⫒ ⫓ ⫔ ⫕ ⫖ ⫗ ⫘ ⫙ ⫷ ⫸ ⫹ ⫺ ⊢ ⊣ ⟂))))
2222 (define prec-pipe< '(|.<\|| |<\||))
2323 (define prec-pipe> '(|.\|>| |\|>|))
2424 (define prec-colon (append! '(: |..|) (add-dots '(… ⁝ ⋮ ⋱ ⋰ ⋯))))
2525 (define prec-plus (append! '($)
26 (add-dots '(+ - |\|| ⊕ ⊖ ⊞ ⊟ |++| ∪ ∨ ⊔ ± ∓ ∔ ∸ ≂ ≏ ⊎ ⊻ ⊽ ⋎ ⋓ ⧺ ⧻ ⨈ ⨢ ⨣ ⨤ ⨥ ⨦ ⨧ ⨨ ⨩ ⨪ ⨫ ⨬ ⨭ ⨮ ⨹ ⨺ ⩁ ⩂ ⩅ ⩊ ⩌ ⩏ ⩐ ⩒ ⩔ ⩖ ⩗ ⩛ ⩝ ⩡ ⩢ ⩣))))
27 (define prec-bitshift (add-dots '(<< >> >>>)))
26 (add-dots '(+ - |\|| ⊕ ⊖ ⊞ ⊟ |++| ∪ ∨ ⊔ ± ∓ ∔ ∸ ≏ ⊎ ⊻ ⊽ ⋎ ⋓ ⧺ ⧻ ⨈ ⨢ ⨣ ⨤ ⨥ ⨦ ⨧ ⨨ ⨩ ⨪ ⨫ ⨬ ⨭ ⨮ ⨹ ⨺ ⩁ ⩂ ⩅ ⩊ ⩌ ⩏ ⩐ ⩒ ⩔ ⩖ ⩗ ⩛ ⩝ ⩡ ⩢ ⩣))))
2827 (define prec-times (add-dots '(* / ÷ % & ⋅ ∘ × |\\| ∩ ∧ ⊗ ⊘ ⊙ ⊚ ⊛ ⊠ ⊡ ⊓ ∗ ∙ ∤ ⅋ ≀ ⊼ ⋄ ⋆ ⋇ ⋉ ⋊ ⋋ ⋌ ⋏ ⋒ ⟑ ⦸ ⦼ ⦾ ⦿ ⧶ ⧷ ⨇ ⨰ ⨱ ⨲ ⨳ ⨴ ⨵ ⨶ ⨷ ⨸ ⨻ ⨼ ⨽ ⩀ ⩃ ⩄ ⩋ ⩍ ⩎ ⩑ ⩓ ⩕ ⩘ ⩚ ⩜ ⩞ ⩟ ⩠ ⫛ ⊍ ▷ ⨝ ⟕ ⟖ ⟗)))
2928 (define prec-rational (add-dots '(//)))
29 (define prec-bitshift (add-dots '(<< >> >>>)))
3030 ;; `where`
3131 ;; implicit multiplication (juxtaposition)
3232 ;; unary
149149 (define initial-reserved-words '(begin while if for try return break continue
150150 function macro quote let local global const do
151151 struct
152 type immutable importall ;; to be deprecated
153152 module baremodule using import export))
154153
155154 (define initial-reserved-word? (Set initial-reserved-words))
179178 (define whitespace-newline #f)
180179 ; enable parsing `where` with high precedence
181180 (define where-enabled #t)
182 ; allow (x...), parsed as (... x). otherwise a deprecation warning is given (#24452)
183 (define accept-dots-without-comma #f)
184181
185182 (define current-filename 'none)
186183
350347 (begin
351348 (if (not (eqv? (peek-char port) #\.))
352349 (let ((num (get-output-string str)))
353 (parser-depwarn port
354 (string num #\. (peek-char port))
355 (string num " ." (peek-char port)))))
350 (error (string "invalid syntax \"" num #\. (peek-char port) "\""
351 (if (eqv? (peek-char port) #\')
352 ""
353 "; add space(s) to clarify")))))
356354 (io.ungetc port #\.))
357355 (begin (write-char #\. str)
358356 (read-digs #f #t)
379377 (or (eq? pred char-bin?) (eq? pred char-oct?)
380378 (and (eq? pred char-hex?) (not is-hex-float-literal)))
381379 (or (char-numeric? c)
382 (and (identifier-start-char? c)
383 (parser-depwarn port ;; remove after v0.7
384 (string (get-output-string str) c)
385 (string (get-output-string str) " * " c))
386 #f))) ;; remove after v0.7
380 (identifier-start-char? c)))
387381 ;; disallow digits after binary or octal literals, e.g., 0b12
388382 ;; and disallow identifier chars after hex literals.
389383 (error (string "invalid numeric constant \""
782776 (let ((ex (parse-arrow s)))
783777 (cond ((eq? (peek-token s) '?)
784778 (begin (if (not (ts:space? s))
785 (parser-depwarn s (string (deparse ex) "?") (string (deparse ex) " ?")))
779 (error "space required before \"?\" operator"))
786780 (take-token s) ; take the ?
787781 (let ((t (with-whitespace-newline (without-range-colon (peek-token s)))))
788782 (if (not (ts:space? s))
789 (parser-depwarn s (string (deparse ex) " ?" (deparse t)) (string (deparse ex) " ? " (deparse t)))))
783 (error "space required after \"?\" operator")))
790784 (let ((then (without-range-colon (parse-eq* s))))
791785 (if (not (eq? (peek-token s) ':))
792786 (error "colon expected in \"?\" expression"))
793787 (if (not (ts:space? s))
794 (parser-depwarn s (string (deparse ex) " ? " (deparse then) ":") (string (deparse ex) " ? " (deparse then) " :")))
788 (error "space required before colon in \"?\" expression"))
795789 (take-token s) ; take the :
796790 (let ((t (with-whitespace-newline (peek-token s))))
797791 (if (not (ts:space? s))
798 (parser-depwarn s (string (deparse ex) " ? " (deparse then) " :" t) (string (deparse ex) " ? " (deparse then) " : " t))))
792 (error "space required after colon in \"?\" expression")))
799793 (list 'if ex then (parse-eq* s)))))
800794 (else ex))))
801795
902896 (else
903897 (loop (list 'call t ex (down s))))))))))
904898
905 (define (parse-with-chains-warn s down ops chain-ops)
906 (let loop ((ex (down s))
907 (got #f))
908 (let ((t (peek-token s)))
909 (if (not (ops t))
910 (cons ex got)
911 (let ((spc (ts:space? s)))
912 (take-token s)
913 (cond ((and space-sensitive spc (memq t unary-and-binary-ops)
914 (not (eqv? (peek-char (ts:port s)) #\ )))
915 ;; here we have "x -y"
916 (ts:put-back! s t spc)
917 (cons ex got))
918 ((memq t chain-ops)
919 (loop (list* 'call t ex
920 (parse-chain s down t))
921 t))
922 (else
923 (loop (list 'call t ex (down s))
924 t))))))))
925
926 (define (parse-expr s) (parse-with-chains s parse-shift is-prec-plus? '(+ ++)))
927
928 (define (bitshift-warn s op)
929 (parser-depwarn s (string "call to `" op "` inside call to bitshift operator")
930 (string "parenthesized call to `" op "`")))
931
932 (define (parse-shift s) #;(parse-LtoR s parse-term is-prec-bitshift?)
933 (let loop ((ex (parse-term s))
934 (t (peek-token s))
935 (warn1 #f))
936 (let ((ex (car ex))
937 (warn (cdr ex)))
938 (if (is-prec-bitshift? t)
939 (begin (if warn (bitshift-warn s warn))
940 (take-token s)
941 (let ((nxt (parse-term s)))
942 (loop (cons (list 'call t ex (car nxt)) (cdr nxt)) (peek-token s) (cdr nxt))))
943 (begin (if warn1 (bitshift-warn s warn1))
944 ex)))))
945
946 (define (parse-term s) (parse-with-chains-warn s parse-rational is-prec-times? '(*)))
947 (define (parse-rational s) (parse-LtoR s parse-unary-subtype is-prec-rational?))
899 (define (parse-expr s) (parse-with-chains s parse-term is-prec-plus? '(+ ++)))
900 (define (parse-term s) (parse-with-chains s parse-rational is-prec-times? '(*)))
901 (define (parse-rational s) (parse-LtoR s parse-shift is-prec-rational?))
902 (define (parse-shift s) (parse-LtoR s parse-unary-subtype is-prec-bitshift?))
948903
949904 ;; parse `<: A where B` as `<: (A where B)` (issue #21545)
950905 (define (parse-unary-subtype s)
10471002 ;; operators handled by parse-unary at the start of an expression
10481003 (define initial-operator?
10491004 ;; TODO: ? should probably not be listed here except for the syntax hack in osutils.jl
1050 (Set (diff operators (append '(: |'| ?) syntactic-unary-operators syntactic-operators))))
1005 (Set (diff operators (append '(: |'| |.'| ?) syntactic-unary-operators syntactic-operators))))
10511006
10521007 (define (parse-unary s)
10531008 (let* ((op (require-token s))
10881043 ((eqv? next #\( )
10891044 (take-token s)
10901045 (let* ((opspc (ts:space? s))
1091 (parens (with-bindings ((accept-dots-without-comma #t))
1092 (parse-paren- s #t))))
1046 (parens (parse-paren- s #t)))
10931047 (if (cdr parens) ;; found an argument list
10941048 (if opspc
10951049 (disallowed-space op #\( )
11011055 ((not un)
11021056 (error (string "\"" op "\" is not a unary operator")))
11031057 (else
1104 (let ((arg (with-bindings ((accept-dots-without-comma #t))
1105 (parse-unary s))))
1058 (let ((arg (parse-unary s)))
11061059 (fix-syntactic-unary (list op arg)))))))
11071060
11081061 (define block-form? (Set '(block quote if for while let function macro abstract primitive struct
11601113 (or (closing-token? next) (newline? next))))
11611114 op)
11621115 ((memq op '(& |::|)) (list op (parse-where s parse-call)))
1163 (else (list op (with-bindings
1164 ((accept-dots-without-comma #t))
1165 (parse-unary-prefix s))))))
1116 (else (list op (parse-unary-prefix s)))))
11661117 (parse-atom s))))
11671118
11681119 (define (parse-def s is-func anon)
1169 (let* ((ex (with-bindings ((accept-dots-without-comma anon))
1170 (parse-unary-prefix s)))
1120 (let* ((ex (parse-unary-prefix s))
11711121 (sig (if (or (and is-func (reserved-word? ex)) (initial-reserved-word? ex))
11721122 (error (string "invalid name \"" ex "\""))
11731123 (parse-call-chain s ex #f)))
12341184 (if (null? al)
12351185 (loop (list 'ref ex))
12361186 (case (car al)
1237 ((vect) (loop (list* 'ref ex (cdr al))))
1187 ((vect) (loop (list* 'ref ex (map =-to-kw (cdr al)))))
12381188 ((hcat) (loop (list* 'typed_hcat ex (cdr al))))
12391189 ((vcat)
12401190 (loop (list* 'typed_vcat ex (cdr al))))
12661216 `(macrocall (|.| ,ex (quote ,(cadr name))) ; move macrocall outside by rewriting A.@B as @A.B
12671217 ,@(cddr name))
12681218 `(|.| ,ex (quote ,name))))))))
1269 ((|.'| |'|)
1219 ((|'|)
12701220 (if (ts:space? s)
12711221 (error (string "space not allowed before \"" t "\"")))
12721222 (take-token s)
12731223 (loop (list t ex)))
1224 ((|.'|) (error "the \".'\" operator is discontinued"))
12741225 ((#\{ )
12751226 (if (ts:space? s) (disallowed-space ex t))
12761227 (take-token s)
14961447 (nb (with-space-sensitive (parse-cond s))))
14971448 (begin0 (list 'primitive spec nb)
14981449 (expect-end (take-lineendings s) "primitive type"))))))
1499 ;; deprecated type keywords
1500 ((type)
1501 (parser-depwarn s "type" "mutable struct") ;; retain in 0.7
1502 (parse-struct-def s #t word))
1503 ((immutable)
1504 (parser-depwarn s "immutable" "struct") ;; retain in 0.7
1505 (parse-struct-def s #f word))
15061450
15071451 ((try)
15081452 (let ((try-block (if (memq (require-token s) '(catch finally))
15161460 (cond
15171461 ((eq? nxt 'end)
15181462 (list* 'try try-block (or catchv 'false)
1519 ;; default to empty catch block in `try ... end`
1520 (or catchb (if finalb 'false (begin (parser-depwarn s "try without catch or finally" "")
1521 '(block))))
1463 (or catchb (if finalb 'false (error "try without catch or finally")))
15221464 (if finalb (list finalb) '())))
15231465 ((and (eq? nxt 'catch)
15241466 (not catchb))
15351477 (var? (and (not nl) (or (and (symbol? var) (not (eq? var 'false))
15361478 (not (eq? var 'true)))
15371479 (and (length= var 2) (eq? (car var) '$))
1538 (and (parser-depwarn s (string "catch " (deparse var) "")
1539 (string "catch; " (deparse var) ""))
1540 #f))))
1480 (error (string "invalid syntax \"catch " (deparse var) "\"")))))
15411481 (catch-block (if (eq? (require-token s) 'finally)
15421482 `(block ,(line-number-node s))
15431483 (parse-block s))))
15881528 (if (not (every symbol-or-interpolate? es))
15891529 (error "invalid \"export\" statement"))
15901530 `(export ,@es)))
1591 ((import using importall)
1531 ((import using)
15921532 (parse-imports s word))
15931533 ((do)
15941534 (error "invalid \"do\" syntax"))
18151755 (if (eqv? (require-token s) closer)
18161756 (loop lst nxt)
18171757 (let ((params (parse-call-arglist s closer)))
1818 (if (or (null? params) (equal? params '((parameters))))
1819 (begin (parser-depwarn s (deparse `(vect (parameters) ,@(reverse lst) ,nxt))
1820 (deparse `(vcat ,@(reverse lst) ,nxt)))
1821 ;; TODO: post 0.7, remove deprecation and change parsing to 'vect
1822 `(vcat ,@(reverse lst) ,nxt))
1823 `(vect ,@params ,@(reverse lst) ,nxt)))))
1758 `(vect ,@params ,@(reverse lst) ,nxt))))
18241759 ((#\] #\})
18251760 (error (string "unexpected \"" t "\"")))
18261761 (else
19911926 (else
19921927 (list (=-to-kw e)))))
19931928
1929 (define invalid-identifier? (Set (list* '.... '? '|.'| syntactic-operators)))
1930
1931 (define-macro (check-identifier ex)
1932 `(if (invalid-identifier? ,ex)
1933 (error (string "invalid identifier name \"" ,ex "\""))))
1934
19941935 (define (parse-paren s (checked #t)) (car (parse-paren- s checked)))
19951936
19961937 ;; return (expr . arglist) where arglist is #t iff this isn't just a parenthesized expr
20331974 (take-token s)
20341975 ;; value in parentheses (x)
20351976 (if (vararg? ex)
2036 (let ((lineno (input-port-line (ts:port s))))
2037 (if (or accept-dots-without-comma (eq? (with-bindings ((whitespace-newline #f))
2038 (peek-token s))
2039 '->))
2040 (cons ex #t)
2041 (begin (parser-depwarn lineno
2042 (string "(" (deparse (cadr ex)) "...)")
2043 (string "(" (deparse (cadr ex)) "...,)"))
2044 (cons `(tuple ,ex) #t))))
1977 (cons ex #t)
20451978 (cons ex #f)))
20461979 ((eqv? t #\,)
20471980 ;; tuple (x,) (x,y) etc.
22912224 (lambda ()
22922225 ;; process escape sequences using lisp read
22932226 (read (open-input-string (string #\" s #\"))))))
2294
2295 (define-macro (check-identifier ex)
2296 `(begin (if (or (syntactic-op? ,ex) (eq? ,ex '....))
2297 (error (string "invalid identifier name \"" ,ex "\"")))
2298 (if (eq? ,ex '?)
2299 (parser-depwarn s "`?` used as an identifier" "")))) ; merge with above check in v1.0
23002227
23012228 ;; parse numbers, identifiers, parenthesized expressions, lists, vectors, etc.
23022229 (define (parse-atom s (checked #t))
24532380 (if (and (length= e 4)
24542381 (eq? (called-macro-name (cadr e)) '@doc))
24552382 (let ((arg (cadddr e)))
2456 (if (and (pair? arg) (eq? (car arg) '->))
2457 (begin (parser-depwarn s "@doc call with ->" "a line break")
2458 e)
2459 (let loop ((t (peek-token s))
2460 (nl 0))
2461 (cond ((closing-token? t) e)
2462 ((newline? t)
2463 (if (> nl 0)
2464 e
2465 (begin (take-token s)
2466 (loop (peek-token s) 1))))
2467 (else
2468 `(,@e ,(parse-eq s)))))))
2383 (let loop ((t (peek-token s))
2384 (nl 0))
2385 (cond ((closing-token? t) e)
2386 ((newline? t)
2387 (if (> nl 0)
2388 e
2389 (begin (take-token s)
2390 (loop (peek-token s) 1))))
2391 (else
2392 `(,@e ,(parse-eq s))))))
24692393 e))
24702394
24712395 (define (simple-string-literal? e) (string? e))
24732397 (define (doc-string-literal? s e)
24742398 (or (simple-string-literal? e)
24752399 (and (pair? e)
2476 (or (eq? (car e) 'string) ; string interpolation
2477 (and (eq? (car e) 'macrocall)
2478 (or (and (length= e 3) (simple-string-literal? (caddr e)))
2479 (and (length= e 4) (simple-string-literal? (cadddr e))))
2480 (eq? (cadr e) '@doc_str)
2481 (begin (parser-depwarn s "doc\" \"" "@doc doc\" \"")
2482 #t))))))
2400 ;; string interpolation
2401 (eq? (car e) 'string))))
24832402
24842403 (define (parse-docstring s production)
24852404 (let ((startloc (line-number-node s)) ; be sure to use the line number from the head of the docstring
24902409 (cond ((closing-token? t) #f)
24912410 ((newline? t)
24922411 (if (= nl 1)
2493 ;;#f ;; extra line => not a doc string. enable when deprecation is removed.
2494 (begin (parser-depwarn s "multiple line breaks between doc string and object"
2495 "at most one line break")
2496 (take-token s)
2497 (loop (peek-token s) 2))
2412 #f ;; extra line => not a doc string
24982413 (begin (take-token s)
24992414 (loop (peek-token s) 1))))
25002415 (else #t))))
147147 ;; GF method does not need to keep decl expressions on lambda args
148148 ;; except for rest arg
149149 (define (method-lambda-expr argl body rett)
150 (let ((argl (map arg-name argl))
150 (let ((argl (map (lambda (x)
151 (let ((n (arg-name x)))
152 (if (underscore-symbol? n) UNUSED n)))
153 argl))
151154 (body (blockify body)))
152155 `(lambda ,argl ()
153156 (scope-block
235238 (or (atom? (cadr e)) (sym-ref? (cadr e)))
236239 (pair? (caddr e)) (memq (car (caddr e)) '(quote inert))
237240 (symbol? (cadr (caddr e))))))
238
239 ;; e.g. Base.(:+) is deprecated in favor of Base.:+
240 (define (deprecate-dotparen e)
241 (if (and (length= e 3) (eq? (car e) '|.|)
242 (or (atom? (cadr e)) (sym-ref? (cadr e)))
243 (length= (caddr e) 2) (eq? (caaddr e) 'tuple)
244 (pair? (cadr (caddr e))) (memq (caadr (caddr e)) '(quote inert)))
245 (let* ((s_ (cdadr (caddr e)))
246 (s (if (symbol? s_) s_
247 (if (and (length= s_ 1) (symbol? (car s_))) (car s_) #f))))
248 (if s
249 (let ((newe (list (car e) (cadr e) (cadr (caddr e))))
250 (S (deparse `(quote ,s)))) ; #16295
251 (syntax-deprecation (string (deparse (cadr e)) ".(" S ")")
252 (string (deparse (cadr e)) "." S) #f)
253 newe)
254 e))
255 e))
256241
257242 ;; convert final (... x) to (curly Vararg x)
258243 (define (dots->vararg a)
323308 (append req opt vararg) rett)))))
324309 ;; no optional positional args
325310 (let ((names (map car sparams))
326 (anames (llist-vars argl)))
311 (anames (map (lambda (x) (if (underscore-symbol? x) UNUSED x))
312 (llist-vars argl))))
327313 (if (has-dups (filter (lambda (x) (not (eq? x UNUSED))) anames))
328314 (error "function argument names not unique"))
329315 (if (has-dups names)
336322 (let* ((gen (generated-version body))
337323 (nongen (non-generated-version body))
338324 (gname (symbol (string (gensy) "#" (current-julia-module-counter))))
339 (gf (make-generator-function gname names (llist-vars argl) gen))
325 (gf (make-generator-function gname names anames gen))
340326 (loc (function-body-lineno body)))
341327 (set! body (insert-after-meta
342328 nongen
517503 (let ((T (caddr v)))
518504 `(call (core typeassert)
519505 ,rval0
520 ;; work around `ANY` not being a type. if arg type
521 ;; looks like `ANY`, test whether it is `ANY` at run
522 ;; time and if so, substitute `Any`. issue #21510
523 ,(if (or (eq? T 'ANY)
524 (and (globalref? T)
525 (eq? (caddr T) 'ANY)))
526 `(call (core ifelse)
527 (call (core ===) ,T (core ANY))
528 (core Any)
529 ,T)
530 T)))
506 ,T))
531507 rval0)))
532508 `(if (call (top haskey) ,kw (quote ,k))
533509 ,rval
947923 (let* ((a (car A))
948924 (isseq (and (vararg? (car F))))
949925 (ty (if isseq (cadar F) (car F))))
950 (if (and isseq (not (null? (cdr F)))) (error "only the trailing ccall argument type should have '...'"))
926 (if (and isseq (not (null? (cdr F)))) (error "only the trailing ccall argument type should have \"...\""))
951927 (if (eq? ty 'Any)
952928 (loop (if isseq F (cdr F)) (cdr A) stmts (list* a C) GC)
953929 (let* ((g (make-ssavalue))
954 (isamp (and (pair? a) (eq? (car a) '&)))
955 (a (if isamp (cadr a) a))
956 (stmts (cons `(= ,g (call (top ,(if isamp 'ptr_arg_cconvert 'cconvert)) ,ty ,a)) stmts))
957 (ca `(call (top ,(if isamp 'ptr_arg_unsafe_convert 'unsafe_convert)) ,ty ,g)))
930 (stmts (cons `(= ,g (call (top cconvert) ,ty ,a)) stmts))
931 (ca `(call (top unsafe_convert) ,ty ,g)))
958932 (loop (if isseq F (cdr F)) (cdr A) stmts
959 (list* (if isamp `(& ,ca) ca) C) (list* g GC))))))))
933 (list* ca C) (list* g GC))))))))
960934
961935 (define (expand-function-def e) ;; handle function definitions
962936 (define (just-arglist? ex)
10261000 ((eq? (car name) 'call)
10271001 (let* ((head (cadr name))
10281002 (argl (cddr name))
1029 (has-sp (and (not where) (pair? head) (eq? (car head) 'curly)))
1030 (name (deprecate-dotparen (if has-sp (cadr head) head)))
1031 (op (let ((op_ (maybe-undotop name))) ; handle .op -> broadcast deprecation
1032 (if op_
1033 (syntax-deprecation (string "function " (deparse name) "(...)")
1034 (string "function Base.broadcast(::typeof(" (deparse op_) "), ...)") #f))
1035 op_))
1036 (name (if op '(|.| Base (inert broadcast)) name))
1003 (name (check-dotop head))
10371004 (annotations (map (lambda (a) `(meta ,(cadr a) ,(arg-name (caddr a))))
10381005 (filter nospecialize-meta? argl)))
10391006 (body (insert-after-meta (caddr e) annotations))
10401007 (argl (map (lambda (a)
10411008 (if (nospecialize-meta? a) (caddr a) a))
10421009 argl))
1043 (argl (if op (cons `(|::| (call (core Typeof) ,op)) argl) argl))
1044 (raw-typevars (cond (has-sp (cddr head))
1045 (where where)
1046 (else '())))
1010 (raw-typevars (or where '()))
10471011 (sparams (map analyze-typevar raw-typevars))
10481012 (adj-decl (lambda (n) (if (and (decl? n) (length= n 2))
10491013 `(|::| |#self#| ,(cadr n))
10621026 (eq? (caar argl) 'parameters))))))
10631027 (name (if (or (decl? name) (and (pair? name) (eq? (car name) 'curly)))
10641028 #f name)))
1065 (if has-sp
1066 (syntax-deprecation (string "parametric method syntax " (deparse (cadr e)))
1067 (deparse `(where (call ,(or name
1068 (cadr (cadr (cadr e))))
1069 ,@(if (has-parameters? argl)
1070 (cons (car argl) (cddr argl))
1071 (cdr argl)))
1072 ,@raw-typevars))
1073 (function-body-lineno body)))
10741029 (expand-forms
10751030 (method-def-expr name sparams argl body rett))))
10761031 (else
11071062 (list (cadr e))))
11081063
11091064 (define (expand-let e)
1110 (if (length= e 2)
1111 (begin (deprecation-message (string "The form `Expr(:let, ex)` is deprecated. "
1112 "Use `Expr(:let, Expr(:block), ex)` instead." #\newline) #f)
1113 (return (expand-let `(let (block) ,(cadr e))))))
1114 (if (length> e 3)
1115 (begin (deprecation-message (string "The form `Expr(:let, ex, binds...)` is deprecated. "
1116 "Use `Expr(:let, Expr(:block, binds...), ex)` instead." #\newline) #f)
1117 (return (expand-let `(let (block ,@(cddr e)) ,(cadr e))))))
11181065 (let ((ex (caddr e))
11191066 (binds (let-binds e)))
11201067 (expand-forms
15581505 (if ,g ,g
15591506 ,(loop (cdr tail)))))))))))
15601507
1561 ;; If true, this will warn on all `for` loop variables that overwrite outer variables.
1562 ;; If false, this will try to warn only for uses of the last value after the loop.
1563 (define *warn-all-loop-vars* #f)
1564
15651508 (define (expand-for lhss itrs body)
15661509 (define (outer? x) (and (pair? x) (eq? (car x) 'outer)))
15671510 (let ((copied-vars ;; variables not declared `outer` are copied in the innermost loop
15841527 (lhs (if outer (cadar lhss) (car lhss)))
15851528 (body
15861529 `(block
1587 ;; NOTE: enable this to force loop-local var
1588 #;,@(map (lambda (v) `(local ,v)) (lhs-vars lhs))
15891530 ,@(if (not outer)
1590 (map (lambda (v) `(warn-if-existing ,v)) (lhs-vars lhs))
1531 (map (lambda (v) `(local ,v)) (lhs-vars lhs))
15911532 '())
15921533 ,(lower-tuple-assignment (list lhs state) next)
15931534 ,(nest (cdr lhss) (cdr itrs))))
18221763 (error (string "invalid " syntax-str " \"" (deparse el) "\""))))))))
18231764
18241765 (define (expand-forms e)
1825 (if (or (atom? e) (memq (car e) '(quote inert top core globalref outerref line module toplevel ssavalue null meta using import importall export)))
1766 (if (or (atom? e) (memq (car e) '(quote inert top core globalref outerref line module toplevel ssavalue null meta using import export)))
18261767 e
18271768 (let ((ex (get expand-table (car e) #f)))
18281769 (if ex
18381779 'let expand-let
18391780 'macro expand-macro-def
18401781 'struct expand-struct-def
1841 'type
1842 (lambda (e)
1843 (syntax-deprecation ":type expression head" ":struct" #f)
1844 (expand-struct-def e))
18451782 'try expand-try
18461783
18471784 'lambda
18591796 (else
18601797 (cons 'block
18611798 (map expand-forms (cdr e))))))
1862
1863 'body
1864 (lambda (e)
1865 (syntax-deprecation ":body expression head" ":block" #f)
1866 (expand-forms (cons 'block (cdr e))))
18671799
18681800 '|.|
18691801 (lambda (e) ; e = (|.| f x)
19351867 ((|.|)
19361868 ;; a.b =
19371869 (let* ((a (cadr lhs))
1938 (b_ (caddr lhs))
1939 (b (if (and (length= b_ 2) (eq? (car b_) 'tuple))
1940 (begin
1941 (syntax-deprecation
1942 (string (deparse a) ".(" (deparse (cadr b_)) ") = ...")
1943 (string "setfield!(" (deparse a) ", " (deparse (cadr b_)) ", ...)") #f)
1944 (cadr b_))
1945 b_))
1870 (b (caddr lhs))
19461871 (rhs (caddr e)))
1872 (if (and (length= b 2) (eq? (car b) 'tuple))
1873 (error (string "invalid syntax \""
1874 (string (deparse a) ".(" (deparse (cadr b)) ") = ...") "\"")))
19471875 (let ((aa (if (symbol-like? a) a (make-ssavalue)))
19481876 (bb (if (or (atom? b) (symbol-like? b) (and (pair? b) (quoted? b)))
19491877 b (make-ssavalue)))
20001928 (let ((a (cadr lhs))
20011929 (idxs (cddr lhs))
20021930 (rhs (caddr e)))
2003 (if (any assignment? idxs)
2004 (syntax-deprecation "assignment inside indexing" "" #f))
20051931 (let* ((reuse (and (pair? a)
20061932 (contains (lambda (x) (eq? x 'end))
20071933 idxs)))
20421968 (receive (name params super) (analyze-type-sig sig)
20431969 (abstract-type-def-expr name params super)))))
20441970
2045 'bitstype
2046 (lambda (e)
2047 (syntax-deprecation "Expr(:bitstype, nbits, name)" "Expr(:primitive, name, nbits)" #f)
2048 (expand-forms `(primitive ,(caddr e) ,(cadr e))))
20491971 'primitive
20501972 (lambda (e)
20511973 (let ((sig (cadr e))
20601982 'ref
20611983 (lambda (e)
20621984 (let ((args (cddr e)))
2063 (if (any assignment? args)
2064 (syntax-deprecation "assignment inside indexing" "" #f))
20651985 (if (has-parameters? args)
20661986 (error "unexpected semicolon in array expression")
20671987 (expand-forms (partially-expand-ref e)))))
20711991 (if (has-parameters? (cddr e))
20721992 (error (string "unexpected semicolon in \"" (deparse e) "\"")))
20731993 (if (any assignment? (cddr e))
2074 (syntax-deprecation "assignment inside T{ }" "" #f))
1994 (error (string "misplaced assignment statement in \"" (deparse e) "\"" )))
20751995 (let* ((p (extract-implicit-whereparams e))
20761996 (curlyparams (car p))
20771997 (whereparams (cdr p)))
22452165 (if (has-parameters? (cdr e))
22462166 (error "unexpected semicolon in array expression"))
22472167 (if (any assignment? (cdr e))
2248 (syntax-deprecation "assignment inside [ ]" "" #f))
2168 (error (string "misplaced assignment statement in \"" (deparse e) "\"")))
22492169 (expand-forms `(call (top vect) ,@(cdr e))))
22502170
22512171 'hcat
22522172 (lambda (e)
22532173 (if (any assignment? (cdr e))
2254 (syntax-deprecation "assignment inside [ ]" "" #f))
2174 (error (string "misplaced assignment statement in \"" (deparse e) "\"")))
22552175 (expand-forms `(call (top hcat) ,@(cdr e))))
22562176
22572177 'vcat
22582178 (lambda (e)
22592179 (let ((a (cdr e)))
22602180 (if (any assignment? a)
2261 (syntax-deprecation "assignment inside [ ]" "" #f))
2181 (error (string "misplaced assignment statement in \"" (deparse e) "\"")))
22622182 (if (has-parameters? a)
22632183 (error "unexpected semicolon in array expression")
22642184 (expand-forms
22792199 'typed_hcat
22802200 (lambda (e)
22812201 (if (any assignment? (cddr e))
2282 (syntax-deprecation "assignment inside T[ ]" "" #f))
2202 (error (string "misplaced assignment statement in \"" (deparse e) "\"")))
22832203 (expand-forms `(call (top typed_hcat) ,@(cdr e))))
22842204
22852205 'typed_vcat
22872207 (let ((t (cadr e))
22882208 (a (cddr e)))
22892209 (if (any assignment? (cddr e))
2290 (syntax-deprecation "assignment inside T[ ]" "" #f))
2210 (error (string "misplaced assignment statement in \"" (deparse e) "\"")))
22912211 (expand-forms
22922212 (if (any (lambda (x)
22932213 (and (pair? x) (eq? (car x) 'row)))
23042224 `(call (top typed_vcat) ,t ,@a)))))
23052225
23062226 '|'| (lambda (e) (expand-forms `(call (top adjoint) ,(cadr e))))
2307 '|.'| (lambda (e) (begin (deprecation-message (string "The postfix .' syntax is deprecated. "
2308 "For vector v in v.', use transpose(v) "
2309 "instead. For matrix A in A.', use "
2310 "copy(transpose(A)) instead, unless A.' "
2311 "appears as an argument of *, / or \\. In "
2312 "those cases, use transpose(A) instead. " #\newline) #f)
2313 (return (expand-forms `(call transpose ,(cadr e))))))
23142227
23152228 'generator
23162229 (lambda (e)
23802293 (inbounds pop)
23812294 (= ,idx (call (top add_int) ,idx 1)))
23822295 `(for (= ,(cadr (car itrs)) ,(car iv))
2383 (block
2384 ;; TODO: remove when all loop vars are local in 1.0
2385 ,.(map (lambda (v) `(local ,v))
2386 (lhs-vars (cadr (car itrs))))
2387 ,(construct-loops (cdr itrs) (cdr iv))))))
2296 ,(construct-loops (cdr itrs) (cdr iv)))))
23882297
23892298 (let ((overall-itr (if (length= itrs 1) (car iv) prod)))
23902299 `(scope-block
24312340 ;; pass 2: identify and rename local vars
24322341
24332342 (define (check-dups locals others)
2434 (if (pair? locals)
2343 #;(if (pair? locals)
24352344 (if (or (memq (car locals) (cdr locals)) (memq (car locals) others))
24362345 (error (string "local \"" (car locals) "\" declared twice"))
24372346 (check-dups (cdr locals) others)))
24522361 ((=)
24532362 (let ((v (decl-var (cadr e)))
24542363 (rest (find-assigned-vars (caddr e) env)))
2455 (if (or (ssavalue? v) (memq v env) (globalref? v))
2364 (if (or (ssavalue? v) (memq v env) (globalref? v) (underscore-symbol? v))
24562365 rest
24572366 (cons v rest))))
24582367 (else
24652374 (cond ((memq (car e) '(lambda scope-block module toplevel))
24662375 '())
24672376 ((eq? (car e) kind)
2468 (list (decl-var (cadr e))))
2377 (if (underscore-symbol? (cadr e))
2378 '()
2379 (list (decl-var (cadr e)))))
24692380 (else
24702381 (apply append! (map (lambda (x) (find-decls kind x))
24712382 e))))))
24742385 (define (find-local-def-decls e) (find-decls 'local-def e))
24752386 (define (find-global-decls e) (find-decls 'global e))
24762387
2477 (define (implicit-locals e env deprecated-env glob)
2388 (define (implicit-locals e env glob)
24782389 ;; const decls on non-globals introduce locals
24792390 (append! (diff (find-decls 'const e) glob)
2480 (filter
2481 (lambda (v)
2482 (if (memq v deprecated-env)
2483 (begin (syntax-deprecation (string "implicit assignment to global variable `" v "`") (string "global " v) #f) #f)
2484 #t))
2485 (find-assigned-vars e env))))
2391 (find-assigned-vars e env)))
24862392
24872393 (define (unbound-vars e bound tab)
2488 (cond ((or (eq? e 'true) (eq? e 'false) (eq? e UNUSED)) tab)
2394 (cond ((or (eq? e 'true) (eq? e 'false) (eq? e UNUSED) (underscore-symbol? e)) tab)
24892395 ((symbol? e) (if (not (memq e bound)) (put! tab e #t)) tab)
24902396 ((or (not (pair? e)) (quoted? e)) tab)
24912397 ((memq (car e) '(lambda scope-block module toplevel)) tab)
25052411 ;; 3. variables assigned inside this scope-block that don't exist in outer
25062412 ;; scopes
25072413 ;; returns lambdas in the form (lambda (args...) (locals...) body)
2508 (define (resolve-scopes- e env outerglobals implicitglobals lam renames newlam (sp '()))
2414 (define (resolve-scopes- e env implicitglobals lam renames newlam (sp '()))
25092415 (cond ((symbol? e) (let ((r (assq e renames)))
25102416 (if r (cdr r) e))) ;; return the renaming for e, or e
25112417 ((or (not (pair? e)) (quoted? e) (memq (car e) '(toplevel global symbolicgoto symboliclabel))) e)
25172423 (if (not (memq (cadr e) env))
25182424 (error "no outer variable declaration exists for \"for outer\""))
25192425 '(null))
2520 ((eq? (car e) 'warn-if-existing)
2521 (if (or (memq (cadr e) outerglobals) (memq (cadr e) implicitglobals))
2522 `(warn-loop-var ,(cadr e))
2523 '(null)))
25242426 ((eq? (car e) 'lambda)
25252427 (let* ((lv (lam:vars e))
25262428 (env (append lv env))
25272429 (body (resolve-scopes- (lam:body e) env
25282430 ;; don't propagate implicit or outer globals
2529 '()
25302431 '()
25312432 e
25322433 ;; remove renames corresponding to local variables from the environment
25472448 ;; being declared global prevents a variable
25482449 ;; assignment from introducing a local
25492450 (append env glob iglo locals-declared vars-def)
2550 outerglobals
25512451 (append glob iglo)))
25522452 (vars (delete-duplicates (append! locals-declared locals-implicit)))
25532453 (all-vars (append vars vars-def))
25632463 vars))))
25642464 (need-rename (need-rename? vars))
25652465 (need-rename-def (need-rename? vars-def))
2566 (deprecated-loop-vars
2567 (filter (lambda (v) (and (memq v env) (not (memq v locals-declared))))
2568 (delete-duplicates (find-decls 'warn-if-existing blok))))
25692466 ;; new gensym names for conflicting variables
25702467 (renamed (map named-gensy need-rename))
25712468 (renamed-def (map named-gensy need-rename-def))
25842481 (memq var implicitglobals) ;; remove anything only added implicitly in the last scope block
25852482 (memq var glob))))) ;; remove anything that's now global
25862483 renames)))
2587 (new-oglo (append iglo outerglobals)) ;; list of all implicit-globals from outside blok
2588 (body (resolve-scopes- blok new-env new-oglo new-iglo lam new-renames #f sp))
2484 (body (resolve-scopes- blok new-env new-iglo lam new-renames #f sp))
25892485 (real-new-vars (append (diff vars need-rename) renamed))
25902486 (real-new-vars-def (append (diff vars-def need-rename-def) renamed-def)))
25912487 (for-each (lambda (v)
26012497 (if lam ;; update in-place the list of local variables in lam
26022498 (set-car! (cddr lam)
26032499 (append real-new-vars real-new-vars-def (caddr lam))))
2604 (let* ((warnings (map (lambda (v) `(warn-loop-var ,v)) deprecated-loop-vars))
2605 (body (if *warn-all-loop-vars*
2606 body
2607 (if (and (pair? body) (eq? (car body) 'block))
2608 (append body warnings)
2609 `(block ,body ,@warnings)))))
2610 (insert-after-meta ;; return the new, expanded scope-block
2611 (blockify body)
2612 (append! (map (lambda (v) `(local ,v)) real-new-vars)
2613 (map (lambda (v) `(local-def ,v)) real-new-vars-def)
2614 (if *warn-all-loop-vars*
2615 (map (lambda (v) `(warn-loop-var ,v)) deprecated-loop-vars)
2616 '()))))))
2500 (insert-after-meta ;; return the new, expanded scope-block
2501 (blockify body)
2502 (append! (map (lambda (v) `(local ,v)) real-new-vars)
2503 (map (lambda (v) `(local-def ,v)) real-new-vars-def)))))
26172504 ((eq? (car e) 'module)
26182505 (error "\"module\" expression not at top level"))
26192506 ((eq? (car e) 'break-block)
26202507 `(break-block ,(cadr e) ;; ignore type symbol of break-block expression
2621 ,(resolve-scopes- (caddr e) env outerglobals implicitglobals lam renames #f sp))) ;; body of break-block expression
2508 ,(resolve-scopes- (caddr e) env implicitglobals lam renames #f sp))) ;; body of break-block expression
26222509 ((eq? (car e) 'with-static-parameters)
26232510 `(with-static-parameters
2624 ,(resolve-scopes- (cadr e) env outerglobals implicitglobals lam renames #f (cddr e))
2511 ,(resolve-scopes- (cadr e) env implicitglobals lam renames #f (cddr e))
26252512 ,@(cddr e)))
26262513 ((and (eq? (car e) 'method) (length> e 2))
26272514 `(method
2628 ,(resolve-scopes- (cadr e) env outerglobals implicitglobals lam renames #f)
2629 ,(resolve-scopes- (caddr e) env outerglobals implicitglobals lam renames #f)
2630 ,(resolve-scopes- (cadddr e) env outerglobals implicitglobals lam renames #f
2515 ,(resolve-scopes- (cadr e) env implicitglobals lam renames #f)
2516 ,(resolve-scopes- (caddr e) env implicitglobals lam renames #f)
2517 ,(resolve-scopes- (cadddr e) env implicitglobals lam renames #f
26312518 (append (method-expr-static-parameters e) sp))))
26322519 (else
26332520 (cons (car e)
26342521 (map (lambda (x)
2635 (resolve-scopes- x env outerglobals implicitglobals lam renames #f sp))
2522 (resolve-scopes- x env implicitglobals lam renames #f sp))
26362523 (cdr e))))))
26372524
2638 (define (resolve-scopes e) (resolve-scopes- e '() '() '() #f '() #f))
2525 (define (resolve-scopes e) (resolve-scopes- e '() '() #f '() #f))
26392526
26402527 ;; pass 3: analyze variables
26412528
26452532
26462533 ;; compute set of variables referenced in a lambda but not bound by it
26472534 (define (free-vars- e tab)
2648 (cond ((or (eq? e 'true) (eq? e 'false) (eq? e UNUSED)) tab)
2535 (cond ((or (eq? e 'true) (eq? e 'false) (eq? e UNUSED) (underscore-symbol? e)) tab)
26492536 ((symbol? e) (put! tab e #t))
26502537 ((and (pair? e) (eq? (car e) 'outerref)) tab)
26512538 ((and (pair? e) (eq? (car e) 'break-block)) (free-vars- (caddr e) tab))
29852872
29862873 (define lambda-opt-ignored-exprs
29872874 (Set '(quote top core line inert local local-def unnecessary copyast
2988 meta inbounds boundscheck simdloop decl warn-loop-var
2875 meta inbounds boundscheck simdloop decl
29892876 struct_type abstract_type primitive_type thunk with-static-parameters
29902877 implicit-global global globalref outerref const-if-global
29912878 const null ssavalue isdefined toplevel module lambda error
2992 gc_preserve_begin gc_preserve_end import importall using export)))
2879 gc_preserve_begin gc_preserve_end import using export)))
29932880
29942881 (define (local-in? s lam)
29952882 (or (assq s (car (lam:vinfo lam)))
30932980 (del! unused (cadr e)))
30942981 ;; in all other cases there's nothing to do except assert that
30952982 ;; all expression heads have been handled.
3096 #;(assert (memq (car e) '(= method new call foreigncall cfunction |::| &)))))))
2983 #;(assert (memq (car e) '(= method new call foreigncall cfunction |::|)))))))
30972984 (visit (lam:body lam))
30982985 ;; Finally, variables can be marked never-undef if they were set in the first block,
30992986 ;; or are currently live, or are back in the unused set (because we've left the only
31773064 ((atom? e) e)
31783065 (else
31793066 (case (car e)
3180 ((quote top core globalref outerref line break inert module toplevel null meta warn-loop-var) e)
3067 ((quote top core globalref outerref line break inert module toplevel null meta) e)
31813068 ((=)
31823069 (let ((var (cadr e))
31833070 (rhs (cl-convert (caddr e) fname lam namemap toplevel interp)))
34783365 (first-line #t)
34793366 (current-loc #f)
34803367 (rett #f)
3481 (deprecated-loop-vars (table))
3482 (deprecated-global-const-locs '())
3368 (global-const-error #f)
34833369 (arg-map #f) ;; map arguments to new names if they are assigned
34843370 (label-counter 0) ;; counter for generating label addresses
34853371 (label-map (table)) ;; maps label names to generated addresses
35813467 (not (simple-atom? arg))
35823468 (not (simple-atom? aval))
35833469 (not (and (pair? arg)
3584 (memq (car arg) '(& quote inert top core globalref outerref boundscheck))))
3470 (memq (car arg) '(quote inert top core globalref outerref boundscheck))))
35853471 (not (and (symbol? aval) ;; function args are immutable and always assigned
35863472 (memq aval (lam:args lam))))
35873473 (not (and (symbol? arg)
36263512 (and (pair? e) (or (eq? (car e) 'outerref)
36273513 (eq? (car e) 'globalref))
36283514 (underscore-symbol? (cadr e)))))
3629 (syntax-deprecation "underscores as an rvalue" "" current-loc))
3630 (if (and (not *warn-all-loop-vars*) (has? deprecated-loop-vars e))
3631 (begin (deprecation-message
3632 (string "Use of final value of loop variable `" e "`" (linenode-string current-loc) " "
3633 "is deprecated. In the future the variable will be local to the loop instead.") current-loc)
3634 (del! deprecated-loop-vars e)))
3515 (error (string "all-underscore identifier used as rvalue" (format-loc current-loc))))
36353516 (cond (tail (emit-return e1))
36363517 (value e1)
36373518 ((or (eq? e1 'true) (eq? e1 'false)) #f)
36433524 ((call new foreigncall cfunction)
36443525 (let* ((args
36453526 (cond ((eq? (car e) 'foreigncall)
3646 (for-each (lambda (a)
3647 (if (and (length= a 2) (eq? (car a) '&))
3648 (deprecation-message
3649 (string "Syntax `&argument`" (linenode-string current-loc)
3650 " is deprecated. Remove the `&` and use a `Ref` argument "
3651 "type instead.")
3652 current-loc)))
3653 (list-tail e 6))
36543527 ;; NOTE: 2nd to 5th arguments of ccall must be left in place
36553528 ;; the 1st should be compiled if an atom.
36563529 (append (if (or (atom? (cadr e))
36803553 (value callex)
36813554 (else (emit callex)))))
36823555 ((=)
3683 (let* ((rhs (compile (caddr e) break-labels #t #f))
3684 (lhs (cadr e))
3685 (lhs (if (and arg-map (symbol? lhs))
3686 (get arg-map lhs lhs)
3687 lhs)))
3688 (if (and (not *warn-all-loop-vars*) (has? deprecated-loop-vars lhs))
3689 (del! deprecated-loop-vars lhs))
3690 (if (and value rhs)
3691 (let ((rr (if (or (atom? rhs) (ssavalue? rhs) (eq? (car rhs) 'null))
3692 rhs (make-ssavalue))))
3693 (if (not (eq? rr rhs))
3694 (emit `(= ,rr ,rhs)))
3695 (emit `(= ,lhs ,rr))
3696 (if tail (emit-return rr))
3697 rr)
3698 (emit-assignment lhs rhs))))
3556 (let ((lhs (cadr e)))
3557 (if (and (symbol? lhs) (underscore-symbol? lhs))
3558 (compile (caddr e) break-labels value tail)
3559 (let* ((rhs (compile (caddr e) break-labels #t #f))
3560 (lhs (if (and arg-map (symbol? lhs))
3561 (get arg-map lhs lhs)
3562 lhs)))
3563 (if (and value rhs)
3564 (let ((rr (if (or (atom? rhs) (ssavalue? rhs) (eq? (car rhs) 'null))
3565 rhs (make-ssavalue))))
3566 (if (not (eq? rr rhs))
3567 (emit `(= ,rr ,rhs)))
3568 (emit `(= ,lhs ,rr))
3569 (if tail (emit-return rr))
3570 rr)
3571 (emit-assignment lhs rhs))))))
36993572 ((block)
37003573 (let* ((last-fname filename)
37013574 (fnm (first-non-meta e))
38743747 (loop (cdr actions)))))))
38753748 val)))
38763749
3877 ((&)
3878 (if (or (not value) tail)
3879 (error "misplaced \"&\" expression"))
3880 `(& ,(compile (cadr e) break-labels value tail)))
3881
38823750 ((newvar)
38833751 ;; avoid duplicate newvar nodes
38843752 (if (and (not (and (pair? code) (equal? (car code) e)))
39003768 ((implicit-global) #f)
39013769 ((const)
39023770 (if (local-in? (cadr e) lam)
3903 (begin
3904 (syntax-deprecation "`const` declaration on local variable" "" current-loc)
3905 '(null))
3771 (error (string "unsupported `const` declaration on local variable" (format-loc current-loc)))
39063772 (if (pair? (cadr lam))
3907 ;; delay these deprecation warnings to allow "misplaced struct" errors to happen first
3908 (set! deprecated-global-const-locs
3909 (cons current-loc deprecated-global-const-locs))
3773 ;; delay this error to allow "misplaced struct" errors to happen first
3774 (if (not global-const-error)
3775 (set! global-const-error current-loc))
39103776 (emit e))))
39113777 ((isdefined) (if tail (emit-return e) e))
3912 ((warn-loop-var)
3913 (if (or *warn-all-loop-vars*
3914 (not (local-in? (cadr e) lam)))
3915 (deprecation-message
3916 (string "Loop variable `" (cadr e) "`" (linenode-string current-loc) " "
3917 "overwrites a variable in an enclosing scope. "
3918 "In the future the variable will be local to the loop instead.")
3919 current-loc)
3920 (put! deprecated-loop-vars (cadr e) #t))
3921 '(null))
39223778 ((boundscheck) (if tail (emit-return e) e))
39233779
39243780 ((method)
39783834 '(null))
39793835
39803836 ;; other top level expressions
3981 ((import importall using export)
3837 ((import using export)
39823838 (check-top-level e)
39833839 (emit e)
39843840 (let ((have-ret? (and (pair? code) (pair? (car code)) (eq? (caar code) 'return))))
40373893 (else
40383894 (set-car! (cdr point) `(leave ,(- hl target-level))))))))
40393895 handler-goto-fixups)
4040 (for-each (lambda (loc)
4041 (deprecation-message
4042 (string "`global const` declarations may no longer appear inside functions." #\newline
4043 "Instead, use a non-constant global, or a global `const var = Ref{T}()`.")
4044 loc))
4045 (reverse! deprecated-global-const-locs))
3896 (if global-const-error
3897 (error (string "`global const` delcaration not allowed inside function" (format-loc global-const-error))))
40463898 (let* ((stmts (reverse! code))
40473899 (di (definitely-initialized-vars stmts vi))
40483900 (body (cons 'block (filter (lambda (e)
519519 extern JL_DLLEXPORT jl_datatype_t *jl_any_type JL_GLOBALLY_ROOTED;
520520 extern JL_DLLEXPORT jl_unionall_t *jl_type_type JL_GLOBALLY_ROOTED;
521521 extern JL_DLLEXPORT jl_unionall_t *jl_typetype_type JL_GLOBALLY_ROOTED;
522 extern JL_DLLEXPORT jl_value_t *jl_ANY_flag JL_GLOBALLY_ROOTED;
523522 extern JL_DLLEXPORT jl_datatype_t *jl_typename_type JL_GLOBALLY_ROOTED;
524523 extern JL_DLLEXPORT jl_typename_t *jl_type_typename JL_GLOBALLY_ROOTED;
525524 extern JL_DLLEXPORT jl_datatype_t *jl_sym_type JL_GLOBALLY_ROOTED;
13411340 JL_DLLEXPORT void jl_module_use(jl_module_t *to, jl_module_t *from, jl_sym_t *s);
13421341 JL_DLLEXPORT void jl_module_import(jl_module_t *to, jl_module_t *from,
13431342 jl_sym_t *s);
1344 JL_DLLEXPORT void jl_module_importall(jl_module_t *to, jl_module_t *from);
13451343 JL_DLLEXPORT void jl_module_export(jl_module_t *from, jl_sym_t *s);
13461344 JL_DLLEXPORT int jl_is_imported(jl_module_t *m, jl_sym_t *s);
13471345 JL_DLLEXPORT int jl_module_exports_p(jl_module_t *m, jl_sym_t *var);
922922 }
923923
924924 JL_DLLEXPORT jl_array_t *jl_array_cconvert_cstring(jl_array_t *a);
925 JL_DLLEXPORT void jl_depwarn_partial_indexing(size_t n);
926925 void jl_depwarn(const char *msg, jl_value_t *sym);
927926
928927 // Log `msg` to the current logger by calling CoreLogging.logmsg_shim() on the
939938 extern jl_sym_t *empty_sym; extern jl_sym_t *top_sym;
940939 extern jl_sym_t *module_sym; extern jl_sym_t *slot_sym;
941940 extern jl_sym_t *export_sym; extern jl_sym_t *import_sym;
942 extern jl_sym_t *importall_sym; extern jl_sym_t *toplevel_sym;
943 extern jl_sym_t *quote_sym; extern jl_sym_t *amp_sym;
941 extern jl_sym_t *toplevel_sym; extern jl_sym_t *quote_sym;
944942 extern jl_sym_t *line_sym; extern jl_sym_t *jl_incomplete_sym;
945943 extern jl_sym_t *goto_sym; extern jl_sym_t *goto_ifnot_sym;
946944 extern jl_sym_t *return_sym; extern jl_sym_t *unreachable_sym;
319319 ,(resolve-expansion-vars-with-new-env (caddr arg) env m parent-scope inarg))))
320320 (else
321321 `(global ,(resolve-expansion-vars-with-new-env arg env m parent-scope inarg))))))
322 ((using import importall export meta line inbounds boundscheck simdloop gc_preserve gc_preserve_end) (map unescape e))
322 ((using import export meta line inbounds boundscheck simdloop gc_preserve gc_preserve_end) (map unescape e))
323323 ((macrocall) e) ; invalid syntax anyways, so just act like it's quoted.
324324 ((symboliclabel) e)
325325 ((symbolicgoto) e)
468468 uint8_t j;
469469 uint8_t called = 0;
470470 int gen_only = 0;
471 for (j = 1; j < m->nargs && j <= 8; j++) {
471 for (j = 1; j < m->nargs && j <= sizeof(m->nospecialize) * 8; j++) {
472472 jl_value_t *ai = jl_array_ptr_ref(src->slotnames, j);
473 if (ai == (jl_value_t*)unused_sym)
473 if (ai == (jl_value_t*)unused_sym) {
474 // TODO: enable this. currently it triggers a bug on arguments like
475 // ::Type{>:Missing}
476 //int sn = j-1;
477 //m->nospecialize |= (1 << sn);
474478 continue;
475 if (jl_array_uint8_ref(src->slotflags, j) & 64)
476 called |= (1 << (j - 1));
479 }
480 if (j <= 8) {
481 if (jl_array_uint8_ref(src->slotflags, j) & 64)
482 called |= (1 << (j - 1));
483 }
477484 }
478485 m->called = called;
479486 m->pure = src->pure;
754761 jl_value_t *argtype = NULL;
755762 JL_GC_PUSH3(&f, &m, &argtype);
756763 size_t i, na = jl_svec_len(atypes);
757 int32_t nospec = 0;
758 for (i = 1; i < na; i++) {
759 jl_value_t *ti = jl_svecref(atypes, i);
760 if (ti == jl_ANY_flag ||
761 (jl_is_vararg_type(ti) && jl_tparam0(jl_unwrap_unionall(ti)) == jl_ANY_flag)) {
762 jl_depwarn("`x::ANY` is deprecated, use `@nospecialize(x)` instead.",
763 (jl_value_t*)jl_symbol("ANY"));
764 if (i <= 32)
765 nospec |= (1 << (i - 1));
766 jl_svecset(atypes, i, jl_substitute_var(ti, (jl_tvar_t*)jl_ANY_flag, (jl_value_t*)jl_any_type));
767 }
768 }
769764
770765 argtype = (jl_value_t*)jl_apply_tuple_type(atypes);
771766 for (i = jl_svec_len(tvars); i > 0; i--) {
792787 f = jl_new_code_info_from_ast((jl_expr_t*)f);
793788 }
794789 m = jl_new_method(f, name, module, (jl_tupletype_t*)argtype, nargs, isva, tvars);
795 m->nospecialize |= nospec;
796790
797791 if (jl_has_free_typevars(argtype)) {
798792 jl_exceptionf(jl_argumenterror_type,
390390 module_import_(to, from, s, 0);
391391 }
392392
393 JL_DLLEXPORT void jl_module_importall(jl_module_t *to, jl_module_t *from)
394 {
395 void **table = from->bindings.table;
396 for(size_t i=1; i < from->bindings.size; i+=2) {
397 if (table[i] != HT_NOTFOUND) {
398 jl_binding_t *b = (jl_binding_t*)table[i];
399 if (b->exportp && (b->owner==from || b->imported))
400 jl_module_import(to, from, b->name);
401 }
402 }
403 }
404
405393 JL_DLLEXPORT void jl_module_using(jl_module_t *to, jl_module_t *from)
406394 {
407395 if (to == from)
637625 b->constp = 1;
638626 }
639627
640 JL_DLLEXPORT jl_value_t *jl_get_current_module(void)
641 {
642 jl_ptls_t ptls = jl_get_ptls_states();
643 return (jl_value_t*)ptls->current_module;
644 }
645
646 JL_DLLEXPORT void jl_set_current_module(jl_value_t *m)
647 {
648 jl_ptls_t ptls = jl_get_ptls_states();
649 assert(jl_typeis(m, jl_module_type));
650 ptls->current_module = (jl_module_t*)m;
651 }
652
653628 JL_DLLEXPORT jl_value_t *jl_module_usings(jl_module_t *m)
654629 {
655630 jl_array_t *a = jl_alloc_array_1d(jl_array_any_type, 0);
11111111 JL_GC_POP();
11121112 }
11131113
1114 JL_DLLEXPORT void jl_depwarn_partial_indexing(size_t n)
1115 {
1116 static jl_value_t *depwarn_func = NULL;
1117 if (!depwarn_func && jl_base_module) {
1118 depwarn_func = jl_get_global(jl_base_module, jl_symbol("_depwarn_for_trailing_indices"));
1119 }
1120 if (!depwarn_func) {
1121 jl_safe_printf("WARNING: omitting indices for non-singleton trailing dimensions is deprecated. Use "
1122 "`reshape(A, Val(%zd))` or add trailing `1` indices to make the dimensionality of the array match "
1123 "the number of indices\n", n);
1124 return;
1125 }
1126 jl_value_t **depwarn_args;
1127 JL_GC_PUSHARGS(depwarn_args, 2);
1128 depwarn_args[0] = depwarn_func;
1129 depwarn_args[1] = jl_box_long(n);
1130 jl_apply(depwarn_args, 2);
1131 JL_GC_POP();
1132 }
1133
11341114 #ifdef __cplusplus
11351115 }
11361116 #endif
16401640 jl_densearray_type, jl_void_type, jl_function_type, jl_typeofbottom_type,
16411641 jl_unionall_type, jl_typename_type, jl_builtin_type, jl_code_info_type,
16421642 jl_task_type, jl_uniontype_type, jl_typetype_type, jl_abstractstring_type,
1643 jl_ANY_flag, jl_array_any_type, jl_intrinsic_type, jl_abstractslot_type,
1643 jl_array_any_type, jl_intrinsic_type, jl_abstractslot_type,
16441644 jl_methtable_type, jl_typemap_level_type, jl_typemap_entry_type,
16451645 jl_voidpointer_type, jl_newvarnode_type,
16461646 jl_array_symbol_type, jl_anytuple_type, jl_tparam0(jl_anytuple_type),
512512 {
513513 return jl_is_expr(e) &&
514514 (((jl_expr_t*)e)->head == module_sym ||
515 ((jl_expr_t*)e)->head == importall_sym ||
516515 ((jl_expr_t*)e)->head == import_sym ||
517516 ((jl_expr_t*)e)->head == using_sym ||
518517 ((jl_expr_t*)e)->head == export_sym ||
555554 b->constp = 1;
556555 jl_gc_wb(m, (jl_value_t*)import);
557556 }
558 }
559
560 // replace Base.X with top-level X
561 static jl_module_t *deprecation_replacement_module(jl_module_t *parent, jl_sym_t *name)
562 {
563 if (parent == jl_base_module) {
564 if (name == jl_symbol("Test") || name == jl_symbol("Mmap"))
565 return call_require(jl_base_module, name);
566 }
567 return NULL;
568557 }
569558
570559 // in `import A.B: x, y, ...`, evaluate the `A.B` part if it exists
600589 jl_lineno = jl_linenode_line(e);
601590 return jl_nothing;
602591 }
592 if (jl_is_symbol(e)) {
593 char *n = jl_symbol_name((jl_sym_t*)e);
594 while (*n == '_') ++n;
595 if (*n == 0)
596 jl_error("all-underscore identifier used as rvalue");
597 }
603598 return jl_interpret_toplevel_expr_in(m, e, NULL, NULL);
604599 }
605600
619614 else if (ex->head == module_sym) {
620615 return jl_eval_module_expr(m, ex);
621616 }
622 else if (ex->head == importall_sym) {
623 jl_sym_t *name = NULL;
624 jl_depwarn("`importall` is deprecated, use `using` or individual `import` statements instead",
625 (jl_value_t*)jl_symbol("importall"));
626 jl_module_t *from = eval_import_from(m, ex, "importall");
627 size_t i = 0;
628 if (from) {
629 i = 1;
630 ex = (jl_expr_t*)jl_exprarg(ex, 0);
631 }
632 for (; i < jl_expr_nargs(ex); i++) {
633 jl_value_t *a = jl_exprarg(ex, i);
634 if (jl_is_expr(a) && ((jl_expr_t*)a)->head == dot_sym) {
635 name = NULL;
636 jl_module_t *import = eval_import_path(m, from, ((jl_expr_t*)a)->args, &name, "importall");
637 if (name != NULL) {
638 import = (jl_module_t*)jl_eval_global_var(import, name);
639 if (!jl_is_module(import))
640 jl_errorf("invalid %s statement: name exists but does not refer to a module", jl_symbol_name(ex->head));
641 }
642 jl_module_importall(m, import);
643 }
644 }
645 return jl_nothing;
646 }
647617 else if (ex->head == using_sym) {
648618 size_t last_age = ptls->world_age;
649619 ptls->world_age = jl_world_counter;
663633 jl_module_t *u = import;
664634 if (name != NULL)
665635 u = (jl_module_t*)jl_eval_global_var(import, name);
666 if (jl_is_module(u)) {
667 if (from) {
668 jl_depwarn("`using A: B` will only be allowed for single bindings, not modules. Use "
669 "`using A.B` instead",
670 (jl_value_t*)jl_symbol("using"));
671 }
636 if (from) {
637 // `using A: B` syntax
638 jl_module_use(m, import, name);
639 }
640 else {
641 if (!jl_is_module(u))
642 jl_errorf("invalid using path: \"%s\" does not name a module", jl_symbol_name(name));
643 // `using A.B` syntax
672644 jl_module_using(m, u);
673645 if (m == jl_main_module && name == NULL) {
674646 // TODO: for now, `using A` in Main also creates an explicit binding for `A`
675647 // This will possibly be extended to all modules.
676648 import_module(m, u);
677649 }
678 }
679 else {
680 if (!from) {
681 jl_depwarn("`using A.B` will only be allowed for modules, not single bindings. Use "
682 "`using A: B` instead",
683 (jl_value_t*)jl_symbol("using"));
684 }
685 jl_module_t *replacement = deprecation_replacement_module(import, name);
686 if (replacement)
687 jl_module_using(m, replacement);
688 else
689 jl_module_use(m, import, name);
690650 }
691651 }
692652 }
713673 import_module(m, import);
714674 }
715675 else {
716 jl_module_t *replacement = deprecation_replacement_module(import, name);
717 if (replacement)
718 import_module(m, replacement);
719 else
720 jl_module_import(m, import, name);
676 jl_module_import(m, import, name);
721677 }
722678 }
723679 }
00 # This file is a part of Julia. License is MIT: https://julialang.org/license
11
2 # 0.7 deprecations
3
4 import Base.(:)
5 import Base.range
6
7 # deprecate remaining vectorized methods from Dates
8 @deprecate(
9 DateTime(Y::AbstractArray{<:AbstractString}, f::AbstractString; locale::Locale=ENGLISH),
10 DateTime.(Y, f; locale=locale) )
11 @deprecate(
12 DateTime(Y::AbstractArray{<:AbstractString}, df::DateFormat=ISODateTimeFormat),
13 DateTime.(Y, df) )
14 @deprecate(
15 Date(Y::AbstractArray{<:AbstractString}, f::AbstractString; locale::Locale=ENGLISH),
16 Date.(Y, f; locale=locale) )
17 @deprecate(
18 Date(Y::AbstractArray{<:AbstractString}, df::DateFormat=ISODateFormat),
19 Date.(Y, df) )
20 @deprecate(
21 format(Y::AbstractArray{<:TimeType}, f::AbstractString; locale::Locale=ENGLISH),
22 format.(Y, f; locale=locale),
23 false )
24 @deprecate(
25 format(Y::AbstractArray{T}, df::DateFormat=default_format(T)) where {T<:TimeType},
26 format.(Y, df),
27 false )
28
29 @deprecate +(a::GeneralPeriod, b::StridedArray{<:GeneralPeriod}) broadcast(+, a, b) false
30 @deprecate +(a::StridedArray{<:GeneralPeriod}, b::GeneralPeriod) broadcast(+, a, b) false
31 @deprecate -(a::GeneralPeriod, b::StridedArray{<:GeneralPeriod}) broadcast(-, a, b) false
32 @deprecate -(a::StridedArray{<:GeneralPeriod}, b::GeneralPeriod) broadcast(-, a, b) false
33
34 # #24258
35 # Physical units define an equivalence class: there is no such thing as a step of "1" (is
36 # it one day or one second or one nanosecond?). So require the user to specify the step
37 # (in physical units).
38 @deprecate (:)(start::T, stop::T) where {T<:DateTime} start:Day(1):stop false
39 @deprecate (:)(start::T, stop::T) where {T<:Date} start:Day(1):stop false
40 @deprecate (:)(start::T, stop::T) where {T<:Time} start:Second(1):stop false
41
42 @deprecate range(start::DateTime, len::Integer) range(start, step=Day(1), length=len) false
43 @deprecate range(start::Date, len::Integer) range(start, step=Day(1), length=len) false
44
45 # PR #23724
46 @deprecate DateTime() DateTime(1)
47 @deprecate Date() Date(1)
48 @deprecate Time() Time(0)
2 # 1.0 deprecations
8282 end
8383 end
8484 @test Dates.Year(3) == Dates.Month(36)
85 #@test_throws MethodError Int(Dates.Month(36)) # re-enable when deprecation removed
85 @test_throws MethodError Int(Dates.Month(36))
8686 @test Dates.Year(3) < Dates.Month(37)
8787 @test_throws InexactError convert(Dates.Year, Dates.Month(37))
8888 @test_throws InexactError Dates.Month(Dates.Year(typemax(Int64)))
1010 import Base: tryparse_internal, show
1111
1212 export readdlm, writedlm
13
14 Base.@deprecate readcsv(io; opts...) readdlm(io, ','; opts...)
15 Base.@deprecate readcsv(io, T::Type; opts...) readdlm(io, ',', T; opts...)
16 Base.@deprecate writecsv(io, a; opts...) writedlm(io, a, ','; opts...)
1713
1814 invalid_dlm(::Type{Char}) = reinterpret(Char, 0xfffffffe)
1915 invalid_dlm(::Type{UInt8}) = 0xfe
9191 include("managers.jl") # LocalManager and SSHManager
9292 include("precompile.jl")
9393
94 # Deprecations
95
96 @eval @deprecate $(Symbol("@parallel")) $(Symbol("@distributed"))
97
98 # PR 26783
99 @deprecate pmap(p::AbstractWorkerPool, f, c; kwargs...) pmap(f, p, c; kwargs...)
100 @deprecate pmap(p::AbstractWorkerPool, f, c1, c...; kwargs...) pmap(f, p, c1, c...; kwargs...)
101
10294 function __init__()
10395 init_parallel()
10496 end
418418 end
419419 end
420420
421 Base._wait(t_launch) # catches any thrown errors from the launch task
421 Base.wait(t_launch) # catches any thrown errors from the launch task
422422
423423 # Since all worker-to-worker setups may not have completed by the time this
424424 # function returns to the caller, send the complete list to all workers.
683683 const PGRP = ProcessGroup([])
684684
685685 function topology(t)
686 if t == :master_slave
687 Base.depwarn("The topology :master_slave is deprecated, use :master_worker instead.", :topology)
688 t = :master_worker
689 end
690686 @assert t in [:all_to_all, :master_worker, :custom]
691687 if (PGRP.topology==t) || ((myid()==1) && (nprocs()==1)) || (myid() > 1)
692688 PGRP.topology = t
125125 for sym in check_syms
126126 v = getfield(Main, sym)
127127
128 if isbitstype(typeof(v))
128 if isbits(v)
129129 push!(lst, sym)
130130 else
131131 oid = objectid(v)
145145
146146 oid = objectid(v)
147147 record_v = true
148 if isbitstype(typeof(v))
148 if isbits(v)
149149 record_v = false
150150 elseif !haskey(s.glbs_sent, oid)
151151 # set up a finalizer the first time this object is sent
326326 end
327327 end
328328
329 for wt in wait_tasks; Base._wait(wt); end
329 for wt in wait_tasks; Base.wait(wt); end
330330
331331 send_connection_hdr(controller, false)
332332 send_msg_now(controller, MsgHeader(RRID(0,0), header.notify_oid), JoinCompleteMsg(Sys.CPU_THREADS, getpid()))
735735
736736 let t = @task 42
737737 schedule(t, ErrorException(""), error=true)
738 @test_throws ErrorException Base._wait(t)
738 @test_throws ErrorException Base.wait(t)
739739 end
740740
741741 # issue #8207
10481048 p = addprocs_with_testenv(1)[1]
10491049 np = nprocs()
10501050 @spawnat p sleep(5)
1051 Base._wait(rmprocs(p; waitfor=0))
1051 Base.wait(rmprocs(p; waitfor=0))
10521052 for pid in procs()
10531053 @test pid == remotecall_fetch(myid, pid)
10541054 end
109109 end
110110 notify(ready_c, all=true)
111111 for idx in 1:n
112 Base._wait(t[idx])
112 Base.wait(t[idx])
113113 end
114114 end
115115 end
4949
5050 - `verbose`: print all additional information
5151 """
52 function versioninfo(io::IO=stdout; verbose::Bool=false, packages::Union{Bool, Nothing}=nothing)
53 if packages !== nothing
54 depwarn("the packages keyword argument has been removed")
55 end
52 function versioninfo(io::IO=stdout; verbose::Bool=false)
5653 println(io, "Julia Version $VERSION")
5754 if !isempty(Base.GIT_VERSION_INFO.commit_short)
5855 println(io, "Commit $(Base.GIT_VERSION_INFO.commit_short) ($(Base.GIT_VERSION_INFO.date_string))")
343340 end
344341 end
345342
346 @deprecate methodswith(typ, supertypes) methodswith(typ, supertypes = supertypes)
347 @deprecate whos(io::IO, m::Module, pat::Regex) show(io, varinfo(m, pat))
348 @deprecate whos(io::IO, m::Module) show(io, varinfo(m))
349 @deprecate whos(io::IO) show(io, varinfo())
350 @deprecate whos(m::Module, pat::Regex) varinfo(m, pat)
351 @deprecate whos(m::Module) varinfo(m)
352 @deprecate whos(pat::Regex) varinfo(pat)
353 @deprecate whos() varinfo()
354 @deprecate code_native(io, f, types, syntax) code_native(io, f, types, syntax = syntax)
355 @deprecate code_native(f, types, syntax) code_native(f, types, syntax = syntax)
356 # PR #21974
357 @deprecate versioninfo(verbose::Bool) versioninfo(verbose=verbose)
358 @deprecate versioninfo(io::IO, verbose::Bool) versioninfo(io, verbose=verbose)
359
360 end
343 end
174174 # PR #23075
175175 @testset "versioninfo" begin
176176 # check that versioninfo(io; verbose=true) doesn't error, produces some output
177 # and doesn't invoke OldPkg.status which will error if JULIA_PKGDIR is set
178177 mktempdir() do dir
179 withenv("JULIA_PKGDIR" => dir) do
180 buf = PipeBuffer()
181 versioninfo(buf, verbose=true)
182 ver = read(buf, String)
183 @test startswith(ver, "Julia Version $VERSION")
184 @test occursin("Environment:", ver)
185 @test isempty(readdir(dir))
186 end
178 buf = PipeBuffer()
179 versioninfo(buf, verbose=true)
180 ver = read(buf, String)
181 @test startswith(ver, "Julia Version $VERSION")
182 @test occursin("Environment:", ver)
187183 end
188184 let exename = `$(Base.julia_cmd()) --startup-file=no`
189185 @test !occursin("Environment:", read(setenv(`$exename -e 'using InteractiveUtils; versioninfo()'`,
282278 end
283279
284280 function test_code_reflections(tester, freflect)
285 test_code_reflection(freflect, contains,
286 Tuple{AbstractString, Regex}, tester) # abstract type
281 test_code_reflection(freflect, occursin,
282 Tuple{Regex, AbstractString}, tester) # abstract type
287283 test_code_reflection(freflect, +, Tuple{Int, Int}, tester) # leaftype signature
288284 test_code_reflection(freflect, +,
289285 Tuple{Array{Float32}, Array{Float32}}, tester) # incomplete types
4141 include("tree.jl")
4242 include("gitcredential.jl")
4343 include("callbacks.jl")
44 include("deprecated.jl")
4544
4645 using .Error
4746
267266 function fetch(repo::GitRepo; remote::AbstractString="origin",
268267 remoteurl::AbstractString="",
269268 refspecs::Vector{<:AbstractString}=AbstractString[],
270 payload::Creds=nothing,
271 credentials::Creds=payload,
269 credentials::Creds=nothing,
272270 callbacks::Callbacks=Callbacks())
273271 rmt = if isempty(remoteurl)
274272 get(GitRemote, repo, remote)
276274 GitRemoteAnon(repo, remoteurl)
277275 end
278276
279 deprecate_payload_keyword(:fetch, "repo", payload)
280277 cred_payload = reset!(CredentialPayload(credentials), GitConfig(repo))
281278 if !haskey(callbacks, :credentials)
282279 callbacks[:credentials] = (credentials_cb(), cred_payload)
325322 remoteurl::AbstractString="",
326323 refspecs::Vector{<:AbstractString}=AbstractString[],
327324 force::Bool=false,
328 payload::Creds=nothing,
329 credentials::Creds=payload,
325 credentials::Creds=nothing,
330326 callbacks::Callbacks=Callbacks())
331327 rmt = if isempty(remoteurl)
332328 get(GitRemote, repo, remote)
334330 GitRemoteAnon(repo, remoteurl)
335331 end
336332
337 deprecate_payload_keyword(:push, "repo", payload)
338333 cred_payload = reset!(CredentialPayload(credentials), GitConfig(repo))
339334 if !haskey(callbacks, :credentials)
340335 callbacks[:credentials] = (credentials_cb(), cred_payload)
558553 branch::AbstractString="",
559554 isbare::Bool = false,
560555 remote_cb::Ptr{Cvoid} = C_NULL,
561 payload::Creds=nothing,
562 credentials::Creds=payload,
556 credentials::Creds=nothing,
563557 callbacks::Callbacks=Callbacks())
564 deprecate_payload_keyword(:clone, "repo_url, repo_path", payload)
565558 cred_payload = reset!(CredentialPayload(credentials))
566559 if !haskey(callbacks, :credentials)
567560 callbacks[:credentials] = (credentials_cb(), cred_payload)
835828 try
836829 rbs = GitRebase(repo, head_ann, upst_ann, onto=onto_ann)
837830 try
838 while (rbs_op = next(rbs)) !== nothing
831 for rbs_op in rbs
839832 commit(rbs, sig)
840833 end
841834 finish(rbs, sig)
+0
-55
stdlib/LibGit2/src/deprecated.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 # BEGIN 0.7 deprecations
3
4 # PR #22062
5 function set_remote_url(repo::LibGit2.GitRepo, url::AbstractString; remote::AbstractString="origin")
6 Base.depwarn(string(
7 "`LibGit2.set_remote_url(repo, url; remote=remote)` is deprecated, use ",
8 "`LibGit2.set_remote_url(repo, remote, url)` instead."), :set_remote_url)
9 set_remote_url(repo, remote, url)
10 end
11
12 function set_remote_url(path::AbstractString, url::AbstractString; remote::AbstractString="origin")
13 Base.depwarn(string(
14 "`LibGit2.set_remote_url(path, url; remote=remote)` is deprecated, use ",
15 "`LibGit2.set_remote_url(path, remote, url)` instead."), :set_remote_url)
16 set_remote_url(path, remote, url)
17 end
18
19 function prompt(msg::AbstractString; default::AbstractString="", password::Bool=false)
20 Base.depwarn(string(
21 "`LibGit2.prompt(msg::AbstractString; default::AbstractString=\"\", password::Bool=false)` is deprecated, use ",
22 "`result = Base.prompt(msg, default=default, password=password); result === nothing ? \"\" : result` instead."), :prompt)
23 something(Base.prompt(msg, default=default, password=password), "")
24 end
25
26 # PR #26437
27 # when this deprecation is deleted, remove all calls to it, and remove the keyword of:
28 # `payload` from "src/LibGit2.jl"
29 function deprecate_payload_keyword(f, sig, payload)
30 if payload !== nothing
31 Base.depwarn(string(
32 "`LibGit2.$f($sig; payload=cred)` is deprecated, use ",
33 "`LibGit2.$f($sig; credentials=cred)` instead."), f)
34 end
35 end
36
37 @deprecate get_creds!(cache::CachedCredentials, credid, default) get!(cache, credid, default)
38
39 @eval Base @deprecate merge!(repo::$(GitRepo), args...; kwargs...) $(LibGit2.merge!)(repo, args...; kwargs...)
40 @eval Base @deprecate push!(w::$(GitRevWalker), arg) $(LibGit2.push!)(w, arg)
41 @eval Base @deprecate count(diff::$(GitDiff)) $(LibGit2.count)(diff)
42 @eval Base @deprecate count(idx::$(GitIndex)) $(LibGit2.count)(idx)
43 @eval Base @deprecate count(rb::$(GitRebase)) $(LibGit2.count)(rb)
44 @eval Base @deprecate count(tree::$(GitTree)) $(LibGit2.count)(tree)
45 @eval Base @deprecate count(f::Function, walker::$(GitRevWalker); kwargs...) $(LibGit2.count)(f, walker; kwargs...)
46 @eval Base @deprecate map(f::Function, walker::$(GitRevWalker); kwargs...) $(LibGit2.map)(f, walker; kwargs...)
47
48 # PR #24594
49 @deprecate AbstractCredentials AbstractCredential false
50 @deprecate UserPasswordCredentials UserPasswordCredential false
51 @deprecate SSHCredentials SSHCredential false
52
53 @deprecate hex(id::LibGit2.GitHash) string(id)
54 @deprecate hex(id::LibGit2.GitShortHash) string(id)
4444 return rb_op
4545 end
4646
47 function Base.next(rb::GitRebase)
47 function Base.iterate(rb::GitRebase, state=nothing)
4848 ensure_initialized()
4949 rb_op_ptr_ptr = Ref{Ptr{RebaseOperation}}(C_NULL)
5050 GC.@preserve rb begin
51 try
52 @check ccall((:git_rebase_next, :libgit2), Cint,
53 (Ptr{Ptr{RebaseOperation}}, Ptr{Cvoid}),
54 rb_op_ptr_ptr, rb.ptr)
55 catch err
56 err.code == Error.ITEROVER && return nothing
57 rethrow(err)
51 err = ccall((:git_rebase_next, :libgit2), Cint,
52 (Ptr{Ptr{RebaseOperation}}, Ptr{Cvoid}),
53 rb_op_ptr_ptr, rb.ptr)
54 if err == Cint(Error.GIT_OK)
55 return unsafe_load(rb_op_ptr_ptr[]), nothing
56 elseif err == Cint(Error.ITEROVER)
57 return nothing
58 else
59 throw(GitError(err))
5860 end
59 rb_op_ptr = unsafe_load(rb_op_ptr_ptr[])
6061 end
61 return rb_op_ptr
6262 end
6363
6464 function Base.show(io::IO, rb::GitRebase)
12011201 function UserPasswordCredential(user::AbstractString="", pass::Union{AbstractString, Base.SecretBuffer}="")
12021202 new(user, pass)
12031203 end
1204
1205 # Deprecated constructors
1206 function UserPasswordCredential(u::AbstractString,p::AbstractString,prompt_if_incorrect::Bool)
1207 Base.depwarn(string(
1208 "`UserPasswordCredential` no longer supports the `prompt_if_incorrect` parameter. ",
1209 "Use the `allow_prompt` keyword in supported by `LibGit2.CredentialPayload` ",
1210 "instead."), :UserPasswordCredential)
1211 UserPasswordCredential(u, p)
1212 end
1213 UserPasswordCredential(prompt_if_incorrect::Bool) = UserPasswordCredential("","",prompt_if_incorrect)
12141204 end
12151205
12161206 function Base.setproperty!(cred::UserPasswordCredential, name::Symbol, value)
12461236 prvkey="", pubkey="")
12471237 new(user, pass, prvkey, pubkey)
12481238 end
1249
1250 # Deprecated constructors
1251 function SSHCredential(u::AbstractString,p::AbstractString,prvkey::AbstractString,pubkey::AbstractString,prompt_if_incorrect::Bool)
1252 Base.depwarn(string(
1253 "`SSHCredential` no longer supports the `prompt_if_incorrect` parameter. ",
1254 "Use the `allow_prompt` keyword in supported by `LibGit2.CredentialPayload` ",
1255 "instead."), :SSHCredential)
1256 SSHCredential(u, p, prvkey, pubkey)
1257 end
1258 SSHCredential(u::AbstractString, p::AbstractString, prompt_if_incorrect::Bool) = SSHCredential(u,p,"","",prompt_if_incorrect)
1259 SSHCredential(prompt_if_incorrect::Bool) = SSHCredential("","","","",prompt_if_incorrect)
12601239 end
12611240
12621241 function Base.setproperty!(cred::SSHCredential, name::Symbol, value)
16091609 rb = LibGit2.GitRebase(repo, head_ann, upst_ann)
16101610 @test_throws BoundsError rb[3]
16111611 @test_throws BoundsError rb[0]
1612 rbo = next(rb)
1612 rbo, _ = iterate(rb)
16131613 rbo_str = sprint(show, rbo)
16141614 @test rbo_str == "RebaseOperation($(string(rbo.id)))\nOperation type: REBASE_OPERATION_PICK\n"
16151615 rb_str = sprint(show, rb)
329329
330330 include("adjtrans.jl")
331331 include("transpose.jl")
332 include("conjarray.jl")
333 include("rowvector.jl")
334332
335333 include("exceptions.jl")
336334 include("generic.jl")
193193
194194 #Singular values
195195 svdvals!(M::Bidiagonal{<:BlasReal}) = LAPACK.bdsdc!(M.uplo, 'N', M.dv, M.ev)[1]
196 function svd!(M::Bidiagonal{<:BlasReal}; full::Bool = false, thin::Union{Bool,Nothing} = nothing)
197 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
198 if thin != nothing
199 Base.depwarn(string("the `thin` keyword argument in `svd!(A; thin = $(thin))` has ",
200 "been deprecated in favor of `full`, which has the opposite meaning, ",
201 "e.g. `svd!(A; full = $(!thin))`."), :svd!)
202 full::Bool = !thin
203 end
196 function svd!(M::Bidiagonal{<:BlasReal}; full::Bool = false)
204197 d, e, U, Vt, Q, iQ = LAPACK.bdsdc!(M.uplo, 'I', M.dv, M.ev)
205198 SVD(U, d, Vt)
206199 end
207 function svd(M::Bidiagonal; full::Bool = false, thin::Union{Bool,Nothing} = nothing)
208 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
209 if thin != nothing
210 Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ",
211 "been deprecated in favor of `full`, which has the opposite meaning, ",
212 "e.g. `svd(A; full = $(!thin))`."), :svd)
213 full::Bool = !thin
214 end
215 return svd!(copy(M), full = full)
200 function svd(M::Bidiagonal; full::Bool = false)
201 svd!(copy(M), full = full)
216202 end
217203
218204 ####################
+0
-25
stdlib/LinearAlgebra/src/conjarray.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 # TODO: remove this type stub between 0.7 and 1.0
3
4 """
5 ConjArray(array)
6
7 A lazy-view wrapper of an `AbstractArray`, taking the elementwise complex conjugate. This
8 type is usually constructed (and unwrapped) via the [`conj`](@ref) function (or related
9 [`adjoint`](@ref)), but currently this is the default behavior for `RowVector` only. For
10 other arrays, the `ConjArray` constructor can be used directly.
11
12 # Examples
13 ```jldoctest
14 julia> ConjArray([1+im 0; 0 1-im])
15 2×2 ConjArray{Complex{Int64},2,Array{Complex{Int64},2}}:
16 1-1im 0+0im
17 0+0im 1+1im
18 ```
19 """
20 struct ConjArray{T,N,A<:AbstractArray} <: AbstractArray{T,N}
21 parent::A
22 end
23 const ConjVector{T,V<:AbstractVector} = ConjArray{T,1,V}
24 const ConjMatrix{T,M<:AbstractMatrix} = ConjArray{T,2,M}
00 # This file is a part of Julia. License is MIT: https://julialang.org/license
11
22 using Base: @deprecate, depwarn
3
4 # BEGIN 0.7 deprecations
5
6 @deprecate cond(F::LinearAlgebra.LU, p::Integer) cond(convert(AbstractArray, F), p)
7
8 # deprecate vecnorm in favor of norm
9 @deprecate vecnorm norm
10
11 # deprecate vecdot in favor of dot
12 @deprecate vecdot dot
13
14 # PR #22188
15 export cholfact, cholfact!
16 @deprecate cholfact!(A::StridedMatrix, uplo::Symbol, ::Type{Val{false}}) cholesky!(Hermitian(A, uplo), Val(false))
17 @deprecate cholfact!(A::StridedMatrix, uplo::Symbol) cholesky!(Hermitian(A, uplo))
18 @deprecate cholfact(A::StridedMatrix, uplo::Symbol, ::Type{Val{false}}) cholesky(Hermitian(A, uplo), Val(false))
19 @deprecate cholfact(A::StridedMatrix, uplo::Symbol) cholesky(Hermitian(A, uplo))
20 @deprecate cholfact!(A::StridedMatrix, uplo::Symbol, ::Type{Val{true}}; tol = 0.0) cholesky!(Hermitian(A, uplo), Val(true), tol = tol)
21 @deprecate cholfact(A::StridedMatrix, uplo::Symbol, ::Type{Val{true}}; tol = 0.0) cholesky(Hermitian(A, uplo), Val(true), tol = tol)
22
23 # PR #22245
24 @deprecate isposdef(A::AbstractMatrix, UL::Symbol) isposdef(Hermitian(A, UL))
25 @deprecate isposdef!(A::StridedMatrix, UL::Symbol) isposdef!(Hermitian(A, UL))
26
27 # bkfact
28 export bkfact, bkfact!
29 function bkfact(A::StridedMatrix, uplo::Symbol, symmetric::Bool = issymmetric(A), rook::Bool = false)
30 depwarn(string("`bkfact` with uplo and symmetric arguments is deprecated, ",
31 "use `bunchkaufman($(symmetric ? "Symmetric(" : "Hermitian(")A, :$uplo))` instead."),
32 :bkfact)
33 return bunchkaufman(symmetric ? Symmetric(A, uplo) : Hermitian(A, uplo), rook)
34 end
35 function bkfact!(A::StridedMatrix, uplo::Symbol, symmetric::Bool = issymmetric(A), rook::Bool = false)
36 depwarn(string("`bkfact!` with uplo and symmetric arguments is deprecated, ",
37 "use `bunchkaufman!($(symmetric ? "Symmetric(" : "Hermitian(")A, :$uplo))` instead."),
38 :bkfact!)
39 return bunchkaufman!(symmetric ? Symmetric(A, uplo) : Hermitian(A, uplo), rook)
40 end
41
42 export lufact!
43 @deprecate sqrtm(A::UpperTriangular{T},::Type{Val{realmatrix}}) where {T,realmatrix} sqrtm(A, Val(realmatrix))
44 @deprecate lufact(A::AbstractMatrix, ::Type{Val{false}}) lu(A, Val(false))
45 @deprecate lufact(A::AbstractMatrix, ::Type{Val{true}}) lu(A, Val(true))
46 @deprecate lufact!(A::AbstractMatrix, ::Type{Val{false}}) lu!(A, Val(false))
47 @deprecate lufact!(A::AbstractMatrix, ::Type{Val{true}}) lu!(A, Val(true))
48 @deprecate qrfact(A::AbstractMatrix, ::Type{Val{false}}) qr(A, Val(false))
49 @deprecate qrfact(A::AbstractMatrix, ::Type{Val{true}}) qr(A, Val(true))
50 @deprecate qrfact!(A::AbstractMatrix, ::Type{Val{false}}) qr!(A, Val(false))
51 @deprecate qrfact!(A::AbstractMatrix, ::Type{Val{true}}) qr!(A, Val(true))
52 @deprecate cholfact(A::AbstractMatrix, ::Type{Val{false}}) cholesky(A, Val(false))
53 @deprecate cholfact(A::AbstractMatrix, ::Type{Val{true}}; tol = 0.0) cholesky(A, Val(true); tol = tol)
54 @deprecate cholfact!(A::AbstractMatrix, ::Type{Val{false}}) cholesky!(A, Val(false))
55 @deprecate cholfact!(A::AbstractMatrix, ::Type{Val{true}}; tol = 0.0) cholesky!(A, Val(true); tol = tol)
56
57 # PR #22703
58 @deprecate Bidiagonal(dv::AbstractVector, ev::AbstractVector, isupper::Bool) Bidiagonal(dv, ev, ifelse(isupper, :U, :L))
59 @deprecate Bidiagonal(dv::AbstractVector, ev::AbstractVector, uplo::AbstractChar) Bidiagonal(dv, ev, ifelse(uplo == 'U', :U, :L))
60 @deprecate Bidiagonal(A::AbstractMatrix, isupper::Bool) Bidiagonal(A, ifelse(isupper, :U, :L))
61
62 # PR #22925
63 # also uncomment constructor tests in test/linalg/bidiag.jl
64 function Bidiagonal(dv::AbstractVector{T}, ev::AbstractVector{S}, uplo::Symbol) where {T,S}
65 depwarn(string("`Bidiagonal(dv::AbstractVector{T}, ev::AbstractVector{S}, uplo::Symbol) where {T, S}`",
66 " is deprecated, use `Bidiagonal{R}(dv, ev, uplo)` or `Bidiagonal{R,V}(dv, ev, uplo)` instead,",
67 " or convert both vectors to the same type manually."), :Bidiagonal)
68 R = promote_type(T, S)
69 Bidiagonal(convert(Vector{R}, dv), convert(Vector{R}, ev), uplo)
70 end
71
72 # PR #23035
73 # also uncomment constructor tests in test/linalg/tridiag.jl
74 function SymTridiagonal(dv::AbstractVector{T}, ev::AbstractVector{S}) where {T,S}
75 depwarn(string("`SymTridiagonal(dv::AbstractVector{T}, ev::AbstractVector{S}) ",
76 "where {T, S}` is deprecated, use `SymTridiagonal{R}(dv, ev)` or `SymTridiagonal{R,V}(dv, ev)` instead,",
77 " or convert both vectors to the same type manually."), :SymTridiagonal)
78 R = promote_type(T, S)
79 SymTridiagonal(convert(Vector{R}, dv), convert(Vector{R}, ev))
80 end
81
82 # PR #23154
83 # also uncomment constructor tests in test/linalg/tridiag.jl
84 function Tridiagonal(dl::AbstractVector{Tl}, d::AbstractVector{Td}, du::AbstractVector{Tu}) where {Tl,Td,Tu}
85 depwarn(string("`Tridiagonal(dl::AbstractVector{Tl}, d::AbstractVector{Td}, du::AbstractVector{Tu}) ",
86 "where {Tl, Td, Tu}` is deprecated, use `Tridiagonal{T}(dl, d, du)` or `Tridiagonal{T,V}(dl, d, du)` instead,",
87 " or convert all three vectors to the same type manually."), :Tridiagonal)
88 Tridiagonal(map(v->convert(Vector{promote_type(Tl,Td,Tu)}, v), (dl, d, du))...)
89 end
90
91 # deprecate sqrtm in favor of sqrt
92 @deprecate sqrtm sqrt
93
94 # deprecate expm in favor of exp
95 @deprecate expm! exp!
96 @deprecate expm exp
97
98 # deprecate logm in favor of log
99 @deprecate logm log
100
101 # PR #23373
102 @deprecate diagm(A::BitMatrix) BitMatrix(Diagonal(vec(A)))
103
104 # PR 23341
105 @eval LinearAlgebra.LAPACK @deprecate laver() version() false
106
107 # deprecate zeros(D::Diagonal[, opts...])
108 import Base: zeros
109 function zeros(D::Diagonal)
110 depwarn(string("`zeros(D::Diagonal)` is deprecated, use ",
111 "`Diagonal(fill!(similar(D.diag), 0))` instead, or ",
112 "`Diagonal(fill!(similar(D.diag), zero(eltype(D.diag))))` where necessary."), :zeros)
113 return Diagonal(fill!(similar(D.diag), zero(eltype(D.diag))))
114 end
115 function zeros(D::Diagonal, ::Type{T}) where {T}
116 depwarn(string("`zeros(D::Diagonal, ::Type{T}) where T` is deprecated, use ",
117 "`Diagonal(fill!(similar(D.diag, T), 0))` instead, or ",
118 "`Diagonal(fill!(similar(D.diag, T), zero(T)))` where necessary."), :zeros)
119 return Diagonal(fill!(similar(D.diag, T), zero(T)))
120 end
121 function zeros(D::Diagonal, ::Type{T}, dims::Dims) where {T}
122 depwarn(string("`zeros(D::Diagonal, ::Type{T}, dims::Dims) where T` is deprecated, ",
123 "use `fill!(similar(D, T, dims), 0)` instead, or ",
124 "`fill!(similar(D, T, dims), zero(T))` where necessary."), :zeros)
125 return fill!(similar(D, T, dims), zero(T))
126 end
127 function zeros(D::Diagonal, ::Type{T}, dims::Integer...) where {T}
128 depwarn(string("`zeros(D::Diagonal, ::Type{T}, dims::Integer...) where T` is deprecated, ",
129 "use `fill!(similar(D, T, dims), 0)` instead, or ",
130 "`fill!(similar(D, T, dims), zero(T))` where necessary."), :zeros)
131 return fill!(similar(D, T, dims), zero(T))
132 end
133
134 ## goodbeye, eye!
135 export eye
136 function eye(m::Integer)
137 depwarn(string("`eye(m::Integer)` has been deprecated in favor of `I` and `Matrix` ",
138 "constructors. For a direct replacement, consider `Matrix(1.0I, m, m)` or ",
139 "`Matrix{Float64}(I, m, m)`. If `Float64` element type is not necessary, ",
140 "consider the shorter `Matrix(I, m, m)` (with default `eltype(I)` `Bool`)."), :eye)
141 return Matrix{Float64}(I, m, m)
142 end
143 function eye(::Type{T}, m::Integer) where T
144 depwarn(string("`eye(T::Type, m::Integer)` has been deprecated in favor of `I` and ",
145 "`Matrix` constructors. For a direct replacement, consider `Matrix{T}(I, m, m)`. If ",
146 "`T` element type is not necessary, consider the shorter `Matrix(I, m, m)`",
147 "(with default `eltype(I)` `Bool`)"), :eye)
148 return Matrix{T}(I, m, m)
149 end
150 function eye(m::Integer, n::Integer)
151 depwarn(string("`eye(m::Integer, n::Integer)` has been deprecated in favor of `I` and ",
152 "`Matrix` constructors. For a direct replacement, consider `Matrix(1.0I, m, n)` ",
153 "or `Matrix{Float64}(I, m, n)`. If `Float64` element type is not necessary, ",
154 "consider the shorter `Matrix(I, m, n)` (with default `eltype(I)` `Bool`)."), :eye)
155 return Matrix{Float64}(I, m, n)
156 end
157 function eye(::Type{T}, m::Integer, n::Integer) where T
158 depwarn(string("`eye(T::Type, m::Integer, n::Integer)` has been deprecated in favor of ",
159 "`I` and `Matrix` constructors. For a direct replacement, consider `Matrix{T}(I, m, n)`.",
160 "If `T` element type is not necessary, consider the shorter `Matrix(I, m, n)` ",
161 "(with default `eltype(I)` `Bool`)."), :eye)
162 return Matrix{T}(I, m, n)
163 end
164 function eye(A::AbstractMatrix{T}) where T
165 depwarn(string("`eye(A::AbstractMatrix{T}) where T` has been deprecated in favor of `I` and ",
166 "`Matrix` constructors. For a direct replacement, consider `Matrix{eltype(A)}(I, size(A))`.",
167 "If `eltype(A)` element type is not necessary, consider the shorter `Matrix(I, size(A))` ",
168 "(with default `eltype(I)` `Bool`)."), :eye)
169 return Matrix(one(T)I, size(A))
170 end
171 function eye(::Type{Diagonal{T}}, n::Int) where T
172 depwarn(string("`eye(DT::Type{Diagonal{T}}, n::Int) where T` has been deprecated in favor of `I` ",
173 "and `Diagonal` constructors. For a direct replacement, consider `Diagonal{T}(I, n)`. ",
174 "If `T` element type is not necessary, consider the shorter `Diagonal(I, n)` ",
175 "(with default `eltype(I)` `Bool`)."), :eye)
176 return Diagonal{T}(I, n)
177 end
178
179 # PR #23816: deprecation of gradient
180 export gradient
181 function gradient(args...)
182 Base.depwarn("`gradient` is deprecated and will be removed in the next release.", :gradient)
183 return _gradient(args...)
184 end
185 _gradient(F::BitVector) = _gradient(Array(F))
186 _gradient(F::BitVector, h::Real) = _gradient(Array(F), h)
187 _gradient(F::Vector, h::BitVector) = _gradient(F, Array(h))
188 _gradient(F::BitVector, h::Vector) = _gradient(Array(F), h)
189 _gradient(F::BitVector, h::BitVector) = _gradient(Array(F), Array(h))
190 function _gradient(F::AbstractVector, h::Vector)
191 @assert !has_offset_axes(F)
192 n = length(F)
193 T = typeof(oneunit(eltype(F))/oneunit(eltype(h)))
194 g = similar(F, T)
195 if n == 1
196 g[1] = zero(T)
197 elseif n > 1
198 g[1] = (F[2] - F[1]) / (h[2] - h[1])
199 g[n] = (F[n] - F[n-1]) / (h[end] - h[end-1])
200 if n > 2
201 h = h[3:n] - h[1:n-2]
202 g[2:n-1] = (F[3:n] - F[1:n-2]) ./ h
203 end
204 end
205 g
206 end
207 _gradient(F::AbstractVector) = _gradient(F, [1:length(F);])
208 _gradient(F::AbstractVector, h::Real) = _gradient(F, [h*(1:length(F));])
209
210 # deprecate odd fill! methods
211 @deprecate fill!(D::Diagonal, x) LinearAlgebra.fillstored!(D, x)
212 @deprecate fill!(A::AbstractTriangular, x) LinearAlgebra.fillstored!(A, x)
213
214 # PR #25030
215 @deprecate fillslots! fillstored! false
216
217 function diagm(v::BitVector)
218 depwarn(string("`diagm(v::BitVector)` is deprecated, use `diagm(0 => v)` or ",
219 "`BitMatrix(Diagonal(v))` instead."), :diagm)
220 return BitMatrix(Diagonal(v))
221 end
222 function diagm(v::AbstractVector)
223 depwarn(string("`diagm(v::AbstractVector)` is deprecated, use `diagm(0 => v)` or ",
224 "`Matrix(Diagonal(v))` instead."), :diagm)
225 return Matrix(Diagonal(v))
226 end
227 @deprecate diagm(v::AbstractVector, k::Integer) diagm(k => v)
228 @deprecate diagm(x::Number) fill(x, 1, 1)
229
230 ## deprecate full
231 import Base: full
232 # full for structured arrays
233 function full(A::Union{Diagonal,Bidiagonal,Tridiagonal,SymTridiagonal})
234 mattypestr = isa(A, Diagonal) ? "Diagonal" :
235 isa(A, Bidiagonal) ? "Bidiagonal" :
236 isa(A, Tridiagonal) ? "Tridiagonal" :
237 isa(A, SymTridiagonal) ? "SymTridiagonal" :
238 error("should not be reachable!")
239 depwarn(string(
240 "`full(A::$(mattypestr))` (and `full` in general) has been deprecated. ",
241 "To replace `full(A::$(mattypestr))`, consider `Matrix(A)` or, if that ",
242 "option is too narrow, `Array(A)`. Also consider `SparseMatrixCSC(A)` ",
243 "or, if that option is too narrow, `sparse(A)`."), :full)
244 return Matrix(A)
245 end
246
247 # full for factorizations
248 function full(F::Union{LinearAlgebra.LU,LinearAlgebra.LQ,LinearAlgebra.QR,LinearAlgebra.QRPivoted,LinearAlgebra.QRCompactWY,
249 LinearAlgebra.SVD,LinearAlgebra.LDLt,LinearAlgebra.Schur,LinearAlgebra.Eigen,LinearAlgebra.Hessenberg,
250 LinearAlgebra.Cholesky,LinearAlgebra.CholeskyPivoted})
251 facttypestr = isa(F, LinearAlgebra.LU) ? "LU" :
252 isa(F, LinearAlgebra.LQ) ? "LQ" :
253 isa(F, LinearAlgebra.QR) ? "QR" :
254 isa(F, LinearAlgebra.QRPivoted) ? "QRPivoted" :
255 isa(F, LinearAlgebra.QRCompactWY) ? "QRCompactWY" :
256 isa(F, LinearAlgebra.SVD) ? "SVD" :
257 isa(F, LinearAlgebra.LDLt) ? "LDLt" :
258 isa(F, LinearAlgebra.Schur) ? "Schur" :
259 isa(F, LinearAlgebra.Eigen) ? "Eigen" :
260 isa(F, LinearAlgebra.Hessenberg) ? "Hessenberg" :
261 isa(F, LinearAlgebra.Cholesky) ? "Cholesky" :
262 isa(F, LinearAlgebra.CholeskyPivoted) ? "CholeskyPivoted" :
263 error("should not be reachable!")
264 depwarn(string(
265 "`full(F::$(facttypestr))` (and `full` in general) has been deprecated. ",
266 "To replace `full(F::$(facttypestr))`, consider `Matrix(F)`, `AbstractMatrix(F)` or, ",
267 "if those options are too narrow, `Array(F)` or `AbstractArray(F)`."), :full)
268 return AbstractMatrix(F)
269 end
270
271 # full for implicit orthogonal factors
272 function full(Q::LinearAlgebra.HessenbergQ)
273 depwarn(string(
274 "`full(Q::HessenbergQ)` (and `full` in general) has been deprecated. ",
275 "To replace `full(Q::HessenbergQ)`, consider `Matrix(Q)` or, ",
276 "if that option is too narrow, `Array(Q)`."), :full)
277 return Matrix(Q)
278 end
279 function full(Q::LinearAlgebra.LQPackedQ; thin::Bool = true)
280 depwarn(string(
281 "`full(Q::LQPackedQ; thin::Bool = true)` (and `full` in general) ",
282 "has been deprecated. To replace `full(Q::LQPackedQ, true)`, ",
283 "consider `Matrix(Q)` or `Array(Q)`. To replace `full(Q::LQPackedQ, false)`, ",
284 "consider `LinearAlgebra.mul!(Q, Matrix{eltype(Q)}(I, size(Q.factors, 2), size(Q.factors, 2)))`."), :full)
285 return thin ? Array(Q) : LinearAlgebra.mul!(Q, Matrix{eltype(Q)}(I, size(Q.factors, 2), size(Q.factors, 2)))
286 end
287 function full(Q::Union{LinearAlgebra.QRPackedQ,LinearAlgebra.QRCompactWYQ}; thin::Bool = true)
288 qtypestr = isa(Q, LinearAlgebra.QRPackedQ) ? "QRPackedQ" :
289 isa(Q, LinearAlgebra.QRCompactWYQ) ? "QRCompactWYQ" :
290 error("should not be reachable!")
291 depwarn(string(
292 "`full(Q::$(qtypestr); thin::Bool = true)` (and `full` in general) ",
293 "has been deprecated. To replace `full(Q::$(qtypestr), true)`, ",
294 "consider `Matrix(Q)` or `Array(Q)`. To replace `full(Q::$(qtypestr), false)`, ",
295 "consider `LinearAlgebra.mul!(Q, Matrix{eltype(Q)}(I, size(Q.factors, 1), size(Q.factors, 1)))`."), :full)
296 return thin ? Array(Q) : LinearAlgebra.mul!(Q, Matrix{eltype(Q)}(I, size(Q.factors, 1), size(Q.factors, 1)))
297 end
298
299 # full for symmetric / hermitian / triangular wrappers
300 function full(A::Symmetric)
301 depwarn(string(
302 "`full(A::Symmetric)` (and `full` in general) has been deprecated. ",
303 "To replace `full(A::Symmetric)`, as appropriate consider `Matrix(A)`, ",
304 "`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copyto!(similar(parent(A)), A)`, ",
305 "or `LinearAlgebra.copytri!(copy(parent(A)), A.uplo)`."), :full)
306 return Matrix(A)
307 end
308 function full(A::Hermitian)
309 depwarn(string(
310 "`full(A::Hermitian)` (and `full` in general) has been deprecated. ",
311 "To replace `full(A::Hermitian)`, as appropriate consider `Matrix(A)`, ",
312 "`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copyto!(similar(parent(A)), A)`, ",
313 "or `LinearAlgebra.copytri!(copy(parent(A)), A.uplo, true)`."), :full)
314 return Matrix(A)
315 end
316 function full(A::Union{UpperTriangular,LowerTriangular})
317 (tritypestr, tri!str) =
318 isa(A, UpperTriangular) ? ("UpperTriangular", "triu!") :
319 isa(A, LowerTriangular) ? ("LowerTriangular", "tril!") :
320 error("should not be reachable!")
321 depwarn(string(
322 "`full(A::$(tritypestr))` (and `full` in general) has been deprecated. ",
323 "To replace `full(A::$(tritypestr))`, as appropriate consider `Matrix(A)`, ",
324 "`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, `copyto!(similar(parent(A)), A)`, ",
325 "or `$(tri!str)(copy(parent(A)))`."), :full)
326 return Matrix(A)
327 end
328 function full(A::Union{LinearAlgebra.UnitUpperTriangular,LinearAlgebra.UnitLowerTriangular})
329 tritypestr = isa(A, LinearAlgebra.UnitUpperTriangular) ? "LinearAlgebra.UnitUpperTriangular" :
330 isa(A, LinearAlgebra.UnitLowerTriangular) ? "LinearAlgebra.UnitLowerTriangular" :
331 error("should not be reachable!")
332 depwarn(string(
333 "`full(A::$(tritypestr))` (and `full` in general) has been deprecated. ",
334 "To replace `full(A::$(tritypestr))`, as appropriate consider `Matrix(A)`, ",
335 "`Array(A)`, `SparseMatrixCSC(A)`, `sparse(A)`, or `copyto!(similar(parent(A)), A)`."), :full)
336 return Matrix(A)
337 end
338
339 # TODO: after 0.7, remove thin keyword argument and associated logic from...
340 # (1) stdlib/LinearAlgebra/src/svd.jl
341 # (2) stdlib/LinearAlgebra/src/qr.jl
342 # (3) stdlib/LinearAlgebra/src/lq.jl
343
344
345 @deprecate chol!(x::Number, uplo) sqrt(x) false
346
347 ### deprecations for lazier, less jazzy linalg transition in the next several blocks ###
348
349 # deprecate ConjArray
350 # TODO: between 0.7 and 1.0 remove
351 # 1) the type definitions in stdlib/LinearAlgebra/src/conjarray.jl
352 # 2) the include("conjarray.jl") from stdlib/LinearAlgebra/src/LinearAlgebra.jl
353 # 3) the file stdlib/LinearAlgebra/conjarray.jl itself
354 export ConjArray, ConjVector, ConjMatrix
355
356 function ConjArray(a::AbstractArray{T,N}) where {T,N}
357 Base.depwarn(_ConjArray_depstring(), :ConjArray)
358 return ConjArray{conj_type(T),N,typeof(a)}(a)
359 end
360 function ConjVector(v::AbstractVector{T}) where {T}
361 Base.depwarn(_ConjArray_depstring(), :ConjArray)
362 return ConjArray{conj_type(T),1,typeof(v)}(v)
363 end
364 function ConjMatrix(m::AbstractMatrix{T}) where {T}
365 Base.depwarn(_ConjArray_depstring(), :ConjArray)
366 return ConjArray{conj_type(T),2,typeof(m)}(m)
367 end
368
369 _ConjArray_depstring() = string("`ConjRowVector` and `RowVector` have been deprecated in favor ",
370 "of `Adjoint` and `Transpose`, and, as part of the implementation of `ConjRowVector`",
371 "/`RowVector`, `ConjArray`s have been deprecated as well. Please see 0.7's NEWS.md ",
372 "for a more detailed explanation of the associated changes.")
373
374 # This type can cause the element type to change under conjugation - e.g. an array of complex arrays.
375 @inline conj_type(x) = conj_type(typeof(x))
376 @inline conj_type(::Type{T}) where {T} = promote_op(conj, T)
377
378 @inline parent(c::ConjArray) = c.parent
379 @inline parent_type(c::ConjArray) = parent_type(typeof(c))
380 @inline parent_type(::Type{ConjArray{T,N,A}}) where {T,N,A} = A
381
382 @inline size(a::ConjArray) = size(a.parent)
383 IndexStyle(::CA) where {CA<:ConjArray} = IndexStyle(parent_type(CA))
384 IndexStyle(::Type{CA}) where {CA<:ConjArray} = IndexStyle(parent_type(CA))
385
386 @propagate_inbounds getindex(a::ConjArray{T,N}, i::Int) where {T,N} = conj(getindex(a.parent, i))
387 @propagate_inbounds getindex(a::ConjArray{T,N}, i::Vararg{Int,N}) where {T,N} = conj(getindex(a.parent, i...))
388 @propagate_inbounds setindex!(a::ConjArray{T,N}, v, i::Int) where {T,N} = setindex!(a.parent, conj(v), i)
389 @propagate_inbounds setindex!(a::ConjArray{T,N}, v, i::Vararg{Int,N}) where {T,N} = setindex!(a.parent, conj(v), i...)
390
391 @inline similar(a::ConjArray, ::Type{T}, dims::Dims{N}) where {T,N} = similar(parent(a), T, dims)
392
393 # Currently, this is default behavior for RowVector only
394 @inline conj(a::ConjArray) = parent(a)
395
396 # Helper functions, currently used by RowVector
397 @inline _conj(a::AbstractArray) = ConjArray(a)
398 @inline _conj(a::AbstractArray{T}) where {T<:Real} = a
399 @inline _conj(a::ConjArray) = parent(a)
400 @inline _conj(a::ConjArray{T}) where {T<:Real} = parent(a)
401
402 # deprecate ConjRowVector/RowVector
403 # TODO: between 0.7 and 1.0 remove
404 # 1) the type definitions in stdlib/LinearAlgebra/src/rowvector.jl
405 # 2) the include("rowvector.jl") from stdlib/LinearAlgebra/src/LinearAlgebra.jl
406 # 3) the file stdlib/LinearAlgebra/src/rowvector.jl itself
407 # 4) the RowVectors in the Unions in stdlib/SparseArrays/src/sparsevector.jl around lines 995, 1010, 1011, and 1012
408 export RowVector
409
410 _RowVector_depstring() = string("`ConjRowVector` and `RowVector` have been deprecated in favor ",
411 "of `Adjoint` and `Transpose`. Please see 0.7's NEWS.md for a more detailed explanation ",
412 "of the associated changes.")
413
414 @inline check_types(::Type{T1}, ::AbstractVector{T2}) where {T1,T2} = check_types(T1, T2)
415 @pure check_types(::Type{T1}, ::Type{T2}) where {T1,T2} = T1 === transpose_type(T2) ? nothing :
416 error("Element type mismatch. Tried to create a `RowVector{$T1}` from an `AbstractVector{$T2}`")
417
418 # The element type may be transformed as transpose is recursive
419 @inline transpose_type(::Type{T}) where {T} = promote_op(transpose, T)
420
421 # Constructors that take a vector
422 function RowVector(vec::AbstractVector{T}) where {T}
423 Base.depwarn(_RowVector_depstring(), :RowVector)
424 return RowVector{transpose_type(T),typeof(vec)}(vec)
425 end
426 function RowVector{T}(vec::AbstractVector{T}) where {T}
427 Base.depwarn(_RowVector_depstring(), :RowVector)
428 return RowVector{T,typeof(vec)}(vec)
429 end
430
431 # Constructors that take a size and default to Array
432 function RowVector{T}(::UndefInitializer, n::Int) where {T}
433 Base.depwarn(_RowVector_depstring(), :RowVector)
434 return RowVector{T}(Vector{transpose_type(T)}(undef, n))
435 end
436 function RowVector{T}(::UndefInitializer, n1::Int, n2::Int) where {T}
437 Base.depwarn(_RowVector_depstring(), :RowVector)
438 return n1 == 1 ? RowVector{T}(Vector{transpose_type(T)}(undef, n2)) :
439 error("RowVector expects 1×N size, got ($n1,$n2)")
440 end
441 function RowVector{T}(::UndefInitializer, n::Tuple{Int}) where {T}
442 Base.depwarn(_RowVector_depstring(), :RowVector)
443 return RowVector{T}(Vector{transpose_type(T)}(undef, n[1]))
444 end
445 function RowVector{T}(::UndefInitializer, n::Tuple{Int,Int}) where {T}
446 Base.depwarn(_RowVector_depstring(), :RowVector)
447 return n[1] == 1 ? RowVector{T}(Vector{transpose_type(T)}(undef, n[2])) :
448 error("RowVector expects 1×N size, got $n")
449 end
450
451 # Conversion of underlying storage
452 convert(::Type{RowVector{T,V}}, rowvec::RowVector) where {T,V<:AbstractVector} =
453 RowVector{T,V}(convert(V,rowvec.vec))
454
455 # similar tries to maintain the RowVector wrapper and the parent type
456 @inline similar(rowvec::RowVector) = RowVector(similar(parent(rowvec)))
457 @inline similar(rowvec::RowVector, ::Type{T}) where {T} = RowVector(similar(parent(rowvec), transpose_type(T)))
458
459 # Resizing similar currently loses its RowVector property.
460 @inline similar(rowvec::RowVector, ::Type{T}, dims::Dims{N}) where {T,N} = similar(parent(rowvec), T, dims)
461
462 # Basic methods
463
464 # replaced in the Adjoint/Transpose transition
465 # """
466 # transpose(v::AbstractVector)
467 #
468 # The transposition operator (`.'`).
469 #
470 # # Examples
471 # ```jldoctest
472 # julia> v = [1,2,3]
473 # 3-element Array{Int64,1}:
474 # 1
475 # 2
476 # 3
477 #
478 # julia> transpose(v)
479 # 1×3 RowVector{Int64,Array{Int64,1}}:
480 # 1 2 3
481 # ```
482 # """
483 # @inline transpose(vec::AbstractVector) = RowVector(vec)
484 # @inline adjoint(vec::AbstractVector) = RowVector(_conj(vec))
485
486 # methods necessary to preserve RowVector's behavior through the Adjoint/Transpose transition
487 rvadjoint(v::AbstractVector) = RowVector(_conj(v))
488 rvtranspose(v::AbstractVector) = RowVector(v)
489 rvadjoint(v::RowVector) = conj(v.vec)
490 rvadjoint(v::RowVector{<:Real}) = v.vec
491 rvtranspose(v::RowVector) = v.vec
492 rvtranspose(v::ConjRowVector) = copy(v.vec)
493 rvadjoint(x) = adjoint(x)
494 rvtranspose(x) = transpose(x)
495
496 @inline transpose(rowvec::RowVector) = rowvec.vec
497 @inline transpose(rowvec::ConjRowVector) = copy(rowvec.vec) # remove the ConjArray wrapper from any raw vector
498 @inline adjoint(rowvec::RowVector) = conj(rowvec.vec)
499 @inline adjoint(rowvec::RowVector{<:Real}) = rowvec.vec
500
501 parent(rowvec::RowVector) = rowvec.vec
502 vec(rowvec::RowVector) = rowvec.vec
503
504 @inline conj(rowvec::RowVector) = RowVector(_conj(rowvec.vec))
505 @inline conj(rowvec::RowVector{<:Real}) = rowvec
506
507 # AbstractArray interface
508 @inline length(rowvec::RowVector) = length(rowvec.vec)
509 @inline size(rowvec::RowVector) = (1, length(rowvec.vec))
510 @inline size(rowvec::RowVector, d) = ifelse(d==2, length(rowvec.vec), 1)
511 @inline axes(rowvec::RowVector) = (Base.OneTo(1), axes(rowvec.vec)[1])
512 @inline axes(rowvec::RowVector, d) = ifelse(d == 2, axes(rowvec.vec)[1], Base.OneTo(1))
513 IndexStyle(::RowVector) = IndexLinear()
514 IndexStyle(::Type{<:RowVector}) = IndexLinear()
515
516 @propagate_inbounds getindex(rowvec::RowVector, i::Int) = rvtranspose(rowvec.vec[i])
517 @propagate_inbounds setindex!(rowvec::RowVector, v, i::Int) = (setindex!(rowvec.vec, rvtranspose(v), i); rowvec)
518
519 # Keep a RowVector where appropriate
520 @propagate_inbounds getindex(rowvec::RowVector, ::Colon, i::Int) = rvtranspose.(rowvec.vec[i:i])
521 @propagate_inbounds getindex(rowvec::RowVector, ::Colon, inds::AbstractArray{Int}) = RowVector(rowvec.vec[inds])
522 @propagate_inbounds getindex(rowvec::RowVector, ::Colon, ::Colon) = RowVector(rowvec.vec[:])
523
524 # helper function for below
525 @inline to_vec(rowvec::RowVector) = map(rvtranspose, rvtranspose(rowvec))
526 @inline to_vec(x::Number) = x
527 @inline to_vecs(rowvecs...) = (map(to_vec, rowvecs)...,)
528
529 # map: Preserve the RowVector by un-wrapping and re-wrapping, but note that `f`
530 # expects to operate within the transposed domain, so to_vec transposes the elements
531 @inline map(f, rowvecs::RowVector...) = RowVector(map(rvtranspose∘f, to_vecs(rowvecs...)...))
532
533 # broacast (other combinations default to higher-dimensional array)
534 @inline broadcast(f, rowvecs::Union{Number,RowVector}...) =
535 RowVector(broadcast(transpose∘f, to_vecs(rowvecs...)...))
536
537 # Horizontal concatenation #
538
539 @inline hcat(X::RowVector...) = rvtranspose(vcat(map(rvtranspose, X)...))
540 @inline hcat(X::Union{RowVector,Number}...) = rvtranspose(vcat(map(rvtranspose, X)...))
541
542 @inline typed_hcat(::Type{T}, X::RowVector...) where {T} =
543 rvtranspose(typed_vcat(T, map(rvtranspose, X)...))
544 @inline typed_hcat(::Type{T}, X::Union{RowVector,Number}...) where {T} =
545 rvtranspose(typed_vcat(T, map(rvtranspose, X)...))
546
547 # Multiplication #
548
549 # inner product -> dot product specializations
550 @inline *(rowvec::RowVector{T}, vec::AbstractVector{T}) where {T<:Real} = dot(parent(rowvec), vec)
551 @inline *(rowvec::ConjRowVector{T}, vec::AbstractVector{T}) where {T<:Real} = dot(rvadjoint(rowvec), vec)
552 @inline *(rowvec::ConjRowVector, vec::AbstractVector) = dot(rvadjoint(rowvec), vec)
553
554 # Generic behavior
555 @inline function *(rowvec::RowVector, vec::AbstractVector)
556 @assert !has_offset_axes(rowvec, vec)
557 if length(rowvec) != length(vec)
558 throw(DimensionMismatch("A has dimensions $(size(rowvec)) but B has dimensions $(size(vec))"))
559 end
560 sum(@inbounds(rowvec[i]*vec[i]) for i = 1:length(vec))
561 end
562 @inline *(rowvec::RowVector, mat::AbstractMatrix) = rvtranspose(transpose(mat) * rvtranspose(rowvec))
563 *(::RowVector, ::RowVector) = throw(DimensionMismatch("Cannot multiply two transposed vectors"))
564 @inline *(vec::AbstractVector, rowvec::RowVector) = vec .* rowvec
565 *(vec::AbstractVector, rowvec::AbstractVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
566
567 # Transposed forms
568 *(::RowVector, ::Transpose{<:Any,<:AbstractVector}) =
569 throw(DimensionMismatch("Cannot multiply two transposed vectors"))
570 *(rowvec::RowVector, transmat::Transpose{<:Any,<:AbstractMatrix}) =
571 (mat = transmat.parent; rvtranspose(mat * rvtranspose(rowvec)))
572 *(rowvec1::RowVector, transrowvec2::Transpose{<:Any,<:RowVector}) =
573 (rowvec2 = transrowvec2.parent; rowvec1*rvtranspose(rowvec2))
574 *(::AbstractVector, ::Transpose{<:Any,<:RowVector}) =
575 throw(DimensionMismatch("Cannot multiply two vectors"))
576 *(mat::AbstractMatrix, transrowvec::Transpose{<:Any,<:RowVector}) =
577 (rowvec = transrowvec.parent; mat * rvtranspose(rowvec))
578
579 *(transrowvec::Transpose{<:Any,<:RowVector}, transvec::Transpose{<:Any,<:AbstractVector}) =
580 rvtranspose(transrowvec.parent) * transpose(transvec.parent)
581 *(transrowvec1::Transpose{<:Any,<:RowVector}, transrowvec2::Transpose{<:Any,<:RowVector}) =
582 throw(DimensionMismatch("Cannot multiply two vectors"))
583 *(transvec::Transpose{<:Any,<:AbstractVector}, transrowvec::Transpose{<:Any,<:RowVector}) =
584 transpose(transvec.parent)*rvtranspose(transrowvec.parent)
585 *(transmat::Transpose{<:Any,<:AbstractMatrix}, transrowvec::Transpose{<:Any,<:RowVector}) =
586 transmat * rvtranspose(transrowvec.parent)
587
588 *(::Transpose{<:Any,<:RowVector}, ::AbstractVector) =
589 throw(DimensionMismatch("Cannot multiply two vectors"))
590 *(transrowvec1::Transpose{<:Any,<:RowVector}, rowvec2::RowVector) =
591 rvtranspose(transrowvec1.parent) * rowvec2
592 *(transvec::Transpose{<:Any,<:AbstractVector}, rowvec::RowVector) =
593 throw(DimensionMismatch("Cannot multiply two transposed vectors"))
594
595 # Conjugated forms
596 *(::RowVector, ::Adjoint{<:Any,<:AbstractVector}) =
597 throw(DimensionMismatch("Cannot multiply two transposed vectors"))
598 *(rowvec::RowVector, adjmat::Adjoint{<:Any,<:AbstractMatrix}) =
599 rvadjoint(adjmat.parent * rvadjoint(rowvec))
600 *(rowvec1::RowVector, adjrowvec2::Adjoint{<:Any,<:RowVector}) =
601 rowvec1 * rvadjoint(adjrowvec2.parent)
602 *(vec::AbstractVector, adjrowvec::Adjoint{<:Any,<:RowVector}) =
603 throw(DimensionMismatch("Cannot multiply two vectors"))
604 *(mat::AbstractMatrix, adjrowvec::Adjoint{<:Any,<:RowVector}) =
605 mat * rvadjoint(adjrowvec.parent)
606
607 *(adjrowvec::Adjoint{<:Any,<:RowVector}, adjvec::Adjoint{<:Any,<:AbstractVector}) =
608 rvadjoint(adjrowvec.parent) * adjoint(adjvec.parent)
609 *(adjrowvec1::Adjoint{<:Any,<:RowVector}, adjrowvec2::Adjoint{<:Any,<:RowVector}) =
610 throw(DimensionMismatch("Cannot multiply two vectors"))
611 *(adjvec::Adjoint{<:Any,<:AbstractVector}, adjrowvec::Adjoint{<:Any,<:RowVector}) =
612 adjoint(adjvec.parent)*rvadjoint(adjrowvec.parent)
613 *(adjmat::Adjoint{<:Any,<:AbstractMatrix}, adjrowvec::Adjoint{<:Any,<:RowVector}) =
614 adjoint(adjmat.parent) * rvadjoint(adjrowvec.parent)
615
616 *(::Adjoint{<:Any,<:RowVector}, ::AbstractVector) = throw(DimensionMismatch("Cannot multiply two vectors"))
617 *(adjrowvec1::Adjoint{<:Any,<:RowVector}, rowvec2::RowVector) = rvadjoint(adjrowvec1.parent) * rowvec2
618 *(adjvec::Adjoint{<:Any,<:AbstractVector}, rowvec::RowVector) = throw(DimensionMismatch("Cannot multiply two transposed vectors"))
619
620 # Pseudo-inverse
621 pinv(v::RowVector, tol::Real=0) = rvadjoint(pinv(rvadjoint(v), tol))
622
623 # Left Division #
624
625 \(rowvec1::RowVector, rowvec2::RowVector) = pinv(rowvec1) * rowvec2
626 \(mat::AbstractMatrix, rowvec::RowVector) = throw(DimensionMismatch("Cannot left-divide transposed vector by matrix"))
627 \(transmat::Transpose{<:Any,<:AbstractMatrix}, rowvec::RowVector) =
628 throw(DimensionMismatch("Cannot left-divide transposed vector by matrix"))
629 \(adjmat::Adjoint{<:Any,<:AbstractMatrix}, rowvec::RowVector) =
630 throw(DimensionMismatch("Cannot left-divide transposed vector by matrix"))
631
632 # Right Division #
633
634 @inline /(rowvec::RowVector, mat::AbstractMatrix) = rvtranspose(transpose(mat) \ rvtranspose(rowvec))
635 /(rowvec::RowVector, transmat::Transpose{<:Any,<:AbstractMatrix}) = rvtranspose(transmat.parent \ rvtranspose(rowvec))
636 /(rowvec::RowVector, adjmat::Adjoint{<:Any,<:AbstractMatrix}) = rvadjoint(adjmat.parent \ rvadjoint(rowvec))
637
638
639 # definitions necessary for test/linalg/dense.jl to pass
640 # should be cleaned up / revised as necessary in the future
641 /(A::Number, B::Adjoint{<:Any,<:RowVector}) = /(A, rvadjoint(B.parent))
642 /(A::Matrix, B::RowVector) = rvadjoint(rvadjoint(B) \ adjoint(A))
643
644
645 # disambiguation methods
646 *(A::Adjoint{<:Any,<:AbstractVector}, B::Transpose{<:Any,<:RowVector}) = adjoint(A.parent) * B
647 *(A::Adjoint{<:Any,<:AbstractMatrix}, B::Transpose{<:Any,<:RowVector}) = A * rvtranspose(B.parent)
648 *(A::Transpose{<:Any,<:AbstractVector}, B::Adjoint{<:Any,<:RowVector}) = transpose(A.parent) * B
649 *(A::Transpose{<:Any,<:AbstractMatrix}, B::Adjoint{<:Any,<:RowVector}) = A * rvadjoint(B.parent)
650
651 # deprecate RowVector{T}(shape...) constructors to RowVector{T}(undef, shape...) equivalents
652 @deprecate RowVector{T}(n::Int) where {T} RowVector{T}(undef, n)
653 @deprecate RowVector{T}(n1::Int, n2::Int) where {T} RowVector{T}(undef, n1, n2)
654 @deprecate RowVector{T}(n::Tuple{Int}) where {T} RowVector{T}(undef, n)
655 @deprecate RowVector{T}(n::Tuple{Int,Int}) where {T} RowVector{T}(undef, n)
656
657 # operations formerly exported from and imported/extended by LinearAlgebra
658 import Base: A_mul_Bt, At_ldiv_Bt, A_rdiv_Bc, At_ldiv_B, Ac_mul_Bc, A_mul_Bc, Ac_mul_B,
659 Ac_ldiv_B, Ac_ldiv_Bc, At_mul_Bt, A_rdiv_Bt, At_mul_B
660
661 # most of these explicit exports are of course obviated by the deprecations below
662 # but life is easier just leaving them for now...
663 export A_ldiv_B!,
664 A_ldiv_Bc,
665 A_ldiv_Bt,
666 A_mul_B!,
667 A_mul_Bc,
668 A_mul_Bc!,
669 A_mul_Bt,
670 A_mul_Bt!,
671 A_rdiv_Bc,
672 A_rdiv_Bt,
673 Ac_ldiv_B,
674 Ac_ldiv_Bc,
675 Ac_ldiv_B!,
676 Ac_mul_B,
677 Ac_mul_B!,
678 Ac_mul_Bc,
679 Ac_mul_Bc!,
680 Ac_rdiv_B,
681 Ac_rdiv_Bc,
682 At_ldiv_B,
683 At_ldiv_Bt,
684 At_ldiv_B!,
685 At_mul_B,
686 At_mul_B!,
687 At_mul_Bt,
688 At_mul_Bt!,
689 At_rdiv_B,
690 At_rdiv_Bt
691
692 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/bidiag.jl, to deprecate
693 @deprecate A_mul_B!(C::AbstractMatrix, A::SymTridiagonal, B::BiTriSym) mul!(C, A, B)
694 @deprecate A_mul_B!(C::AbstractMatrix, A::BiTri, B::BiTriSym) mul!(C, A, B)
695 @deprecate A_mul_B!(C::AbstractMatrix, A::BiTriSym, B::BiTriSym) mul!(C, A, B)
696 @deprecate A_mul_B!(C::AbstractMatrix, A::AbstractTriangular, B::BiTriSym) mul!(C, A, B)
697 @deprecate A_mul_B!(C::AbstractMatrix, A::AbstractMatrix, B::BiTriSym) mul!(C, A, B)
698 @deprecate A_mul_B!(C::AbstractMatrix, A::Diagonal, B::BiTriSym) mul!(C, A, B)
699 @deprecate A_mul_B!(C::AbstractVector, A::BiTri, B::AbstractVector) mul!(C, A, B)
700 @deprecate A_mul_B!(C::AbstractMatrix, A::BiTri, B::AbstractVecOrMat) mul!(C, A, B)
701 @deprecate A_mul_B!(C::AbstractVecOrMat, A::BiTri, B::AbstractVecOrMat) mul!(C, A, B)
702 @deprecate Ac_ldiv_B(A::Bidiagonal, v::RowVector) (\)(adjoint(A), v)
703 @deprecate At_ldiv_B(A::Bidiagonal, v::RowVector) (\)(transpose(A), v)
704 @deprecate Ac_ldiv_B(A::Bidiagonal{<:Number}, v::RowVector{<:Number}) (\)(adjoint(A), v)
705 @deprecate At_ldiv_B(A::Bidiagonal{<:Number}, v::RowVector{<:Number}) (\)(transpose(A), v)
706 @deprecate Ac_mul_B(A::Bidiagonal{T}, B::AbstractVector{T}) where {T} (*)(adjoint(A), B)
707 @deprecate A_mul_Bc(A::Bidiagonal{T}, B::AbstractVector{T}) where {T} (*)(A, adjoint(B))
708 @deprecate A_rdiv_Bc(A::Bidiagonal{T}, B::AbstractVector{T}) where {T} (/)(A, adjoint(B))
709 @deprecate A_ldiv_B!(A::Union{Bidiagonal, AbstractTriangular}, b::AbstractVector) ldiv!(A, b)
710 @deprecate At_ldiv_B!(A::Bidiagonal, b::AbstractVector) ldiv!(transpose(A), b)
711 @deprecate Ac_ldiv_B!(A::Bidiagonal, b::AbstractVector) ldiv!(adjoint(A), b)
712 @deprecate A_ldiv_B!(A::Union{Bidiagonal,AbstractTriangular}, B::AbstractMatrix) ldiv!(A, B)
713 @deprecate Ac_ldiv_B!(A::Union{Bidiagonal,AbstractTriangular}, B::AbstractMatrix) ldiv!(adjoint(A), B)
714 @deprecate At_ldiv_B!(A::Union{Bidiagonal,AbstractTriangular}, B::AbstractMatrix) ldiv!(transpose(A), B)
715 @deprecate At_ldiv_B(A::Bidiagonal, B::AbstractVecOrMat) (\)(transpose(A), B)
716 @deprecate Ac_ldiv_B(A::Bidiagonal, B::AbstractVecOrMat) ldiv!(adjoint(A), B)
717 @deprecate Ac_ldiv_B(A::Bidiagonal{TA}, B::AbstractVecOrMat{TB}) where {TA<:Number,TB<:Number} (\)(adjoint(A), B)
718 @deprecate At_ldiv_B(A::Bidiagonal{TA}, B::AbstractVecOrMat{TB}) where {TA<:Number,TB<:Number} (\)(transpose(A), B)
719
720 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/tridiag.jl, to deprecate
721 @deprecate A_mul_B!(C::StridedVecOrMat, S::SymTridiagonal, B::StridedVecOrMat) mul!(C, S, B)
722
723 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/diagonal.jl, to deprecate
724 @deprecate A_mul_B!(A::Union{LowerTriangular,UpperTriangular}, D::Diagonal) rmul!(A, D)
725 @deprecate A_mul_B!(A::UnitLowerTriangular, D::Diagonal) rmul!(A, D)
726 @deprecate A_mul_B!(A::UnitUpperTriangular, D::Diagonal) rmul!(A, D)
727 @deprecate A_mul_B!(D::Diagonal, B::UnitLowerTriangular) lmul!(D, B)
728 @deprecate A_mul_B!(D::Diagonal, B::UnitUpperTriangular) lmul!(D, B)
729 @deprecate Ac_mul_B(D::Diagonal, B::Diagonal) (*)(adjoint(D), B)
730 @deprecate Ac_mul_B(A::AbstractTriangular, D::Diagonal) (*)(adjoint(A), D)
731 @deprecate Ac_mul_B(A::AbstractMatrix, D::Diagonal) (*)(adjoint(A), D)
732 @deprecate At_mul_B(D::Diagonal, B::Diagonal) (*)(transpose(D), B)
733 @deprecate At_mul_B(A::AbstractTriangular, D::Diagonal) (*)(transpose(A), D)
734 @deprecate At_mul_B(A::AbstractMatrix, D::Diagonal) (*)(transpose(A), D)
735 @deprecate A_mul_Bc(D::Diagonal, B::Diagonal) (*)(D, adjoint(B))
736 @deprecate A_mul_Bc(D::Diagonal, B::AbstractTriangular) (*)(D, adjoint(B))
737 @deprecate A_mul_Bc(D::Diagonal, Q::Union{QRCompactWYQ,QRPackedQ}) (*)(D, adjoint(Q))
738 @deprecate A_mul_Bc(D::Diagonal, A::AbstractMatrix) (*)(D, adjoint(A))
739 @deprecate A_mul_Bt(D::Diagonal, B::Diagonal) (*)(D, transpose(B))
740 @deprecate A_mul_Bt(D::Diagonal, B::AbstractTriangular) (*)(D, transpose(B))
741 @deprecate A_mul_Bt(D::Diagonal, A::AbstractMatrix) (*)(D, transpose(A))
742 @deprecate Ac_mul_Bc(D::Diagonal, B::Diagonal) (*)(adjoint(D), adjoint(B))
743 @deprecate At_mul_Bt(D::Diagonal, B::Diagonal) (*)(transpose(D), transpose(B))
744 function A_mul_B!(A::Diagonal,B::Diagonal)
745 depwarn("`A_mul_B!(A::Diagonal,B::Diagonal)` should be replaced with `rmul!(A, B)` or `lmul!(A, B)`.", :A_mul_B!)
746 throw(MethodError(A_mul_B!, (A, B)))
747 end
748 @deprecate At_mul_B!(A::Diagonal,B::Diagonal) lmul!(transpose(A), B)
749 @deprecate Ac_mul_B!(A::Diagonal,B::Diagonal) lmul!(adjoint(A), B)
750 @deprecate A_mul_B!(A::QRPackedQ, D::Diagonal) rmul!(A, D)
751 @deprecate A_mul_B!(A::Diagonal,B::AbstractMatrix) lmul!(A, B)
752 @deprecate At_mul_B!(A::Diagonal,B::AbstractMatrix) lmul!(transpose(A), B)
753 @deprecate Ac_mul_B!(A::Diagonal,B::AbstractMatrix) lmul!(adjoint(A), B)
754 @deprecate A_mul_B!(A::AbstractMatrix,B::Diagonal) rmul!(A, B)
755 @deprecate A_mul_Bt!(A::AbstractMatrix,B::Diagonal) rmul!(A, transpose(B))
756 @deprecate A_mul_Bc!(A::AbstractMatrix,B::Diagonal) rmul!(A, adjoint(B))
757 @deprecate A_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) mul!(out, A, in)
758 @deprecate Ac_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) mul!(out, adjoint(A), in)
759 @deprecate At_mul_B!(out::AbstractVector, A::Diagonal, in::AbstractVector) mul!(out, transpose(A), in)
760 @deprecate A_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) mul!(out, A, in)
761 @deprecate Ac_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) mul!(out, adjoint(A), in)
762 @deprecate At_mul_B!(out::AbstractMatrix, A::Diagonal, in::AbstractMatrix) mul!(out, transpose(A), in)
763 @deprecate A_mul_Bt(A::Diagonal, B::RealHermSymComplexSym) (*)(A, transpose(B))
764 @deprecate At_mul_B(A::RealHermSymComplexSym, B::Diagonal) (*)(transpose(A), B)
765 @deprecate A_mul_Bc(A::Diagonal, B::RealHermSymComplexHerm) (*)(A, adjoint(B))
766 @deprecate Ac_mul_B(A::RealHermSymComplexHerm, B::Diagonal) (*)(adjoint(A), B)
767 @deprecate A_ldiv_B!(D::Diagonal{T}, v::AbstractVector{T}) where {T} ldiv!(D, v)
768 @deprecate A_ldiv_B!(D::Diagonal{T}, V::AbstractMatrix{T}) where {T} ldiv!(D, V)
769 @deprecate Ac_ldiv_B!(D::Diagonal{T}, B::AbstractVecOrMat{T}) where {T} ldiv!(adjoint(D), B)
770 @deprecate At_ldiv_B!(D::Diagonal{T}, B::AbstractVecOrMat{T}) where {T} ldiv!(transpose(D), B)
771 @deprecate A_rdiv_B!(A::AbstractMatrix{T}, D::Diagonal{T}) where {T} rdiv!(A, D)
772 @deprecate A_rdiv_Bc!(A::AbstractMatrix{T}, D::Diagonal{T}) where {T} rdiv!(A, adjoint(D))
773 @deprecate A_rdiv_Bt!(A::AbstractMatrix{T}, D::Diagonal{T}) where {T} rdiv!(A, transpose(D))
774 @deprecate Ac_ldiv_B(F::Factorization, D::Diagonal) (\)(adjoint(F), D)
775 @deprecate A_mul_Bt(D::Diagonal, rowvec::RowVector) (*)(D, transpose(rowvec))
776 @deprecate A_mul_Bc(D::Diagonal, rowvec::RowVector) (*)(D, adjoint(rowvec))
777 @deprecate A_ldiv_B!(D::Diagonal, B::StridedVecOrMat) ldiv!(D, B)
778
779 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/special.jl, to deprecate
780 @deprecate A_mul_Bc!(A::AbstractTriangular, B::Union{QRCompactWYQ,QRPackedQ}) rmul!(A, adjoint(B))
781 @deprecate A_mul_Bc(A::AbstractTriangular, B::Union{QRCompactWYQ,QRPackedQ}) (*)(A, adjoint(B))
782
783 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/bunchkaufman.jl, to deprecate
784 @deprecate A_ldiv_B!(B::BunchKaufman{T}, R::StridedVecOrMat{T}) where {T<:BlasReal} ldiv!(B, R)
785 @deprecate A_ldiv_B!(B::BunchKaufman{T}, R::StridedVecOrMat{T}) where {T<:BlasComplex} ldiv!(B, R)
786 @deprecate A_ldiv_B!(B::BunchKaufman{T}, R::StridedVecOrMat{S}) where {T,S} ldiv!(B, R)
787
788 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/cholesky.jl, to deprecate
789 @deprecate A_ldiv_B!(C::Cholesky{T,<:AbstractMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(C, B)
790 @deprecate A_ldiv_B!(C::Cholesky{<:Any,<:AbstractMatrix}, B::StridedVecOrMat) ldiv!(C, B)
791 @deprecate A_ldiv_B!(C::CholeskyPivoted{T}, B::StridedVector{T}) where {T<:BlasFloat} ldiv!(C, B)
792 @deprecate A_ldiv_B!(C::CholeskyPivoted{T}, B::StridedMatrix{T}) where {T<:BlasFloat} ldiv!(C, B)
793 @deprecate A_ldiv_B!(C::CholeskyPivoted, B::StridedVector) ldiv!(C, B)
794 @deprecate A_ldiv_B!(C::CholeskyPivoted, B::StridedMatrix) ldiv!(C, B)
795
796 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/factorization.jl, to deprecate
797 @deprecate Ac_ldiv_B(F::Factorization, B::AbstractVecOrMat) (\)(adjoint(F), B)
798 @deprecate A_ldiv_B!(Y::AbstractVecOrMat, A::Factorization, B::AbstractVecOrMat) ldiv!(Y, A, B)
799 @deprecate Ac_ldiv_B!(Y::AbstractVecOrMat, A::Factorization, B::AbstractVecOrMat) ldiv!(Y, adjoint(A), B)
800 @deprecate At_ldiv_B!(Y::AbstractVecOrMat, A::Factorization, B::AbstractVecOrMat) ldiv!(Y, transpose(A), B)
801 @deprecate At_ldiv_B(F::Factorization{<:Real}, B::AbstractVecOrMat) (\)(transpose(F), B)
802 @deprecate At_ldiv_B(F::Factorization, B) (\)(transpose(F), B)
803
804 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/hessenberg.jl, to deprecate
805 @deprecate A_mul_B!(Q::HessenbergQ{T}, X::StridedVecOrMat{T}) where {T<:BlasFloat} lmul!(Q, X)
806 @deprecate A_mul_B!(X::StridedMatrix{T}, Q::HessenbergQ{T}) where {T<:BlasFloat} rmul!(X, Q)
807 @deprecate Ac_mul_B!(Q::HessenbergQ{T}, X::StridedVecOrMat{T}) where {T<:BlasFloat} lmul!(adjoint(Q), X)
808 @deprecate A_mul_Bc!(X::StridedMatrix{T}, Q::HessenbergQ{T}) where {T<:BlasFloat} rmul!(X, adjoint(Q))
809 @deprecate Ac_mul_B(Q::HessenbergQ{T}, X::StridedVecOrMat{S}) where {T,S} (*)(adjoint(Q), X)
810 @deprecate A_mul_Bc(X::StridedVecOrMat{S}, Q::HessenbergQ{T}) where {T,S} (*)(X, adjoint(Q))
811
812 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/ldlt.jl, to deprecate
813 @deprecate A_ldiv_B!(S::LDLt{T,M}, B::AbstractVecOrMat{T}) where {T,M<:SymTridiagonal{T}} ldiv!(S, B)
814
815 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/svd.jl, to deprecate
816 @deprecate A_ldiv_B!(A::SVD{T}, B::StridedVecOrMat) where {T} ldiv!(A, B)
817
818 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/symmetric.jl, to deprecate
819 @deprecate A_mul_B!(y::StridedVector{T}, A::Symmetric{T,<:StridedMatrix}, x::StridedVector{T}) where {T<:BlasFloat} mul!(y, A, x)
820 @deprecate A_mul_B!(y::StridedVector{T}, A::Hermitian{T,<:StridedMatrix}, x::StridedVector{T}) where {T<:BlasReal} mul!(y, A, x)
821 @deprecate A_mul_B!(y::StridedVector{T}, A::Hermitian{T,<:StridedMatrix}, x::StridedVector{T}) where {T<:BlasComplex} mul!(y, A, x)
822 @deprecate A_mul_B!(C::StridedMatrix{T}, A::Symmetric{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasFloat} mul!(C, A, B)
823 @deprecate A_mul_B!(C::StridedMatrix{T}, A::StridedMatrix{T}, B::Symmetric{T,<:StridedMatrix}) where {T<:BlasFloat} mul!(C, A, B)
824 @deprecate A_mul_B!(C::StridedMatrix{T}, A::Hermitian{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasReal} mul!(C, A, B)
825 @deprecate A_mul_B!(C::StridedMatrix{T}, A::StridedMatrix{T}, B::Hermitian{T,<:StridedMatrix}) where {T<:BlasReal} mul!(C, A, B)
826 @deprecate A_mul_B!(C::StridedMatrix{T}, A::Hermitian{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasComplex} mul!(C, A, B)
827 @deprecate A_mul_B!(C::StridedMatrix{T}, A::StridedMatrix{T}, B::Hermitian{T,<:StridedMatrix}) where {T<:BlasComplex} mul!(C, A, B)
828 @deprecate At_mul_B(A::RealHermSymComplexSym, B::AbstractVector) (*)(transpose(A), B)
829 @deprecate At_mul_B(A::RealHermSymComplexSym, B::AbstractMatrix) (*)(transpose(A), B)
830 @deprecate A_mul_Bt(A::AbstractMatrix, B::RealHermSymComplexSym) (*)(A, transpose(B))
831 @deprecate Ac_mul_B(A::RealHermSymComplexHerm, B::AbstractVector) (*)(adjoint(A), B)
832 @deprecate Ac_mul_B(A::RealHermSymComplexHerm, B::AbstractMatrix) (*)(adjoint(A), B)
833 @deprecate A_mul_Bc(A::AbstractMatrix, B::RealHermSymComplexHerm) (*)(A, adjoint(B))
834 @deprecate A_mul_Bt(A::RowVector, B::RealHermSymComplexSym) (*)(A, transpose(B))
835 @deprecate A_mul_Bc(A::RowVector, B::RealHermSymComplexHerm) (*)(A, adjoint(B))
836 @deprecate At_mul_B(A::RealHermSymComplexSym, B::AbstractTriangular) (*)(transpose(A), B)
837 @deprecate A_mul_Bt(A::AbstractTriangular, B::RealHermSymComplexSym) (*)(A, transpose(B))
838 @deprecate Ac_mul_B(A::RealHermSymComplexHerm, B::AbstractTriangular) (*)(adjoint(A), B)
839 @deprecate A_mul_Bc(A::AbstractTriangular, B::RealHermSymComplexHerm) (*)(A, adjoint(B))
840
841 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/lu.jl, to deprecate
842 @deprecate A_ldiv_B!(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(A, B)
843 @deprecate A_ldiv_B!(A::LU{<:Any,<:StridedMatrix}, B::StridedVecOrMat) ldiv!(A, B)
844 @deprecate At_ldiv_B!(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(transpose(A), B)
845 @deprecate At_ldiv_B!(A::LU{<:Any,<:StridedMatrix}, B::StridedVecOrMat) ldiv!(transpose(A), B)
846 @deprecate Ac_ldiv_B!(F::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:Real} ldiv!(adjoint(F), B)
847 @deprecate Ac_ldiv_B!(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasComplex} ldiv!(adjoint(A), B)
848 @deprecate Ac_ldiv_B!(A::LU{<:Any,<:StridedMatrix}, B::StridedVecOrMat) ldiv!(adjoint(A), B)
849 @deprecate At_ldiv_Bt(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} (\)(transpose(A), transpose(B))
850 @deprecate At_ldiv_Bt(A::LU, B::StridedVecOrMat) (\)(transpose(A), transpose(B))
851 @deprecate Ac_ldiv_Bc(A::LU{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasComplex} (\)(adjoint(A), adjoint(B))
852 @deprecate Ac_ldiv_Bc(A::LU, B::StridedVecOrMat) (\)(adjoint(A), adjoint(B))
853 @deprecate A_ldiv_B!(A::LU{T,Tridiagonal{T,V}}, B::AbstractVecOrMat) where {T,V} ldiv!(A, B)
854 @deprecate At_ldiv_B!(A::LU{T,Tridiagonal{T,V}}, B::AbstractVecOrMat) where {T,V} (\)(transpose(A), B)
855 @deprecate Ac_ldiv_B!(A::LU{T,Tridiagonal{T,V}}, B::AbstractVecOrMat) where {T,V} ldiv!(adjoint(A), B)
856
857 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/lq.jl, to deprecate
858 @deprecate A_mul_B!(A::LQ{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} lmul!(A, B)
859 @deprecate A_mul_B!(A::LQ{T}, B::QR{T}) where {T<:BlasFloat} A*B
860 @deprecate A_mul_B!(A::QR{T}, B::LQ{T}) where {T<:BlasFloat} A*B
861 @deprecate A_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} lmul!(A, B)
862 @deprecate Ac_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasReal} lmul!(adjoint(A), B)
863 @deprecate Ac_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasComplex} lmul!(adjoint(A), B)
864 @deprecate Ac_mul_B(A::LQPackedQ, B::StridedVecOrMat) (*)(adjoint(A), B)
865 @deprecate A_mul_Bc(A::LQPackedQ, B::StridedVecOrMat) (*)(A, adjoint(B))
866 @deprecate Ac_mul_Bc(A::LQPackedQ, B::StridedVecOrMat) (*)(adjoint(A), adjoint(B))
867 @deprecate A_mul_B!(A::StridedMatrix{T}, B::LQPackedQ{T}) where {T<:BlasFloat} rmul!(A, B)
868 @deprecate A_mul_Bc!(A::StridedMatrix{T}, B::LQPackedQ{T}) where {T<:BlasReal} rmul!(A, adjoint(B))
869 @deprecate A_mul_Bc!(A::StridedMatrix{T}, B::LQPackedQ{T}) where {T<:BlasComplex} rmul!(A, adjoint(B))
870 @deprecate A_mul_Bc(A::StridedVecOrMat, Q::LQPackedQ) (*)(A, adjoint(Q))
871 @deprecate Ac_mul_Bc(A::StridedMatrix, Q::LQPackedQ) (*)(adjoint(A), adjoint(Q))
872 @deprecate Ac_mul_B(A::StridedMatrix, Q::LQPackedQ) (*)(adjoint(A), Q)
873 @deprecate A_ldiv_B!(A::LQ{T}, B::StridedVecOrMat{T}) where {T} ldiv!(A, B)
874
875 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/qr.jl, to deprecate
876 @deprecate A_mul_B!(A::QRCompactWYQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasFloat, S<:StridedMatrix} lmul!(A, B)
877 @deprecate A_mul_B!(A::QRPackedQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasFloat, S<:StridedMatrix} lmul!(A, B)
878 @deprecate A_mul_B!(A::QRPackedQ, B::AbstractVecOrMat) lmul!(A, B)
879 @deprecate Ac_mul_B!(A::QRCompactWYQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasReal,S<:StridedMatrix} lmul!(adjoint(A), B)
880 @deprecate Ac_mul_B!(A::QRCompactWYQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasComplex,S<:StridedMatrix} lmul!(adjoint(A), B)
881 @deprecate Ac_mul_B!(A::QRPackedQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasReal,S<:StridedMatrix} lmul!(adjoint(A), B)
882 @deprecate Ac_mul_B!(A::QRPackedQ{T,S}, B::StridedVecOrMat{T}) where {T<:BlasComplex,S<:StridedMatrix} lmul!(adjoint(A), B)
883 @deprecate Ac_mul_B!(A::QRPackedQ, B::AbstractVecOrMat) lmul!(adjoint(A), B)
884 @deprecate Ac_mul_B(Q::AbstractQ, B::StridedVecOrMat) (*)(adjoint(Q), B)
885 @deprecate A_mul_Bc(Q::AbstractQ, B::StridedVecOrMat) (*)(Q, adjoint(B))
886 @deprecate Ac_mul_Bc(Q::AbstractQ, B::StridedVecOrMat) (*)(adjoint(Q), adjoint(B))
887 @deprecate A_mul_B!(A::StridedVecOrMat{T}, B::QRCompactWYQ{T,S}) where {T<:BlasFloat,S<:StridedMatrix} rmul!(A, B)
888 @deprecate A_mul_B!(A::StridedVecOrMat{T}, B::QRPackedQ{T,S}) where {T<:BlasFloat,S<:StridedMatrix} rmul!(A, B)
889 @deprecate A_mul_B!(A::StridedMatrix,Q::QRPackedQ) rmul!(A, Q)
890 @deprecate A_mul_Bc!(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) where {T<:BlasReal} rmul!(A, adjoint(B))
891 @deprecate A_mul_Bc!(A::StridedVecOrMat{T}, B::QRCompactWYQ{T}) where {T<:BlasComplex} rmul!(A, adjoint(B))
892 @deprecate A_mul_Bc!(A::StridedVecOrMat{T}, B::QRPackedQ{T}) where {T<:BlasReal} rmul!(A, adjoint(B))
893 @deprecate A_mul_Bc!(A::StridedVecOrMat{T}, B::QRPackedQ{T}) where {T<:BlasComplex} rmul!(A, adjoint(B))
894 @deprecate A_mul_Bc!(A::StridedMatrix,Q::QRPackedQ) rmul!(A, adjoint(Q))
895 @deprecate A_mul_Bc(A::StridedMatrix, B::AbstractQ) (*)(A, adjoint(B))
896 @deprecate A_mul_Bc(rowvec::RowVector, B::AbstractQ) (*)(rowvec, adjoint(B))
897 @deprecate Ac_mul_B(A::StridedVecOrMat, Q::AbstractQ) (*)(adjoint(A), Q)
898 @deprecate Ac_mul_Bc(A::StridedVecOrMat, Q::AbstractQ) (*)(adjoint(A), adjoint(Q))
899 @deprecate A_ldiv_B!(A::QRCompactWY{T}, b::StridedVector{T}) where {T<:BlasFloat} ldiv!(A, b)
900 @deprecate A_ldiv_B!(A::QRCompactWY{T}, B::StridedMatrix{T}) where {T<:BlasFloat} ldiv!(A, B)
901 @deprecate A_ldiv_B!(A::QRPivoted{T}, B::StridedMatrix{T}, rcond::Real) where {T<:BlasFloat} ldiv!(A, B, rcond)
902 @deprecate A_ldiv_B!(A::QRPivoted{T}, B::StridedVector{T}) where {T<:BlasFloat} ldiv!(A, B)
903 @deprecate A_ldiv_B!(A::QRPivoted{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(A, B)
904 @deprecate A_ldiv_B!(A::QR{T}, B::StridedMatrix{T}) where {T} ldiv!(A, B)
905 @deprecate A_ldiv_B!(A::QR, B::StridedVector) ldiv!(A, B)
906 @deprecate A_ldiv_B!(A::QRPivoted, b::StridedVector) ldiv!(A, b)
907 @deprecate A_ldiv_B!(A::QRPivoted, B::StridedMatrix) ldiv!(A, B)
908
909 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/matmul.jl, to deprecate
910 @deprecate Ac_mul_Bc(A::AbstractMatrix{T}, B::AbstractMatrix{S}) where {T,S} (*)(adjoint(A), adjoint(B))
911 @deprecate Ac_mul_Bc!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} mul!(C, adjoint(A), adjoint(B))
912 @deprecate Ac_mul_Bc!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, adjoint(A), adjoint(B))
913 @deprecate Ac_mul_Bt!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, adjoint(A), transpose(B))
914 @deprecate A_mul_Bc!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasComplex} mul!(C, A, adjoint(B))
915 @deprecate A_mul_Bc!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, A, adjoint(B))
916 @deprecate A_mul_Bc(A::AbstractMatrix{T}, B::AbstractMatrix{S}) where {T,S} (*)(A, adjoint(B))
917 @deprecate A_mul_Bc(A::StridedMatrix{<:BlasFloat}, B::StridedMatrix{<:BlasReal}) (*)(A, adjoint(B))
918 @deprecate A_mul_Bc!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{<:BlasReal}) where {T<:BlasFloat} mul!(C, A, adjoint(B))
919 @deprecate Ac_mul_B!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasComplex} mul!(C, adjoint(A), B)
920 @deprecate Ac_mul_B!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, adjoint(A), B)
921 @deprecate Ac_mul_B(A::AbstractMatrix{T}, B::AbstractMatrix{S}) where {T,S} (*)(adjoint(A), B)
922 @deprecate Ac_mul_B(A::StridedMatrix{T}, B::StridedMatrix{T}) where {T<:BlasReal} (*)(adjoint(A), B)
923 @deprecate Ac_mul_B!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasReal} mul!(C, adjoint(A), B)
924 @deprecate At_mul_Bt!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} mul!(C, transpose(A), transpose(B))
925 @deprecate At_mul_Bt!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, transpose(A), transpose(B))
926 @deprecate At_mul_Bt(A::AbstractMatrix{T}, B::AbstractVecOrMat{S}) where {T,S} (*)(transpose(A), transpose(B))
927 @deprecate A_mul_Bt!(C::AbstractVecOrMat, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, A, transpose(B))
928 @deprecate A_mul_Bt!(C::StridedMatrix{Complex{Float32}}, A::StridedVecOrMat{Complex{Float32}}, B::StridedVecOrMat{Float32}) mul!(C, A, transpose(B))
929 @deprecate A_mul_Bt!(C::StridedMatrix{Complex{Float64}}, A::StridedVecOrMat{Complex{Float64}}, B::StridedVecOrMat{Float64}) mul!(C, A, transpose(B))
930 @deprecate A_mul_Bt!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} mul!(C, A, transpose(B))
931 @deprecate A_mul_Bt(A::AbstractMatrix{T}, B::AbstractMatrix{S}) where {T,S} (*)(A, transpose(B))
932 @deprecate At_mul_B!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} mul!(C, transpose(A), B)
933 @deprecate At_mul_B!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, transpose(A), B)
934 @deprecate At_mul_B(A::AbstractMatrix{T}, B::AbstractMatrix{S}) where {T,S} (*)(transpose(A), B)
935 @deprecate A_mul_B!(C::AbstractMatrix, A::AbstractVecOrMat, B::AbstractVecOrMat) mul!(C, A, B)
936 @deprecate A_mul_B!(C::StridedMatrix{Complex{Float32}}, A::StridedVecOrMat{Complex{Float32}}, B::StridedVecOrMat{Float32}) mul!(C, A, B)
937 @deprecate A_mul_B!(C::StridedMatrix{Complex{Float64}}, A::StridedVecOrMat{Complex{Float64}}, B::StridedVecOrMat{Float64}) mul!(C, A, B)
938 @deprecate A_mul_B!(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} mul!(C, A, B)
939 @deprecate Ac_mul_B!(y::StridedVector{T}, A::StridedVecOrMat{T}, x::StridedVector{T}) where {T<:BlasReal} mul!(y, adjoint(A), x)
940 @deprecate Ac_mul_B!(y::StridedVector{T}, A::StridedVecOrMat{T}, x::StridedVector{T}) where {T<:BlasComplex} mul!(y, adjoint(A), x)
941 @deprecate Ac_mul_B!(y::AbstractVector, A::AbstractVecOrMat, x::AbstractVector) mul!(y, adjoint(A), x)
942 @deprecate Ac_mul_B(A::StridedMatrix{T}, x::StridedVector{S}) where {T<:BlasFloat,S} (*)(adjoint(A), x)
943 @deprecate Ac_mul_B(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T,S} (*)(adjoint(A), x)
944 @deprecate At_mul_B(A::StridedMatrix{T}, x::StridedVector{S}) where {T<:BlasFloat,S} (*)(transpose(A), x)
945 @deprecate At_mul_B(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T,S} (*)(transpose(A), x)
946 @deprecate At_mul_B!(y::StridedVector{T}, A::StridedVecOrMat{T}, x::StridedVector{T}) where {T<:BlasFloat} mul!(y, transpose(A), x)
947 @deprecate At_mul_B!(y::AbstractVector, A::AbstractVecOrMat, x::AbstractVector) mul!(y, transpose(A), x)
948 @deprecate A_mul_B!(y::AbstractVector, A::AbstractVecOrMat, x::AbstractVector) mul!(y, A, x)
949 @deprecate A_mul_B!(y::StridedVector{Complex{Float32}}, A::StridedVecOrMat{Complex{Float32}}, x::StridedVector{Float32}) mul!(y, A, x)
950 @deprecate A_mul_B!(y::StridedVector{Complex{Float64}}, A::StridedVecOrMat{Complex{Float64}}, x::StridedVector{Float64}) mul!(y, A, x)
951 @deprecate A_mul_B!(y::StridedVector{T}, A::StridedVecOrMat{T}, x::StridedVector{T}) where {T<:BlasFloat} mul!(y, A, x)
952 @deprecate A_mul_Bt(a::AbstractVector, B::AbstractMatrix) (*)(a, transpose(B))
953 @deprecate A_mul_Bt(A::AbstractMatrix, b::AbstractVector) (*)(A, transpose(b))
954 @deprecate A_mul_Bc(a::AbstractVector, B::AbstractMatrix) (*)(a, adjoint(B))
955 @deprecate A_mul_Bc(A::AbstractMatrix, b::AbstractVector) (*)(A, adjoint(b))
956 @deprecate At_mul_B(x::StridedVector{T}, y::StridedVector{T}) where {T<:BlasComplex} (*)(transpose(x), y)
957
958 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/triangular.jl, to deprecate
959 @deprecate A_mul_Bc(A::AbstractTriangular, B::AbstractTriangular) (*)(A, adjoint(B))
960 @deprecate A_mul_Bt(A::AbstractTriangular, B::AbstractTriangular) (*)(A, transpose(B))
961 @deprecate Ac_mul_B(A::AbstractTriangular, B::AbstractTriangular) (*)(adjoint(A), B)
962 @deprecate At_mul_B(A::AbstractTriangular, B::AbstractTriangular) (*)(transpose(A), B)
963 @deprecate Ac_ldiv_B(A::Union{UpperTriangular,LowerTriangular}, B::RowVector) (\)(adjoint(A), B)
964 @deprecate Ac_ldiv_B(A::Union{UnitUpperTriangular,UnitLowerTriangular}, B::RowVector) (\)(adjoint(A), B)
965 @deprecate At_ldiv_B(A::Union{UpperTriangular,LowerTriangular}, B::RowVector) (\)(transpose(A), B)
966 @deprecate At_ldiv_B(A::Union{UnitUpperTriangular,UnitLowerTriangular}, B::RowVector) (\)(transpose(A), B)
967 @deprecate A_rdiv_Bc(rowvec::RowVector, A::Union{UpperTriangular,LowerTriangular}) (/)(rowvec, adjoint(A))
968 @deprecate A_rdiv_Bc(rowvec::RowVector, A::Union{UnitUpperTriangular,UnitLowerTriangular}) (/)(rowvec, adjoint(A))
969 @deprecate A_rdiv_Bt(rowvec::RowVector, A::Union{UpperTriangular,LowerTriangular}) (/)(rowvec, transpose(A))
970 @deprecate A_rdiv_Bt(rowvec::RowVector, A::Union{UnitUpperTriangular,UnitLowerTriangular}) (/)(rowvec, transpose(A))
971 @deprecate A_mul_Bt(rowvec::RowVector, A::AbstractTriangular) (*)(rowvec, transpose(A))
972 @deprecate A_mul_Bt(A::AbstractTriangular, rowvec::RowVector) (*)(A, transpose(rowvec))
973 @deprecate At_mul_Bt(A::AbstractTriangular, rowvec::RowVector) (*)(transpose(A), transpose(rowvec))
974 @deprecate A_mul_Bc(rowvec::RowVector, A::AbstractTriangular) (*)(rowvec, adjoint(A))
975 @deprecate A_mul_Bc(A::AbstractTriangular, rowvec::RowVector) (*)(A, adjoint(rowvec))
976 @deprecate Ac_mul_Bc(A::AbstractTriangular, rowvec::RowVector) (*)(adjoint(A), adjoint(rowvec))
977 @deprecate Ac_mul_B(A::AbstractMatrix, B::AbstractTriangular) (*)(adjoint(A), B)
978 @deprecate At_mul_B(A::AbstractMatrix, B::AbstractTriangular) (*)(transpose(A), B)
979 @deprecate A_mul_Bc(A::AbstractTriangular, B::AbstractMatrix) (*)(A, adjoint(B))
980 @deprecate A_mul_Bt(A::AbstractTriangular, B::AbstractMatrix) (*)(A, transpose(B))
981 @deprecate Ac_mul_Bc(A::AbstractTriangular, B::AbstractTriangular) (*)(adjoint(A), adjoint(B))
982 @deprecate Ac_mul_Bc(A::AbstractTriangular, B::AbstractMatrix) (*)(adjoint(A), adjoint(B))
983 @deprecate Ac_mul_Bc(A::AbstractMatrix, B::AbstractTriangular) (*)(adjoint(A), adjoint(B))
984 @deprecate At_mul_Bt(A::AbstractTriangular, B::AbstractTriangular) (*)(transpose(A), transpose(B))
985 @deprecate At_mul_Bt(A::AbstractTriangular, B::AbstractMatrix) (*)(transpose(A), transpose(B))
986 @deprecate At_mul_Bt(A::AbstractMatrix, B::AbstractTriangular) (*)(transpose(A), transpose(B))
987 @deprecate A_mul_Bc!(A::UpperTriangular, B::Union{LowerTriangular,UnitLowerTriangular}) rmul!(A, adjoint(B))
988 @deprecate A_mul_Bc!(A::LowerTriangular, B::Union{UpperTriangular,UnitUpperTriangular}) rmul!(A, adjoint(B))
989 @deprecate A_mul_Bt!(A::UpperTriangular, B::Union{LowerTriangular,UnitLowerTriangular}) rmul!(A, transpose(B))
990 @deprecate A_mul_Bt!(A::LowerTriangular, B::Union{UpperTriangular,UnitUpperTriangular}) rmul!(A, transpose(B))
991 @deprecate A_rdiv_Bc!(A::UpperTriangular, B::Union{LowerTriangular,UnitLowerTriangular}) rdiv!(A, adjoint(B))
992 @deprecate A_rdiv_Bc!(A::LowerTriangular, B::Union{UpperTriangular,UnitUpperTriangular}) rdiv!(A, adjoint(B))
993 @deprecate A_rdiv_Bt!(A::UpperTriangular, B::Union{LowerTriangular,UnitLowerTriangular}) rdiv!(A, transpose(B))
994 @deprecate A_rdiv_Bt!(A::LowerTriangular, B::Union{UpperTriangular,UnitUpperTriangular}) rdiv!(A, transpose(B))
995 @deprecate A_rdiv_B!(A::UpperTriangular, B::Union{UpperTriangular,UnitUpperTriangular}) rdiv!(A, B)
996 @deprecate A_rdiv_B!(A::LowerTriangular, B::Union{LowerTriangular,UnitLowerTriangular}) rdiv!(A, B)
997 @deprecate Ac_mul_B!(A::Union{LowerTriangular,UnitLowerTriangular}, B::UpperTriangular) lmul!(adjoint(A), B)
998 @deprecate Ac_mul_B!(A::Union{UpperTriangular,UnitUpperTriangular}, B::LowerTriangular) lmul!(adjoint(A), B)
999 @deprecate At_mul_B!(A::Union{LowerTriangular,UnitLowerTriangular}, B::UpperTriangular) lmul!(transpose(A), B)
1000 @deprecate At_mul_B!(A::Union{UpperTriangular,UnitUpperTriangular}, B::LowerTriangular) lmul!(transpose(A), B)
1001 @deprecate Ac_ldiv_B!(A::Union{LowerTriangular,UnitLowerTriangular}, B::UpperTriangular) ldiv!(adjoint(A), B)
1002 @deprecate Ac_ldiv_B!(A::Union{UpperTriangular,UnitUpperTriangular}, B::LowerTriangular) ldiv!(adjoint(A), B)
1003 @deprecate At_ldiv_B!(A::Union{LowerTriangular,UnitLowerTriangular}, B::UpperTriangular) ldiv!(transpose(A), B)
1004 @deprecate At_ldiv_B!(A::Union{UpperTriangular,UnitUpperTriangular}, B::LowerTriangular) ldiv!(transpose(A), B)
1005 @deprecate A_rdiv_Bt!(A::StridedMatrix, B::UnitLowerTriangular) rdiv!(A, transpose(B))
1006 @deprecate A_rdiv_Bt!(A::StridedMatrix, B::LowerTriangular) rdiv!(A, transpose(B))
1007 @deprecate A_rdiv_Bt!(A::StridedMatrix, B::UnitUpperTriangular) rdiv!(A, transpose(B))
1008 @deprecate A_rdiv_Bt!(A::StridedMatrix, B::UpperTriangular) rdiv!(A, transpose(B))
1009 @deprecate A_rdiv_Bc!(A::StridedMatrix, B::UnitLowerTriangular) rdiv!(A, adjoint(B))
1010 @deprecate A_rdiv_Bc!(A::StridedMatrix, B::LowerTriangular) rdiv!(A, adjoint(B))
1011 @deprecate A_rdiv_Bc!(A::StridedMatrix, B::UnitUpperTriangular) rdiv!(A, adjoint(B))
1012 @deprecate A_rdiv_Bc!(A::StridedMatrix, B::UpperTriangular) rdiv!(A, adjoint(B))
1013 @deprecate A_rdiv_B!(A::StridedMatrix, B::UnitLowerTriangular) rdiv!(A, B)
1014 @deprecate A_rdiv_B!(A::StridedMatrix, B::LowerTriangular) rdiv!(A, B)
1015 @deprecate A_rdiv_B!(A::StridedMatrix, B::UnitUpperTriangular) rdiv!(A, B)
1016 @deprecate A_rdiv_B!(A::StridedMatrix, B::UpperTriangular) rdiv!(A, B)
1017 @deprecate Ac_ldiv_B!(A::UnitUpperTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(adjoint(A), b, x)
1018 @deprecate Ac_ldiv_B!(A::UpperTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(adjoint(A), b, x)
1019 @deprecate Ac_ldiv_B!(A::UnitLowerTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(adjoint(A), b, x)
1020 @deprecate Ac_ldiv_B!(A::LowerTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(adjoint(A), b, x)
1021 @deprecate At_ldiv_B!(A::UnitUpperTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(transpose(A), b, x)
1022 @deprecate At_ldiv_B!(A::UpperTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(transpose(A), b, x)
1023 @deprecate At_ldiv_B!(A::UnitLowerTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(transpose(A), b, x)
1024 @deprecate At_ldiv_B!(A::LowerTriangular, b::AbstractVector, x::AbstractVector = b) ldiv!(transpose(A), b, x)
1025 @deprecate A_mul_Bt!(A::StridedMatrix, B::UnitLowerTriangular) rmul!(A, transpose(B))
1026 @deprecate A_mul_Bt!(A::StridedMatrix, B::LowerTriangular) rmul!(A, transpose(B))
1027 @deprecate A_mul_Bt!(A::StridedMatrix, B::UnitUpperTriangular) rmul!(A, transpose(B))
1028 @deprecate A_mul_Bt!(A::StridedMatrix, B::UpperTriangular) rmul!(A, transpose(B))
1029 @deprecate A_mul_Bc!(A::StridedMatrix, B::UnitLowerTriangular) rmul!(A, adjoint(B))
1030 @deprecate A_mul_Bc!(A::StridedMatrix, B::LowerTriangular) rmul!(A, adjoint(B))
1031 @deprecate A_mul_Bc!(A::StridedMatrix, B::UnitUpperTriangular) rmul!(A, adjoint(B))
1032 @deprecate A_mul_Bc!(A::StridedMatrix, B::UpperTriangular) rmul!(A, adjoint(B))
1033 @deprecate A_mul_B!(A::StridedMatrix, B::UnitLowerTriangular) rmul!(A, B)
1034 @deprecate A_mul_B!(A::StridedMatrix, B::LowerTriangular) rmul!(A, B)
1035 @deprecate A_mul_B!(A::StridedMatrix, B::UnitUpperTriangular) rmul!(A, B)
1036 @deprecate A_mul_B!(A::StridedMatrix, B::UpperTriangular) rmul!(A, B)
1037 @deprecate At_mul_B!(A::UnitLowerTriangular, B::StridedVecOrMat) lmul!(transpose(A), B)
1038 @deprecate At_mul_B!(A::LowerTriangular, B::StridedVecOrMat) lmul!(transpose(A), B)
1039 @deprecate At_mul_B!(A::UnitUpperTriangular, B::StridedVecOrMat) lmul!(transpose(A), B)
1040 @deprecate At_mul_B!(A::UpperTriangular, B::StridedVecOrMat) lmul!(transpose(A), B)
1041 @deprecate Ac_mul_B!(A::UnitLowerTriangular, B::StridedVecOrMat) lmul!(adjoint(A), B)
1042 @deprecate Ac_mul_B!(A::LowerTriangular, B::StridedVecOrMat) lmul!(adjoint(A), B)
1043 @deprecate Ac_mul_B!(A::UnitUpperTriangular, B::StridedVecOrMat) lmul!(adjoint(A), B)
1044 @deprecate Ac_mul_B!(A::UpperTriangular, B::StridedVecOrMat) lmul!(adjoint(A), B)
1045 @deprecate A_mul_B!(A::UnitLowerTriangular, B::StridedVecOrMat) lmul!(A, B)
1046 @deprecate A_mul_B!(A::LowerTriangular, B::StridedVecOrMat) lmul!(A, B)
1047 @deprecate A_mul_B!(A::UnitUpperTriangular, B::StridedVecOrMat) lmul!(A, B)
1048 @deprecate A_mul_B!(A::UpperTriangular, B::StridedVecOrMat) lmul!(A, B)
1049 @deprecate A_mul_B!(C::AbstractVector , A::AbstractTriangular, B::AbstractVector) mul!(C, A, B)
1050 @deprecate A_mul_B!(C::AbstractMatrix , A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, A, B)
1051 @deprecate A_mul_B!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, A, B)
1052 @deprecate Ac_mul_B!(C::AbstractVector , A::AbstractTriangular, B::AbstractVector) mul!(C, adjoint(A), B)
1053 @deprecate Ac_mul_B!(C::AbstractMatrix , A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, adjoint(A), B)
1054 @deprecate Ac_mul_B!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, adjoint(A), B)
1055 @deprecate At_mul_B!(C::AbstractVector , A::AbstractTriangular, B::AbstractVector) mul!(C, transpose(A), B)
1056 @deprecate At_mul_B!(C::AbstractMatrix , A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, transpose(A), B)
1057 @deprecate At_mul_B!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, transpose(A), B)
1058 @deprecate A_mul_B!(A::Tridiagonal, B::AbstractTriangular) lmul!(A, B)
1059 @deprecate A_mul_B!(C::AbstractMatrix, A::AbstractTriangular, B::Tridiagonal) mul!(C, A, B)
1060 @deprecate A_mul_B!(C::AbstractMatrix, A::Tridiagonal, B::AbstractTriangular) mul!(C, A, B)
1061 @deprecate A_mul_Bt!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, A, transpose(B))
1062 @deprecate A_mul_Bc!(C::AbstractMatrix, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, A, adjoint(B))
1063 @deprecate A_mul_Bc!(C::AbstractVecOrMat, A::AbstractTriangular, B::AbstractVecOrMat) mul!(C, A, adjoint(B))
1064 for mat in (:AbstractVector, :AbstractMatrix)
1065 @eval begin
1066 @deprecate Ac_mul_B(A::AbstractTriangular, B::$mat) (*)(adjoint(A), B)
1067 @deprecate At_mul_B(A::AbstractTriangular, B::$mat) (*)(transpose(A), B)
1068 @deprecate Ac_ldiv_B(A::Union{UnitUpperTriangular,UnitLowerTriangular}, B::$mat) (\)(adjoint(A), B)
1069 @deprecate At_ldiv_B(A::Union{UnitUpperTriangular,UnitLowerTriangular}, B::$mat) (\)(transpose(A), B)
1070 @deprecate Ac_ldiv_B(A::Union{UpperTriangular,LowerTriangular}, B::$mat) (\)(adjoint(A), B)
1071 @deprecate At_ldiv_B(A::Union{UpperTriangular,LowerTriangular}, B::$mat) (\)(transpose(A), B)
1072 @deprecate A_rdiv_Bc(A::$mat, B::Union{UnitUpperTriangular, UnitLowerTriangular}) (/)(A, adjoint(B))
1073 @deprecate A_rdiv_Bt(A::$mat, B::Union{UnitUpperTriangular, UnitLowerTriangular}) (/)(A, transpose(B))
1074 @deprecate A_rdiv_Bc(A::$mat, B::Union{UpperTriangular,LowerTriangular}) (/)(A, adjoint(B))
1075 @deprecate A_rdiv_Bt(A::$mat, B::Union{UpperTriangular,LowerTriangular}) (/)(A, transpose(B))
1076 end
1077 end
1078 @deprecate A_mul_Bc(A::AbstractMatrix, B::AbstractTriangular) (*)(A, adjoint(B))
1079 @deprecate A_mul_Bt(A::AbstractMatrix, B::AbstractTriangular) (*)(A, transpose(B))
1080 for (f, op, transform) in (
1081 (:A_mul_Bc, :*, :adjoint),
1082 (:A_mul_Bt, :*, :transpose),
1083 (:A_rdiv_Bc, :/, :adjoint),
1084 (:A_rdiv_Bt, :/, :transpose))
1085 @eval begin
1086 @deprecate $f(A::LowerTriangular, B::UpperTriangular) ($op)(A, ($transform)(B))
1087 @deprecate $f(A::LowerTriangular, B::UnitUpperTriangular) ($op)(A, ($transform)(B))
1088 @deprecate $f(A::UpperTriangular, B::LowerTriangular) ($op)(A, ($transform)(B))
1089 @deprecate $f(A::UpperTriangular, B::UnitLowerTriangular) ($op)(A, ($transform)(B))
1090 end
1091 end
1092 for (f, op, transform) in (
1093 (:Ac_mul_B, :*, :adjoint),
1094 (:At_mul_B, :*, :transpose),
1095 (:Ac_ldiv_B, :\, :adjoint),
1096 (:At_ldiv_B, :\, :transpose))
1097 @eval begin
1098 @deprecate ($f)(A::UpperTriangular, B::LowerTriangular) ($op)(($transform)(A), B)
1099 @deprecate ($f)(A::UnitUpperTriangular, B::LowerTriangular) ($op)(($transform)(A), B)
1100 @deprecate ($f)(A::LowerTriangular, B::UpperTriangular) ($op)(($transform)(A), B)
1101 @deprecate ($f)(A::UnitLowerTriangular, B::UpperTriangular) ($op)(($transform)(A), B)
1102 end
1103 end
1104 for (t, uploc, isunitc) in ((:LowerTriangular, 'L', 'N'),
1105 (:UnitLowerTriangular, 'L', 'U'),
1106 (:UpperTriangular, 'U', 'N'),
1107 (:UnitUpperTriangular, 'U', 'U'))
1108 @eval begin
1109 # Vector multiplication
1110 @deprecate A_mul_B!(A::$t{T,<:StridedMatrix}, b::StridedVector{T}) where {T<:BlasFloat} lmul!(A, b)
1111 @deprecate At_mul_B!(A::$t{T,<:StridedMatrix}, b::StridedVector{T}) where {T<:BlasFloat} lmul!(transpose(A), b)
1112 @deprecate Ac_mul_B!(A::$t{T,<:StridedMatrix}, b::StridedVector{T}) where {T<:BlasReal} lmul!(adjoint(A), b)
1113 @deprecate Ac_mul_B!(A::$t{T,<:StridedMatrix}, b::StridedVector{T}) where {T<:BlasComplex} lmul!(adjoint(A), b)
1114
1115 # Matrix multiplication
1116 @deprecate A_mul_B!(A::$t{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasFloat} lmul!(A, B)
1117 @deprecate A_mul_B!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasFloat} rmul!(A, B)
1118
1119 @deprecate At_mul_B!(A::$t{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasFloat} lmul!(transpose(A), B)
1120 @deprecate Ac_mul_B!(A::$t{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasComplex} lmul!(adjoint(A), B)
1121 @deprecate Ac_mul_B!(A::$t{T,<:StridedMatrix}, B::StridedMatrix{T}) where {T<:BlasReal} lmul!(adjoint(A), B)
1122
1123 @deprecate A_mul_Bt!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasFloat} rmul!(A, transpose(B))
1124 @deprecate A_mul_Bc!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasComplex} rmul!(A, adjoint(B))
1125 @deprecate A_mul_Bc!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasReal} rmul!(A, adjoint(B))
1126
1127 # Left division
1128 @deprecate A_ldiv_B!(A::$t{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(A, B)
1129 @deprecate At_ldiv_B!(A::$t{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasFloat} ldiv!(transpose(A), B)
1130 @deprecate Ac_ldiv_B!(A::$t{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasReal} ldiv!(adjoint(A), B)
1131 @deprecate Ac_ldiv_B!(A::$t{T,<:StridedMatrix}, B::StridedVecOrMat{T}) where {T<:BlasComplex} ldiv!(adjoint(A), B)
1132
1133 # Right division
1134 @deprecate A_rdiv_B!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasFloat} rdiv!(A, B)
1135 @deprecate A_rdiv_Bt!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasFloat} rdiv!(A, transpose(B))
1136 @deprecate A_rdiv_Bc!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasReal} rdiv!(A, adjoint(B))
1137 @deprecate A_rdiv_Bc!(A::StridedMatrix{T}, B::$t{T,<:StridedMatrix}) where {T<:BlasComplex} rdiv!(A, adjoint(B))
1138 end
1139 end
1140
1141 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/rowvector.jl, to deprecate
1142 @deprecate A_rdiv_Bt(rowvec::RowVector, mat::AbstractMatrix) (/)(rowvec, transpose(mat))
1143 @deprecate A_rdiv_Bc(rowvec::RowVector, mat::AbstractMatrix) (/)(rowvec, adjoint(mat))
1144 @deprecate At_ldiv_B(mat::AbstractMatrix, rowvec::RowVector) (\)(transpose(mat), rowvec)
1145 @deprecate Ac_ldiv_B(mat::AbstractMatrix, rowvec::RowVector) (\)(adjoint(mat), rowvec)
1146 @deprecate Ac_mul_B(u::RowVector, v::AbstractVector) (*)(adjoint(u), v)
1147 @deprecate Ac_mul_B(vec::AbstractVector, mat::AbstractMatrix) (*)(adjoint(vec), mat)
1148 @deprecate Ac_mul_B(rowvec1::RowVector, rowvec2::RowVector) (*)(adjoint(rowvec1), rowvec2)
1149 @deprecate Ac_mul_B(vec::AbstractVector, rowvec::RowVector) (*)(adjoint(vec), rowvec)
1150 @deprecate Ac_mul_B(vec1::AbstractVector, vec2::AbstractVector) (*)(adjoint(vec1), vec2)
1151 @deprecate Ac_mul_Bc(rowvec::RowVector, vec::AbstractVector) (*)(adjoint(rowvec), adjoint(vec))
1152 @deprecate Ac_mul_Bc(vec::AbstractVector, mat::AbstractMatrix) (*)(adjoint(vec), adjoint(mat))
1153 @deprecate Ac_mul_Bc(rowvec1::RowVector, rowvec2::RowVector) (*)(adjoint(rowvec1), adjoint(rowvec2))
1154 @deprecate Ac_mul_Bc(vec::AbstractVector, rowvec::RowVector) (*)(adjoint(vec), adjoint(rowvec))
1155 @deprecate Ac_mul_Bc(vec::AbstractVector, rowvec::AbstractVector) (*)(adjoint(vec), adjoint(rowvec))
1156 @deprecate Ac_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) (*)(adjoint(mat), adjoint(rowvec))
1157 @deprecate A_mul_Bc(u::RowVector, v::AbstractVector) (*)(u, adjoint(v))
1158 @deprecate A_mul_Bc(rowvec::RowVector, mat::AbstractMatrix) (*)(rowvec, adjoint(mat))
1159 @deprecate A_mul_Bc(rowvec1::RowVector, rowvec2::RowVector) (*)(rowvec1, adjoint(rowvec2))
1160 @deprecate A_mul_Bc(vec::AbstractVector, rowvec::RowVector) (*)(vec, adjoint(rowvec))
1161 @deprecate A_mul_Bc(vec1::AbstractVector, vec2::AbstractVector) (*)(vec1, adjoint(vec2))
1162 @deprecate A_mul_Bc(mat::AbstractMatrix, rowvec::RowVector) (*)(mat, adjoint(rowvec))
1163 @deprecate At_mul_B(v::RowVector, u::AbstractVector) (*)(transpose(v), u)
1164 @deprecate At_mul_B(vec::AbstractVector, mat::AbstractMatrix) (*)(transpose(vec), mat)
1165 @deprecate At_mul_B(rowvec1::RowVector, rowvec2::RowVector) (*)(transpose(rowvec1), rowvec2)
1166 @deprecate At_mul_B(vec::AbstractVector, rowvec::RowVector) (*)(transpose(vec), rowvec)
1167 @deprecate At_mul_B(vec1::AbstractVector{T}, vec2::AbstractVector{T}) where {T<:Real} (*)(transpose(vec1), vec2)
1168 @deprecate At_mul_B(vec1::AbstractVector, vec2::AbstractVector) (*)(transpose(vec1), vec2)
1169 @deprecate At_mul_Bt(rowvec::RowVector, vec::AbstractVector) (*)(transpose(rowvec), transpose(vec))
1170 @deprecate At_mul_Bt(vec::AbstractVector, mat::AbstractMatrix) (*)(transpose(vec), transpose(mat))
1171 @deprecate At_mul_Bt(rowvec1::RowVector, rowvec2::RowVector) (*)(transpose(rowvec1), transpose(rowvec2))
1172 @deprecate At_mul_Bt(vec::AbstractVector, rowvec::RowVector) (*)(transpose(vec), transpose(rowvec))
1173 @deprecate At_mul_Bt(vec::AbstractVector, rowvec::AbstractVector) (*)(transpose(vec), transpose(rowvec))
1174 @deprecate At_mul_Bt(mat::AbstractMatrix, rowvec::RowVector) (*)(transpose(mat), transpose(rowvec))
1175 @deprecate A_mul_Bt(v::RowVector, A::AbstractVector) (*)(v, transpose(A))
1176 @deprecate A_mul_Bt(rowvec::RowVector, mat::AbstractMatrix) (*)(rowvec, transpose(mat))
1177 @deprecate A_mul_Bt(rowvec1::RowVector, rowvec2::RowVector) (*)(rowvec1, transpose(rowvec2))
1178 @deprecate A_mul_Bt(vec::AbstractVector, rowvec::RowVector) (*)(vec, transpose(rowvec))
1179 @deprecate A_mul_Bt(vec1::AbstractVector, vec2::AbstractVector) (*)(vec1, transpose(vec2))
1180 @deprecate A_mul_Bt(mat::AbstractMatrix, rowvec::RowVector) (*)(mat, transpose(rowvec))
1181
1182 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/linalg/givens.jl, to deprecate
1183 @deprecate A_mul_Bc!(A::AbstractMatrix, R::Rotation) rmul!(A, adjoint(R))
1184 @deprecate A_mul_B!(R::Rotation, A::AbstractMatrix) lmul!(R, A)
1185 @deprecate A_mul_B!(G::Givens, R::Rotation) lmul!(G, R)
1186 @deprecate A_mul_Bc!(A::AbstractMatrix, G::Givens) rmul!(A, adjoint(G))
1187 @deprecate A_mul_B!(G::Givens, A::AbstractVecOrMat) lmul!(G, A)
1188 @deprecate A_mul_B!(G1::Givens, G2::Givens) G1 * G2
1189 @deprecate A_mul_Bc(A::AbstractVecOrMat{T}, R::AbstractRotation{S}) where {T,S} (*)(A, adjoint(R))
1190
1191
1192 # methods involving RowVector from base/linalg/bidiag.jl, to deprecate
1193 \(::Diagonal, ::RowVector) = _mat_ldiv_rowvec_error()
1194 \(::Bidiagonal, ::RowVector) = _mat_ldiv_rowvec_error()
1195 \(::Bidiagonal{<:Number}, ::RowVector{<:Number}) = _mat_ldiv_rowvec_error()
1196 \(::Adjoint{<:Any,<:Bidiagonal}, ::RowVector) = _mat_ldiv_rowvec_error()
1197 \(::Transpose{<:Any,<:Bidiagonal}, ::RowVector) = _mat_ldiv_rowvec_error()
1198 \(::Adjoint{<:Number,<:Bidiagonal{<:Number}}, ::RowVector{<:Number}) = _mat_ldiv_rowvec_error()
1199 \(::Transpose{<:Number,<:Bidiagonal{<:Number}}, ::RowVector{<:Number}) = _mat_ldiv_rowvec_error()
1200 _mat_ldiv_rowvec_error() = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1201
1202 # methods involving RowVector from base/linalg/diagonal.jl, to deprecate
1203 *(rowvec::RowVector, D::Diagonal) = rvtranspose(D * rvtranspose(rowvec)) # seems potentially incorrect without also transposing D?
1204 *(D::Diagonal, transrowvec::Transpose{<:Any,<:RowVector}) = (rowvec = transrowvec.parent; D*rvtranspose(rowvec))
1205 *(D::Diagonal, adjrowvec::Adjoint{<:Any,<:RowVector}) = (rowvec = adjrowvec.parent; D*rvadjoint(rowvec))
1206
1207 # methods involving RowVector from base/linalg/qr.jl, to deprecate
1208 *(rowvec::RowVector, adjB::Adjoint{<:Any,<:AbstractQ}) = (B = adjB.parent; rvadjoint(B*rvadjoint(rowvec)))
1209
1210 # methods involving RowVector from base/linalg/qr.jl, to deprecate
1211 *(A::RowVector, B::Adjoint{<:Any,<:AbstractRotation}) = A * adjoint(B.parent)
1212
1213 # methods involving RowVector from base/linalg/generic.jl, to deprecate
1214 norm(tv::RowVector, q::Real) = q == Inf ? norm(rvtranspose(tv), 1) : norm(rvtranspose(tv), q/(q-1))
1215 norm(tv::RowVector) = norm(rvtranspose(tv))
1216
1217 # methods involving RowVector from base/linalg/factorization.jl, to deprecate
1218 \(A::Adjoint{<:Any,<:Factorization}, B::RowVector) = adjoint(A.parent) \ B
1219 \(A::Transpose{<:Any,<:Factorization}, B::RowVector) = transpose(A.parent) \ B
1220 \(A::Transpose{<:Any,<:Factorization{<:Real}}, B::RowVector) = transpose(A.parent) \ B
1221
1222 # methods involving RowVector from base/linalg/symmetric.jl, to deprecate
1223 *(A::RowVector, transB::Transpose{<:Any,<:RealHermSymComplexSym}) = A * transB.parent
1224 *(A::RowVector, adjB::Adjoint{<:Any,<:RealHermSymComplexHerm}) = A * adjB.parent
1225 \(A::HermOrSym{<:Any,<:StridedMatrix}, B::RowVector) = invoke(\, Tuple{AbstractMatrix, RowVector}, A, B)
1226 *(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B
1227 *(A::Adjoint{<:Any,<:RealHermSymComplexHerm}, B::Transpose{<:Any,<:RowVector}) = A.parent * B
1228 *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Adjoint{<:Any,<:RowVector}) = A.parent * B
1229 *(A::Transpose{<:Any,<:RealHermSymComplexSym}, B::Transpose{<:Any,<:RowVector}) = A.parent * B
1230
1231 # methods involving RowVector from base/linalg/triangular.jl, to deprecate
1232 *(rowvec::RowVector, A::AbstractTriangular) = rvtranspose(transpose(A) * rvtranspose(rowvec))
1233 *(rowvec::RowVector, transA::Transpose{<:Any,<:AbstractTriangular}) = rvtranspose(transA.parent * rvtranspose(rowvec))
1234 *(A::AbstractTriangular, transrowvec::Transpose{<:Any,<:RowVector}) = A * rvtranspose(transrowvec.parent)
1235 *(transA::Transpose{<:Any,<:AbstractTriangular}, transrowvec::Transpose{<:Any,<:RowVector}) = transA * rvtranspose(transrowvec.parent)
1236 *(rowvec::RowVector, adjA::Adjoint{<:Any,<:AbstractTriangular}) = rvadjoint(adjA.parent * rvadjoint(rowvec))
1237 *(A::AbstractTriangular, adjrowvec::Adjoint{<:Any,<:RowVector}) = A * rvadjoint(adjrowvec.parent)
1238 *(adjA::Adjoint{<:Any,<:AbstractTriangular}, adjrowvec::Adjoint{<:Any,<:RowVector}) = adjA * rvadjoint(adjrowvec.parent)
1239 \(::Union{UpperTriangular,LowerTriangular}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1240 \(::Union{UnitUpperTriangular,UnitLowerTriangular}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1241 \(::Adjoint{<:Any,<:Union{UpperTriangular,LowerTriangular}}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1242 \(::Adjoint{<:Any,<:Union{UnitUpperTriangular,UnitLowerTriangular}}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1243 \(::Transpose{<:Any,<:Union{UpperTriangular,LowerTriangular}}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1244 \(::Transpose{<:Any,<:Union{UnitUpperTriangular,UnitLowerTriangular}}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
1245 /(rowvec::RowVector, A::Union{UpperTriangular,LowerTriangular}) = rvtranspose(transpose(A) \ rvtranspose(rowvec))
1246 /(rowvec::RowVector, A::Union{UnitUpperTriangular,UnitLowerTriangular}) = rvtranspose(transpose(A) \ rvtranspose(rowvec))
1247 /(rowvec::RowVector, transA::Transpose{<:Any,<:Union{UpperTriangular,LowerTriangular}}) = rvtranspose(transA.parent \ rvtranspose(rowvec))
1248 /(rowvec::RowVector, transA::Transpose{<:Any,<:Union{UnitUpperTriangular,UnitLowerTriangular}}) = rvtranspose(transA.parent \ rvtranspose(rowvec))
1249 /(rowvec::RowVector, adjA::Adjoint{<:Any,<:Union{UpperTriangular,LowerTriangular}}) = /(rowvec, adjoint(adjA.parent))
1250 /(rowvec::RowVector, adjA::Adjoint{<:Any,<:Union{UnitUpperTriangular,UnitLowerTriangular}}) = /(rowvec, adjoint(adjA.parent))
1251 *(A::Adjoint{<:Any,<:AbstractTriangular}, B::Transpose{<:Any,<:RowVector}) = A * rvtranspose(B.parent)
1252 *(A::Transpose{<:Any,<:AbstractTriangular}, B::Adjoint{<:Any,<:RowVector}) = A * rvadjoint(B.parent)
1253
1254 @deprecate *(A::LQ,B::QR) A*Matrix(B)
1255 @deprecate *(A::QR,B::LQ) A*Matrix(B)
1256 @deprecate *(A::Adjoint{<:Any,<:LQ}, B::LQ) A*Matrix(B)
1257 @deprecate *(A::LQ, B::Adjoint{<:Any,<:LQ}) A*Matrix(B)
1258
1259 # PR #25184. Use getproperty instead of getindex for Factorizations
1260 function getindex(F::Factorization, s::Symbol)
1261 depwarn("`F[:$s]` is deprecated, use `F.$s` instead.", :getindex)
1262 return getproperty(F, s)
1263 end
1264 @deprecate getq(F::Factorization) F.Q
1265
1266 # Deprecate scaling
1267 @deprecate scale!(A::AbstractArray, b::Number) rmul!(A, b)
1268 @deprecate scale!(a::Number, B::AbstractArray) lmul!(a, B)
1269 @deprecate scale!(A::AbstractMatrix, b::AbstractVector) rmul!(A, Diagonal(b))
1270 @deprecate scale!(a::AbstractVector, B::AbstractMatrix) lmul!(Diagonal(a), B)
1271 @deprecate scale!(C::AbstractMatrix, A::AbstractMatrix, b::AbstractVector) mul!(C, A, Diagonal(b))
1272 @deprecate scale!(C::AbstractMatrix, a::AbstractVector, B::AbstractMatrix) mul!(C, Diagonal(a), B)
1273
1274 Base.@deprecate_binding trace tr
1275
1276 # deprecate lufact to lu
1277 export lufact
1278 @deprecate(lufact(S::LU), lu(S))
1279 @deprecate(lufact(x::Number), lu(x))
1280 @deprecate(lufact(A::AbstractMatrix{T}) where T, lu(A))
1281 @deprecate(lufact(A::AbstractMatrix{T}, pivot::Union{Val{false}, Val{true}}) where T, lu(A, pivot))
1282 @deprecate(lufact(A::Union{AbstractMatrix{T}, AbstractMatrix{Complex{T}}}, pivot::Union{Val{false}, Val{true}} = Val(true)) where {T<:AbstractFloat}, lu(A, pivot))
1283
1284 # deprecate schurfact to schur
1285 export schurfact
1286 @deprecate(schurfact(A::StridedMatrix{<:BlasFloat}), schur(A))
1287 @deprecate(schurfact(A::StridedMatrix{T}) where T, schur(A))
1288 @deprecate(schurfact(A::StridedMatrix{T},B::StridedMatrix{T}) where {T<:BlasFloat}, schur(A))
1289 @deprecate(schurfact(A::StridedMatrix{TA}, B::StridedMatrix{TB}) where {TA,TB}, schur(A))
1290
1291 # deprecate lqfact to lq
1292 export lqfact
1293 @deprecate lqfact(A::StridedMatrix{<:BlasFloat}) lq(A)
1294 @deprecate lqfact(x::Number) lq(x)
1295
1296 # deprecate qrfact to qr
1297 export qrfact
1298 @deprecate(qrfact(x::Number), qr(x))
1299 @deprecate(qrfact(v::AbstractVector), qr(v))
1300 @deprecate(qrfact(A::AbstractMatrix{T}) where T, qr(A))
1301 @deprecate(qrfact(A::AbstractMatrix{T}, arg) where T, qr(A, arg))
1302
1303 # deprecate ldltfact to ldlt
1304 export ldltfact
1305 @deprecate(ldltfact(M::SymTridiagonal{T}) where T, ldlt(M))
1306
1307 # deprecate lufact! to lu!
1308 # lufact! exported in a deprecation above
1309 @deprecate(lufact!(A::StridedMatrix{T}, pivot::Union{Val{false}, Val{true}} = Val(true)) where T<:BlasFloat, lufact!(A, pivot))
1310 @deprecate(lufact!(A::HermOrSym, pivot::Union{Val{false}, Val{true}} = Val(true)), lu!(A, pivot))
1311 @deprecate(lufact!(A::StridedMatrix, pivot::Union{Val{false}, Val{true}} = Val(true)), lu!(A, pivot))
1312 @deprecate(lufact!(A::Tridiagonal{T,V}, pivot::Union{Val{false}, Val{true}} = Val(true)) where {T,V}, lu!(A, pivot))
1313
1314 # deprecate schurfact! to schur!
1315 export schurfact!
1316 @deprecate(schurfact!(A::StridedMatrix{T}, B::StridedMatrix{T}) where {T<:BlasFloat}, schur!(A, B))
1317 @deprecate(schurfact!(A::StridedMatrix{<:BlasFloat}), schur!(A))
1318
1319 # deprecate lqfact! to lq!
1320 export lqfact!
1321 @deprecate(lqfact!(A::StridedMatrix{<:BlasFloat}), lq!(A))
1322
1323 # deprecate qrfact! to qr!
1324 export qrfact!
1325 @deprecate(qrfact!(A::StridedMatrix{<:BlasFloat}, ::Val{false}), qr!(A, Val(false)))
1326 @deprecate(qrfact!(A::StridedMatrix{<:BlasFloat}, ::Val{true}), qr!(A, Val(true)))
1327 @deprecate(qrfact!(A::StridedMatrix{<:BlasFloat}), qr!(A))
1328 @deprecate(qrfact!(A::StridedMatrix, ::Val{false}), qr!(A, Val(false)))
1329 @deprecate(qrfact!(A::StridedMatrix, ::Val{true}), qr!(A, Val(true)))
1330 @deprecate(qrfact!(A::StridedMatrix), qr!(A))
1331
1332 # deprecate ldltfact! to ldlt!
1333 export ldltfact!
1334 @deprecate(ldltfact!(S::SymTridiagonal{T,V}) where {T<:Real,V}, ldlt!(S))
1335
1336 # deprecate svdfact! to svd!
1337 export svdfact!
1338 @deprecate(svdfact!(M::Bidiagonal{<:BlasReal}; full::Bool = false, thin::Union{Bool,Nothing} = nothing), svd!(M; full=full, thin=thin))
1339 @deprecate(svdfact!(A::StridedMatrix{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T<:BlasFloat, svd!(A; full=full, thin=thin))
1340 @deprecate(svdfact!(A::StridedMatrix{T}, B::StridedMatrix{T}) where T<:BlasFloat, svd!(A, B))
1341 @deprecate(svdfact!(A::AbstractTriangular), svd!(A))
1342
1343 # deprecate svdfact to svd
1344 export svdfact
1345 @deprecate(svdfact(D::Diagonal), svd(D))
1346 @deprecate(svdfact(A::StridedVecOrMat{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T, svd(A; full=full, thin=thin))
1347 @deprecate(svdfact(x::Number; full::Bool = false, thin::Union{Bool,Nothing} = nothing), svd(x; full=full, thin=thin))
1348 @deprecate(svdfact(x::Integer; full::Bool = false, thin::Union{Bool,Nothing} = nothing), svd(x; full=full, thin=thin))
1349 @deprecate(svdfact(A::StridedMatrix{T}, B::StridedMatrix{T}) where {T<:BlasFloat}, svd(A, B))
1350 @deprecate(svdfact(A::StridedMatrix{TA}, B::StridedMatrix{TB}) where {TA,TB}, svd(A, B))
1351 @deprecate(svdfact(x::Number, y::Number), svd(x, y))
1352 @deprecate(svdfact(M::Bidiagonal; full::Bool = false, thin::Union{Bool,Nothing} = nothing), svd(M; full=full, thin=thin))
1353 @deprecate(svdfact(A::AbstractTriangular), svd(A))
1354
1355 # deprecate bkfact to bunchkaufman
1356 # bkfact exported in a deprecation above
1357 @deprecate(bkfact(A::AbstractMatrix{T}, rook::Bool=false) where {T}, bunchkaufman(A, rook))
1358
1359 # deprecate bkfact! to bunchkaufman!
1360 export bkfact!
1361 @deprecate(bkfact!(A::RealHermSymComplexSym{T,S} where {T<:BlasReal,S<:StridedMatrix}, rook::Bool = false), bunchkaufman!(A, rook))
1362 @deprecate(bkfact!(A::Hermitian{T,S} where {T<:BlasComplex,S<:StridedMatrix{T}}, rook::Bool = false), bunchkaufman!(A, rook))
1363 @deprecate(bkfact!(A::StridedMatrix{<:BlasFloat}, rook::Bool = false), bunchkaufman!(A, rook))
1364
1365 # deprecate hessfact to hessenberg
1366 export hessfact
1367 @deprecate(hessfact(A::StridedMatrix{<:BlasFloat}), hessenberg(A))
1368 @deprecate(hessfact(A::StridedMatrix{T}) where T, hessenberg(A))
1369
1370 # deprecate hessfact! to hessenberg!
1371 export hessenberg!
1372 @deprecate(hessfact!(A::StridedMatrix{<:BlasFloat}), hessenberg!(A))
1373
1374 # deprecate eigfact to eigen
1375 export eigfact
1376 @deprecate(eigfact(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true) where T, eigen(A; permute=permute, scale=scale))
1377 @deprecate(eigfact(x::Number), eigen(x))
1378 @deprecate(eigfact(A::AbstractMatrix{TA}, B::AbstractMatrix{TB}) where {TA,TB}, eigen(A, B))
1379 @deprecate(eigfact(A::Number, B::Number), eigen(A, B))
1380
1381 @deprecate(eigfact(A::SymTridiagonal{T}) where T, eigen(A))
1382 @deprecate(eigfact(A::SymTridiagonal{T}, irange::UnitRange) where T, eigen(A))
1383 @deprecate(eigfact(A::SymTridiagonal{T}, vl::Real, vu::Real) where T, eigen(A))
1384
1385 @deprecate(eigfact(M::Bidiagonal), eigen(M))
1386
1387 @deprecate(eigfact(A::RealHermSymComplexHerm), eigen(A))
1388 @deprecate(eigfact(A::RealHermSymComplexHerm, irange::UnitRange), eigen(A, irange))
1389 @deprecate(eigfact(A::RealHermSymComplexHerm, vl::Real, vh::Real), eigen(A, vl, vh))
1390 @deprecate(eigfact(A::AbstractTriangular), eigen(A))
1391 @deprecate(eigfact(D::Diagonal; permute::Bool=true, scale::Bool=true), eigen(D; permute=permute, scale=scale))
1392
1393 # deprecate eigfact! to eigen!
1394 export eigfact!
1395 @deprecate(eigfact!(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true) where T<:BlasReal, eigen!(A; permute=permute, scale=scale))
1396 @deprecate(eigfact!(A::StridedMatrix{T}; permute::Bool=true, scale::Bool=true) where T<:BlasComplex, eigen!(A; permute=permute, scale=scale))
1397 @deprecate(eigfact!(A::StridedMatrix{T}, B::StridedMatrix{T}) where T<:BlasReal, eigen!(A, B))
1398 @deprecate(eigfact!(A::StridedMatrix{T}, B::StridedMatrix{T}) where T<:BlasComplex, eigen!(A, B))
1399
1400 @deprecate(eigfact!(A::SymTridiagonal{<:BlasReal}), eigen!(A))
1401 @deprecate(eigfact!(A::SymTridiagonal{<:BlasReal}, irange::UnitRange), eigen!(A, irange))
1402 @deprecate(eigfact!(A::SymTridiagonal{<:BlasReal}, vl::Real, vu::Real), eigen!(A, vl, vu))
1403
1404 @deprecate(eigfact!(A::RealHermSymComplexHerm{<:BlasReal,<:StridedMatrix}), eigen!(A))
1405 @deprecate(eigfact!(A::RealHermSymComplexHerm{<:BlasReal,<:StridedMatrix}, irange::UnitRange), eigen!(A, irange))
1406 @deprecate(eigfact!(A::RealHermSymComplexHerm{T,<:StridedMatrix}, vl::Real, vh::Real) where {T<:BlasReal}, eigen!(A, vl, vh))
1407 @deprecate(eigfact!(A::HermOrSym{T,S}, B::HermOrSym{T,S}) where {T<:BlasReal,S<:StridedMatrix}, eigen!(A, B))
1408 @deprecate(eigfact!(A::Hermitian{T,S}, B::Hermitian{T,S}) where {T<:BlasComplex,S<:StridedMatrix}, eigen!(A, B))
1409
1410 # deprecate cholfact to cholesky
1411 # cholfact exported from deprecation above
1412 @deprecate(cholfact(A::Union{StridedMatrix,RealHermSymComplexHerm{<:Real,<:StridedMatrix}}, ::Val{false}=Val(false)), cholesky(A, Val(false)))
1413 @deprecate(cholfact(A::Union{StridedMatrix,RealHermSymComplexHerm{<:Real,<:StridedMatrix}}, ::Val{true}; tol = 0.0), cholesky(A, Val(true); tol=tol))
1414 @deprecate(cholfact(x::Number, uplo::Symbol=:U), cholesky(x, uplo))
1415
1416 # deprecate cholfact! to cholesky!
1417 # cholfact! exported from deprecation above
1418 @deprecate(cholfact!(A::RealHermSymComplexHerm, ::Val{false}=Val(false)), cholesky!(A, Val(false)))
1419 @deprecate(cholfact!(A::StridedMatrix, ::Val{false}=Val(false)), cholesky!(A, Val(false)))
1420 @deprecate(cholfact!(A::RealHermSymComplexHerm{<:BlasReal,<:StridedMatrix}, ::Val{true}; tol = 0.0), cholesky!(A, Val(true); tol=tol))
1421 @deprecate(cholfact!(A::RealHermSymComplexHerm{<:Real}, ::Val{true}; tol = 0.0), cholesky!(A, Val(true); tol=tol))
1422 @deprecate(cholfact!(A::StridedMatrix, ::Val{true}; tol = 0.0), cholesky!(A, Val(true); tol=tol))
1423
1424 # deprecate chol[!] to cholesky[!] with getproperty
1425 @deprecate(chol(A::RealHermSymComplexHerm), cholesky(A).U)
1426 @deprecate(chol(A::AbstractMatrix), cholesky(A).U)
1427 @deprecate(chol(x::Number, args...), sqrt(x))
1428 @deprecate(chol(J::UniformScaling), UniformScaling(sqrt(J.λ)))
1429 @deprecate(chol!(A::RealHermSymComplexHerm{<:Real,<:StridedMatrix}), cholesky!(A).U, false)
1430 @deprecate(chol!(A::StridedMatrix), cholesky!(A).U, false)
1431
1432 # deprecate eig in favor of eigen and destructuring via iteration
1433 # deprecate eig(...) in favor of eigfact and factorization destructuring
1434 export eig
1435 function eig(A::Union{Number, StridedMatrix}; permute::Bool=true, scale::Bool=true)
1436 depwarn(string("`eig(A[, permute, scale])` has been deprecated in favor of ",
1437 "`eigen(A[, permute, scale])`. Whereas `eig(A[, permute, scale])` ",
1438 "returns a tuple of arrays, `eigen(A[, permute, scale])` returns ",
1439 "an `Eigen` object. So for a direct replacement, use ",
1440 "`(eigen(A[, permute, scale])...,)`. But going forward, consider ",
1441 "using the direct result of `eigen(A[, permute, scale])` instead, ",
1442 "either destructured into its components ",
1443 "(`vals, vecs = eigen(A[, permute, scale])`) ",
1444 "or as an `Eigen` object (`X = eigen(A[, permute, scale])`)."), :eig)
1445 return (eigen(A; permute=permute, scale=scale)...,)
1446 end
1447 function eig(A::AbstractMatrix, args...)
1448 depwarn(string("`eig(A, args...)` has been deprecated in favor of ",
1449 "`eigen(A, args...)`. Whereas `eig(A, args....)` ",
1450 "returns a tuple of arrays, `eigen(A, args...)` returns ",
1451 "an `Eigen` object. So for a direct replacement, use ",
1452 "`(eigen(A, args...)...,)`. But going forward, consider ",
1453 "using the direct result of `eigen(A, args...)` instead, ",
1454 "either destructured into its components ",
1455 "(`vals, vecs = eigen(A, args...)`) ",
1456 "or as an `Eigen` object (`X = eigen(A, args...)`)."), :eig)
1457 return (eigen(A, args...)...,)
1458 end
1459 eig(A::AbstractMatrix, B::AbstractMatrix) = _geneig(A, B)
1460 eig(A::Number, B::Number) = _geneig(A, B)
1461 function _geneig(A, B)
1462 depwarn(string("`eig(A::AbstractMatrix, B::AbstractMatrix)` and ",
1463 "`eig(A::Number, B::Number)` have been deprecated in favor of ",
1464 "`eigen(A, B)`. Whereas the former each return a tuple of arrays, ",
1465 "the latter returns a `GeneralizedEigen` object. So for a direct ",
1466 "replacement, use `(eigen(A, B)...,)`. But going forward, consider ",
1467 "using the direct result of `eigen(A, B)` instead, either ",
1468 "destructured into its components (`vals, vecs = eigen(A, B)`), ",
1469 "or as a `GeneralizedEigen` object (`X = eigen(A, B)`)."), :eig)
1470 return (eigen(A, B)...,)
1471 end
1472
1473 # deprecate transitional decomposition getindex methods out of the blocks
1474 function Base.getindex(S::LU, i::Integer)
1475 depwarn(string("decomposition functions (e.g. `lu`) now return decomposition ",
1476 "objects (e.g. `LU`), and indexing such objects is deprecated. Instead ",
1477 "extract components via their accessors (e.g. `X.L`, `X.S`, and `X.p` for ",
1478 "`X::LU`), or destructure the decomposition via iteration ",
1479 "(e.g. `l, u, p = X` for `X::LU`)."), :getindex)
1480 i == 1 ? (return S.L) :
1481 i == 2 ? (return S.U) :
1482 i == 3 ? (return S.p) :
1483 throw(BoundsError(S, i))
1484 end
1485 function Base.getindex(S::Union{Eigen,GeneralizedEigen}, i::Integer)
1486 depwarn(string("decomposition functions (e.g. `eig`) now return decomposition ",
1487 "objects (e.g. `Eigen` and `GeneralizedEigen`), and indexing such objects ",
1488 "is deprecated. Instead extract components via their accessors ",
1489 "(e.g. `X.values` and `X.vectors` for `X::Union{Eigen,GeneralizedEigen}`), ",
1490 "or destructure the decomposition via iteration ",
1491 "(e.g. `vals, vecs = X` for `X::Union{Eigen,GeneralizedEigen}`)."), :getindex)
1492 i == 1 ? (return S.values) :
1493 i == 2 ? (return S.vectors) :
1494 throw(BoundsError(S, i))
1495 end
1496 function Base.getindex(S::Schur, i::Integer)
1497 depwarn(string("decomposition functions (e.g. `schur`) now return decomposition ",
1498 "objects (e.g. `Schur`), and indexing such objects ",
1499 "is deprecated. Instead extract components via their accessors ",
1500 "(e.g. `X.T`, `X.Z`, and `X.values` for `X::Schur`), ",
1501 "or destructure the decomposition via iteration ",
1502 "(e.g. `t, z, vals = X` for `X::Schur`)."), :getindex)
1503 i == 1 ? (return S.T) :
1504 i == 2 ? (return S.Z) :
1505 i == 3 ? (return S.values) :
1506 throw(BoundsError(S, i))
1507 end
1508 function Base.getindex(S::GeneralizedSchur, i::Integer)
1509 depwarn(string("decomposition functions (e.g. `schur`) now return decomposition ",
1510 "objects (e.g. `GeneralizedSchur`), and indexing such objects ",
1511 "is deprecated. Instead extract components via their accessors ",
1512 "(e.g. `X.S`, `X.T`, `X.Q`, `X.Z`, `X.α`, and `X.β` for `X::GeneralizedSchur`), ",
1513 "or destructure the decomposition via iteration ",
1514 "(e.g. `s, t, q, z, α, β = X` for `X::GeneralizedSchur`)."), :getindex)
1515 i == 1 ? (return S.S) :
1516 i == 2 ? (return S.T) :
1517 i == 3 ? (return S.Q) :
1518 i == 4 ? (return S.Z) :
1519 i == 5 ? (return S.α) :
1520 i == 6 ? (return S.β) :
1521 throw(BoundsError(S, i))
1522 end
1523 function Base.getindex(S::LQ, i::Integer)
1524 depwarn(string("decomposition functions (e.g. `lq`) now return decomposition ",
1525 "objects (e.g. `LQ`), and indexing such objects ",
1526 "is deprecated. Instead extract components via their accessors ",
1527 "(e.g. `X.L` and `X.Q` for `X::LQ`), ",
1528 "or destructure the decomposition via iteration ",
1529 "(e.g. `l, q = X` for `X::LQ`)."), :getindex)
1530 i == 1 ? (return S.L) :
1531 i == 2 ? (return S.Q) :
1532 throw(BoundsError(S, i))
1533 end
1534 function Base.getindex(S::QR, i::Integer)
1535 depwarn(string("decomposition functions (e.g. `qr`) now return decomposition ",
1536 "objects (e.g. `QR`), and indexing such objects ",
1537 "is deprecated. Instead extract components via their accessors ",
1538 "(e.g. `X.Q` and `X.R` for `X::QR`), ",
1539 "or destructure the decomposition via iteration ",
1540 "(e.g. `q, r = X` for `X::QR`)."), :getindex)
1541 i == 1 ? (return S.Q) :
1542 i == 2 ? (return S.R) :
1543 throw(BoundsError(S, i))
1544 end
1545 function Base.getindex(S::QRCompactWY, i::Integer)
1546 depwarn(string("decomposition functions (e.g. `qr`) now return decomposition ",
1547 "objects (e.g. `QRCompactWY`), and indexing such objects ",
1548 "is deprecated. Instead extract components via their accessors ",
1549 "(e.g. `X.Q` and `X.R` for `X::QR`), ",
1550 "or destructure the decomposition via iteration ",
1551 "(e.g. `q, r = X` for `X::QR`)."), :getindex)
1552 i == 1 ? (return S.Q) :
1553 i == 2 ? (return S.R) :
1554 throw(BoundsError(S, i))
1555 end
1556 function Base.getindex(S::QRPivoted, i::Integer)
1557 depwarn(string("decomposition functions (e.g. `qr`) now return decomposition ",
1558 "objects (e.g. `QRPivoted`), and indexing such objects ",
1559 "is deprecated. Instead extract components via their accessors ",
1560 "(e.g. `X.Q`, `X.R`, and `X.p` for `X::QRPivoted`), ",
1561 "or destructure the decomposition via iteration ",
1562 "(e.g. `q, r, p = X` for `X::QRPivoted`)."), :getindex)
1563 i == 1 ? (return S.Q) :
1564 i == 2 ? (return S.R) :
1565 i == 3 ? (return S.p) :
1566 throw(BoundsError(S, i))
1567 end
1568 function Base.getindex(S::SVD, i::Integer)
1569 depwarn(string("decomposition functions (e.g. `svd`) now return decomposition ",
1570 "objects (e.g. `SVD`), and indexing such objects ",
1571 "is deprecated. Instead extract components via their accessors ",
1572 "(e.g. `X.U`, `X.S`, and `X.V` for `X::SVD`), ",
1573 "or destructure the decomposition via iteration ",
1574 "(e.g. `u, s, v = X` for `X::SVD`)."), :getindex)
1575 i == 1 ? (return S.U) :
1576 i == 2 ? (return S.S) :
1577 i == 3 ? (return S.V) :
1578 throw(BoundsError(S, i))
1579 end
1580 function Base.getindex(S::GeneralizedSVD, i::Integer)
1581 depwarn(string("decomposition functions (e.g. `svd`) now return decomposition ",
1582 "objects (e.g. `GeneralizedSVD`), and indexing such objects ",
1583 "is deprecated. Instead extract components via their accessors ",
1584 "(e.g. `X.U`, `X.V`, `X.Q`, `X.D1`, `X.D2`, and `X.R0` for `X::GeneralizedSVD`), ",
1585 "or destructure the decomposition via iteration ",
1586 "(e.g. `u, v, q, d1, d2, r0 = X` for `X::GeneralizedSVD`)."), :getindex)
1587 i == 1 ? (return S.U) :
1588 i == 2 ? (return S.V) :
1589 i == 3 ? (return S.Q) :
1590 i == 4 ? (return S.D1) :
1591 i == 5 ? (return S.D2) :
1592 i == 6 ? (return S.R0) :
1593 throw(BoundsError(S, i))
1594 end
1595
1596 # deprecate two ordschur methods where the individual components are passed instead of
1597 # the factorization
1598
1599 function ordschur!(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}
1600 depwarn(string("`ordschur!(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})`",
1601 "`where {Ty<:BlasFloat}` is deprecated, use `ordschur!(schur::Schur, select::Union{Vector{Bool},BitVector})`", "instead."), :ordschur!)
1602 return LinearAlgebra.LAPACK.trsen!(convert(Vector{BlasInt}, select), T, Z)[1:3]
1603 end
1604
1605 function ordschur(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}
1606 depwarn(string("`ordschur!(T::StridedMatrix{Ty}, Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector})`",
1607 "`where {Ty<:BlasFloat}` is deprecated, use `ordschur(schur::Schur, select::Union{Vector{Bool},BitVector})`", "instead."), :ordschur)
1608 return ordschur!(copy(T), copy(Z), select)
1609 end
1610
1611 function ordschur!(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},
1612 Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}
1613 depwarn(string("`ordschur!(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},`",
1614 "`Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}`",
1615 "is deprecated, use `ordschur!(gschur::GeneralizedSchur, select::Union{Vector{Bool},BitVector})`",
1616 "instead."), :ordschur!)
1617 return LinearAlgebra.LAPACK.tgsen!(convert(Vector{BlasInt}, select), S, T, Q, Z)
1618 end
1619
1620 function ordschur(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},
1621 Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}
1622 depwarn(string("`ordschur(S::StridedMatrix{Ty}, T::StridedMatrix{Ty}, Q::StridedMatrix{Ty},`",
1623 "`Z::StridedMatrix{Ty}, select::Union{Vector{Bool},BitVector}) where {Ty<:BlasFloat}`",
1624 "is deprecated, use `ordschur(gschur::GeneralizedSchur, select::Union{Vector{Bool},BitVector})`",
1625 "instead."), :ordschur)
1626 return ordschur!(copy(S), copy(T), copy(Q), copy(Z), select)
1627 end
321321
322322 Multiplication with respect to either full/square or non-full/square `Q` is allowed, i.e. both `F.Q*F.R`
323323 and `F.Q*A` are supported. A `Q` matrix can be converted into a regular matrix with
324 [`Matrix`](@ref).
324 [`Matrix`](@ref). This operation returns the "thin" Q factor, i.e., if `A` is `m`×`n` with `m>=n`, then
325 `Matrix(F.Q)` yields an `m`×`n` matrix with orthonormal columns. To retrieve the "full" Q factor, an
326 `m`×`m` orthogonal matrix, use `F.Q*Matrix(I,m,m)`. If `m<=n`, then `Matrix(F.Q)` yields an `m`×`m`
327 orthogonal matrix.
325328
326329 # Examples
327330 ```jldoctest
+0
-62
stdlib/LinearAlgebra/src/rowvector.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 # TODO: remove the type stubs below between 0.7 and 1.0
3
4 """
5 RowVector(vector)
6
7 A lazy-view wrapper of an [`AbstractVector`](@ref), which turns a length-`n` vector into a `1×n`
8 shaped row vector and represents the transpose of a vector (the elements are also transposed
9 recursively).
10
11 By convention, a vector can be multiplied by a matrix on its left (`A * v`) whereas a row
12 vector can be multiplied by a matrix on its right (such that `RowVector(v) * A = RowVector(transpose(A) * v)`). It
13 differs from a `1×n`-sized matrix by the facts that its transpose returns a vector and the
14 dot product `RowVector(v1) * v2` returns a scalar, but will otherwise behave similarly.
15
16 # Examples
17 ```jldoctest
18 julia> a = [1; 2; 3; 4]
19 4-element Array{Int64,1}:
20 1
21 2
22 3
23 4
24
25 julia> RowVector(a)
26 1×4 RowVector{Int64,Array{Int64,1}}:
27 1 2 3 4
28
29 julia> RowVector(a)[3]
30 3
31
32 julia> RowVector(a)[1,3]
33 3
34
35 julia> RowVector(a)[3,1]
36 ERROR: BoundsError: attempt to access 1×4 RowVector{Int64,Array{Int64,1}} at index [3, 1]
37 [...]
38
39 julia> RowVector(a)*a
40 30
41
42 julia> B = [1 2; 3 4; 5 6; 7 8]
43 4×2 Array{Int64,2}:
44 1 2
45 3 4
46 5 6
47 7 8
48
49 julia> RowVector(a)*B
50 1×2 RowVector{Int64,Array{Int64,1}}:
51 50 60
52 ```
53 """
54 struct RowVector{T,V<:AbstractVector} <: AbstractMatrix{T}
55 vec::V
56 function RowVector{T,V}(v::V) where V<:AbstractVector where T
57 check_types(T,v)
58 new(v)
59 end
60 end
61 const ConjRowVector{T,CV<:ConjVector} = RowVector{T,CV}
141141 _small_enough(A::Tridiagonal) = size(A, 1) <= 2
142142 _small_enough(A::SymTridiagonal) = size(A, 1) <= 2
143143
144 # TODO: Add Diagonal to this method when 0.7 deprecations are removed
145 function fill!(A::Union{Bidiagonal,Tridiagonal,SymTridiagonal}, x)
144 function fill!(A::Union{Diagonal,Bidiagonal,Tridiagonal,SymTridiagonal}, x)
146145 xT = convert(eltype(A), x)
147146 (iszero(xT) || _small_enough(A)) && return fillstored!(A, xT)
148147 throw(ArgumentError("array of type $(typeof(A)) and size $(size(A)) can
5454 0.0 0.0 -2.0 0.0 0.0
5555 ```
5656 """
57 function svd!(A::StridedMatrix{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T<:BlasFloat
58 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
59 if thin != nothing
60 Base.depwarn(string("the `thin` keyword argument in `svd!(A; thin = $(thin))` has ",
61 "been deprecated in favor of `full`, which has the opposite meaning, ",
62 "e.g. `svd!(A; full = $(!thin))`."), :svd!)
63 full::Bool = !thin
64 end
57 function svd!(A::StridedMatrix{T}; full::Bool = false) where T<:BlasFloat
6558 m,n = size(A)
6659 if m == 0 || n == 0
6760 u,s,vt = (Matrix{T}(I, m, full ? m : n), real(zeros(T,0)), Matrix{T}(I, n, n))
108101 0.0 2.0 0.0 0.0 0.0
109102 ```
110103 """
111 function svd(A::StridedVecOrMat{T}; full::Bool = false, thin::Union{Bool,Nothing} = nothing) where T
112 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
113 if thin != nothing
114 Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ",
115 "been deprecated in favor of `full`, which has the opposite meaning, ",
116 "e.g. `svd(A; full = $(!thin))`."), :svd)
117 full::Bool = !thin
118 end
104 function svd(A::StridedVecOrMat{T}; full::Bool = false) where T
119105 svd!(copy_oftype(A, eigtype(T)), full = full)
120106 end
121 function svd(x::Number; full::Bool = false, thin::Union{Bool,Nothing} = nothing)
122 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
123 if thin != nothing
124 Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ",
125 "been deprecated in favor of `full`, which has the opposite meaning, ",
126 "e.g. `svd(A; full = $(!thin))`."), :svd)
127 full::Bool = !thin
128 end
129 return SVD(x == 0 ? fill(one(x), 1, 1) : fill(x/abs(x), 1, 1), [abs(x)], fill(one(x), 1, 1))
130 end
131 function svd(x::Integer; full::Bool = false, thin::Union{Bool,Nothing} = nothing)
132 # DEPRECATION TODO: remove deprecated thin argument and associated logic after 0.7
133 if thin != nothing
134 Base.depwarn(string("the `thin` keyword argument in `svd(A; thin = $(thin))` has ",
135 "been deprecated in favor of `full`, which has the opposite meaning, ",
136 "e.g. `svd(A; full = $(!thin))`."), :svd)
137 full::Bool = !thin
138 end
139 return svd(float(x), full = full)
107 function svd(x::Number; full::Bool = false)
108 SVD(x == 0 ? fill(one(x), 1, 1) : fill(x/abs(x), 1, 1), [abs(x)], fill(one(x), 1, 1))
109 end
110 function svd(x::Integer; full::Bool = false)
111 svd(float(x), full = full)
140112 end
141113 function svd(A::Adjoint; full::Bool = false)
142114 s = svd(A.parent, full = full)
4343 end
4444 @test eltype(Bidiagonal{elty}([1,2,3,4], [1.0f0,2.0f0,3.0f0], :U)) == elty
4545 @test isa(Bidiagonal{elty,Vector{elty}}(GenericArray(dv), ev, :U), Bidiagonal{elty,Vector{elty}})
46 # enable when deprecations for 0.7 are dropped
47 # @test_throws MethodError Bidiagonal(dv, GenericArray(ev), :U)
48 # @test_throws MethodError Bidiagonal(GenericArray(dv), ev, :U)
46 @test_throws MethodError Bidiagonal(dv, GenericArray(ev), :U)
47 @test_throws MethodError Bidiagonal(GenericArray(dv), ev, :U)
4948 BI = Bidiagonal([1,2,3,4], [1,2,3], :U)
5049 @test Bidiagonal(BI) === BI
5150 @test isa(Bidiagonal{elty}(BI), Bidiagonal{elty})
342342 Base.setindex!(A::WrappedArray, v, i::Int) = setindex!(A.A, v, i)
343343 Base.setindex!(A::WrappedArray{T, N}, v, I::Vararg{Int, N}) where {T, N} = setindex!(A.A, v, I...)
344344 Base.unsafe_convert(::Type{Ptr{T}}, A::WrappedArray{T}) where T = Base.unsafe_convert(Ptr{T}, A.A)
345
346 @test_deprecated strides(WrappedArray(rand(5)))
347 @test_deprecated stride(WrappedArray(rand(5)), 1)
348345
349346 Base.stride(A::WrappedArray, i::Int) = stride(A.A, i)
350347
833833 @test strides(A) == (1,10)
834834 @test strides(B) == (2,20)
835835
836 @test_deprecated strides(1:5)
837 @test_deprecated stride(1:5,1)
838
839836 for M in (a, b, A, B)
840837 @inferred strides(M)
841838 strides_M = strides(M)
7979 @test isa(ST, SymTridiagonal{elty,Vector{elty}})
8080 TT = Tridiagonal{elty,Vector{elty}}(GenericArray(dl), d, GenericArray(dl))
8181 @test isa(TT, Tridiagonal{elty,Vector{elty}})
82 # enable when deprecations for 0.7 are dropped
83 # @test_throws MethodError SymTridiagonal(dv, GenericArray(ev))
84 # @test_throws MethodError SymTridiagonal(GenericArray(dv), ev)
85 # @test_throws MethodError Tridiagonal(GenericArray(ev), dv, GenericArray(ev))
86 # @test_throws MethodError Tridiagonal(ev, GenericArray(dv), ev)
87 # @test_throws MethodError SymTridiagonal{elty}(dv, GenericArray(ev))
88 # @test_throws MethodError Tridiagonal{elty}(GenericArray(ev), dv, GenericArray(ev))
82 @test_throws MethodError SymTridiagonal(d, GenericArray(dl))
83 @test_throws MethodError SymTridiagonal(GenericArray(d), dl)
84 @test_throws MethodError Tridiagonal(GenericArray(dl), d, GenericArray(dl))
85 @test_throws MethodError Tridiagonal(dl, GenericArray(d), dl)
86 @test_throws MethodError SymTridiagonal{elty}(d, GenericArray(dl))
87 @test_throws MethodError Tridiagonal{elty}(GenericArray(dl), d,GenericArray(dl))
8988 STI = SymTridiagonal([1,2,3,4], [1,2,3])
9089 TTI = Tridiagonal([1,2,3], [1,2,3,4], [1,2,3])
9190 TTI2 = Tridiagonal([1,2,3], [1,2,3,4], [1,2,3], [1,2])
255255 @test (I - LL')\[[0], [0], [1]] == (I - LL)'\[[0], [0], [1]] == fill([1], 3)
256256 end
257257
258 # Ensure broadcasting of I is an error (could be made to work in the future)
259 @testset "broadcasting of I (#23197)" begin
260 @test_throws MethodError I .+ 1
261 @test_throws MethodError I .+ [1 1; 1 1]
262 end
263
258264 end # module TestUniformscaling
110110 valbuf = IOBuffer()
111111 rows_per_value = max(1, dsize[1]÷(length(kwargs)+1))
112112 valio = IOContext(IOContext(valbuf, logger.stream),
113 :displaysize=>(rows_per_value,dsize[2]-5))
114 if logger.show_limited
115 valio = IOContext(valio, :limit=>true)
116 end
113 :displaysize => (rows_per_value,dsize[2]-5),
114 :limit => logger.show_limited)
117115 for (key,val) in pairs(kwargs)
118116 showvalue(valio, val)
119117 vallines = split(String(take!(valbuf)), '\n')
+0
-12
stdlib/OldPkg/Project.toml less more
0 name = "OldPkg"
1 uuid = "fe1c5a76-5840-53d2-82f9-288dd83ce2ce"
2
3 [deps]
4 LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433"
5
6 [extras]
7 Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
8 Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
9
10 [targets]
11 test = ["Test", "Random"]
+0
-311
stdlib/OldPkg/src/OldPkg.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 """
3 OldPkg
4
5 The `OldPkg` module provides package management for Julia.
6 Use
7 `OldPkg.status()` for a list of installed packages,
8 `OldPkg.add("<pkg name>")` to add a package,
9 `OldPkg.update()` to update the installed packages.
10
11 Please see the manual section on packages for more information.
12 """
13 module OldPkg
14
15 export Dir, Types, Reqs, Cache, Read, Query, Resolve, Write, Entry
16 export dir, init, add, available, installed, status, clone, checkout,
17 update, resolve, test, build, free, pin, PkgError, setprotocol!
18
19 const DEFAULT_META = "https://github.com/JuliaLang/METADATA.jl"
20 const META_BRANCH = "metadata-v2"
21
22 struct PkgError <: Exception
23 msg::AbstractString
24 ex::Union{Exception, Nothing}
25 end
26 PkgError(msg::AbstractString) = PkgError(msg, nothing)
27 function Base.showerror(io::IO, pkgerr::PkgError)
28 print(io, pkgerr.msg)
29 if pkgerr.ex !== nothing
30 pkgex = pkgerr.ex
31 if isa(pkgex, CompositeException)
32 for cex in pkgex
33 print(io, "\n=> ")
34 showerror(io, cex)
35 end
36 else
37 print(io, "\n")
38 showerror(io, pkgex)
39 end
40 end
41 end
42
43 for file in split("dir types reqs cache read query resolve write entry")
44 include("$file.jl")
45 end
46 const cd = Dir.cd
47
48 dir(path...) = Dir.path(path...)
49
50 # remove extension .jl
51 const PKGEXT = ".jl"
52 splitjl(pkg::AbstractString) = endswith(pkg, PKGEXT) ? pkg[1:(end-length(PKGEXT))] : pkg
53
54 """
55 dir() -> AbstractString
56
57 Returns the absolute path of the package directory. This defaults to
58 `joinpath(homedir(),".julia","v\$(VERSION.major).\$(VERSION.minor)")` on all platforms (i.e.
59 `~/.julia/v$(VERSION.major).$(VERSION.minor)` in UNIX shell syntax). If the `JULIA_PKGDIR`
60 environment variable is set, then that path is used in the returned value as
61 `joinpath(ENV["JULIA_PKGDIR"],"v\$(VERSION.major).\$(VERSION.minor)")`. If `JULIA_PKGDIR` is
62 a relative path, it is interpreted relative to whatever the current working directory is.
63 """
64 dir()
65
66 """
67 dir(names...) -> AbstractString
68
69 Equivalent to `normpath(OldPkg.dir(),names...)` – i.e. it appends path components to the
70 package directory and normalizes the resulting path. In particular, `OldPkg.dir(pkg)` returns
71 the path to the package `pkg`.
72 """
73 dir(names...)
74
75 """
76 init(meta::AbstractString=DEFAULT_META, branch::AbstractString=META_BRANCH)
77
78 Initialize `OldPkg.dir()` as a package directory. This will be done automatically when the
79 `JULIA_PKGDIR` is not set and `OldPkg.dir()` uses its default value. As part of this process,
80 clones a local METADATA git repository from the site and branch specified by its arguments,
81 which are typically not provided. Explicit (non-default) arguments can be used to support a
82 custom METADATA setup.
83 """
84 init(meta::AbstractString=DEFAULT_META, branch::AbstractString=META_BRANCH) = Dir.init(meta,branch)
85
86 """
87 edit()
88
89 Opens `OldPkg.dir("REQUIRE")` in the editor specified by the `VISUAL` or `EDITOR` environment
90 variables; when the editor command returns, it runs `OldPkg.resolve()` to determine and install
91 a new optimal set of installed package versions.
92 """
93 edit() = cd(Entry.edit)
94
95 """
96 rm(pkg)
97
98 Remove all requirement entries for `pkg` from `OldPkg.dir("REQUIRE")` and call `OldPkg.resolve()`.
99 """
100 rm(pkg::AbstractString) = cd(Entry.rm,splitjl(pkg))
101
102 """
103 add(pkg, vers...)
104
105 Add a requirement entry for `pkg` to `OldPkg.dir("REQUIRE")` and call `OldPkg.resolve()`. If
106 `vers` are given, they must be `VersionNumber` objects and they specify acceptable version
107 intervals for `pkg`.
108 """
109 add(pkg::AbstractString, vers::VersionNumber...) = cd(Entry.add,splitjl(pkg),vers...)
110
111 """
112 available() -> Vector{String}
113
114 Returns the names of available packages.
115 """
116 available() = cd(Entry.available)
117
118 """
119 available(pkg) -> Vector{VersionNumber}
120
121 Returns the version numbers available for package `pkg`.
122 """
123 available(pkg::AbstractString) = cd(Entry.available,splitjl(pkg))
124
125 """
126 installed() -> Dict{String,VersionNumber}
127
128 Returns a dictionary mapping installed package names to the installed version number of each
129 package.
130 """
131 installed() = cd(Entry.installed)
132
133 """
134 installed(pkg) -> Nothing | VersionNumber
135
136 If `pkg` is installed, return the installed version number. If `pkg` is registered,
137 but not installed, return `nothing`.
138 """
139 installed(pkg::AbstractString) = cd(Entry.installed,splitjl(pkg))
140
141 """
142 status()
143
144 Prints out a summary of what packages are installed and what version and state they're in.
145 """
146 status(io::IO=stdout) = cd(Entry.status,io)
147
148 """
149 status(pkg)
150
151 Prints out a summary of what version and state `pkg`, specifically, is in.
152 """
153 status(pkg::AbstractString, io::IO=stdout) = cd(Entry.status,io,splitjl(pkg))
154
155 """
156 clone(pkg)
157
158 If `pkg` has a URL registered in `OldPkg.dir("METADATA")`, clone it from that URL on the
159 default branch. The package does not need to have any registered versions.
160 """
161 clone(url_or_pkg::AbstractString) = cd(Entry.clone,url_or_pkg)
162
163 """
164 clone(url, [pkg])
165
166 Clone a package directly from the git URL `url`. The package does not need to be registered
167 in `OldPkg.dir("METADATA")`. The package repo is cloned by the name `pkg` if provided; if not
168 provided, `pkg` is determined automatically from `url`.
169 """
170 clone(url::AbstractString, pkg::AbstractString) = cd(Entry.clone,url,splitjl(pkg))
171
172 """
173 checkout(pkg, [branch="master"]; merge=true, pull=true)
174
175 Checkout the `OldPkg.dir(pkg)` repo to the branch `branch`. Defaults to checking out the
176 "master" branch. To go back to using the newest compatible released version, use
177 `OldPkg.free(pkg)`. Changes are merged (fast-forward only) if the keyword argument `merge ==
178 true`, and the latest version is pulled from the upstream repo if `pull == true`.
179 """
180 checkout(pkg::AbstractString, branch::AbstractString="master"; merge::Bool=true, pull::Bool=true) =
181 cd(Entry.checkout,splitjl(pkg),branch,merge,pull)
182
183 """
184 free(pkg)
185
186 Free the package `pkg` to be managed by the package manager again. It calls `OldPkg.resolve()`
187 to determine optimal package versions after. This is an inverse for both `OldPkg.checkout` and
188 `OldPkg.pin`.
189
190 You can also supply an iterable collection of package names, e.g., `OldPkg.free(("Pkg1",
191 "Pkg2"))` to free multiple packages at once.
192 """
193 free(pkg) = cd(Entry.free,splitjl.(pkg))
194
195 """
196 pin(pkg)
197
198 Pin `pkg` at the current version. To go back to using the newest compatible released
199 version, use `OldPkg.free(pkg)`
200 """
201 pin(pkg::AbstractString) = cd(Entry.pin,splitjl(pkg))
202
203 """
204 pin(pkg, version)
205
206 Pin `pkg` at registered version `version`.
207 """
208 pin(pkg::AbstractString, ver::VersionNumber) = cd(Entry.pin,splitjl(pkg),ver)
209
210 """
211 update(pkgs...)
212
213 Update the metadata repo – kept in `OldPkg.dir("METADATA")` – then update any fixed packages
214 that can safely be pulled from their origin; then call `OldPkg.resolve()` to determine a new
215 optimal set of packages versions.
216
217 Without arguments, updates all installed packages. When one or more package names are provided as
218 arguments, only those packages and their dependencies are updated.
219 """
220 update(upkgs::AbstractString...) = cd(Entry.update,Dir.getmetabranch(),Set{String}(splitjl.([upkgs...])))
221
222 """
223 resolve()
224
225 Determines an optimal, consistent set of package versions to install or upgrade to. The
226 optimal set of package versions is based on the contents of `OldPkg.dir("REQUIRE")` and the
227 state of installed packages in `OldPkg.dir()`, Packages that are no longer required are moved
228 into `OldPkg.dir(".trash")`.
229 """
230 resolve() = cd(Entry.resolve)
231
232 """
233 build()
234
235 Run the build scripts for all installed packages in depth-first recursive order.
236 """
237 build() = cd(Entry.build)
238
239 """
240 build(pkgs...)
241
242 Run the build script in `deps/build.jl` for each package in `pkgs` and all of their
243 dependencies in depth-first recursive order. This is called automatically by `OldPkg.resolve()`
244 on all installed or updated packages.
245 """
246 build(pkgs::AbstractString...) = cd(Entry.build,[splitjl.(pkgs)...])
247
248 """
249 test(; coverage=false)
250
251 Run the tests for all installed packages ensuring that each package's test dependencies are
252 installed for the duration of the test. A package is tested by running its
253 `test/runtests.jl` file and test dependencies are specified in `test/REQUIRE`.
254 Coverage statistics for the packages may be generated by passing `coverage=true`.
255 The default behavior is not to run coverage.
256 """
257 test(;coverage::Bool=false) = cd(Entry.test; coverage=coverage)
258
259 """
260 test(pkgs...; coverage=false)
261
262 Run the tests for each package in `pkgs` ensuring that each package's test dependencies are
263 installed for the duration of the test. A package is tested by running its
264 `test/runtests.jl` file and test dependencies are specified in `test/REQUIRE`.
265 Coverage statistics for the packages may be generated by passing `coverage=true`.
266 The default behavior is not to run coverage.
267 """
268 test(pkgs::AbstractString...; coverage::Bool=false) = cd(Entry.test,AbstractString[splitjl.(pkgs)...]; coverage=coverage)
269
270 """
271 dependents(pkg)
272
273 List the packages that have `pkg` as a dependency.
274 """
275 dependents(pkg::AbstractString) = Reqs.dependents(splitjl(pkg))
276
277 """
278 setprotocol!(proto)
279
280 Set the protocol used to access GitHub-hosted packages. Defaults to 'https', with a blank
281 `proto` delegating the choice to the package developer.
282 """
283 setprotocol!(proto::AbstractString) = Cache.setprotocol!(proto)
284
285 # point users to PkgDev
286 register(args...) =
287 error("OldPkg.register(pkg,[url]) has been moved to the package PkgDev.jl.\n",
288 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
289
290 tag(pkg, ver=nothing, commit=nothing) =
291 error("OldPkg.tag(pkg, [ver, [commit]]) has been moved to the package PkgDev.jl.\n",
292 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
293
294 publish() =
295 error("OldPkg.publish() has been moved to the package PkgDev.jl.\n",
296 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
297
298 generate(pkg, license) =
299 error("OldPkg.generate(pkg, license) has been moved to the package PkgDev.jl.\n",
300 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
301
302 license(lic=nothing) =
303 error("OldPkg.license([lic]) has been moved to the package PkgDev.jl.\n",
304 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
305
306 submit(pkg, commit=nothing) =
307 error("OldPkg.submit(pkg[, commit]) has been moved to the package PkgDev.jl.\n",
308 "Run OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-")
309
310 end # module
+0
-94
stdlib/OldPkg/src/cache.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Cache
3
4 import LibGit2
5 import ..Dir, ..PkgError
6 using ..Types
7
8 rewrite_url_to = "https"
9
10 const GITHUB_REGEX =
11 r"^(?:git@|git://|https://(?:[\w\.\+\-]+@)?)github.com[:/](([^/].+)/(.+?))(?:\.git)?$"i
12
13 path(pkg::AbstractString) = abspath(".cache", pkg)
14
15 function mkcachedir()
16 cache = joinpath(realpath("."), ".cache")
17 if isdir(cache)
18 return
19 end
20
21 @static if Sys.isunix()
22 if Dir.isversioned(pwd())
23 rootcache = joinpath(realpath(".."), ".cache")
24 if !isdir(rootcache)
25 mkdir(rootcache)
26 end
27 symlink(rootcache, cache)
28 return
29 end
30 end
31 mkdir(cache)
32 end
33
34 function prefetch(pkg::AbstractString, url::AbstractString, sha1s::Vector)
35 isdir(".cache") || mkcachedir()
36
37 cache = path(pkg)
38 normalized_url = normalize_url(url)
39
40 repo = if isdir(cache)
41 LibGit2.GitRepo(cache) # open repo, free it at the end
42 else
43 @info "Cloning cache of $pkg from $normalized_url"
44 try
45 # clone repo, free it at the end
46 LibGit2.clone(normalized_url, cache, isbare = true, remote_cb = LibGit2.mirror_cb())
47 catch err
48 errmsg = if isa(err, LibGit2.Error.GitError)
49 "Cannot clone $pkg from $normalized_url. $(err.msg)"
50 elseif isa(err, InterruptException)
51 "Package `$pkg` prefetching was interrupted."
52 else
53 "Unknown error: $err"
54 end
55 isdir(cache) && rm(cache, recursive=true)
56 throw(PkgError(errmsg))
57 end
58 end
59 try
60 LibGit2.set_remote_url(repo, "origin", normalized_url)
61 in_cache = BitVector(map(sha1->LibGit2.iscommit(sha1, repo), sha1s))
62 if !all(in_cache)
63 @info "Updating cache of $pkg..."
64 LibGit2.fetch(repo)
65 in_cache = BitVector(map(sha1->LibGit2.iscommit(sha1, repo), sha1s))
66 end
67 sha1s[.!in_cache]
68 finally
69 close(repo) # closing repo opened/created above
70 end
71 end
72 prefetch(pkg::AbstractString, url::AbstractString, sha1::AbstractString...) =
73 prefetch(pkg, url, AbstractString[sha1...])
74
75 function setprotocol!(proto::AbstractString)
76 global rewrite_url_to
77
78 if length(proto) == 0
79 rewrite_url_to = nothing
80 else
81 rewrite_url_to = proto
82 end
83 end
84
85 function normalize_url(url::AbstractString)
86 global rewrite_url_to
87
88 m = match(GITHUB_REGEX,url)
89 (m === nothing || rewrite_url_to === nothing) ?
90 url : "$rewrite_url_to://github.com/$(m.captures[1]).git"
91 end
92
93 end # module
+0
-82
stdlib/OldPkg/src/dir.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Dir
3
4 import OldPkg
5 import ..DEFAULT_META, ..META_BRANCH, ..PkgError
6 import LibGit2, LibGit2.with
7 const DIR_NAME = ".julia"
8
9 _pkgroot() = abspath(get(ENV,"JULIA_PKGDIR",joinpath(homedir(),DIR_NAME)))
10 isversioned(p::AbstractString) = ((x,y) = (VERSION.major, VERSION.minor); basename(p) == "v$x.$y")
11
12 function path()
13 b = _pkgroot()
14 x, y = VERSION.major, VERSION.minor
15 d = joinpath(b,"v$x.$y")
16 if isdir(d) || !isdir(b) || !isdir(joinpath(b, "METADATA"))
17 return d
18 end
19 return b
20 end
21 path(pkg::AbstractString...) = normpath(path(),pkg...)
22
23 function cd(f::Function, args...; kws...)
24 dir = path()
25 metadata_dir = joinpath(dir, "METADATA")
26 if !isdir(metadata_dir)
27 !haskey(ENV,"JULIA_PKGDIR") ? init() :
28 throw(PkgError("Package metadata directory $metadata_dir doesn't exist; run OldPkg.init() to initialize it."))
29 end
30 if haskey(ENV,"JULIA_PKGDIR")
31 withenv("JULIA_PKGDIR" => abspath(ENV["JULIA_PKGDIR"])) do
32 Base.cd(()->f(args...; kws...), dir)
33 end
34 else
35 Base.cd(()->f(args...; kws...), dir)
36 end
37 end
38
39 function init(meta::AbstractString=DEFAULT_META, branch::AbstractString=META_BRANCH)
40 dir = path()
41 @info "Initializing package repository $dir"
42 metadata_dir = joinpath(dir, "METADATA")
43 if isdir(metadata_dir)
44 @info "Package directory $dir is already initialized"
45 LibGit2.set_remote_url(metadata_dir, "origin", meta)
46 return
47 end
48 local temp_dir = ""
49 try
50 mkpath(dir)
51 temp_dir = mktempdir(dir)
52 Base.cd(temp_dir) do
53 @info "Cloning METADATA from $meta"
54 with(LibGit2.clone(meta, "METADATA", branch = branch)) do metadata_repo
55 LibGit2.set_remote_url(metadata_repo, "origin", meta)
56 end
57 touch("REQUIRE")
58 touch("META_BRANCH")
59 write("META_BRANCH", branch)
60 end
61 #Move TEMP to METADATA
62 Base.mv(joinpath(temp_dir,"METADATA"), metadata_dir)
63 Base.mv(joinpath(temp_dir,"REQUIRE"), joinpath(dir,"REQUIRE"))
64 Base.mv(joinpath(temp_dir,"META_BRANCH"), joinpath(dir,"META_BRANCH"))
65 rm(temp_dir, recursive=true)
66 catch err
67 ispath(metadata_dir) && rm(metadata_dir, recursive=true)
68 ispath(temp_dir) && rm(temp_dir, recursive=true)
69 rethrow(err)
70 end
71 end
72
73 function getmetabranch()
74 try
75 readline(joinpath(path(),"META_BRANCH"))
76 catch err
77 META_BRANCH
78 end
79 end
80
81 end # module
+0
-770
stdlib/OldPkg/src/entry.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Entry
3
4 import Base: thispatch, nextpatch, nextminor, nextmajor, check_new_version
5 import OldPkg
6 import ..Reqs, ..Read, ..Query, ..Resolve, ..Cache, ..Write, ..Dir
7 using LibGit2
8 import ..PkgError
9 using ..Types
10 using Base.Printf: @printf
11
12 macro recover(ex)
13 quote
14 try $(esc(ex))
15 catch err
16 show(err)
17 print('\n')
18 end
19 end
20 end
21
22 function edit(f::Function, pkg::AbstractString, args...)
23 r = Reqs.read("REQUIRE")
24 reqs = Reqs.parse(r)
25 avail = Read.available()
26 !haskey(avail,pkg) && !haskey(reqs,pkg) && return false
27 rʹ = f(r,pkg,args...)
28 rʹ == r && return false
29 reqsʹ = Reqs.parse(rʹ)
30 reqsʹ != reqs && resolve(reqsʹ,avail)
31 Reqs.write("REQUIRE",rʹ)
32 @info "Package database updated"
33 return true
34 end
35
36 function edit()
37 editor = get(ENV,"VISUAL",get(ENV,"EDITOR",nothing))
38 editor !== nothing ||
39 throw(PkgError("set the EDITOR environment variable to an edit command"))
40 editor = Base.shell_split(editor)
41 reqs = Reqs.parse("REQUIRE")
42 run(`$editor REQUIRE`)
43 reqsʹ = Reqs.parse("REQUIRE")
44 reqs == reqsʹ && return @info "Nothing to be done"
45 @info "Computing changes..."
46 resolve(reqsʹ)
47 end
48
49 function add(pkg::AbstractString, vers::VersionSet)
50 outdated = :maybe
51 @sync begin
52 @async if !edit(Reqs.add,pkg,vers)
53 ispath(pkg) || throw(PkgError("unknown package $pkg"))
54 @info "Package $pkg is already installed"
55 end
56 branch = Dir.getmetabranch()
57 outdated = with(GitRepo, "METADATA") do repo
58 if LibGit2.branch(repo) == branch
59 if LibGit2.isdiff(repo, "origin/$branch")
60 outdated = :yes
61 else
62 try
63 LibGit2.fetch(repo)
64 outdated = LibGit2.isdiff(repo, "origin/$branch") ? (:yes) : (:no)
65 catch
66 end
67 end
68 else
69 :no # user is doing something funky with METADATA
70 end
71 end
72 end
73 if outdated != :no
74 is = outdated == :yes ? "is" : "might be"
75 @info """
76 METADATA $is out-of-date — you may not have the latest version of $pkg
77 Use `OldPkg.update()` to get the latest versions of your packages
78 """
79 end
80 end
81 add(pkg::AbstractString, vers::VersionNumber...) = add(pkg,VersionSet(vers...))
82
83 function rm(pkg::AbstractString)
84 edit(Reqs.rm,pkg) && return
85 ispath(pkg) || return @info "Package $pkg is not installed"
86 @info "Removing $pkg (unregistered)"
87 Write.remove(pkg)
88 end
89
90 function available()
91 all_avail = Read.available()
92 avail = AbstractString[]
93 for (pkg, vers) in all_avail
94 any(x->Types.satisfies("julia", VERSION, x[2].requires), vers) && push!(avail, pkg)
95 end
96 sort!(avail, by=lowercase)
97 end
98
99 function available(pkg::AbstractString)
100 avail = Read.available(pkg)
101 if !isempty(avail) || Read.isinstalled(pkg)
102 return sort!(collect(keys(avail)))
103 end
104 throw(PkgError("$pkg is not a package (not registered or installed)"))
105 end
106
107 function installed()
108 pkgs = Dict{String,VersionNumber}()
109 for (pkg,(ver,fix)) in Read.installed()
110 pkgs[pkg] = ver
111 end
112 return pkgs
113 end
114
115 function installed(pkg::AbstractString)
116 avail = Read.available(pkg)
117 if Read.isinstalled(pkg)
118 res = typemin(VersionNumber)
119 if ispath(joinpath(pkg,".git"))
120 LibGit2.with(GitRepo, pkg) do repo
121 res = Read.installed_version(pkg, repo, avail)
122 end
123 end
124 return res
125 end
126 isempty(avail) && throw(PkgError("$pkg is not a package (not registered or installed)"))
127 return nothing # registered but not installed
128 end
129
130 function status(io::IO; pkgname::AbstractString = "")
131 if !isempty(pkgname) && !ispath(pkgname)
132 throw(PkgError("Package $pkgname does not exist"))
133 end
134 showpkg(pkg) = isempty(pkgname) ? true : (pkg == pkgname)
135 reqs = Reqs.parse("REQUIRE")
136 instd = Read.installed()
137 required = sort!(collect(keys(reqs)))
138 if !isempty(required)
139 showpkg("") && println(io, "$(length(required)) required packages:")
140 for pkg in required
141 if !haskey(instd, pkg)
142 showpkg(pkg) && status(io,pkg,"not found")
143 else
144 ver,fix = pop!(instd,pkg)
145 showpkg(pkg) && status(io,pkg,ver,fix)
146 end
147 end
148 end
149 additional = sort!(collect(keys(instd)))
150 if !isempty(additional)
151 showpkg("") && println(io, "$(length(additional)) additional packages:")
152 for pkg in additional
153 ver,fix = instd[pkg]
154 showpkg(pkg) && status(io,pkg,ver,fix)
155 end
156 end
157 if isempty(required) && isempty(additional)
158 println(io, "No packages installed")
159 end
160 end
161
162 status(io::IO, pkg::AbstractString) = status(io, pkgname = pkg)
163
164 function status(io::IO, pkg::AbstractString, ver::VersionNumber, fix::Bool)
165 if !isempty(pkg) && !ispath(pkg)
166 throw(PkgError("Package $pkg does not exist"))
167 end
168 @printf io " - %-29s " pkg
169 fix || return println(io,ver)
170 @printf io "%-19s" ver
171 if ispath(pkg,".git")
172 prepo = GitRepo(pkg)
173 try
174 with(LibGit2.head(prepo)) do phead
175 if LibGit2.isattached(prepo)
176 print(io, LibGit2.shortname(phead))
177 else
178 print(io, string(LibGit2.GitHash(phead))[1:8])
179 end
180 end
181 attrs = AbstractString[]
182 isfile("METADATA",pkg,"url") || push!(attrs,"unregistered")
183 LibGit2.isdirty(prepo) && push!(attrs,"dirty")
184 isempty(attrs) || print(io, " (",join(attrs,", "),")")
185 catch err
186 printstyled(io, " broken-repo (unregistered)", color=Base.error_color())
187 finally
188 close(prepo)
189 end
190 else
191 printstyled(io, "non-repo (unregistered)", color=Base.warn_color())
192 end
193 println(io)
194 end
195
196 function status(io::IO, pkg::AbstractString, msg::AbstractString)
197 @printf io " - %-29s %-19s\n" pkg msg
198 end
199
200 function clone(url::AbstractString, pkg::AbstractString)
201 @info "Cloning $pkg from $url"
202 ispath(pkg) && throw(PkgError("$pkg already exists"))
203 try
204 LibGit2.with(LibGit2.clone(url, pkg)) do repo
205 LibGit2.set_remote_url(repo, "origin", url)
206 end
207 catch err
208 isdir(pkg) && Base.rm(pkg, recursive=true)
209 rethrow(err)
210 end
211 @info "Computing changes..."
212 if !edit(Reqs.add, pkg)
213 isempty(Reqs.parse("$pkg/REQUIRE")) && return
214 resolve()
215 end
216 end
217
218 function url_and_pkg(url_or_pkg::AbstractString)
219 if !(':' in url_or_pkg)
220 # no colon, could be a package name
221 url_file = joinpath("METADATA", url_or_pkg, "url")
222 isfile(url_file) && return readchomp(url_file), url_or_pkg
223 end
224 # try to parse as URL or local path
225 m = match(r"(?:^|[/\\])(\w+?)(?:\.jl)?(?:\.git)?$", url_or_pkg)
226 m === nothing && throw(PkgError("can't determine package name from URL: $url_or_pkg"))
227 return url_or_pkg, m.captures[1]
228 end
229
230 clone(url_or_pkg::AbstractString) = clone(url_and_pkg(url_or_pkg)...)
231
232 function checkout(pkg::AbstractString, branch::AbstractString, do_merge::Bool, do_pull::Bool)
233 ispath(pkg,".git") || throw(PkgError("$pkg is not a git repo"))
234 @info "Checking out $pkg $branch..."
235 with(GitRepo, pkg) do r
236 LibGit2.transact(r) do repo
237 LibGit2.isdirty(repo) && throw(PkgError("$pkg is dirty, bailing"))
238 LibGit2.branch!(repo, branch, track=LibGit2.Consts.REMOTE_ORIGIN)
239 do_merge && LibGit2.merge!(repo, fastforward=true) # merge changes
240 if do_pull
241 @info "Pulling $pkg latest $branch..."
242 LibGit2.fetch(repo)
243 LibGit2.merge!(repo, fastforward=true)
244 end
245 resolve()
246 end
247 end
248 end
249
250 function free(pkg::AbstractString)
251 ispath(pkg,".git") || throw(PkgError("$pkg is not a git repo"))
252 Read.isinstalled(pkg) || throw(PkgError("$pkg cannot be freed – not an installed package"))
253 avail = Read.available(pkg)
254 isempty(avail) && throw(PkgError("$pkg cannot be freed – not a registered package"))
255 with(GitRepo, pkg) do repo
256 LibGit2.isdirty(repo) && throw(PkgError("$pkg cannot be freed – repo is dirty"))
257 @info "Freeing $pkg"
258 vers = sort!(collect(keys(avail)), rev=true)
259 while true
260 for ver in vers
261 sha1 = avail[ver].sha1
262 LibGit2.iscommit(sha1, repo) || continue
263 return LibGit2.transact(repo) do r
264 LibGit2.isdirty(repo) && throw(PkgError("$pkg is dirty, bailing"))
265 LibGit2.checkout!(repo, sha1)
266 resolve()
267 end
268 end
269 isempty(Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail])) && continue
270 throw(PkgError("can't find any registered versions of $pkg to checkout"))
271 end
272 end
273 end
274
275 function free(pkgs)
276 try
277 for pkg in pkgs
278 ispath(pkg,".git") || throw(PkgError("$pkg is not a git repo"))
279 Read.isinstalled(pkg) || throw(PkgError("$pkg cannot be freed – not an installed package"))
280 avail = Read.available(pkg)
281 isempty(avail) && throw(PkgError("$pkg cannot be freed – not a registered package"))
282 with(GitRepo, pkg) do repo
283 LibGit2.isdirty(repo) && throw(PkgError("$pkg cannot be freed – repo is dirty"))
284 @info "Freeing $pkg"
285 vers = sort!(collect(keys(avail)), rev=true)
286 for ver in vers
287 sha1 = avail[ver].sha1
288 LibGit2.iscommit(sha1, repo) || continue
289 LibGit2.checkout!(repo, sha1)
290 break
291 end
292 end
293 isempty(Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail])) && continue
294 throw(PkgError("Can't find any registered versions of $pkg to checkout"))
295 end
296 finally
297 resolve()
298 end
299 end
300
301 function pin(pkg::AbstractString, head::AbstractString)
302 ispath(pkg,".git") || throw(PkgError("$pkg is not a git repo"))
303 should_resolve = true
304 with(GitRepo, pkg) do repo
305 id = if isempty(head) # get HEAD commit
306 # no need to resolve, branch will be from HEAD
307 should_resolve = false
308 LibGit2.head_oid(repo)
309 else
310 LibGit2.revparseid(repo, head)
311 end
312 commit = LibGit2.GitCommit(repo, id)
313 try
314 # note: changing the following naming scheme requires a corresponding change in Read.ispinned()
315 branch = "pinned.$(string(id)[1:8]).tmp"
316 if LibGit2.isattached(repo) && LibGit2.branch(repo) == branch
317 @info "Package $pkg is already pinned" * (isempty(head) ? "" : " to the selected commit")
318 should_resolve = false
319 return
320 end
321 ref = LibGit2.lookup_branch(repo, branch)
322 try
323 if ref !== nothing
324 if LibGit2.revparseid(repo, branch) != id
325 throw(PkgError("Package $pkg: existing branch $branch has " *
326 "been edited and doesn't correspond to its original commit"))
327 end
328 @info "Package $pkg: checking out existing branch $branch"
329 else
330 @info "Creating $pkg branch $branch"
331 ref = LibGit2.create_branch(repo, branch, commit)
332 end
333
334 # checkout selected branch
335 with(LibGit2.peel(LibGit2.GitTree, ref)) do btree
336 LibGit2.checkout_tree(repo, btree)
337 end
338 # switch head to the branch
339 LibGit2.head!(repo, ref)
340 finally
341 close(ref)
342 end
343 finally
344 close(commit)
345 end
346 end
347 should_resolve && resolve()
348 nothing
349 end
350 pin(pkg::AbstractString) = pin(pkg, "")
351
352 function pin(pkg::AbstractString, ver::VersionNumber)
353 ispath(pkg,".git") || throw(PkgError("$pkg is not a git repo"))
354 Read.isinstalled(pkg) || throw(PkgError("$pkg cannot be pinned – not an installed package"))
355 avail = Read.available(pkg)
356 isempty(avail) && throw(PkgError("$pkg cannot be pinned – not a registered package"))
357 haskey(avail,ver) || throw(PkgError("$pkg – $ver is not a registered version"))
358 pin(pkg, avail[ver].sha1)
359 end
360
361 function update(branch::AbstractString, upkgs::Set{String})
362 @info "Updating METADATA..."
363 with(GitRepo, "METADATA") do repo
364 try
365 with(LibGit2.head(repo)) do h
366 if LibGit2.branch(h) != branch
367 if LibGit2.isdirty(repo)
368 throw(PkgError("METADATA is dirty and not on $branch, bailing"))
369 end
370 if !LibGit2.isattached(repo)
371 throw(PkgError("METADATA is detached not on $branch, bailing"))
372 end
373 LibGit2.fetch(repo)
374 LibGit2.checkout_head(repo)
375 LibGit2.branch!(repo, branch, track="refs/remotes/origin/$branch")
376 LibGit2.merge!(repo)
377 end
378 end
379
380 LibGit2.fetch(repo)
381 ff_succeeded = LibGit2.merge!(repo, fastforward=true)
382 if !ff_succeeded
383 LibGit2.rebase!(repo, "origin/$branch")
384 end
385 catch err
386 cex = CapturedException(err, catch_backtrace())
387 throw(PkgError("METADATA cannot be updated. Resolve problems manually in " *
388 OldPkg.dir("METADATA") * ".", cex))
389 end
390 end
391 deferred_errors = CompositeException()
392 avail = Read.available()
393 # this has to happen before computing free/fixed
394 for pkg in filter(Read.isinstalled, collect(keys(avail)))
395 try
396 Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
397 catch err
398 cex = CapturedException(err, catch_backtrace())
399 push!(deferred_errors, PkgError("Package $pkg: unable to update cache.", cex))
400 end
401 end
402 instd = Read.installed(avail)
403 reqs = Reqs.parse("REQUIRE")
404 if !isempty(upkgs)
405 for (pkg, (v,f)) in instd
406 satisfies(pkg, v, reqs) || throw(PkgError("Package $pkg: current " *
407 "package status does not satisfy the requirements, cannot do " *
408 "a partial update; use `OldPkg.update()`"))
409 end
410 end
411 dont_update = Query.partial_update_mask(instd, avail, upkgs)
412 free = Read.free(instd,dont_update)
413 for (pkg,ver) in free
414 try
415 Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
416 catch err
417 cex = CapturedException(err, catch_backtrace())
418 push!(deferred_errors, PkgError("Package $pkg: unable to update cache.", cex))
419 end
420 end
421 fixed = Read.fixed(avail,instd,dont_update)
422 Base.shred!(LibGit2.CachedCredentials()) do creds
423 stopupdate = false
424 for (pkg,ver) in fixed
425 ispath(pkg,".git") || continue
426 pkg in dont_update && continue
427 with(GitRepo, pkg) do repo
428 if LibGit2.isattached(repo)
429 if LibGit2.isdirty(repo)
430 @warn "Package $pkg: skipping update (dirty)..."
431 elseif Read.ispinned(repo)
432 @info "Package $pkg: skipping update (pinned)..."
433 else
434 prev_sha = string(LibGit2.head_oid(repo))
435 success = true
436 try
437 LibGit2.fetch(repo, credentials=creds)
438 LibGit2.merge!(repo, fastforward=true)
439 catch err
440 cex = CapturedException(err, catch_backtrace())
441 push!(deferred_errors, PkgError("Package $pkg cannot be updated.", cex))
442 success = false
443 stopupdate = isa(err, InterruptException)
444 end
445 if success
446 post_sha = string(LibGit2.head_oid(repo))
447 branch = LibGit2.branch(repo)
448 @info "Updating $pkg $branch..." * (prev_sha != post_sha ?
449 " $(prev_sha[1:8]) → $(post_sha[1:8])" : "")
450 end
451 end
452 end
453 end
454 stopupdate && break
455 if haskey(avail,pkg)
456 try
457 Cache.prefetch(pkg, Read.url(pkg), [a.sha1 for (v,a)=avail[pkg]])
458 catch err
459 cex = CapturedException(err, catch_backtrace())
460 push!(deferred_errors, PkgError("Package $pkg: unable to update cache.", cex))
461 end
462 end
463 end
464 end
465 @info "Computing changes..."
466 resolve(reqs, avail, instd, fixed, free, upkgs)
467 # Don't use instd here since it may have changed
468 updatehook(sort!(collect(keys(installed()))))
469
470 # Print deferred errors
471 length(deferred_errors) > 0 && throw(PkgError("Update finished with errors.", deferred_errors))
472 nothing
473 end
474
475
476 function resolve(
477 reqs :: Dict = Reqs.parse("REQUIRE"),
478 avail :: Dict = Read.available(),
479 instd :: Dict = Read.installed(avail),
480 fixed :: Dict = Read.fixed(avail, instd),
481 have :: Dict = Read.free(instd),
482 upkgs :: Set{String} = Set{String}()
483 )
484 bktrc = Query.init_resolve_backtrace(reqs, fixed)
485 orig_reqs = deepcopy(reqs)
486 Query.check_fixed(reqs, fixed, avail)
487 Query.propagate_fixed!(reqs, bktrc, fixed)
488 deps, conflicts = Query.dependencies(avail, fixed)
489
490 for pkg in keys(reqs)
491 if !haskey(deps,pkg)
492 if "julia" in conflicts[pkg]
493 throw(PkgError("$pkg can't be installed because it has no versions that support $VERSION " *
494 "of julia. You may need to update METADATA by running `OldPkg.update()`"))
495 else
496 sconflicts = join(conflicts[pkg], ", ", " and ")
497 throw(PkgError("$pkg's requirements can't be satisfied because " *
498 "of the following fixed packages: $sconflicts"))
499 end
500 end
501 end
502
503 Query.check_requirements(reqs, deps, fixed)
504
505 deps = Query.prune_dependencies(reqs, deps, bktrc)
506 want = Resolve.resolve(reqs, deps)
507
508 if !isempty(upkgs)
509 orig_deps, _ = Query.dependencies(avail)
510 Query.check_partial_updates(orig_reqs, orig_deps, want, fixed, upkgs)
511 end
512
513 # compare what is installed with what should be
514 changes = Query.diff(have, want, avail, fixed)
515 isempty(changes) && return @info "No packages to install, update or remove"
516
517 # prefetch phase isolates network activity, nothing to roll back
518 missing = []
519 for (pkg,(ver1,ver2)) in changes
520 vers = String[]
521 ver1 !== nothing && push!(vers,LibGit2.head(pkg))
522 ver2 !== nothing && push!(vers,Read.sha1(pkg,ver2))
523 append!(missing,
524 map(sha1->(pkg,(ver1,ver2),sha1),
525 Cache.prefetch(pkg, Read.url(pkg), vers)))
526 end
527 if !isempty(missing)
528 msg = "Missing package versions (possible metadata misconfiguration):"
529 for (pkg,ver,sha1) in missing
530 msg *= " $pkg v$ver [$sha1[1:10]]\n"
531 end
532 throw(PkgError(msg))
533 end
534
535 # try applying changes, roll back everything if anything fails
536 changed = []
537 imported = String[]
538 try
539 for (pkg,(ver1,ver2)) in changes
540 if ver1 === nothing
541 @info "Installing $pkg v$ver2"
542 Write.install(pkg, Read.sha1(pkg,ver2))
543 elseif ver2 === nothing
544 @info "Removing $pkg v$ver1"
545 Write.remove(pkg)
546 else
547 up = ver1 <= ver2 ? "Up" : "Down"
548 @info "$(up)grading $pkg: v$ver1 => v$ver2"
549 Write.update(pkg, Read.sha1(pkg,ver2))
550 if Base.root_module_exists(Base.PkgId(pkg))
551 push!(imported, "- $pkg")
552 end
553 end
554 push!(changed,(pkg,(ver1,ver2)))
555 end
556 catch err
557 for (pkg,(ver1,ver2)) in reverse!(changed)
558 if ver1 === nothing
559 @info "Rolling back install of $pkg"
560 @recover Write.remove(pkg)
561 elseif ver2 === nothing
562 @info "Rolling back deleted $pkg to v$ver1"
563 @recover Write.install(pkg, Read.sha1(pkg,ver1))
564 else
565 @info "Rolling back $pkg from v$ver2 to v$ver1"
566 @recover Write.update(pkg, Read.sha1(pkg,ver1))
567 end
568 end
569 rethrow(err)
570 end
571 if !isempty(imported)
572 @warn join(["The following packages have been updated but were already imported:",
573 imported..., "Restart Julia to use the updated versions."], "\n")
574 end
575 # re/build all updated/installed packages
576 build(map(x->x[1], filter(x -> x[2][2] !== nothing, changes)))
577 end
578
579 function build(pkg::AbstractString, build_file::AbstractString, errfile::AbstractString)
580 # To isolate the build from the running Julia process, we execute each build.jl file in
581 # a separate process. Errors are written to errfile for later reporting.
582 code = """
583 import OldPkg
584 $(Base.load_path_setup_code())
585 open("$(escape_string(errfile))", "a") do f
586 pkg, build_file = "$pkg", "$(escape_string(build_file))"
587 try
588 @info "Building \$pkg"
589 cd(dirname(build_file)) do
590 evalfile(build_file)
591 end
592 catch err
593 @error \"""
594 ------------------------------------------------------------
595 # Build failed for \$pkg
596 \""" exception=err,catch_backtrace()
597 write(f, pkg); write(f, 0x00)
598 write(f, sprint(showerror, err)); write(f, 0x00)
599 end
600 end
601 """
602 cmd = ```
603 $(Base.julia_cmd()) -O0
604 --color=$(Base.have_color ? "yes" : "no")
605 --compiled-modules=$(Bool(Base.JLOptions().use_compiled_modules) ? "yes" : "no")
606 --history-file=no
607 --startup-file=$(Base.JLOptions().startupfile != 2 ? "yes" : "no")
608 --eval $code
609 ```
610
611 success(pipeline(cmd, stdout=stdout, stderr=stderr))
612 end
613
614 function build!(pkgs::Vector, seen::Set, errfile::AbstractString)
615 for pkg in pkgs
616 pkg == "julia" && continue
617 pkg in seen ? continue : push!(seen,pkg)
618 Read.isinstalled(pkg) || throw(PkgError("$pkg is not an installed package"))
619 build!(Read.requires_list(pkg), seen, errfile)
620 path = abspath(pkg,"deps","build.jl")
621 isfile(path) || continue
622 build(pkg, path, errfile) || error("Build process failed.")
623 end
624 end
625
626 function build!(pkgs::Vector, errs::Dict, seen::Set=Set())
627 mktemp() do errfile, f
628 build!(pkgs, seen, errfile)
629 while !eof(f)
630 pkg = readuntil(f, '\0')
631 err = readuntil(f, '\0')
632 errs[pkg] = err
633 end
634 end
635 end
636
637 function build(pkgs::Vector)
638 errs = Dict()
639 build!(pkgs,errs)
640 isempty(errs) && return
641 @warn """
642 ------------------------------------------------------------
643 # Build error summary
644
645 $(join(keys(errs),", "," and ")) had build errors.
646
647 - packages with build errors remain installed in $(pwd())
648 - build the package(s) and all dependencies with `OldPkg.build("$(join(keys(errs),"\", \""))")`
649 - build a single package by running its `deps/build.jl` script
650 """
651 end
652 build() = build(sort!(collect(keys(installed()))))
653
654 function updatehook!(pkgs::Vector, errs::Dict, seen::Set=Set())
655 for pkg in pkgs
656 pkg in seen && continue
657 updatehook!(Read.requires_list(pkg),errs,push!(seen,pkg))
658 path = abspath(pkg,"deps","update.jl")
659 isfile(path) || continue
660 @info "Running update script for $pkg"
661 cd(dirname(path)) do
662 try evalfile(path)
663 catch err
664 @error """
665 ------------------------------------------------------------
666 # Update hook failed for $pkg
667 """ exception=err,catch_backtrace()
668 errs[pkg] = err
669 end
670 end
671 end
672 end
673
674 function updatehook(pkgs::Vector)
675 errs = Dict()
676 updatehook!(pkgs,errs)
677 isempty(errs) && return
678 println(stderr)
679 @warn """
680 ------------------------------------------------------------
681 # Update hook summary
682
683 $(join(keys(errs),", "," and ")) had update errors.
684
685 - Unrelated packages are unaffected
686 - To retry, run OldPkg.update() again
687 """
688 end
689
690 function test!(pkg::AbstractString,
691 errs::Vector{AbstractString},
692 nopkgs::Vector{AbstractString},
693 notests::Vector{AbstractString}; coverage::Bool=false)
694 reqs_path = abspath(pkg,"test","REQUIRE")
695 if isfile(reqs_path)
696 tests_require = Reqs.parse(reqs_path)
697 if (!isempty(tests_require))
698 @info "Computing test dependencies for $pkg..."
699 resolve(merge(Reqs.parse("REQUIRE"), tests_require))
700 end
701 end
702 test_path = abspath(pkg,"test","runtests.jl")
703 if !isdir(pkg)
704 push!(nopkgs, pkg)
705 elseif !isfile(test_path)
706 push!(notests, pkg)
707 else
708 @info "Testing $pkg"
709 cd(dirname(test_path)) do
710 try
711 cmd = ```
712 $(Base.julia_cmd())
713 --code-coverage=$(coverage ? "user" : "none")
714 --color=$(Base.have_color ? "yes" : "no")
715 --compiled-modules=$(Bool(Base.JLOptions().use_compiled_modules) ? "yes" : "no")
716 --check-bounds=yes
717 --warn-overwrite=yes
718 --startup-file=$(Base.JLOptions().startupfile != 2 ? "yes" : "no")
719 $test_path
720 ```
721 run(cmd)
722 @info "$pkg tests passed"
723 catch err
724 @error """
725 ------------------------------------------------------------
726 # Testing failed for $pkg
727 """ exception=err,catch_backtrace()
728 push!(errs,pkg)
729 end
730 end
731 end
732 isfile(reqs_path) && resolve()
733 end
734
735 struct PkgTestError <: Exception
736 msg::AbstractString
737 end
738
739 function Base.showerror(io::IO, ex::PkgTestError, bt; backtrace=true)
740 printstyled(io, ex.msg, color=Base.error_color())
741 end
742
743 function test(pkgs::Vector{AbstractString}; coverage::Bool=false)
744 errs = AbstractString[]
745 nopkgs = AbstractString[]
746 notests = AbstractString[]
747 for pkg in pkgs
748 test!(pkg,errs,nopkgs,notests; coverage=coverage)
749 end
750 if !all(isempty, (errs, nopkgs, notests))
751 messages = AbstractString[]
752 if !isempty(errs)
753 push!(messages, "$(join(errs,", "," and ")) had test errors")
754 end
755 if !isempty(nopkgs)
756 msg = length(nopkgs) > 1 ? " are not installed packages" :
757 " is not an installed package"
758 push!(messages, string(join(nopkgs,", ", " and "), msg))
759 end
760 if !isempty(notests)
761 push!(messages, "$(join(notests,", "," and ")) did not provide a test/runtests.jl file")
762 end
763 throw(PkgTestError(join(messages, "and")))
764 end
765 end
766
767 test(;coverage::Bool=false) = test(sort!(AbstractString[keys(installed())...]); coverage=coverage)
768
769 end # module
+0
-590
stdlib/OldPkg/src/query.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Query
3
4 import OldPkg
5 import ..PkgError
6 using ..Types
7
8 function init_resolve_backtrace(reqs::Requires, fix::Dict{String,Fixed} = Dict{String,Fixed}())
9 bktrc = ResolveBacktrace()
10 for (p,f) in fix
11 bktrc[p] = ResolveBacktraceItem(:fixed, f.version)
12 end
13 for (p,vs) in reqs
14 bktrcp = get!(bktrc, p) do; ResolveBacktraceItem() end
15 push!(bktrcp, :required, vs)
16 end
17 return bktrc
18 end
19
20 function check_fixed(reqs::Requires, fix::Dict{String,Fixed}, avail::Dict)
21 for (p1,f1) in fix
22 for p2 in keys(f1.requires)
23 haskey(avail, p2) || haskey(fix, p2) || throw(PkgError("unknown package $p2 required by $p1"))
24 end
25 satisfies(p1, f1.version, reqs) ||
26 @warn "$p1 is fixed at $(f1.version) conflicting with top-level requirement: $(reqs[p1])"
27 for (p2,f2) in fix
28 satisfies(p1, f1.version, f2.requires) ||
29 @warn "$p1 is fixed at $(f1.version) conflicting with requirement for $p2: $(f2.requires[p1])"
30 end
31 end
32 end
33
34 function propagate_fixed!(reqs::Requires, bktrc::ResolveBacktrace, fix::Dict{String,Fixed})
35 for (p,f) in fix
36 merge_requires!(reqs, f.requires)
37 for (rp,rvs) in f.requires
38 bktrcp = get!(bktrc, rp) do; ResolveBacktraceItem() end
39 push!(bktrcp, p=>bktrc[p], rvs)
40 end
41 end
42 for (p,f) in fix
43 delete!(reqs, p)
44 end
45 reqs
46 end
47
48 # Specialized copy for the avail argument below because the deepcopy is slow
49 function availcopy(avail)
50 new_avail = empty(avail)
51 for (pkg, vers_avail) in avail
52 new_vers_avail = empty(vers_avail)
53 for (version, pkg_avail) in vers_avail
54 new_vers_avail[version] = copy(pkg_avail)
55 end
56 new_avail[pkg] = new_vers_avail
57 end
58 return new_avail
59 end
60
61 # Generate a reverse dependency graph (package names only)
62 function gen_backdeps(avail::Dict)
63 backdeps = Dict{String,Set{String}}()
64 for (ap,av) in avail, (v,a) in av, rp in keys(a.requires)
65 s = get!(backdeps, rp) do; Set{String}() end
66 push!(s, ap)
67 end
68 return backdeps
69 end
70
71 function dependencies(avail::Dict, fix::Dict = Dict{String,Fixed}("julia"=>Fixed(VERSION)))
72 avail = availcopy(avail)
73 conflicts = Dict{String,Set{String}}()
74 to_expunge = VersionNumber[]
75 emptied = String[]
76 backdeps = gen_backdeps(avail)
77
78 for (fp,fx) in fix
79 delete!(avail, fp)
80 haskey(backdeps, fp) || continue
81 # for (ap,av) in avail
82 for ap in backdeps[fp]
83 haskey(avail, ap) || continue
84 av = avail[ap]
85 empty!(to_expunge)
86 for (v,a) in av
87 if satisfies(fp, fx.version, a.requires)
88 delete!(a.requires, fp)
89 else
90 conflicts_ap = get!(conflicts, ap) do; Set{String}() end
91 push!(conflicts_ap, fp)
92 # don't delete v from av right away so as not to screw up iteration
93 push!(to_expunge, v)
94 end
95 end
96 for v in to_expunge
97 delete!(av, v)
98 end
99 isempty(av) && push!(emptied, ap)
100 end
101 end
102 while !isempty(emptied)
103 deleted_pkgs = String[]
104 for ap in emptied
105 delete!(avail, ap)
106 push!(deleted_pkgs, ap)
107 end
108 empty!(emptied)
109
110 for dp in deleted_pkgs
111 haskey(backdeps, dp) || continue
112 for ap in backdeps[dp]
113 haskey(avail, ap) || continue
114 av = avail[ap]
115 empty!(to_expunge)
116 for (v,a) in av
117 haskey(a.requires, dp) || continue
118 conflicts_ap = get!(conflicts, ap) do; Set{String}() end
119 union!(conflicts_ap, conflicts[dp])
120 push!(to_expunge, v)
121 end
122 for v in to_expunge
123 delete!(av, v)
124 end
125 isempty(av) && push!(emptied, ap)
126 end
127 end
128 end
129 avail, conflicts
130 end
131
132 function partial_update_mask(instd::Dict{String,Tuple{VersionNumber,Bool}},
133 avail::Dict{String,Dict{VersionNumber,Available}}, upkgs::Set{String})
134 dont_update = Set{String}()
135 isempty(upkgs) && return dont_update
136 avail_new = deepcopy(avail)
137 for p in upkgs
138 haskey(instd, p) || throw(PkgError("Package $p is not installed"))
139 v = instd[p][1]
140 if haskey(avail, p)
141 for vn in keys(avail[p])
142 vn < v && delete!(avail_new[p], vn)
143 end
144 end
145 end
146 avail_new = dependencies_subset(avail_new, upkgs)
147
148 for p in keys(avail)
149 !haskey(avail_new, p) && push!(dont_update, p)
150 end
151 for p in keys(instd)
152 !haskey(avail_new, p) && p ∉ upkgs && push!(dont_update, p)
153 end
154 return dont_update
155 end
156
157 # Try to produce some helpful message in case of a partial update which does not go all the way
158 # (Does not do a full analysis, it only checks requirements and direct dependents.)
159 function check_partial_updates(reqs::Requires,
160 deps::Dict{String,Dict{VersionNumber,Available}},
161 want::Dict{String,VersionNumber},
162 fixed::Dict{String,Fixed},
163 upkgs::Set{String})
164 for p in upkgs
165 if !haskey(want, p)
166 if !haskey(fixed, p)
167 @warn "Something went wrong with the update of package $p, please submit a bug report"
168 continue
169 end
170 v = fixed[p].version
171 else
172 v = want[p]
173 if haskey(fixed, p) && v != fixed[p].version
174 @warn "Something went wrong with the update of package $p, please submit a bug report"
175 continue
176 end
177 end
178 haskey(deps, p) || continue
179 vers = sort!(collect(keys(deps[p])))
180 higher_vers = vers[vers .> v]
181 isempty(higher_vers) && continue # package p has been set to the highest available version
182
183 # Determine if there are packages which depend on `p` and somehow prevent its update to
184 # the latest version
185 blocking_parents = Set{String}()
186 for (p1,d1) in deps
187 p1 in upkgs && continue # package `p1` is among the ones to be updated, skip the check
188 haskey(fixed, p1) || continue # if package `p1` is not fixed, it can't be blocking
189 r1 = fixed[p1].requires # get `p1` requirements
190 haskey(r1, p) || continue # check if package `p1` requires `p`
191 vs1 = r1[p] # get the versions of `p` allowed by `p1` requirements
192 any(hv in vs1 for hv in higher_vers) && continue # package `p1` would allow some of the higher versions,
193 # therefore it's not responsible for blocking `p`
194 push!(blocking_parents, p1) # package `p1` is blocking the update of `p`
195 end
196
197 # Determine if the update of `p` is prevented by explicit user-provided requirements
198 blocking_reqs = (haskey(reqs, p) && all(hv ∉ reqs[p] for hv in higher_vers))
199
200 # Determine if the update of `p` is prevented by it being fixed (e.g. it's dirty, or pinned...)
201 isfixed = haskey(fixed, p)
202
203 @info begin
204 "Package $p was set to version $v, but a higher version $(vers[end]) exists.\n" *
205 if isfixed
206 "The package is fixed. You can try using `OldPkg.free(\"$p\")` to update it."
207 elseif blocking_reqs
208 "The update is prevented by explicit requirements constraints. Edit your REQUIRE file to change this."
209 elseif !isempty(blocking_parents)
210 string("To install the latest version, you could try updating these packages as well: ", join(blocking_parents, ", ", " and "), ".")
211 else
212 "To install the latest version, you could try doing a full update with `OldPkg.update()`."
213 end
214 end
215 end
216 end
217
218 const PackageState = Union{Nothing,VersionNumber}
219
220 function diff(have::Dict, want::Dict, avail::Dict, fixed::Dict)
221 change = Vector{Tuple{String,Tuple{PackageState,PackageState}}}()
222 remove = Vector{Tuple{String,Tuple{PackageState,PackageState}}}()
223
224 for pkg in collect(union(keys(have),keys(want)))
225 h, w = haskey(have,pkg), haskey(want,pkg)
226 if h && w
227 if have[pkg] != want[pkg]
228 push!(change, (pkg,(have[pkg], want[pkg])))
229 end
230 elseif h
231 push!(remove, (pkg,(have[pkg],nothing)))
232 elseif w
233 push!(change, (pkg,(nothing,want[pkg])))
234 end
235 end
236 append!(sort!(change), sort!(remove))
237 end
238
239 function check_requirements(reqs::Requires, deps::Dict{String,Dict{VersionNumber,Available}}, fix::Dict)
240 for (p,vs) in reqs
241 if !any(vn->(vn in vs), keys(deps[p]))
242 remaining_vs = VersionSet()
243 err_msg = "fixed packages introduce conflicting requirements for $p: \n"
244 available_list = sort!(collect(keys(deps[p])))
245 for (p1,f1) in fix
246 f1r = f1.requires
247 haskey(f1r, p) || continue
248 err_msg *= " $p1 requires versions $(f1r[p])"
249 if !any([vn in f1r[p] for vn in available_list])
250 err_msg *= " [none of the available versions can satisfy this requirement]"
251 end
252 err_msg *= "\n"
253 remaining_vs = intersect(remaining_vs, f1r[p])
254 end
255 if isempty(remaining_vs)
256 err_msg *= " the requirements are unsatisfiable because their intersection is empty"
257 else
258 err_msg *= " available versions are $(join(available_list, ", ", " and "))"
259 end
260 throw(PkgError(err_msg))
261 end
262 end
263 end
264
265 # If there are explicitly required packages, dicards all versions outside
266 # the allowed range.
267 # It also propagates requirements: when all allowed versions of a required package
268 # require some other package, this creates a new implicit requirement.
269 # The propagation is tracked so that in case a contradiction is detected the error
270 # message allows to determine the cause.
271 # This is a pre-pruning step, so it also creates some structures which are later used by pruning
272 function filter_versions(reqs::Requires, deps::Dict{String,Dict{VersionNumber,Available}}, bktrc::ResolveBacktrace)
273 allowed = Dict{String,Dict{VersionNumber,Bool}}()
274 staged = copy(reqs)
275 while !isempty(staged)
276 staged_next = Requires()
277 for (p,vs) in staged
278 # Parse requirements and store allowed versions.
279 depsp = deps[p]
280 if !haskey(allowed, p)
281 allowedp = Dict{VersionNumber,Bool}(vn=>true for vn in keys(depsp))
282 allowed[p] = allowedp
283 seen = false
284 else
285 allowedp = allowed[p]
286 oldallowedp = copy(allowedp)
287 seen = true
288 end
289 for vn in keys(depsp)
290 allowedp[vn] &= vn ∈ vs
291 end
292 @assert !isempty(allowedp)
293 if !any(values(allowedp))
294 err_msg = "Unsatisfiable requirements detected for package $p:\n"
295 err_msg *= string(bktrc[p])
296 err_msg *= """The intersection of the requirements is $(bktrc[p].versionreq).
297 None of the available versions can satisfy this requirement."""
298 throw(PkgError(err_msg))
299 end
300
301 # If we've seen this package already and nothing has changed since
302 # the last time, we stop here.
303 seen && allowedp == oldallowedp && continue
304
305 # Propagate requirements:
306 # if all allowed versions of a required package require some other package,
307 # then compute the union of the allowed versions for that other package, and
308 # treat that as a new requirement.
309 # Start by filtering out the non-allowed versions
310 fdepsp = Dict{VersionNumber,Available}(vn=>depsp[vn] for vn in keys(depsp) if allowedp[vn])
311 # Collect all required packages
312 isreq = Dict{String,Bool}(rp=>true for a in values(fdepsp) for rp in keys(a.requires))
313 # Compute whether a required package appears in all requirements
314 for rp in keys(isreq)
315 isreq[rp] = all(haskey(a.requires, rp) for a in values(fdepsp))
316 end
317
318 # Create a list of candidates for new implicit requirements
319 staged_new = Set{String}()
320 for a in values(fdepsp), (rp,rvs) in a.requires
321 # Skip packages that may not be required
322 isreq[rp] || continue
323 # Compute the union of the version sets
324 if haskey(staged_next, rp)
325 snvs = staged_next[rp]
326 union!(snvs, rvs)
327 else
328 snvs = copy(rvs)
329 staged_next[rp] = snvs
330 end
331 push!(staged_new, rp)
332 end
333 for rp in staged_new
334 @assert isreq[rp]
335 srvs = staged_next[rp]
336 bktrcp = get!(bktrc, rp) do; ResolveBacktraceItem(); end
337 push!(bktrcp, p=>bktrc[p], srvs)
338 if isa(bktrcp.versionreq, VersionSet) && isempty(bktrcp.versionreq)
339 err_msg = "Unsatisfiable requirements detected for package $rp:\n"
340 err_msg *= string(bktrcp)
341 err_msg *= "The intersection of the requirements is empty."
342 throw(PkgError(err_msg))
343 end
344 end
345 end
346 staged = staged_next
347 end
348
349 filtered_deps = Dict{String,Dict{VersionNumber,Available}}()
350 for (p,depsp) in deps
351 filtered_deps[p] = Dict{VersionNumber,Available}()
352 allowedp = get(allowed, p) do; Dict{VersionNumber,Bool}() end
353 fdepsp = filtered_deps[p]
354 for (vn,a) in depsp
355 get(allowedp, vn, true) || continue
356 fdepsp[vn] = a
357 end
358 end
359
360 return filtered_deps, allowed
361 end
362
363 # Reduce the number of versions by creating equivalence classes, and retaining
364 # only the highest version for each equivalence class.
365 # Two versions are equivalent if:
366 # 1) They appear together as dependencies of another package (i.e. for each
367 # dependency relation, they are both required or both not required)
368 # 2) They have the same dependencies
369 # Preliminarily calls filter_versions.
370 function prune_versions(reqs::Requires, deps::Dict{String,Dict{VersionNumber,Available}}, bktrc::ResolveBacktrace)
371 filtered_deps, allowed = filter_versions(reqs, deps, bktrc)
372 if !isempty(reqs)
373 filtered_deps = dependencies_subset(filtered_deps, Set{String}(keys(reqs)))
374 end
375
376 # To each version in each package, we associate a BitVector.
377 # It is going to hold a pattern such that all versions with
378 # the same pattern are equivalent.
379 vmask = Dict{String,Dict{VersionNumber, BitVector}}()
380
381 # For each package, we examine the dependencies of its versions
382 # and put together those which are equal.
383 # While we're at it, we also collect all dependencies into alldeps
384 alldeps = Dict{String,Set{VersionSet}}()
385 for (p,fdepsp) in filtered_deps
386 # Extract unique dependencies lists (aka classes), thereby
387 # assigning an index to each class.
388 uniqdepssets = unique(a.requires for a in values(fdepsp))
389
390 # Store all dependencies seen so far for later use
391 for r in uniqdepssets, (rp,rvs) in r
392 get!(alldeps, rp) do; Set{VersionSet}() end
393 push!(alldeps[rp], rvs)
394 end
395
396 # If the package has just one version, it's uninteresting
397 length(deps[p]) == 1 && continue
398
399 # Grow the pattern by the number of classes
400 luds = length(uniqdepssets)
401 @assert !haskey(vmask, p)
402 vmask[p] = Dict{VersionNumber,BitVector}()
403 vmaskp = vmask[p]
404 for vn in keys(fdepsp)
405 vmaskp[vn] = falses(luds)
406 end
407 for (vn,a) in fdepsp
408 vmind = findfirst(isequal(a.requires), uniqdepssets)
409 @assert vmind !== nothing
410 vm = vmaskp[vn]
411 vm[vmind] = true
412 end
413 end
414
415 # Produce dependency patterns.
416 for (p,vss) in alldeps, vs in vss
417 # packages with just one version, or dependencies
418 # which do not distinguish between versions, are not
419 # interesting
420 (length(deps[p]) == 1 || vs == VersionSet()) && continue
421
422 # Store the dependency info in the patterns
423 @assert haskey(vmask, p)
424 for (vn,vm) in vmask[p]
425 push!(vm, vn in vs)
426 end
427 end
428
429 # At this point, the vmask patterns are computed. We divide them into
430 # classes so that we can keep just one version for each class.
431 pruned_vers = Dict{String,Vector{VersionNumber}}()
432 eq_classes = Dict{String,Dict{VersionNumber,Vector{VersionNumber}}}()
433 for (p, vmaskp) in vmask
434 vmask0_uniq = unique(values(vmaskp))
435 nc = length(vmask0_uniq)
436 classes = [VersionNumber[] for c0 = 1:nc]
437 for (vn,vm) in vmaskp
438 c0 = findfirst(isequal(vm), vmask0_uniq)::Int
439 push!(classes[c0], vn)
440 end
441 map(sort!, classes)
442
443 # For each nonempty class, we store only the highest version)
444 pruned_vers[p] = VersionNumber[]
445 prunedp = pruned_vers[p]
446 eq_classes[p] = Dict{VersionNumber,Vector{VersionNumber}}()
447 eqclassp = eq_classes[p]
448 for cl in classes
449 if !isempty(cl)
450 vtop = maximum(cl)
451 push!(prunedp, vtop)
452 @assert !haskey(eqclassp, vtop)
453 eqclassp[vtop] = cl
454 end
455 end
456 sort!(prunedp)
457 end
458 # Put non-allowed versions into eq_classes
459 for (p, allowedp) in allowed
460 haskey(eq_classes, p) || continue
461 eqclassp = eq_classes[p]
462 for (vn, a) in allowedp
463 a && continue
464 eqclassp[vn] = [vn]
465 end
466 end
467 # Put all remaining packages into eq_classes
468 for (p, depsp) in deps
469 haskey(eq_classes, p) && continue
470 eq_classes[p] = Dict{VersionNumber,Vector{VersionNumber}}()
471 eqclassp = eq_classes[p]
472 for vn in keys(depsp)
473 eqclassp[vn] = [vn]
474 end
475 end
476
477
478 # Recompute deps. We could simplify them, but it's not worth it
479 new_deps = Dict{String,Dict{VersionNumber,Available}}()
480
481 for (p,depsp) in filtered_deps
482 @assert !haskey(new_deps, p)
483 if !haskey(pruned_vers, p)
484 new_deps[p] = depsp
485 continue
486 end
487 new_deps[p] = Dict{VersionNumber,Available}()
488 pruned_versp = pruned_vers[p]
489 for (vn,a) in depsp
490 vn ∈ pruned_versp || continue
491 new_deps[p][vn] = a
492 end
493 end
494
495 #println("pruning stats:")
496 #numvers = 0
497 #numdeps = 0
498 #for (p,d) in deps, (vn,a) in d
499 # numvers += 1
500 # for r in a.requires
501 # numdeps += 1
502 # end
503 #end
504 #numnewvers = 0
505 #numnewdeps = 0
506 #for (p,d) in new_deps, (vn,a) in d
507 # numnewvers += 1
508 # for r in a.requires
509 # numnewdeps += 1
510 # end
511 #end
512 #println(" before: vers=$numvers deps=$numdeps")
513 #println(" after: vers=$numnewvers deps=$numnewdeps")
514 #println()
515
516 return new_deps, eq_classes
517 end
518 prune_versions(deps::Dict{String,Dict{VersionNumber,Available}}) =
519 prune_versions(Dict{String,VersionSet}(), deps, ResolveBacktrace())
520 prune_versions(deps::Dict{String,Dict{VersionNumber,Available}}, bktrc::ResolveBacktrace) =
521 prune_versions(Dict{String,VersionSet}(), deps, bktrc)
522
523 # Build a graph restricted to a subset of the packages
524 function subdeps(deps::Dict{String,Dict{VersionNumber,Available}}, pkgs::Set{String})
525 sub_deps = Dict{String,Dict{VersionNumber,Available}}()
526 for p in pkgs
527 haskey(sub_deps, p) || (sub_deps[p] = Dict{VersionNumber,Available}())
528 sub_depsp = sub_deps[p]
529 for (vn,a) in deps[p]
530 sub_depsp[vn] = a
531 end
532 end
533
534 return sub_deps
535 end
536
537 # Build a subgraph including only the (direct and indirect) dependencies
538 # of a given package set
539 function dependencies_subset(deps::Dict{String,Dict{VersionNumber,Available}}, pkgs::Set{String})
540 staged::Set{String} = filter(p->p in keys(deps), pkgs)
541 allpkgs = copy(staged)
542 while !isempty(staged)
543 staged_next = Set{String}()
544 for p in staged, a in values(get(deps, p, Dict{VersionNumber,Available}())), rp in keys(a.requires)
545 rp ∉ allpkgs && rp ≠ "julia" && push!(staged_next, rp)
546 end
547 union!(allpkgs, staged_next)
548 staged = staged_next
549 end
550
551 return subdeps(deps, allpkgs)
552 end
553
554 # Build a subgraph including only the (direct and indirect) dependencies and dependants
555 # of a given package set
556 function undirected_dependencies_subset(deps::Dict{String,Dict{VersionNumber,Available}}, pkgs::Set{String})
557 graph = Dict{String, Set{String}}()
558
559 for (p,d) in deps
560 haskey(graph, p) || (graph[p] = Set{String}())
561 for a in values(d), rp in keys(a.requires)
562 push!(graph[p], rp)
563 haskey(graph, rp) || (graph[rp] = Set{String}())
564 push!(graph[rp], p)
565 end
566 end
567
568 staged = pkgs
569 allpkgs = copy(pkgs)
570 while !isempty(staged)
571 staged_next = Set{String}()
572 for p in staged, rp in graph[p]
573 rp ∉ allpkgs && push!(staged_next, rp)
574 end
575 union!(allpkgs, staged_next)
576 staged = staged_next
577 end
578
579 return subdeps(deps, allpkgs)
580 end
581
582 function prune_dependencies(reqs::Requires,
583 deps::Dict{String,Dict{VersionNumber,Available}},
584 bktrc::ResolveBacktrace = init_resolve_backtrace(reqs))
585 deps, _ = prune_versions(reqs, deps, bktrc)
586 return deps
587 end
588
589 end # module
+0
-255
stdlib/OldPkg/src/read.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Read
3
4 import OldPkg
5 import LibGit2
6 import ..Cache, ..Reqs, ..PkgError, ..Dir
7 using ..Types
8
9 readstrip(path...) = strip(read(joinpath(path...), String))
10
11 url(pkg::AbstractString) = readstrip(Dir.path("METADATA"), pkg, "url")
12 sha1(pkg::AbstractString, ver::VersionNumber) =
13 readstrip(Dir.path("METADATA"), pkg, "versions", string(ver), "sha1")
14
15 function available(names=readdir("METADATA"))
16 pkgs = Dict{String,Dict{VersionNumber,Available}}()
17 for pkg in names
18 isfile("METADATA", pkg, "url") || continue
19 versdir = joinpath("METADATA", pkg, "versions")
20 isdir(versdir) || continue
21 for ver in readdir(versdir)
22 occursin(Base.VERSION_REGEX, ver) || continue
23 isfile(versdir, ver, "sha1") || continue
24 haskey(pkgs,pkg) || (pkgs[pkg] = Dict{VersionNumber,Available}())
25 pkgs[pkg][VersionNumber(ver)] = Available(
26 readchomp(joinpath(versdir,ver,"sha1")),
27 Reqs.parse(joinpath(versdir,ver,"requires"))
28 )
29 end
30 end
31 return pkgs
32 end
33 available(pkg::AbstractString) = get(available([pkg]),pkg,Dict{VersionNumber,Available}())
34
35 function latest(names=readdir("METADATA"))
36 pkgs = Dict{String,Available}()
37 for pkg in names
38 isfile("METADATA", pkg, "url") || continue
39 versdir = joinpath("METADATA", pkg, "versions")
40 isdir(versdir) || continue
41 pkgversions = VersionNumber[]
42 for ver in readdir(versdir)
43 occursin(Base.VERSION_REGEX, ver) || continue
44 isfile(versdir, ver, "sha1") || continue
45 push!(pkgversions, VersionNumber(ver))
46 end
47 isempty(pkgversions) && continue
48 ver = string(maximum(pkgversions))
49 pkgs[pkg] = Available(
50 readchomp(joinpath(versdir,ver,"sha1")),
51 Reqs.parse(joinpath(versdir,ver,"requires"))
52 )
53 end
54 return pkgs
55 end
56
57 isinstalled(pkg::AbstractString) =
58 pkg != "METADATA" && pkg != "REQUIRE" && pkg[1] != '.' && isdir(pkg)
59
60 function isfixed(pkg::AbstractString, prepo::LibGit2.GitRepo, avail::Dict=available(pkg))
61 isinstalled(pkg) || throw(PkgError("$pkg is not an installed package."))
62 isfile("METADATA", pkg, "url") || return true
63 ispath(pkg, ".git") || return true
64
65 LibGit2.isdirty(prepo) && return true
66 LibGit2.isattached(prepo) && return true
67 LibGit2.need_update(prepo)
68 if findall("REQUIRE", LibGit2.GitIndex(prepo)) === nothing
69 isfile(pkg,"REQUIRE") && return true
70 end
71 head = string(LibGit2.head_oid(prepo))
72 for (ver,info) in avail
73 head == info.sha1 && return false
74 end
75
76 cache = Cache.path(pkg)
77 cache_has_head = if isdir(cache)
78 crepo = LibGit2.GitRepo(cache)
79 LibGit2.iscommit(head, crepo)
80 else
81 false
82 end
83 res = true
84 try
85 for (ver,info) in avail
86 if cache_has_head && LibGit2.iscommit(info.sha1, crepo)
87 if LibGit2.is_ancestor_of(head, info.sha1, crepo)
88 res = false
89 break
90 end
91 elseif LibGit2.iscommit(info.sha1, prepo)
92 if LibGit2.is_ancestor_of(head, info.sha1, prepo)
93 res = false
94 break
95 end
96 else
97 @warn """Unknown $pkg commit $(info.sha1[1:8]), metadata may be
98 ahead of package cache""" maxlog=1
99 end
100 end
101 finally
102 cache_has_head && LibGit2.close(crepo)
103 end
104 return res
105 end
106
107 function ispinned(pkg::AbstractString)
108 ispath(pkg,".git") || return false
109 LibGit2.with(LibGit2.GitRepo, pkg) do repo
110 return ispinned(repo)
111 end
112 end
113
114 function ispinned(prepo::LibGit2.GitRepo)
115 LibGit2.isattached(prepo) || return false
116 br = LibGit2.branch(prepo)
117 # note: regex is based on the naming scheme used in Entry.pin()
118 return occursin(r"^pinned\.[0-9a-f]{8}\.tmp$", br)
119 end
120
121 function installed_version(pkg::AbstractString, prepo::LibGit2.GitRepo, avail::Dict=available(pkg))
122 ispath(pkg,".git") || return typemin(VersionNumber)
123
124 # get package repo head hash
125 local head
126 try
127 head = string(LibGit2.head_oid(prepo))
128 catch ex
129 # refs/heads/master does not exist
130 if isa(ex,LibGit2.GitError) &&
131 ex.code == LibGit2.Error.EUNBORNBRANCH
132 head = ""
133 else
134 rethrow(ex)
135 end
136 end
137 isempty(head) && return typemin(VersionNumber)
138
139 vers = collect(keys(filter(#=ver,info=#p->p[2].sha1==head, avail)))
140 !isempty(vers) && return maximum(vers)
141
142 cache = Cache.path(pkg)
143 cache_has_head = if isdir(cache)
144 crepo = LibGit2.GitRepo(cache)
145 LibGit2.iscommit(head, crepo)
146 else
147 false
148 end
149 ancestors = VersionNumber[]
150 descendants = VersionNumber[]
151 try
152 for (ver,info) in avail
153 sha1 = info.sha1
154 base = if cache_has_head && LibGit2.iscommit(sha1, crepo)
155 LibGit2.merge_base(crepo, head, sha1)
156 elseif LibGit2.iscommit(sha1, prepo)
157 LibGit2.merge_base(prepo, head, sha1)
158 else
159 @warn """Unknown $pkg commit $(sha1[1:8]), metadata may be ahead
160 of package cache""" maxlog=1
161 continue
162 end
163 string(base) == sha1 && push!(ancestors,ver)
164 string(base) == head && push!(descendants,ver)
165 end
166 finally
167 cache_has_head && LibGit2.close(crepo)
168 end
169 both = sort!(intersect(ancestors,descendants))
170 isempty(both) || @warn "$pkg: some versions are both ancestors and descendants of head: $both"
171 if !isempty(descendants)
172 v = minimum(descendants)
173 return VersionNumber(v.major, v.minor, v.patch, ("",), ())
174 elseif !isempty(ancestors)
175 v = maximum(ancestors)
176 return VersionNumber(v.major, v.minor, v.patch, (), ("",))
177 else
178 return typemin(VersionNumber)
179 end
180 end
181
182 function requires_path(pkg::AbstractString, avail::Dict=available(pkg))
183 pkgreq = joinpath(pkg,"REQUIRE")
184 ispath(pkg,".git") || return pkgreq
185 repo = LibGit2.GitRepo(pkg)
186 head = LibGit2.with(LibGit2.GitRepo, pkg) do repo
187 LibGit2.isdirty(repo, "REQUIRE") && return pkgreq
188 LibGit2.need_update(repo)
189 if findall("REQUIRE", LibGit2.GitIndex(repo)) === nothing
190 isfile(pkgreq) && return pkgreq
191 end
192 string(LibGit2.head_oid(repo))
193 end
194 for (ver,info) in avail
195 if head == info.sha1
196 return joinpath("METADATA", pkg, "versions", string(ver), "requires")
197 end
198 end
199 return pkgreq
200 end
201
202 requires_list(pkg::AbstractString, avail::Dict=available(pkg)) =
203 collect(keys(Reqs.parse(requires_path(pkg,avail))))
204
205 requires_dict(pkg::AbstractString, avail::Dict=available(pkg)) =
206 Reqs.parse(requires_path(pkg,avail))
207
208 function installed(avail::Dict=available())
209 pkgs = Dict{String,Tuple{VersionNumber,Bool}}()
210 for pkg in readdir()
211 isinstalled(pkg) || continue
212 ap = get(avail,pkg,Dict{VersionNumber,Available}())
213 if ispath(pkg,".git")
214 LibGit2.with(LibGit2.GitRepo, pkg) do repo
215 ver = installed_version(pkg, repo, ap)
216 fixed = isfixed(pkg, repo, ap)
217 pkgs[pkg] = (ver, fixed)
218 end
219 else
220 pkgs[pkg] = (typemin(VersionNumber), true)
221 end
222 end
223 return pkgs
224 end
225
226 function fixed(avail::Dict=available(), inst::Dict=installed(avail), dont_update::Set{String}=Set{String}(),
227 julia_version::VersionNumber=VERSION)
228 pkgs = Dict{String,Fixed}()
229 for (pkg,(ver,fix)) in inst
230 (fix || pkg in dont_update) || continue
231 ap = get(avail,pkg,Dict{VersionNumber,Available}())
232 pkgs[pkg] = Fixed(ver,requires_dict(pkg,ap))
233 end
234 pkgs["julia"] = Fixed(julia_version)
235 return pkgs
236 end
237
238 function free(inst::Dict=installed(), dont_update::Set{String}=Set{String}())
239 pkgs = Dict{String,VersionNumber}()
240 for (pkg,(ver,fix)) in inst
241 (fix || pkg in dont_update) && continue
242 pkgs[pkg] = ver
243 end
244 return pkgs
245 end
246
247 function issue_url(pkg::AbstractString)
248 ispath(pkg,".git") || return ""
249 m = match(LibGit2.GITHUB_REGEX, url(pkg))
250 m === nothing && return ""
251 return "https://github.com/" * m.captures[1] * "/issues"
252 end
253
254 end # module
+0
-146
stdlib/OldPkg/src/reqs.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Reqs
3
4 import Base: ==
5 import OldPkg
6 import ..PkgError
7 using ..Types
8
9 # representing lines of REQUIRE files
10
11 abstract type Line end
12 struct Comment <: Line
13 content::AbstractString
14 end
15 struct Requirement <: Line
16 content::AbstractString
17 package::AbstractString
18 versions::VersionSet
19 system::Vector{AbstractString}
20
21 function Requirement(content::AbstractString)
22 fields = split(replace(content, r"#.*$" => ""))
23 system = AbstractString[]
24 while !isempty(fields) && fields[1][1] == '@'
25 push!(system,popfirst!(fields)[2:end])
26 end
27 isempty(fields) && throw(PkgError("invalid requires entry: $content"))
28 package = popfirst!(fields)
29 all(field->occursin(Base.VERSION_REGEX, field), fields) ||
30 throw(PkgError("invalid requires entry for $package: $content"))
31 versions = map(VersionNumber, fields)
32 issorted(versions) || throw(PkgError("invalid requires entry for $package: $content"))
33 new(content, package, VersionSet(versions), system)
34 end
35 function Requirement(package::AbstractString, versions::VersionSet, system::Vector{AbstractString}=AbstractString[])
36 content = ""
37 for os in system
38 content *= "@$os "
39 end
40 content *= package
41 if versions != VersionSet()
42 for ival in versions.intervals
43 (content *= " $(ival.lower)")
44 ival.upper < typemax(VersionNumber) &&
45 (content *= " $(ival.upper)")
46 end
47 end
48 new(content, package, versions, system)
49 end
50 end
51
52 ==(a::Line, b::Line) = a.content == b.content
53 hash(s::Line, h::UInt) = hash(s.content, h + (0x3f5a631add21cb1a % UInt))
54
55 # general machinery for parsing REQUIRE files
56
57 function read(readable::Vector{<:AbstractString})
58 lines = Line[]
59 for line in readable
60 line = chomp(line)
61 push!(lines, occursin(r"^\s*(?:#|$)", line) ? Comment(line) : Requirement(line))
62 end
63 return lines
64 end
65
66 function read(readable::Union{IO,Base.AbstractCmd})
67 lines = Line[]
68 for line in eachline(readable)
69 push!(lines, occursin(r"^\s*(?:#|$)", line) ? Comment(line) : Requirement(line))
70 end
71 return lines
72 end
73 read(file::AbstractString) = isfile(file) ? open(read,file) : Line[]
74
75 function write(io::IO, lines::Vector{Line})
76 for line in lines
77 println(io, line.content)
78 end
79 end
80 function write(io::IO, reqs::Requires)
81 for pkg in sort!(collect(keys(reqs)), by=lowercase)
82 println(io, Requirement(pkg, reqs[pkg]).content)
83 end
84 end
85 write(file::AbstractString, r::Union{Vector{Line},Requires}) = open(io->write(io,r), file, "w")
86
87 function parse(lines::Vector{Line})
88 reqs = Requires()
89 for line in lines
90 if isa(line,Requirement)
91 if !isempty(line.system)
92 applies = false
93 if Sys.iswindows(); applies |= ("windows" in line.system); end
94 if Sys.isunix(); applies |= ("unix" in line.system); end
95 if Sys.isapple(); applies |= ("osx" in line.system); end
96 if Sys.islinux(); applies |= ("linux" in line.system); end
97 if Sys.isbsd(); applies |= ("bsd" in line.system); end
98 if Sys.iswindows(); applies &= !("!windows" in line.system); end
99 if Sys.isunix(); applies &= !("!unix" in line.system); end
100 if Sys.isapple(); applies &= !("!osx" in line.system); end
101 if Sys.islinux(); applies &= !("!linux" in line.system); end
102 if Sys.isbsd(); applies &= !("!bsd" in line.system); end
103 applies || continue
104 end
105 reqs[line.package] = haskey(reqs, line.package) ?
106 intersect(reqs[line.package], line.versions) : line.versions
107 end
108 end
109 return reqs
110 end
111 parse(x) = parse(read(x))
112
113 function dependents(packagename::AbstractString)
114 pkgs = AbstractString[]
115 cd(OldPkg.dir()) do
116 for (pkg,latest) in OldPkg.Read.latest()
117 if haskey(latest.requires, packagename)
118 push!(pkgs, pkg)
119 end
120 end
121 end
122 pkgs
123 end
124
125 # add & rm – edit the content a requires file
126
127 function add(lines::Vector{Line}, pkg::AbstractString, versions::VersionSet=VersionSet())
128 v = VersionSet[]
129 filtered = filter(lines) do line
130 if !isa(line,Comment) && line.package == pkg && isempty(line.system)
131 push!(v, line.versions)
132 return false
133 end
134 return true
135 end
136 length(v) == 1 && v[1] == intersect(v[1],versions) && return copy(lines)
137 versions = reduce(intersect, v; init=versions)
138 push!(filtered, Requirement(pkg, versions))
139 end
140
141 rm(lines::Vector{Line}, pkg::AbstractString) = filter(lines) do line
142 isa(line,Comment) || line.package != pkg
143 end
144
145 end # module
+0
-128
stdlib/OldPkg/src/resolve/fieldvalue.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module FieldValues
3
4 using ...VersionWeights
5
6 export FieldValue, Field, validmax, secondmax
7
8 # FieldValue is a hierarchical numeric type with 6 levels.
9 # When summing two FieldValues, the levels are summed independently.
10 # When comparing them, lower levels take precedence.
11 # The levels are used as such:
12 # l0 : for hard constraints (dependencies and requirements)
13 # l1 : for favoring higher versions of the explicitly required
14 # packages
15 # l2 : for favoring higher versions of all other packages
16 # l3 : for favoring uninstallation of non-needed packages
17 # l4 : for favoring dependants over dependencies
18 # l5 : for symmetry-breaking random noise
19 #
20 struct FieldValue
21 l0::Int
22 l1::VersionWeight
23 l2::VersionWeight
24 l3::Int
25 l4::Int
26 l5::Int128
27 end
28 FieldValue(l0::Integer, l1::VersionWeight, l2::VersionWeight, l3::Integer, l4::Integer) = FieldValue(l0, l1, l2, l3, l4, Int128(0))
29 FieldValue(l0::Integer, l1::VersionWeight, l2::VersionWeight, l3::Integer) = FieldValue(l0, l1, l2, l3, 0)
30 FieldValue(l0::Integer, l1::VersionWeight, l2::VersionWeight) = FieldValue(l0, l1, l2, 0)
31 FieldValue(l0::Integer, l1::VersionWeight) = FieldValue(l0, l1, zero(VersionWeight))
32 FieldValue(l0::Integer) = FieldValue(l0, zero(VersionWeight))
33 FieldValue() = FieldValue(0)
34
35 # This isn't nice, but it's for debugging only anyway
36 function Base.show(io::IO, a::FieldValue)
37 print(io, a.l0)
38 a == FieldValue(a.l0) && return
39 print(io, ".", a.l1)
40 a == FieldValue(a.l0, a.l1) && return
41 print(io, ".", a.l2)
42 a == FieldValue(a.l0, a.l1, a.l2) && return
43 print(io, ".", a.l3)
44 a == FieldValue(a.l0, a.l1, a.l2, a.l3) && return
45 print(io, ".", a.l4)
46 a == FieldValue(a.l0, a.l1, a.l2, a.l3, a.l4) && return
47 print(io, ".", a.l5)
48 return
49 end
50
51 const Field = Vector{FieldValue}
52
53 Base.zero(::Type{FieldValue}) = FieldValue()
54
55 Base.typemin(::Type{FieldValue}) = (x=typemin(Int); y=typemin(VersionWeight); FieldValue(x, y, y, x, x, typemin(Int128)))
56
57 Base.:-(a::FieldValue, b::FieldValue) = FieldValue(a.l0-b.l0, a.l1-b.l1, a.l2-b.l2, a.l3-b.l3, a.l4-b.l4, a.l5-b.l5)
58 Base.:+(a::FieldValue, b::FieldValue) = FieldValue(a.l0+b.l0, a.l1+b.l1, a.l2+b.l2, a.l3+b.l3, a.l4+b.l4, a.l5+b.l5)
59
60 function Base.isless(a::FieldValue, b::FieldValue)
61 a.l0 < b.l0 && return true
62 a.l0 > b.l0 && return false
63 c = cmp(a.l1, b.l1)
64 c < 0 && return true
65 c > 0 && return false
66 c = cmp(a.l2, b.l2)
67 c < 0 && return true
68 c > 0 && return false
69 a.l3 < b.l3 && return true
70 a.l3 > b.l3 && return false
71 a.l4 < b.l4 && return true
72 a.l4 > b.l4 && return false
73 a.l5 < b.l5 && return true
74 return false
75 end
76
77 Base.:(==)(a::FieldValue, b::FieldValue) =
78 a.l0 == b.l0 && a.l1 == b.l1 && a.l2 == b.l2 && a.l3 == b.l3 && a.l4 == b.l4 && a.l5 == b.l5
79
80 Base.abs(a::FieldValue) = FieldValue(abs(a.l0), abs(a.l1), abs(a.l2), abs(a.l3), abs(a.l4), abs(a.l5))
81
82 Base.copy(a::FieldValue) = FieldValue(a.l0, copy(a.l1), copy(a.l2), a.l3, a.l4, a.l5)
83
84 function Base.unsafe_copyto!(dest::Field, doffs, src::Field, soffs, n)
85 for i = 1:n
86 dest[doffs+i-1] = copy(src[soffs+i-1])
87 end
88 return dest
89 end
90
91 # if the maximum field has l0 < 0, it means that
92 # some hard constraint is being violated
93 validmax(a::FieldValue) = a.l0 >= 0
94
95 # like usual argmax, but favors the highest indices
96 # in case of a tie
97 function Base.argmax(f::Field)
98 m = typemin(FieldValue)
99 mi = 0
100 for j = length(f):-1:1
101 if f[j] > m
102 m = f[j]
103 mi = j
104 end
105 end
106 @assert mi != 0
107 return mi
108 end
109
110 # secondmax returns the (normalized) value of the second maximum in a
111 # field. It's used to determine the most polarized field.
112 function secondmax(f::Field)
113 m = typemin(FieldValue)
114 m2 = typemin(FieldValue)
115 for i = 1:length(f)
116 a = f[i]
117 if a > m
118 m2 = m
119 m = a
120 elseif a > m2
121 m2 = a
122 end
123 end
124 return m2 - m
125 end
126
127 end
+0
-364
stdlib/OldPkg/src/resolve/interface.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module PkgToMaxSumInterface
3
4 using ...Types, ...Query, ..VersionWeights
5
6 export Interface, compute_output_dict, greedysolver,
7 verify_solution, enforce_optimality!
8
9 # A collection of objects which allow interfacing external (Pkg) and
10 # internal (MaxSum) representation
11 mutable struct Interface
12 # requirements and dependencies, in external representation
13 reqs::Requires
14 deps::Dict{String,Dict{VersionNumber,Available}}
15
16 # packages list
17 pkgs::Vector{String}
18
19 # number of packages
20 np::Int
21
22 # states per package: one per version + uninstalled
23 spp::Vector{Int}
24
25 # package dict: associates an index to each package name
26 pdict::Dict{String,Int}
27
28 # package versions: for each package, keep the list of the
29 # possible version numbers; this defines a
30 # mapping from version numbers of a package
31 # to indices
32 pvers::Vector{Vector{VersionNumber}}
33
34 # versions dict: associates a version index to each package
35 # version; such that
36 # pvers[p0][vdict[p0][vn]] = vn
37 vdict::Vector{Dict{VersionNumber,Int}}
38
39 # version weights: the weight for each version of each package
40 # (versions include the uninstalled state; the
41 # higher the weight, the more favored the version)
42 vweight::Vector{Vector{VersionWeight}}
43
44 function Interface(reqs::Requires, deps::Dict{String,Dict{VersionNumber,Available}})
45 # generate pkgs
46 pkgs = sort!(String[keys(deps)...])
47
48 np = length(pkgs)
49
50 # generate pdict
51 pdict = Dict{String,Int}(pkgs[i] => i for i = 1:np)
52
53 # generate spp and pvers
54 spp = Vector{Int}(undef, np)
55
56 pvers = [VersionNumber[] for i = 1:np]
57
58 for (p,depsp) in deps, vn in keys(depsp)
59 p0 = pdict[p]
60 push!(pvers[p0], vn)
61 end
62 for p0 = 1:np
63 sort!(pvers[p0])
64 spp[p0] = length(pvers[p0]) + 1
65 end
66
67 # generate vdict
68 vdict = [Dict{VersionNumber,Int}() for p0 = 1:np]
69 for (p,depsp) in deps
70 p0 = pdict[p]
71 vdict0 = vdict[p0]
72 pvers0 = pvers[p0]
73 for vn in keys(depsp)
74 for v0 in 1:length(pvers0)
75 if pvers0[v0] == vn
76 vdict0[vn] = v0
77 break
78 end
79 end
80 end
81 end
82
83 ## generate wveights:
84 vweight = Vector{Vector{VersionWeight}}(undef, np)
85 for p0 = 1:np
86 pvers0 = pvers[p0]
87 spp0 = spp[p0]
88 vweight0 = vweight[p0] = Vector{VersionWeight}(undef, spp0)
89 for v0 = 1:spp0-1
90 vweight0[v0] = VersionWeight(pvers0[v0])
91 end
92 vweight0[spp0] = VersionWeight(v"0") # last version means uninstalled
93 end
94
95 return new(reqs, deps, pkgs, np, spp, pdict, pvers, vdict, vweight)
96 end
97 end
98
99 # The output format is a Dict which associates a VersionNumber to each installed package name
100 function compute_output_dict(sol::Vector{Int}, interface::Interface)
101 pkgs = interface.pkgs
102 np = interface.np
103 pvers = interface.pvers
104 spp = interface.spp
105
106 want = Dict{String,VersionNumber}()
107 for p0 = 1:np
108 p = pkgs[p0]
109 s = sol[p0]
110 if s != spp[p0]
111 v = pvers[p0][s]
112 want[p] = v
113 end
114 end
115
116 return want
117 end
118
119 # Produce a trivial solution: try to maximize each version;
120 # bail out as soon as some non-trivial requirements are detected.
121 function greedysolver(interface::Interface)
122 reqs = interface.reqs
123 deps = interface.deps
124 spp = interface.spp
125 pdict = interface.pdict
126 pvers = interface.pvers
127 np = interface.np
128
129 # initialize solution: all uninstalled
130 sol = [spp[p0] for p0 = 1:np]
131
132 # set up required packages to their highest allowed versions
133 for (rp,rvs) in reqs
134 rp0 = pdict[rp]
135 # look for the highest version which satisfies the requirements
136 rv = spp[rp0] - 1
137 while rv > 0
138 rvn = pvers[rp0][rv]
139 rvn ∈ rvs && break
140 rv -= 1
141 end
142 @assert rv > 0
143 sol[rp0] = rv
144 end
145
146 # we start from required packages and explore the graph
147 # following dependencies
148 staged = Set{String}(keys(reqs))
149 seen = copy(staged)
150
151 while !isempty(staged)
152 staged_next = Set{String}()
153 for p in staged
154 p0 = pdict[p]
155 @assert sol[p0] < spp[p0]
156 vn = pvers[p0][sol[p0]]
157 a = deps[p][vn]
158
159 # scan dependencies
160 for (rp,rvs) in a.requires
161 rp0 = pdict[rp]
162 # look for the highest version which satisfies the requirements
163 rv = spp[rp0] - 1
164 while rv > 0
165 rvn = pvers[rp0][rv]
166 rvn ∈ rvs && break
167 rv -= 1
168 end
169 # if we found a version, and the package was uninstalled
170 # or the same version was already selected, we're ok;
171 # otherwise we can't be sure what the optimal configuration is
172 # and we bail out
173 if rv > 0 && (sol[rp0] == spp[rp0] || sol[rp0] == rv)
174 sol[rp0] = rv
175 else
176 return (false, Int[])
177 end
178
179 rp ∈ seen || push!(staged_next, rp)
180 end
181 end
182 union!(seen, staged_next)
183 staged = staged_next
184 end
185
186 @assert verify_solution(sol, interface)
187
188 return true, sol
189 end
190
191 # verifies that the solution fulfills all hard constraints
192 # (requirements and dependencies)
193 function verify_solution(sol::Vector{Int}, interface::Interface)
194 reqs = interface.reqs
195 deps = interface.deps
196 spp = interface.spp
197 pdict = interface.pdict
198 pvers = interface.pvers
199 vdict = interface.vdict
200
201 # verify requirements
202 for (p,vs) in reqs
203 p0 = pdict[p]
204 sol[p0] != spp[p0] || return false
205 vn = pvers[p0][sol[p0]]
206 vn ∈ vs || return false
207 end
208
209 # verify dependencies
210 for (p,d) in deps
211 p0 = pdict[p]
212 vdict0 = vdict[p0]
213 for (vn,a) in d
214 v0 = vdict0[vn]
215 if sol[p0] == v0
216 for (rp, rvs) in a.requires
217 p1 = pdict[rp]
218 if sol[p1] == spp[p1]
219 println("""
220 VERIFICATION ERROR: REQUIRED DEPENDENCY NOT INSTALLED
221 package p=$p (p0=$p0) version=$vn (v0=$v0) requires package rp=$rp in version set rvs=$rvs
222 but package $rp is not being installed (p1=$p1 sol[p1]=$(sol[p1]) == spp[p1]=$(spp[p1]))
223 """)
224 return false
225 end
226 vn1 = pvers[p1][sol[p1]]
227 if vn1 ∉ rvs
228 println("""
229 VERIFICATION ERROR: INVALID VERSION
230 package p=$p (p0=$p0) version=$vn (v0=$v0) requires package rp=$rp in version set rvs=$rvs
231 but package $rp version is being set to $vn1 (p1=$p1 sol[p1]=$(sol[p1]) spp[p1]=$(spp[p1]))
232 """)
233 return false
234 end
235 end
236 end
237 end
238 end
239 return true
240 end
241
242 # Push the given solution to a local optimium if needed
243 function enforce_optimality!(sol::Vector{Int}, interface::Interface)
244 np = interface.np
245
246 reqs = interface.reqs
247 deps = interface.deps
248 pkgs = interface.pkgs
249 spp = interface.spp
250 pdict = interface.pdict
251 pvers = interface.pvers
252 vdict = interface.vdict
253
254 # prepare some useful structures
255 # pdeps[p0][v0] has all dependencies of package p0 version v0
256 pdeps = [Vector{Requires}(undef, spp[p0]-1) for p0 = 1:np]
257 # prevdeps[p1][p0][v0] is the VersionSet of package p1 which package p0 version v0
258 # depends upon
259 prevdeps = [Dict{Int,Dict{Int,VersionSet}}() for p0 = 1:np]
260
261 for (p,d) in deps
262 p0 = pdict[p]
263 vdict0 = vdict[p0]
264 for (vn,a) in d
265 v0 = vdict0[vn]
266 pdeps[p0][v0] = a.requires
267 for (rp, rvs) in a.requires
268 p1 = pdict[rp]
269 if !haskey(prevdeps[p1], p0)
270 prevdeps[p1][p0] = Dict{Int,VersionSet}()
271 end
272 prevdeps[p1][p0][v0] = rvs
273 end
274 end
275 end
276
277 restart = true
278 while restart
279 restart = false
280 for p0 = 1:np
281 s0 = sol[p0]
282 if s0 >= spp[p0] - 1
283 # either the package is not installed,
284 # or it's already at the maximum version
285 continue
286 end
287 viol = false
288 # check if the higher version has a depencency which
289 # would be violated by the state of the remaining packages
290 for (p,vs) in pdeps[p0][s0+1]
291 p1 = pdict[p]
292 if sol[p1] == spp[p1]
293 # the dependency is violated because
294 # the other package is not being installed
295 viol = true
296 break
297 end
298 vn = pvers[p1][sol[p1]]
299 if vn ∉ vs
300 # the dependency is violated because
301 # the other package version is invalid
302 viol = true
303 break
304 end
305 end
306 viol && continue
307
308 # check if bumping the version would violate some
309 # dependency of another package
310 for (p1,d) in prevdeps[p0]
311 vs = get(d, sol[p1], nothing)
312 vs === nothing && continue
313 vn = pvers[p0][s0+1]
314 if vn ∉ vs
315 # bumping the version would violate
316 # the dependency
317 viol = true
318 break
319 end
320 end
321 viol && continue
322 # So the solution is non-optimal: we bump it manually
323 #@debug "Nonoptimal solution for package `$(interface.pkgs[p0])`: sol=$s0"
324 sol[p0] += 1
325 restart = true
326 end
327 end
328
329 # Finally uninstall unneeded packages:
330 # start from the required ones and keep only
331 # the packages reachable from them along the graph
332 uninst = trues(np)
333 staged = Set{String}(keys(reqs))
334 seen = copy(staged)
335
336 while !isempty(staged)
337 staged_next = Set{String}()
338 for p in staged
339 p0 = pdict[p]
340 uninst[p0] = false
341 @assert sol[p0] < spp[p0]
342 vn = pvers[p0][sol[p0]]
343 a = deps[p][vn]
344
345 # scan dependencies
346 for (rp,rvs) in a.requires
347 rp0 = pdict[rp]
348 @assert sol[rp0] < spp[rp0] && pvers[rp0][sol[rp0]] ∈ rvs
349 rp ∈ seen || push!(staged_next, rp)
350 end
351 end
352 union!(seen, staged_next)
353 staged = staged_next
354 end
355
356 for p0 in findall(uninst)
357 sol[p0] = spp[p0]
358 end
359
360 return
361 end
362
363 end
+0
-524
stdlib/OldPkg/src/resolve/maxsum.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module MaxSum
3
4 include("fieldvalue.jl")
5
6 using .FieldValues, ..VersionWeights, ..PkgToMaxSumInterface
7
8 export UnsatError, Graph, Messages, maxsum
9
10 # An exception type used internally to signal that an unsatisfiable
11 # constraint was detected
12 struct UnsatError <: Exception
13 info
14 end
15
16 # Some parameters to drive the decimation process
17 mutable struct MaxSumParams
18 nondec_iterations # number of initial iterations before starting
19 # decimation
20 dec_interval # number of iterations between decimations
21 dec_fraction # fraction of nodes to decimate at every decimation
22 # step
23
24 function MaxSumParams()
25 accuracy = parse(Int, get(ENV, "JULIA_PKGRESOLVE_ACCURACY", "1"))
26 if accuracy <= 0
27 error("JULIA_PKGRESOLVE_ACCURACY must be > 0")
28 end
29 nondec_iterations = accuracy * 20
30 dec_interval = accuracy * 10
31 dec_fraction = 0.05 / accuracy
32 return new(nondec_iterations, dec_interval, dec_fraction)
33 end
34 end
35
36 # Graph holds the graph structure onto which max-sum is run, in
37 # sparse format
38 mutable struct Graph
39 # adjacency matrix:
40 # for each package, has the list of neighbors
41 # indices (both dependencies and dependants)
42 gadj::Vector{Vector{Int}}
43
44 # compatibility mask:
45 # for each package p0 has a list of bool masks.
46 # Each entry in the list gmsk[p0] is relative to the
47 # package p1 as read from gadj[p0].
48 # Each mask has dimension spp1 x spp0, where
49 # spp0 is the number of states of p0, and
50 # spp1 is the number of states of p1.
51 gmsk::Vector{Vector{BitMatrix}}
52
53 # dependency direction:
54 # keeps track of which direction the dependency goes
55 # takes 3 values:
56 # 1 = dependant
57 # -1 = dependency
58 # 0 = both
59 # Used to break symmetry between dependants and
60 # dependencies (introduces a FieldValue at level l3).
61 # The "both" case is for when there are dependency
62 # relations which go both ways, in which case the
63 # noise is left to discriminate in case of ties
64 gdir::Vector{Vector{Int}}
65
66 # adjacency dict:
67 # allows one to retrieve the indices in gadj, so that
68 # gadj[p0][adjdict[p1][p0]] = p1
69 # ("At which index does package p1 appear in gadj[p0]?")
70 adjdict::Vector{Dict{Int,Int}}
71
72 # states per package: same as in Interface
73 spp::Vector{Int}
74
75 # update order: shuffled at each iteration
76 perm::Vector{Int}
77
78 # number of packages (all Vectors above have this length)
79 np::Int
80
81 function Graph(interface::Interface)
82 deps = interface.deps
83 np = interface.np
84
85 spp = interface.spp
86 pdict = interface.pdict
87 pvers = interface.pvers
88 vdict = interface.vdict
89
90 gadj = [Int[] for i = 1:np]
91 gmsk = [BitMatrix[] for i = 1:np]
92 gdir = [Int[] for i = 1:np]
93 adjdict = [Dict{Int,Int}() for i = 1:np]
94
95 for (p,d) in deps
96 p0 = pdict[p]
97 vdict0 = vdict[p0]
98 for (vn,a) in d
99 v0 = vdict0[vn]
100 for (rp, rvs) in a.requires
101 p1 = pdict[rp]
102
103 j0 = 1
104 while j0 <= length(gadj[p0]) && gadj[p0][j0] != p1
105 j0 += 1
106 end
107 j1 = 1
108 while j1 <= length(gadj[p1]) && gadj[p1][j1] != p0
109 j1 += 1
110 end
111 @assert (j0 > length(gadj[p0]) && j1 > length(gadj[p1])) ||
112 (j0 <= length(gadj[p0]) && j1 <= length(gadj[p1]))
113
114 if j0 > length(gadj[p0])
115 push!(gadj[p0], p1)
116 push!(gadj[p1], p0)
117 j0 = length(gadj[p0])
118 j1 = length(gadj[p1])
119
120 adjdict[p1][p0] = j0
121 adjdict[p0][p1] = j1
122
123 bm = trues(spp[p1], spp[p0])
124 bmt = trues(spp[p0], spp[p1])
125
126 push!(gmsk[p0], bm)
127 push!(gmsk[p1], bmt)
128
129 push!(gdir[p0], 1)
130 push!(gdir[p1], -1)
131 else
132 bm = gmsk[p0][j0]
133 bmt = gmsk[p1][j1]
134 if gdir[p0][j0] == -1
135 gdir[p0][j0] = 0
136 gdir[p1][j1] = 0
137 end
138 end
139
140 for v1 = 1:length(pvers[p1])
141 if pvers[p1][v1] ∉ rvs
142 bm[v1, v0] = false
143 bmt[v0, v1] = false
144 end
145 end
146 bm[end,v0] = false
147 bmt[v0,end] = false
148 end
149 end
150 end
151
152 perm = [1:np;]
153
154 return new(gadj, gmsk, gdir, adjdict, spp, perm, np)
155 end
156 end
157
158 # Messages has the cavity messages and the total fields, and
159 # gets updated iteratively (and occasionally decimated) until
160 # convergence
161 mutable struct Messages
162 # cavity incoming messages: for each package p0,
163 # for each neighbor p1 of p0,
164 # msg[p0][p1] is a vector of length spp[p0]
165 # messages are normalized (i.e. the max is always 0)
166 msg::Vector{Vector{Field}}
167
168 # overall fields: for each package p0,
169 # fld[p0] is a vector of length spp[p0]
170 # fields are not normalized
171 fld::Vector{Field}
172
173 # backup of the initial value of fld, to be used when resetting
174 initial_fld::Vector{Field}
175
176 # keep track of which variables have been decimated
177 decimated::BitVector
178 num_nondecimated::Int
179
180 function Messages(interface::Interface, graph::Graph)
181 reqs = interface.reqs
182 pkgs = interface.pkgs
183 np = interface.np
184 spp = interface.spp
185 pvers = interface.pvers
186 pdict = interface.pdict
187 vweight = interface.vweight
188
189 # a "deterministic noise" function based on hashes
190 function noise(p0::Int, v0::Int)
191 s = pkgs[p0] * string(v0 == spp[p0] ? "UNINST" : pvers[p0][v0])
192 Int128(hash(s))
193 end
194
195 # external fields: there are 2 terms, a noise to break potential symmetries
196 # and one to favor newest versions over older, and no-version over all
197 fld = [[FieldValue(0, zero(VersionWeight), vweight[p0][v0], (v0==spp[p0]), 0, noise(p0,v0)) for v0 = 1:spp[p0]] for p0 = 1:np]
198
199 # enforce requirements
200 for (rp, rvs) in reqs
201 p0 = pdict[rp]
202 pvers0 = pvers[p0]
203 fld0 = fld[p0]
204 for v0 = 1:spp[p0]-1
205 vn = pvers0[v0]
206 if !in(vn, rvs)
207 # the state is forbidden by requirements
208 fld0[v0] = FieldValue(-1)
209 else
210 # the state is one of those explicitly requested:
211 # favor it at a higher level than normal (upgrade
212 # FieldValue from l2 to l1)
213 fld0[v0] += FieldValue(0, vweight[p0][v0], -vweight[p0][v0])
214 end
215 end
216 # the uninstalled state is forbidden by requirements
217 fld0[spp[p0]] = FieldValue(-1)
218 end
219 # normalize fields
220 for p0 = 1:np
221 m = maximum(fld[p0])
222 for v0 = 1:spp[p0]
223 fld[p0][v0] -= m
224 end
225 end
226
227 initial_fld = deepcopy(fld)
228
229 # initialize cavity messages to 0
230 gadj = graph.gadj
231 msg = [[zeros(FieldValue, spp[p0]) for p1 = 1:length(gadj[p0])] for p0 = 1:np]
232
233 return new(msg, fld, initial_fld, falses(np), np)
234 end
235 end
236
237 function getsolution(msgs::Messages)
238 # the solution is just the location of the maximum in
239 # each field
240
241 fld = msgs.fld
242 np = length(fld)
243 sol = Vector{Int}(undef, np)
244 for p0 = 1:np
245 fld0 = fld[p0]
246 s0 = argmax(fld0)
247 if !validmax(fld0[s0])
248 throw(UnsatError(p0))
249 end
250 sol[p0] = s0
251 end
252 return sol
253 end
254
255 # This is the core of the max-sum solver:
256 # for a given node p0 (i.e. a package) updates all
257 # input cavity messages and fields of its neighbors
258 function update(p0::Int, graph::Graph, msgs::Messages)
259 gadj = graph.gadj
260 gmsk = graph.gmsk
261 gdir = graph.gdir
262 adjdict = graph.adjdict
263 spp = graph.spp
264 np = graph.np
265 msg = msgs.msg
266 fld = msgs.fld
267 decimated = msgs.decimated
268
269 maxdiff = zero(FieldValue)
270
271 gadj0 = gadj[p0]
272 msg0 = msg[p0]
273 fld0 = fld[p0]
274 spp0 = spp[p0]
275 adjdict0 = adjdict[p0]
276
277 # iterate over all neighbors of p0
278 for j0 in 1:length(gadj0)
279
280 p1 = gadj0[j0]
281 decimated[p1] && continue
282 j1 = adjdict0[p1]
283 #@assert j0 == adjdict[p1][p0]
284 bm1 = gmsk[p1][j1]
285 dir1 = gdir[p1][j1]
286 spp1 = spp[p1]
287 msg1 = msg[p1]
288
289 # compute the output cavity message p0->p1
290 cavmsg = fld0 - msg0[j0]
291
292 if dir1 == -1
293 # p0 depends on p1
294 for v0 = 1:spp0-1
295 cavmsg[v0] += FieldValue(0, VersionWeight(0), VersionWeight(0), 0, v0)
296 end
297 end
298
299 # keep the old input cavity message p0->p1
300 oldmsg = msg1[j1]
301
302 # init the new message to minus infinity
303 newmsg = [FieldValue(-1) for v1 = 1:spp1]
304
305 # compute the new message by passing cavmsg
306 # through the constraint encoded in the bitmask
307 # (nearly equivalent to:
308 # newmsg = [maximum(cavmsg[bm1[:,v1]]) for v1 = 1:spp1]
309 # except for the gnrg term)
310 m = FieldValue(-1)
311 for v1 = 1:spp1
312 for v0 = 1:spp0
313 if bm1[v0, v1]
314 newmsg[v1] = max(newmsg[v1], cavmsg[v0])
315 end
316 end
317 if dir1 == 1 && v1 != spp1
318 # p1 depends on p0
319 newmsg[v1] += FieldValue(0, VersionWeight(0), VersionWeight(0), 0, v1)
320 end
321 m = max(m, newmsg[v1])
322 end
323 if !validmax(m)
324 # No state available without violating some
325 # hard constraint
326 throw(UnsatError(p1))
327 end
328
329 # normalize the new message
330 for v1 = 1:spp1
331 newmsg[v1] -= m
332 end
333
334 diff = newmsg - oldmsg
335 maxdiff = max(maxdiff, maximum(abs.(diff)))
336
337 # update the field of p1
338 fld1 = fld[p1]
339 for v1 = 1:spp1
340 fld1[v1] += diff[v1]
341 end
342
343 # put the newly computed message in place
344 msg1[j1] = newmsg
345 end
346 return maxdiff
347 end
348
349 # A simple shuffling machinery for the update order in iterate()
350 # (woulnd't pass any random quality test but it's arguably enough)
351 let step=1
352 global shuffleperm, shuffleperminit
353 shuffleperminit() = (step = 1)
354 function shuffleperm(graph::Graph)
355 perm = graph.perm
356 np = graph.np
357 for j = np:-1:2
358 k = mod(step,j)+1
359 perm[j], perm[k] = perm[k], perm[j]
360 step += isodd(j) ? 1 : k
361 end
362 #@assert isperm(perm)
363 end
364 end
365
366 # Call update for all nodes (i.e. packages) in
367 # random order
368 function iterate(graph::Graph, msgs::Messages)
369 np = graph.np
370
371 maxdiff = zero(FieldValue)
372 shuffleperm(graph)
373 perm = graph.perm
374 for p0 in perm
375 maxdiff0 = update(p0, graph, msgs)
376 maxdiff = max(maxdiff, maxdiff0)
377 end
378 return maxdiff
379 end
380
381 function decimate1(p0::Int, graph::Graph, msgs::Messages)
382 decimated = msgs.decimated
383 fld = msgs.fld
384 adjdict = graph.adjdict
385 gmsk = graph.gmsk
386
387 @assert !decimated[p0]
388 fld0 = fld[p0]
389 s0 = argmax(fld0)
390 # only do the decimation if it is consistent with
391 # the previously decimated nodes
392 for p1 in findall(decimated)
393 haskey(adjdict[p0], p1) || continue
394 s1 = argmax(fld[p1])
395 j1 = adjdict[p0][p1]
396 gmsk[p1][j1][s0,s1] || return false
397 end
398 #println("DECIMATING $p0 (s0=$s0 fld=$fld0)")
399 for v0 = 1:length(fld0)
400 v0 == s0 && continue
401 fld0[v0] = FieldValue(-1)
402 end
403 msgs.decimated[p0] = true
404 msgs.num_nondecimated -= 1
405 return true
406 end
407
408 function reset_messages!(msgs::Messages)
409 msg = msgs.msg
410 fld = msgs.fld
411 initial_fld = msgs.initial_fld
412 decimated = msgs.decimated
413 np = length(fld)
414 for p0 = 1:np
415 map(m->fill!(m, zero(FieldValue)), msg[p0])
416 decimated[p0] && continue
417 fld[p0] = copy(initial_fld[p0])
418 end
419 return msgs
420 end
421
422 # If normal convergence fails (or is too slow) fix the most
423 # polarized packages by adding extra infinite fields on every state
424 # but the maximum
425 function decimate(n::Int, graph::Graph, msgs::Messages)
426 #println("DECIMATING $n NODES")
427 adjdict = graph.adjdict
428 fld = msgs.fld
429 decimated = msgs.decimated
430 fldorder = sortperm(fld, by=secondmax)
431 did_dec = false
432 for p0 in fldorder
433 decimated[p0] && continue
434 did_dec |= decimate1(p0, graph, msgs)
435 n -= 1
436 n == 0 && break
437 end
438 @assert n == 0
439 if !did_dec
440 # did not succeed in decimating anything;
441 # try to decimate at least one node
442 for p0 in fldorder
443 decimated[p0] && continue
444 if decimate1(p0, graph, msgs)
445 did_dec = true
446 break
447 end
448 end
449 end
450 if !did_dec
451 # still didn't succeed, give up
452 p0 = first(fldorder[.~(decimated)])
453 throw(UnsatError(p0))
454 end
455
456 reset_messages!(msgs)
457 return
458 end
459
460 # In case ties still exist at convergence, break them and
461 # keep converging
462 function break_ties(msgs::Messages)
463 fld = msgs.fld
464 unbroken_ties = Int[]
465 for p0 = 1:length(fld)
466 fld0 = fld[p0]
467 z = 0
468 m = typemin(FieldValue)
469 for v0 = 1:length(fld0)
470 if fld0[v0] > m
471 m = fld0[v0]
472 z = 1
473 elseif fld0[v0] == m
474 z += 1
475 end
476 end
477 if z > 1
478 #println("TIE! p0=$p0")
479 decimate1(p0, msgs) && return false
480 push!(unbroken_ties, p0)
481 end
482 end
483 # If there were ties, but none were broken, bail out
484 isempty(unbroken_ties) || throw(PkgError(first(unbroken_ties)))
485 return true
486 end
487
488 # Iterative solver: run iterate() until convergence
489 # (occasionally calling decimate())
490 function maxsum(graph::Graph, msgs::Messages)
491 params = MaxSumParams()
492
493 it = 0
494 shuffleperminit()
495 while true
496 it += 1
497 maxdiff = iterate(graph, msgs)
498 #println("it = $it maxdiff = $maxdiff")
499
500 if maxdiff == zero(FieldValue)
501 break_ties(msgs) && break
502 continue
503 end
504 if it >= params.nondec_iterations &&
505 (it - params.nondec_iterations) % params.dec_interval == 0
506 numdec = clamp(floor(Int, params.dec_fraction * graph.np), 1, msgs.num_nondecimated)
507 decimate(numdec, graph, msgs)
508 msgs.num_nondecimated == 0 && break
509 end
510 end
511
512 # Finally, decimate everything just to
513 # check against inconsistencies
514 # (old_numnondec is saved just to prevent
515 # wrong messages about accuracy)
516 old_numnondec = msgs.num_nondecimated
517 decimate(msgs.num_nondecimated, graph, msgs)
518 msgs.num_nondecimated = old_numnondec
519
520 return getsolution(msgs)
521 end
522
523 end
+0
-228
stdlib/OldPkg/src/resolve/versionweight.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module VersionWeights
3
4 export VersionWeight
5
6 struct HierarchicalValue{T}
7 v::Vector{T}
8 rest::T
9 end
10
11 HierarchicalValue(v::Vector{T}) where {T} = HierarchicalValue{T}(v, zero(T))
12 HierarchicalValue(T::Type) = HierarchicalValue(T[])
13
14 Base.zero(::Type{HierarchicalValue{T}}) where {T} = HierarchicalValue(T)
15
16 Base.typemin(::Type{HierarchicalValue{T}}) where {T} = HierarchicalValue(T[], typemin(T))
17
18 for f in (:-, :+)
19 @eval function Base.$f(a::HierarchicalValue{T}, b::HierarchicalValue{T}) where T
20 av = a.v
21 bv = b.v
22 la = length(a.v)
23 lb = length(b.v)
24 l0 = min(la, lb)
25 l1 = max(la, lb)
26 ld = la - lb
27 rv = Vector{T}(undef, l1)
28 rf = ($f)(a.rest, b.rest)
29 @inbounds for i = 1:l0
30 rv[i] = ($f)(av[i], bv[i])
31 end
32 @inbounds for i = l0+1:l0+ld
33 rv[i] = ($f)(av[i], b.rest)
34 end
35 @inbounds for i = l0+1:l0-ld
36 rv[i] = ($f)(a.rest, bv[i])
37 end
38 return HierarchicalValue(rv, rf)
39 end
40 end
41
42 Base.:-(a::HierarchicalValue) = HierarchicalValue(-a.v, -a.rest)
43
44 function Base.cmp(a::HierarchicalValue{T}, b::HierarchicalValue{T}) where T
45 av = a.v
46 bv = b.v
47 la = length(a.v)
48 lb = length(b.v)
49 l0 = min(la, lb)
50 l1 = max(la, lb)
51 ld = la - lb
52 @inbounds for i = 1:l0
53 c = cmp(av[i], bv[i]); c != 0 && return c
54 end
55 @inbounds for i = l0+1:l0+ld
56 c = cmp(av[i], b.rest); c != 0 && return c
57 end
58 @inbounds for i = l0+1:l0-ld
59 c = cmp(a.rest, bv[i]); c != 0 && return c
60 end
61 return cmp(a.rest, b.rest)
62 end
63 Base.isless(a::HierarchicalValue{T}, b::HierarchicalValue{T}) where {T} = cmp(a,b) < 0
64 Base.:(==)(a::HierarchicalValue{T}, b::HierarchicalValue{T}) where {T} = cmp(a,b) == 0
65
66 Base.abs(a::HierarchicalValue{T}) where {T} = HierarchicalValue(T[abs(x) for x in a.v], abs(a.rest))
67
68 Base.copy(a::HierarchicalValue{T}) where {T} = HierarchicalValue(T[copy(x) for x in a.v], copy(a.rest))
69
70 struct VWPreBuildItem
71 nonempty::Int
72 s::HierarchicalValue{Int}
73 i::Int
74 end
75 VWPreBuildItem() = VWPreBuildItem(0, HierarchicalValue(Int), 0)
76 VWPreBuildItem(i::Integer) = VWPreBuildItem(1, HierarchicalValue(Int), i)
77 VWPreBuildItem(s::String) = VWPreBuildItem(1, HierarchicalValue(Int[s...]), 0)
78
79 Base.zero(::Type{VWPreBuildItem}) = VWPreBuildItem()
80
81 Base.typemin(::Type{VWPreBuildItem}) = (x=typemin(Int); VWPreBuildItem(x, typemin(HierarchicalValue{Int}), x))
82
83 Base.:-(a::VWPreBuildItem, b::VWPreBuildItem) = VWPreBuildItem(a.nonempty-b.nonempty, a.s-b.s, a.i-b.i)
84 Base.:+(a::VWPreBuildItem, b::VWPreBuildItem) = VWPreBuildItem(a.nonempty+b.nonempty, a.s+b.s, a.i+b.i)
85
86 Base.:-(a::VWPreBuildItem) = VWPreBuildItem(-a.nonempty, -a.s, -a.i)
87
88 function Base.cmp(a::VWPreBuildItem, b::VWPreBuildItem)
89 c = cmp(a.nonempty, b.nonempty); c != 0 && return c
90 c = cmp(a.s, b.s); c != 0 && return c
91 return cmp(a.i, b.i)
92 end
93 Base.isless(a::VWPreBuildItem, b::VWPreBuildItem) = cmp(a,b) < 0
94 Base.:(==)(a::VWPreBuildItem, b::VWPreBuildItem) = cmp(a,b) == 0
95
96 Base.abs(a::VWPreBuildItem) = VWPreBuildItem(abs(a.nonempty), abs(a.s), abs(a.i))
97
98 Base.copy(a::VWPreBuildItem) = VWPreBuildItem(a.nonempty, copy(a.s), a.i)
99
100 struct VWPreBuild
101 nonempty::Int
102 w::HierarchicalValue{VWPreBuildItem}
103 end
104
105 const _vwprebuild_zero = VWPreBuild(0, HierarchicalValue(VWPreBuildItem))
106
107 function VWPreBuild(ispre::Bool, desc::Tuple{Vararg{Union{Integer,String}}})
108 isempty(desc) && return _vwprebuild_zero
109 desc == ("",) && return VWPreBuild(ispre ? -1 : 1, HierarchicalValue(VWPreBuildItem[]))
110 hv = HierarchicalValue([VWPreBuildItem(item) for item in desc])
111 return VWPreBuild(ispre ? -1 : 0, hv)
112 end
113 VWPreBuild() = _vwprebuild_zero
114
115 Base.zero(::Type{VWPreBuild}) = VWPreBuild()
116
117 const _vwprebuild_min = VWPreBuild(typemin(Int), typemin(HierarchicalValue{VWPreBuildItem}))
118 Base.typemin(::Type{VWPreBuild}) = _vwprebuild_min
119
120 function Base.:(-)(a::VWPreBuild, b::VWPreBuild)
121 b === _vwprebuild_zero && return a
122 a === _vwprebuild_zero && return -b
123 VWPreBuild(a.nonempty-b.nonempty, a.w-b.w)
124 end
125 function Base.:(+)(a::VWPreBuild, b::VWPreBuild)
126 b === _vwprebuild_zero && return a
127 a === _vwprebuild_zero && return b
128 VWPreBuild(a.nonempty+b.nonempty, a.w+b.w)
129 end
130
131 function Base.:(-)(a::VWPreBuild)
132 a === _vwprebuild_zero && return a
133 VWPreBuild(-a.nonempty, -a.w)
134 end
135
136 @inline function Base.cmp(a::VWPreBuild, b::VWPreBuild)
137 a === _vwprebuild_zero && b === _vwprebuild_zero && return 0
138 c = cmp(a.nonempty, b.nonempty); c != 0 && return c
139 return cmp(a.w, b.w)
140 end
141 Base.isless(a::VWPreBuild, b::VWPreBuild) = cmp(a,b) < 0
142 Base.:(==)(a::VWPreBuild, b::VWPreBuild) = cmp(a,b) == 0
143
144 function Base.abs(a::VWPreBuild)
145 a === _vwprebuild_zero && return a
146 VWPreBuild(abs(a.nonempty), abs(a.w))
147 end
148
149 function Base.copy(a::VWPreBuild)
150 a === _vwprebuild_zero && return a
151 VWPreBuild(a.nonempty, copy(a.w))
152 end
153
154 function Base.deepcopy_internal(a::VWPreBuild, dict::IdDict)
155 haskey(dict, a) && return dict[a]
156 b = (a === _vwprebuild_zero) ? _vwprebuild_zero : VWPreBuild(a.nonempty, Base.deepcopy_internal(a.w, dict))
157 dict[a] = b
158 return b
159 end
160
161 # The numeric type used to determine how the different
162 # versions of a package should be weighed
163 struct VersionWeight
164 major::Int
165 minor::Int
166 patch::Int
167 prerelease::VWPreBuild
168 build::VWPreBuild
169 end
170 VersionWeight(major::Int, minor::Int, patch::Int, prerelease::VWPreBuild) = VersionWeight(major, minor, patch, prerelease, zero(VWPreBuild))
171 VersionWeight(major::Int, minor::Int, patch::Int) = VersionWeight(major, minor, patch, zero(VWPreBuild))
172 VersionWeight(major::Int, minor::Int) = VersionWeight(major, minor, 0)
173 VersionWeight(major::Int) = VersionWeight(major, 0)
174 VersionWeight() = VersionWeight(0)
175
176 VersionWeight(vn::VersionNumber) =
177 VersionWeight(vn.major, vn.minor, vn.patch,
178 VWPreBuild(true, vn.prerelease), VWPreBuild(false, vn.build))
179
180 Base.zero(::Type{VersionWeight}) = VersionWeight()
181
182 Base.typemin(::Type{VersionWeight}) = (x=typemin(Int); y=typemin(VWPreBuild); VersionWeight(x, x, x, y, y))
183
184 Base.:(-)(a::VersionWeight, b::VersionWeight) =
185 VersionWeight(a.major-b.major, a.minor-b.minor, a.patch-b.patch,
186 a.prerelease-b.prerelease, a.build-b.build)
187
188 Base.:(+)(a::VersionWeight, b::VersionWeight) =
189 VersionWeight(a.major+b.major, a.minor+b.minor, a.patch+b.patch,
190 a.prerelease+b.prerelease, a.build+b.build)
191
192 Base.:(-)(a::VersionWeight) =
193 VersionWeight(-a.major, -a.minor, -a.patch,
194 -a.prerelease, -a.build)
195
196 function Base.cmp(a::VersionWeight, b::VersionWeight)
197 c = cmp(a.major, b.major); c != 0 && return c
198 c = cmp(a.minor, b.minor); c != 0 && return c
199 c = cmp(a.patch, b.patch); c != 0 && return c
200 c = cmp(a.prerelease, b.prerelease); c != 0 && return c
201 return cmp(a.build, b.build)
202 end
203 Base.isless(a::VersionWeight, b::VersionWeight) = cmp(a,b) < 0
204 Base.:(==)(a::VersionWeight, b::VersionWeight) = cmp(a,b) == 0
205
206 Base.abs(a::VersionWeight) =
207 VersionWeight(abs(a.major), abs(a.minor), abs(a.patch),
208 abs(a.prerelease), abs(a.build))
209
210 Base.copy(a::VersionWeight) =
211 VersionWeight(a.major, a.minor, a.patch,
212 copy(a.prerelease), copy(a.build))
213
214 # This isn't nice, but it's for debugging only anyway
215 function Base.show(io::IO, a::VersionWeight)
216 print(io, "(", a.major)
217 a == VersionWeight(a.major) && @goto done
218 print(io, ".", a.minor)
219 a == VersionWeight(a.major, a.minor) && @goto done
220 print(io, ".", a.patch)
221 a.prerelease ≠ _vwprebuild_zero && print(io, "-", a.prerelease)
222 a.build ≠ _vwprebuild_zero && print(io, "+", a.build)
223 @label done
224 print(io, ")")
225 end
226
227 end
+0
-166
stdlib/OldPkg/src/resolve.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Resolve
3
4 import OldPkg
5
6 include("resolve/versionweight.jl")
7 include("resolve/interface.jl")
8 include("resolve/maxsum.jl")
9
10 using ..Types, ..Query, .PkgToMaxSumInterface, .MaxSum
11 import ..PkgError
12
13 export resolve, sanity_check
14
15 # Use the max-sum algorithm to resolve packages dependencies
16 function resolve(reqs::Requires, deps::Dict{String,Dict{VersionNumber,Available}})
17 # init interface structures
18 interface = Interface(reqs, deps)
19
20 # attempt trivial solution first
21 ok, sol = greedysolver(interface)
22 if !ok
23 # trivial solution failed, use maxsum solver
24 graph = Graph(interface)
25 msgs = Messages(interface, graph)
26
27 try
28 sol = maxsum(graph, msgs)
29 catch err
30 isa(err, UnsatError) || rethrow(err)
31 p = interface.pkgs[err.info]
32 # TODO: build tools to analyze the problem, and suggest to use them here.
33 msg =
34 """
35 resolve is unable to satisfy package requirements.
36 The problem was detected when trying to find a feasible version
37 for package $p.
38 However, this only means that package $p is involved in an
39 unsatisfiable or difficult dependency relation, and the root of
40 the problem may be elsewhere.
41 """
42 if msgs.num_nondecimated != graph.np
43 msg *= """
44 (you may try increasing the value of the JULIA_PKGRESOLVE_ACCURACY
45 environment variable)
46 """
47 end
48 ## @info "ERROR MESSAGE:\n" * msg
49 throw(PkgError(msg))
50 end
51
52 # verify solution (debug code) and enforce its optimality
53 @assert verify_solution(sol, interface)
54 enforce_optimality!(sol, interface)
55 @assert verify_solution(sol, interface)
56 end
57
58 # return the solution as a Dict mapping package_name => sha1
59 return compute_output_dict(sol, interface)
60 end
61
62 # Scan dependencies for (explicit or implicit) contradictions
63 function sanity_check(deps::Dict{String,Dict{VersionNumber,Available}},
64 pkgs::Set{String} = Set{String}())
65 isempty(pkgs) || (deps = Query.undirected_dependencies_subset(deps, pkgs))
66
67 deps, eq_classes = Query.prune_versions(deps)
68
69 ndeps = Dict{String,Dict{VersionNumber,Int}}()
70
71 for (p,depsp) in deps
72 ndeps[p] = ndepsp = Dict{VersionNumber,Int}()
73 for (vn,a) in depsp
74 ndepsp[vn] = length(a.requires)
75 end
76 end
77
78 vers = [(p,vn) for (p,d) in deps for vn in keys(d)]
79 sort!(vers, by=pvn->(-ndeps[pvn[1]][pvn[2]]))
80
81 nv = length(vers)
82
83 svdict = Dict{Tuple{String,VersionNumber},Int}(vers[i][1:2]=>i for i = 1:nv)
84
85 checked = falses(nv)
86
87 problematic = Vector{Tuple{String,VersionNumber,String}}()
88
89 i = 1
90 for (p,vn) in vers
91 ndeps[p][vn] == 0 && break
92 checked[i] && (i += 1; continue)
93
94 fixed = Dict{String,Fixed}(p=>Fixed(vn, deps[p][vn].requires), "julia"=>Fixed(VERSION))
95 sub_reqs = Dict{String,VersionSet}()
96 bktrc = Query.init_resolve_backtrace(sub_reqs, fixed)
97 Query.propagate_fixed!(sub_reqs, bktrc, fixed)
98 sub_deps = Query.dependencies_subset(deps, Set{String}([p]))
99 sub_deps, conflicts = Query.dependencies(sub_deps, fixed)
100
101 try
102 for pkg in keys(sub_reqs)
103 if !haskey(sub_deps, pkg)
104 if "julia" in conflicts[pkg]
105 throw(PkgError("$pkg can't be installed because it has no versions that support $VERSION " *
106 "of julia. You may need to update METADATA by running `OldPkg.update()`"))
107 else
108 sconflicts = join(conflicts[pkg], ", ", " and ")
109 throw(PkgError("$pkg's requirements can't be satisfied because " *
110 "of the following fixed packages: $sconflicts"))
111 end
112 end
113 end
114 Query.check_requirements(sub_reqs, sub_deps, fixed)
115 sub_deps = Query.prune_dependencies(sub_reqs, sub_deps, bktrc)
116 catch err
117 isa(err, PkgError) || rethrow(err)
118 ## @info "ERROR MESSAGE:\n" * err.msg
119 for vneq in eq_classes[p][vn]
120 push!(problematic, (p, vneq, ""))
121 end
122 i += 1
123 continue
124 end
125 interface = Interface(sub_reqs, sub_deps)
126
127 red_pkgs = interface.pkgs
128 red_np = interface.np
129 red_spp = interface.spp
130 red_pvers = interface.pvers
131
132 ok, sol = greedysolver(interface)
133
134 if !ok
135 try
136 graph = Graph(interface)
137 msgs = Messages(interface, graph)
138 sol = maxsum(graph, msgs)
139 ok = verify_solution(sol, interface)
140 @assert ok
141 catch err
142 isa(err, UnsatError) || rethrow(err)
143 pp = red_pkgs[err.info]
144 for vneq in eq_classes[p][vn]
145 push!(problematic, (p, vneq, pp))
146 end
147 end
148 end
149 if ok
150 for p0 = 1:red_np
151 s0 = sol[p0]
152 if s0 != red_spp[p0]
153 j = svdict[(red_pkgs[p0], red_pvers[p0][s0])]
154 checked[j] = true
155 end
156 end
157 checked[i] = true
158 end
159 i += 1
160 end
161
162 return sort!(problematic)
163 end
164
165 end # module
+0
-258
stdlib/OldPkg/src/types.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Types
3
4 import OldPkg
5
6 export VersionInterval, VersionSet, Requires, Available, Fixed, merge_requires!, satisfies,
7 ResolveBacktraceItem, ResolveBacktrace
8 import Base: show, isempty, in, intersect, union!, union, ==, hash, copy, deepcopy_internal, push!
9
10 struct VersionInterval
11 lower::VersionNumber
12 upper::VersionNumber
13 end
14 VersionInterval(lower::VersionNumber) = VersionInterval(lower,typemax(VersionNumber))
15 VersionInterval() = VersionInterval(typemin(VersionNumber))
16
17 show(io::IO, i::VersionInterval) = print(io, "[$(i.lower),$(i.upper))")
18 isempty(i::VersionInterval) = i.upper <= i.lower
19 in(v::VersionNumber, i::VersionInterval) = i.lower <= v < i.upper
20 intersect(a::VersionInterval, b::VersionInterval) = VersionInterval(max(a.lower,b.lower), min(a.upper,b.upper))
21 ==(a::VersionInterval, b::VersionInterval) = a.lower == b.lower && a.upper == b.upper
22 hash(i::VersionInterval, h::UInt) = hash((i.lower, i.upper), h + (0x0f870a92db508386 % UInt))
23
24 function normalize!(ivals::Vector{VersionInterval})
25 # VersionSet internal normalization:
26 # removes empty intervals and fuses intervals without gaps
27 # e.g.:
28 # [0.0.0,1.0.0) ∪ [1.0.0,1.5.0) ∪ [1.6.0,1.6.0) ∪ [2.0.0,∞)
29 # becomes:
30 # [0.0.0,1.5.0) ∪ [2.0.0,∞)
31 # (still assumes that lower bounds are sorted, and intervals do
32 # not overlap)
33 l = length(ivals)
34 l == 0 && return ivals
35
36 lo, up, k0 = ivals[1].lower, ivals[1].upper, 1
37 fusing = false
38 for k = 2:l
39 lo1, up1 = ivals[k].lower, ivals[k].upper
40 if lo1 == up
41 up = up1
42 fusing = true
43 continue
44 end
45 if lo < up
46 # The only purpose of the "fusing" check is to avoid
47 # extra allocations
48 ivals[k0] = fusing ? VersionInterval(lo, up) : ivals[k-1]
49 k0 += 1
50 end
51 fusing = false
52 lo, up = lo1, up1
53 end
54 if lo < up
55 ivals[k0] = fusing ? VersionInterval(lo, up) : ivals[l]
56 k0 += 1
57 end
58 resize!(ivals, k0 - 1)
59 return ivals
60 end
61
62 struct VersionSet
63 intervals::Vector{VersionInterval}
64 VersionSet(intervals::Vector{VersionInterval}) = new(normalize!(intervals))
65 # copy is defined inside the struct block to call `new` directly
66 # without going through `normalize!`
67 Base.copy(vset::VersionSet) = new(copy(vset.intervals))
68 end
69 function VersionSet(versions::Vector{VersionNumber})
70 intervals = VersionInterval[]
71 if isempty(versions)
72 push!(intervals, VersionInterval())
73 else
74 isodd(length(versions)) && push!(versions, typemax(VersionNumber))
75 while !isempty(versions)
76 push!(intervals, VersionInterval(popfirst!(versions), popfirst!(versions)))
77 end
78 end
79 VersionSet(intervals)
80 end
81 VersionSet(versions::VersionNumber...) = VersionSet(VersionNumber[versions...])
82
83 const empty_versionset = VersionSet(VersionInterval[])
84
85 # Windows console doesn't like Unicode
86 const _empty_symbol = @static Sys.iswindows() ? "empty" : "∅"
87 const _union_symbol = @static Sys.iswindows() ? " or " : " ∪ "
88 show(io::IO, s::VersionSet) = isempty(s) ? print(io, _empty_symbol) :
89 join(io, s.intervals, _union_symbol)
90 isempty(s::VersionSet) = all(isempty, s.intervals)
91 in(v::VersionNumber, s::VersionSet) = any(i->in(v,i), s.intervals)
92 function intersect(A::VersionSet, B::VersionSet)
93 (isempty(A) || isempty(B)) && return copy(empty_versionset)
94 ivals = [intersect(a,b) for a in A.intervals for b in B.intervals]
95 sort!(ivals, by=i->i.lower)
96 VersionSet(ivals)
97 end
98
99 union(A::VersionSet, B::VersionSet) = union!(copy(A), B)
100 function union!(A::VersionSet, B::VersionSet)
101 A == B && return A
102 ivals = A.intervals
103 for intB in B.intervals
104 lB, uB = intB.lower, intB.upper
105 k0 = findfirst(i->(i.upper > lB), ivals)
106 if k0 === nothing
107 push!(ivals, intB)
108 continue
109 end
110 lB = min(lB, ivals[k0].lower)
111 for k1 = k0:length(ivals)
112 intA = ivals[k1]
113 if uB < intA.lower
114 splice!(ivals, k0:(k1-1), (VersionInterval(lB, uB),))
115 break
116 elseif uB ∈ intA || k1 == length(ivals)
117 splice!(ivals, k0:k1, (VersionInterval(lB, max(uB, intA.upper)),))
118 break
119 end
120 end
121 end
122 normalize!(ivals)
123 return A
124 end
125
126 ==(A::VersionSet, B::VersionSet) = A.intervals == B.intervals
127 hash(s::VersionSet, h::UInt) = hash(s.intervals, h + (0x2fd2ca6efa023f44 % UInt))
128 deepcopy_internal(vs::VersionSet, ::IdDict) = copy(vs)
129
130 const Requires = Dict{String,VersionSet}
131
132 function merge_requires!(A::Requires, B::Requires)
133 for (pkg,vers) in B
134 A[pkg] = haskey(A,pkg) ? intersect(A[pkg],vers) : vers
135 end
136 return A
137 end
138
139 satisfies(pkg::AbstractString, ver::VersionNumber, reqs::Requires) =
140 !haskey(reqs, pkg) || in(ver, reqs[pkg])
141
142 struct Available
143 sha1::String
144 requires::Requires
145 end
146
147 ==(a::Available, b::Available) = a.sha1 == b.sha1 && a.requires == b.requires
148 hash(a::Available, h::UInt) = hash((a.sha1, a.requires), h + (0xbc8ae0de9d11d972 % UInt))
149 copy(a::Available) = Available(a.sha1, copy(a.requires))
150
151 show(io::IO, a::Available) = isempty(a.requires) ?
152 print(io, "Available(", repr(a.sha1), ")") :
153 print(io, "Available(", repr(a.sha1), ",", a.requires, ")")
154
155 struct Fixed
156 version::VersionNumber
157 requires::Requires
158 end
159 Fixed(v::VersionNumber) = Fixed(v,Requires())
160
161 ==(a::Fixed, b::Fixed) = a.version == b.version && a.requires == b.requires
162 hash(f::Fixed, h::UInt) = hash((f.version, f.requires), h + (0x68628b809fd417ca % UInt))
163
164 show(io::IO, f::Fixed) = isempty(f.requires) ?
165 print(io, "Fixed(", repr(f.version), ")") :
166 print(io, "Fixed(", repr(f.version), ",", f.requires, ")")
167
168 # TODO: Available & Fixed are almost the same – merge them?
169 # Free could include the same information too, it just isn't
170 # required by anything that processes these things.
171
172
173 const VersionReq = Union{VersionNumber,VersionSet}
174 const WhyReq = Tuple{VersionReq,Any}
175
176 # This is used to keep track of dependency relations when propagating
177 # requirements, so as to emit useful information in case of unsatisfiable
178 # conditions.
179 # The `versionreq` field keeps track of the remaining allowed versions,
180 # intersecting all requirements.
181 # The `why` field is a Vector which keeps track of the requirements. Each
182 # entry is a Tuple of two elements:
183 # 1) the first element is the version requirement (can be a single VersionNumber
184 # or a VersionSet).
185 # 2) the second element can be either :fixed (for requirements induced by
186 # fixed packages), :required (for requirements induced by explicitly
187 # required packages), or a Pair p=>backtrace_item (for requirements induced
188 # indirectly, where `p` is the package name and `backtrace_item` is
189 # another ResolveBacktraceItem.
190 mutable struct ResolveBacktraceItem
191 versionreq::VersionReq
192 why::Vector{WhyReq}
193 ResolveBacktraceItem() = new(VersionSet(), WhyReq[])
194 ResolveBacktraceItem(reason, versionreq::VersionReq) = new(versionreq, WhyReq[(versionreq,reason)])
195 end
196
197 function push!(ritem::ResolveBacktraceItem, reason, versionset::VersionSet)
198 if isa(ritem.versionreq, VersionSet)
199 ritem.versionreq = ritem.versionreq ∩ versionset
200 elseif ritem.versionreq ∉ versionset
201 ritem.versionreq = copy(empty_versionset)
202 end
203 push!(ritem.why, (versionset,reason))
204 end
205
206 function push!(ritem::ResolveBacktraceItem, reason, version::VersionNumber)
207 if isa(ritem.versionreq, VersionSet)
208 if version ∈ ritem.versionreq
209 ritem.versionreq = version
210 else
211 ritem.versionreq = copy(empty_versionset)
212 end
213 elseif ritem.versionreq ≠ version
214 ritem.versionreq = copy(empty_versionset)
215 end
216 push!(ritem.why, (version,reason))
217 end
218
219
220 show(io::IO, ritem::ResolveBacktraceItem) = _show(io, ritem, "", Set{ResolveBacktraceItem}([ritem]))
221
222 function _show(io::IO, ritem::ResolveBacktraceItem, indent::String, seen::Set{ResolveBacktraceItem})
223 l = length(ritem.why)
224 for (i,(vs,w)) in enumerate(ritem.why)
225 print(io, indent, (i==l ? '└' : '├'), '─')
226 if w ≡ :fixed
227 @assert isa(vs, VersionNumber)
228 println(io, "version $vs set by fixed requirement (package is checked out, dirty or pinned)")
229 elseif w ≡ :required
230 @assert isa(vs, VersionSet)
231 println(io, "version range $vs set by an explicit requirement")
232 else
233 @assert isa(w, Pair{<:AbstractString,ResolveBacktraceItem})
234 if isa(vs, VersionNumber)
235 print(io, "version $vs ")
236 else
237 print(io, "version range $vs ")
238 end
239 print(io, "required by package $(w[1]), ")
240 if isa(w[2].versionreq, VersionSet)
241 println(io, "whose allowed version range is $(w[2].versionreq):")
242 else
243 println(io, "whose only allowed version is $(w[2].versionreq):")
244 end
245 if w[2] ∈ seen
246 println(io, (i==l ? " " : "│ ") * indent, "└─[see above for $(w[1]) backtrace]")
247 continue
248 end
249 push!(seen, w[2])
250 _show(io, w[2], (i==l ? " " : "│ ") * indent, seen)
251 end
252 end
253 end
254
255 const ResolveBacktrace = Dict{AbstractString,ResolveBacktraceItem}
256
257 end # module
+0
-65
stdlib/OldPkg/src/write.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module Write
3
4 import OldPkg
5 import ..Cache, ..Read, ..PkgError
6 using LibGit2
7
8 function prefetch(pkg::AbstractString, sha1::AbstractString)
9 isempty(Cache.prefetch(pkg, Read.url(pkg), sha1)) && return
10 throw(PkgError("$pkg: couldn't find commit $(sha1[1:10])"))
11 end
12
13 function fetch(repo::GitRepo, pkg::AbstractString, sha1::AbstractString)
14 cache = Cache.path(pkg)
15 LibGit2.fetch(repo, remoteurl=cache, refspecs=["+refs/*:refs/remotes/cache/*"])
16 LibGit2.need_update(repo)
17 LibGit2.iscommit(sha1, repo) && return
18 f = with(GitRepo, cache) do repo
19 LibGit2.iscommit(sha1, repo)
20 end ? "fetch" : "prefetch"
21 url = Read.issue_url(pkg)
22 if isempty(url)
23 throw(PkgError("$pkg: $f failed to get commit $(sha1[1:10]), please file a bug report with the package author."))
24 else
25 throw(PkgError("$pkg: $f failed to get commit $(sha1[1:10]), please file an issue at $url"))
26 end
27 end
28
29 function checkout(repo::GitRepo, pkg::AbstractString, sha1::AbstractString)
30 LibGit2.set_remote_url(repo, "origin", Cache.normalize_url(Read.url(pkg)))
31 LibGit2.checkout!(repo, sha1)
32 end
33
34 function install(pkg::AbstractString, sha1::AbstractString)
35 prefetch(pkg, sha1)
36 repo = if isdir(".trash/$pkg")
37 mv(".trash/$pkg", "./$pkg") #TODO check for newer version in cache before moving
38 GitRepo(pkg)
39 else
40 LibGit2.clone(Cache.path(pkg), pkg)
41 end
42 try
43 fetch(repo, pkg, sha1)
44 checkout(repo, pkg, sha1)
45 finally
46 close(repo)
47 end
48 end
49
50 function update(pkg::AbstractString, sha1::AbstractString)
51 prefetch(pkg, sha1)
52 with(GitRepo, pkg) do repo
53 fetch(repo, pkg, sha1)
54 checkout(repo, pkg, sha1)
55 end
56 end
57
58 function remove(pkg::AbstractString)
59 isdir(".trash") || mkdir(".trash")
60 ispath(".trash/$pkg") && rm(".trash/$pkg", recursive=true)
61 mv(pkg, ".trash/$pkg")
62 end
63
64 end # module
+0
-734
stdlib/OldPkg/test/pkg.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module PkgTests
3
4 using Test
5 import OldPkg
6 import OldPkg.PkgError
7 using LibGit2
8 using Random: randstring
9
10 function capture_stdout(f::Function)
11 let fname = tempname()
12 try
13 open(fname, "w") do fout
14 redirect_stdout(fout) do
15 f()
16 end
17 end
18 return read(fname, String)
19 finally
20 rm(fname, force=true)
21 end
22 end
23 end
24
25
26 function temp_pkg_dir(fn::Function, tmp_dir=joinpath(tempdir(), randstring()),
27 remove_tmp_dir::Bool=true; initialize::Bool=true)
28
29 # Used in tests below to set up and tear down a sandboxed package directory
30 withenv("JULIA_PKGDIR" => tmp_dir) do
31 @test !isdir(OldPkg.dir())
32 try
33 if initialize
34 OldPkg.init()
35 @test isdir(OldPkg.dir())
36 OldPkg.resolve()
37 else
38 mkpath(OldPkg.dir())
39 end
40 fn()
41 finally
42 remove_tmp_dir && rm(tmp_dir, recursive=true)
43 end
44 end
45 end
46
47 function write_build(pkg, content)
48 build_filename = OldPkg.dir(pkg, "deps", "build.jl")
49 mkpath(dirname(build_filename))
50 write(build_filename, content)
51 end
52
53 # Test basic operations: adding or removing a package, status, free
54 # Also test for the existence of REQUIRE and META_BRANCH
55 temp_pkg_dir() do
56 @test isfile(joinpath(OldPkg.dir(),"REQUIRE"))
57 @test isfile(joinpath(OldPkg.dir(),"META_BRANCH"))
58 @test isempty(OldPkg.installed())
59 @test sprint(OldPkg.status) == "No packages installed\n"
60 @test !isempty(OldPkg.available())
61
62 # 18325
63 cd(OldPkg.dir()) do
64 avail = OldPkg.Read.available()
65 avail_copy = OldPkg.Query.availcopy(avail);
66 delete!(avail_copy["Example"][v"0.0.1"].requires, "julia")
67 @test haskey(avail["Example"][v"0.0.1"].requires, "julia")
68 end
69
70 @test_throws PkgError OldPkg.installed("MyFakePackage")
71 @test_throws PkgError OldPkg.status("MyFakePackage")
72 @test OldPkg.installed("Example") === nothing
73
74 # Check that setprotocol! works.
75 begin
76 try
77 OldPkg.setprotocol!("notarealprotocol")
78 OldPkg.add("Example")
79 error("unexpected")
80 catch ex
81 if isa(ex, CompositeException)
82 ex = ex.exceptions[1]
83
84 if isa(ex, CapturedException)
85 ex = ex.ex
86 end
87 end
88 @test isa(ex,OldPkg.PkgError)
89 @test occursin("Cannot clone Example from notarealprotocol://github.com/JuliaLang/Example.jl.git", ex.msg)
90 end
91 end
92
93 OldPkg.setprotocol!("")
94 @test OldPkg.Cache.rewrite_url_to === nothing
95 OldPkg.setprotocol!("https")
96 OldPkg.add("Example")
97 @test [keys(OldPkg.installed())...] == ["Example"]
98 iob = IOBuffer()
99 OldPkg.checkout("Example")
100 OldPkg.status("Example", iob)
101 str = chomp(String(take!(iob)))
102 @test startswith(str, " - Example")
103 @test endswith(str, "master")
104 OldPkg.free("Example")
105 OldPkg.status("Example", iob)
106 str = chomp(String(take!(iob)))
107 @test endswith(str, string(OldPkg.installed("Example")))
108 OldPkg.checkout("Example")
109 OldPkg.free(("Example",))
110 OldPkg.status("Example", iob)
111 str = chomp(String(take!(iob)))
112 @test endswith(str, string(OldPkg.installed("Example")))
113 OldPkg.rm("Example")
114 @test isempty(OldPkg.installed())
115 @test !isempty(OldPkg.available("Example"))
116 @test !in("Example", keys(OldPkg.installed()))
117 OldPkg.rm("Example")
118 @test isempty(OldPkg.installed())
119 @test !isempty(OldPkg.available("Example"))
120 @test !in("Example", keys(OldPkg.installed()))
121 OldPkg.clone("https://github.com/JuliaLang/Example.jl.git")
122 @test [keys(OldPkg.installed())...] == ["Example"]
123 OldPkg.status("Example", iob)
124 str = chomp(String(take!(iob)))
125 @test startswith(str, " - Example")
126 @test endswith(str, "master")
127 OldPkg.free("Example")
128 OldPkg.status("Example", iob)
129 str = chomp(String(take!(iob)))
130 @test endswith(str, string(OldPkg.installed("Example")))
131 OldPkg.checkout("Example")
132 OldPkg.free(("Example",))
133 OldPkg.status("Example", iob)
134 str = chomp(String(take!(iob)))
135 @test endswith(str, string(OldPkg.installed("Example")))
136
137 # 17364 - a, OldPkg.checkout with specific local branch
138 let branch_name = "test-branch-1",
139 branch_commit = "ba3888212e30a7974ac6803a89e64c7098f4865e"
140
141 # create a branch in Example package
142 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example")) do repo
143 LibGit2.branch!(repo, branch_name, branch_commit, set_head=false)
144 end
145
146 OldPkg.clone(OldPkg.dir("Example"), "Example2")
147 OldPkg.clone(OldPkg.dir("Example"), "Example3")
148 open(OldPkg.dir("Example3", "README.md"), "w") do f
149 println(f, "overwritten")
150 end
151 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example3")) do repo
152 LibGit2.add!(repo, "README.md")
153 test_sig = LibGit2.Signature("TEST", "TEST@TEST.COM", round(time()), 0)
154 LibGit2.commit(repo, "testmsg"; author=test_sig, committer=test_sig)
155 end
156
157 OldPkg.checkout("Example2", branch_name)
158 OldPkg.checkout("Example3", branch_name)
159
160 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example2")) do repo
161 @test LibGit2.head_oid(repo) == LibGit2.GitHash(branch_commit)
162 end
163 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example3")) do repo
164 @test LibGit2.head_oid(repo) == LibGit2.GitHash(branch_commit)
165 end
166 end
167
168 # 17364 - b, remote off-tree branch
169 let branch_name = "test-branch-2",
170 branch_commit = "ba3888212e30a7974ac6803a89e64c7098f4865e"
171
172 # create a branch in Example package
173 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example")) do repo
174 LibGit2.branch!(repo, branch_name, branch_commit, set_head=true)
175 end
176
177 # Make changes to local branch
178 open(OldPkg.dir("Example", "README.md"), "w") do f
179 println(f, "overwritten")
180 end
181
182 test_commit = LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example")) do repo
183 LibGit2.add!(repo, "README.md")
184 test_sig = LibGit2.Signature("TEST", "TEST@TEST.COM", round(time()), 0)
185 LibGit2.commit(repo, "testmsg"; author=test_sig, committer=test_sig)
186 end
187 OldPkg.checkout("Example")
188
189 OldPkg.clone(OldPkg.dir("Example"), "Example4")
190 OldPkg.checkout("Example4", branch_name)
191
192 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example4")) do repo
193 @test LibGit2.head_oid(repo) == test_commit
194 end
195 end
196
197 # adding a package with unsatisfiable julia version requirements (REPL.jl) errors
198 try
199 OldPkg.add("REPL")
200 error("unexpected")
201 catch err
202 @test isa(err.exceptions[1].ex, PkgError)
203 @test err.exceptions[1].ex.msg == "REPL can't be installed because " *
204 "it has no versions that support $VERSION of julia. You may " *
205 "need to update METADATA by running `OldPkg.update()`"
206 end
207
208 # trying to add, check availability, or pin a nonexistent package errors
209 try
210 OldPkg.add("NonexistentPackage")
211 error("unexpected")
212 catch err
213 @test isa(err.exceptions[1].ex, PkgError)
214 @test err.exceptions[1].ex.msg == "unknown package NonexistentPackage"
215 end
216 try
217 OldPkg.available("NonexistentPackage")
218 error("unexpected")
219 catch err
220 @test isa(err, PkgError)
221 @test err.msg == "NonexistentPackage is not a package (not registered or installed)"
222 end
223 try
224 OldPkg.pin("NonexistentPackage", v"1.0.0")
225 error("unexpected")
226 catch err
227 @test isa(err, PkgError)
228 @test err.msg == "NonexistentPackage is not a git repo"
229 end
230
231 # trying to pin a git repo under OldPkg.dir that is not an installed package errors
232 try
233 OldPkg.pin("METADATA", v"1.0.0")
234 error("unexpected")
235 catch err
236 @test isa(err, PkgError)
237 @test err.msg == "METADATA cannot be pinned – not an installed package"
238 end
239
240 # trying to pin an installed, registered package to an unregistered version errors
241 try
242 OldPkg.pin("Example", v"2147483647.0.0")
243 error("unexpected")
244 catch err
245 @test isa(err, PkgError)
246 @test err.msg == "Example – 2147483647.0.0 is not a registered version"
247 end
248
249 # PR #13572, handling of versions with untagged detached heads
250 LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example")) do repo
251 LibGit2.checkout!(repo, "72f09c7d0099793378c645929a9961155faae6d2")
252 end
253 @test OldPkg.installed()["Example"] > v"0.0.0"
254
255 # issue #13583
256 begin
257 try
258 OldPkg.test("IDoNotExist")
259 error("unexpected")
260 catch ex
261 @test isa(ex,OldPkg.Entry.PkgTestError)
262 @test ex.msg == "IDoNotExist is not an installed package"
263 end
264
265 try
266 OldPkg.test("IDoNotExist1", "IDoNotExist2")
267 error("unexpected")
268 catch ex
269 @test isa(ex,OldPkg.Entry.PkgTestError)
270 @test ex.msg == "IDoNotExist1 and IDoNotExist2 are not installed packages"
271 end
272 end
273
274 # Various pin/free/re-pin/change-pin patterns (issue #17176)
275 @test "" == capture_stdout() do
276 nothingtodomsg = (:info,"No packages to install, update or remove")
277
278 @test_logs((:info,"Freeing Example"),
279 nothingtodomsg,
280 OldPkg.free("Example"))
281
282 @test_logs (:info,r"^Creating Example branch pinned\.[0-9a-f]{8}\.tmp$") OldPkg.pin("Example")
283 vers = OldPkg.installed("Example")
284 branch = LibGit2.with(LibGit2.GitRepo, OldPkg.dir("Example")) do repo
285 LibGit2.branch(repo)
286 end
287
288 @test_logs((:info,"Freeing Example"),
289 nothingtodomsg,
290 OldPkg.free("Example"))
291
292 @test_logs((:info,"Creating Example branch pinned.b1990792.tmp"),
293 nothingtodomsg, OldPkg.pin("Example", v"0.4.0"))
294 @test OldPkg.installed("Example") == v"0.4.0"
295
296 @test_logs (:info,r"^Package Example is already pinned to the selected commit$") OldPkg.pin("Example", v"0.4.0")
297 @test OldPkg.installed("Example") == v"0.4.0"
298
299 @test_logs (:info,r"^Package Example is already pinned$") OldPkg.pin("Example")
300 @test OldPkg.installed("Example") == v"0.4.0"
301
302 @test_logs (:info,"Package Example: skipping update (pinned)...") match_mode=:any OldPkg.update()
303 @test OldPkg.installed("Example") == v"0.4.0"
304
305 @test_logs((:info,"Creating Example branch pinned.d1ef7b00.tmp"),
306 nothingtodomsg, OldPkg.pin("Example", v"0.3.1"))
307 @test OldPkg.installed("Example") == v"0.3.1"
308
309 @test_logs((:info,"Package Example: checking out existing branch pinned.b1990792.tmp"),
310 nothingtodomsg, OldPkg.pin("Example", v"0.4.0"))
311 @test OldPkg.installed("Example") == v"0.4.0"
312
313 @test_logs((:info,"Freeing Example"),
314 nothingtodomsg, OldPkg.free("Example"))
315 @test OldPkg.installed("Example") == vers
316
317 @test_logs (:info,Regex("^Package Example: checking out existing branch $branch\$")) OldPkg.pin("Example")
318 @test OldPkg.installed("Example") == vers
319
320 @test_logs((:info,"Freeing Example"),
321 nothingtodomsg, OldPkg.free("Example"))
322 @test OldPkg.installed("Example") == vers
323 end
324
325 begin
326 # bug identified in #16850, Base.url \ vs / for non-Base methods
327 include(OldPkg.dir("Example","src","Example.jl"))
328 meth = first(methods(Example.domath))
329 fname = string(meth.file)
330 @test ('\\' in fname) == Sys.iswindows()
331 @test startswith(Base.url(meth), "https://github.com/JuliaLang/Example.jl/tree")
332 end
333
334 # add a directory that is not a git repository
335 begin
336 mkdir(joinpath(OldPkg.dir(), "NOTGIT"))
337 OldPkg.installed("NOTGIT") == typemin(VersionNumber)
338 OldPkg.installed()["NOTGIT"] == typemin(VersionNumber)
339 end
340
341 begin
342 # don't bork when a Pkg repo is bare, issue #13804
343 pth = joinpath(OldPkg.dir(), "BAREGIT")
344 mkdir(pth)
345 # create a bare repo (isbare = true)
346 repo = LibGit2.init(pth, true)
347 @test repo.ptr != C_NULL
348 close(repo)
349 OldPkg.update()
350 end
351
352 #test PkgDev redirects
353 begin
354 try
355 OldPkg.register("IDoNotExist")
356 error("unexpected")
357 catch ex
358 @test ex.msg == "OldPkg.register(pkg,[url]) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
359 end
360
361 try
362 OldPkg.tag("IDoNotExist")
363 error("unexpected")
364 catch ex
365 @test ex.msg == "OldPkg.tag(pkg, [ver, [commit]]) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
366 end
367
368 try
369 OldPkg.generate("IDoNotExist","MIT")
370 error("unexpected")
371 catch ex
372 @test ex.msg == "OldPkg.generate(pkg, license) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
373 end
374
375 try
376 OldPkg.publish()
377 error("unexpected")
378 catch ex
379 @test ex.msg == "OldPkg.publish() has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
380 end
381
382 try
383 OldPkg.license()
384 error("unexpected")
385 catch ex
386 @test ex.msg == "OldPkg.license([lic]) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
387 end
388 try
389 OldPkg.submit("IDoNotExist")
390 error("unexpected")
391 catch ex
392 @test ex.msg == "OldPkg.submit(pkg[, commit]) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
393 end
394 try
395 OldPkg.submit("IDoNotExist", "nonexistentcommit")
396 error("unexpected")
397 catch ex
398 @test ex.msg == "OldPkg.submit(pkg[, commit]) has been moved to the package PkgDev.jl.\nRun OldPkg.add(\"PkgDev\") to install PkgDev on Julia v0.5-"
399 end
400 end
401
402 # Test OldPkg.Read.url works
403 @test OldPkg.Read.url("Example") == "git://github.com/JuliaLang/Example.jl.git"
404
405 # issue #15789, build failure warning are printed correctly.
406 # Also makes sure `OldPkg.build()` works even for non-git repo
407 begin
408 pth = joinpath(OldPkg.dir(), "BuildFail")
409 mkdir(pth)
410 depspath = joinpath(pth, "deps")
411 mkdir(depspath)
412 depsbuild = joinpath(depspath, "build.jl")
413 touch(depsbuild)
414 # OldPkg.build works without the src directory now
415 # but it's probably fine to require it.
416 msg = read(`$(Base.julia_cmd()) --startup-file=no -e 'redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); import OldPkg; OldPkg.build("BuildFail")'`, String)
417 @test occursin("Building BuildFail", msg)
418 @test !occursin("Build failed for BuildFail", msg)
419 open(depsbuild, "w") do fd
420 println(fd, "error(\"Throw build error\")")
421 end
422 msg = read(`$(Base.julia_cmd()) --startup-file=no -e 'redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); import OldPkg; OldPkg.build("BuildFail")'`, String)
423 @test occursin("Building BuildFail", msg)
424 @test occursin("Build failed for BuildFail", msg)
425 @test occursin("OldPkg.build(\"BuildFail\")", msg)
426 @test occursin("Throw build error", msg)
427 end
428
429 # issue #15948
430 let package = "Example"
431 OldPkg.rm(package) # Remove package if installed
432 @test OldPkg.installed(package) === nothing # Registered with METADATA but not installed
433 msg = read(ignorestatus(`$(Base.julia_cmd()) --startup-file=no -e "redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); import OldPkg; OldPkg.build(\"$package\")"`), String)
434 @test occursin("$package is not an installed package", msg)
435 @test !occursin("signal (15)", msg)
436 end
437
438 # issue #20695
439 OldPkg.cd() do
440 @test OldPkg.Entry.url_and_pkg("Example") == ("git://github.com/JuliaLang/Example.jl.git", "Example")
441 for url = [
442 "https://github.com/Org/Nonsense",
443 "git@github.com:Org/Nonsense",
444 "file:///home/user/Nonsense",
445 "/home/user/Nonsense",
446 ]
447 @test OldPkg.Entry.url_and_pkg(url) == (url, "Nonsense")
448 @test OldPkg.Entry.url_and_pkg("$url.jl") == ("$url.jl", "Nonsense")
449 @test OldPkg.Entry.url_and_pkg("$url.git") == ("$url.git", "Nonsense")
450 @test OldPkg.Entry.url_and_pkg("$url.jl.git") == ("$url.jl.git", "Nonsense")
451 end
452 pkg = randstring(20)
453 @test OldPkg.Entry.url_and_pkg(pkg) == (pkg, pkg)
454 end
455
456 # partial OldPkg.update
457 @test "" == capture_stdout() do
458 nothingtodomsg = (:info,"No packages to install, update or remove")
459
460 @test_logs (:info,r"Installing Example v") match_mode=:any begin
461 OldPkg.rm("Example")
462 OldPkg.add("Example")
463 end
464
465 @test_logs nothingtodomsg match_mode=:any OldPkg.update("Example")
466
467 @test_logs (:info,"Installing Example v0.4.0") match_mode=:any begin
468 OldPkg.rm("Example")
469 OldPkg.add("Example", v"0", v"0.4.1-") # force version to be < 0.4.1
470 end
471
472
473 @test_logs((:info,r"""Package Example was set to version 0\.4\.0, but a higher version \d+\.\d+\.\d+\S* exists.
474 The update is prevented by explicit requirements constraints. Edit your REQUIRE file to change this."""),
475 nothingtodomsg, match_mode=:any, OldPkg.update("Example"))
476
477 @test_logs (:info,r"Installing Example") match_mode=:any begin
478 OldPkg.rm("Example")
479 OldPkg.add("Example")
480 OldPkg.pin("Example", v"0.4.0")
481 end
482
483 @test_logs((:info,"Package Example: skipping update (pinned)..."),
484 (:info,r"""Package Example was set to version 0\.4\.0, but a higher version \d+\.\d+\.\d+\S* exists.
485 The package is fixed. You can try using `OldPkg.free\("Example"\)` to update it."""),
486 nothingtodomsg, match_mode=:any, OldPkg.update("Example"))
487
488 metadata_dir = OldPkg.dir("METADATA")
489 old_commit = "313bfaafa301e82d40574a778720e893c559a7e2"
490
491 # Force a METADATA rollback to an old version, so that we will install some
492 # outdated versions of some packages and then update some of those
493 # (note that the following OldPkg.update calls will update METADATA to the
494 # latest version even though they don't update all packages)
495 LibGit2.with(LibGit2.GitRepo, metadata_dir) do repo
496 LibGit2.reset!(repo, LibGit2.GitHash(old_commit), LibGit2.Consts.RESET_HARD)
497 end
498
499 # run these at an old metadata commit where it's guaranteed no
500 # packages depend on Example.jl
501 @test isempty(OldPkg.dependents("Example"))
502 @test isempty(OldPkg.dependents("Example.jl"))
503
504 logs,_ = Test.collect_test_logs() do
505 OldPkg.add("Iterators")
506 OldPkg.update("Iterators")
507 end
508 @test all(!occursin("updated but were already imported", l.message) for l in logs)
509
510 # Do it again, because the above Iterators test will update things prematurely
511 LibGit2.with(LibGit2.GitRepo, metadata_dir) do repo
512 LibGit2.reset!(repo, LibGit2.GitHash(old_commit), LibGit2.Consts.RESET_HARD)
513 end
514
515 @test_logs((:info,"Installing Colors v0.6.4"),
516 (:info,"Installing ColorTypes v0.2.2"),
517 (:info,"Installing FixedPointNumbers v0.1.3"),
518 (:info,"Installing Compat v0.7.18"),
519 (:info,"Installing Reexport v0.0.3"), match_mode=:any, OldPkg.add("Colors"))
520
521 logs,_ = Test.collect_test_logs() do
522 OldPkg.update("ColorTypes")
523 end
524 @test any(occursin((:info, r"Upgrading ColorTypes: v0\.2\.2 => v\d+\.\d+\.\d+"), l) for l in logs)
525 @test any(occursin((:info, r"Upgrading Compat: v0\.7\.18 => v\d+\.\d+\.\d+"), l) for l in logs)
526 @test !any(occursin((:info, r"Upgrading Colors"), l) for l in logs)
527
528 @test OldPkg.installed("Colors") == v"0.6.4"
529
530 @test_logs nothingtodomsg match_mode=:any OldPkg.update("FixedPointNumbers")
531 end
532
533 # issue #18239
534 let package = "Example"
535 OldPkg.free(package)
536 OldPkg.rm(package) # Remove package if installed
537
538 metadata_dir = OldPkg.dir("METADATA")
539 old_commit = "83ff7116e51fc9cdbd7e67affbd344b9f5c9dbf2"
540
541 # Reset METADATA to the second to last update of Example.jl
542 LibGit2.with(LibGit2.GitRepo, metadata_dir) do repo
543 LibGit2.reset!(repo, LibGit2.GitHash(old_commit), LibGit2.Consts.RESET_HARD)
544 end
545
546 OldPkg.add(package)
547 msg = read(ignorestatus(`$(Base.julia_cmd()) --startup-file=no -e
548 "import OldPkg; push!(LOAD_PATH, OldPkg.dir()); redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); using Example; OldPkg.update(\"$package\")"`), String)
549 @test occursin(Regex("- $package.*Restart Julia to use the updated versions","s"), msg)
550 end
551
552 # Verify that the --startup-file flag is respected by OldPkg.build / OldPkg.test
553 let package = "StartupFile"
554 content = """
555 @info "JULIA_RC_LOADED defined \$(isdefined(@__MODULE__, :JULIA_RC_LOADED))"
556 @info "Main.JULIA_RC_LOADED defined \$(isdefined(Main, :JULIA_RC_LOADED))"
557 """
558
559 write_build(package, content)
560
561 test_filename = OldPkg.dir(package, "test", "runtests.jl")
562 mkpath(dirname(test_filename))
563 write(test_filename, content)
564
565 # Make a ~/.julia/config/startup.jl
566 home = OldPkg.dir(".home")
567 mkpath(joinpath(home, ".julia", "config"))
568 write(joinpath(home, ".julia", "config", "startup.jl"),
569 "const JULIA_RC_LOADED = true")
570
571 withenv((Sys.iswindows() ? "USERPROFILE" : "HOME") => home) do
572 code = "redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); import OldPkg; OldPkg.build(\"$package\")"
573 msg = read(`$(Base.julia_cmd()) --startup-file=no -e $code`, String)
574 @test occursin("JULIA_RC_LOADED defined false", msg)
575 @test occursin("Main.JULIA_RC_LOADED defined false", msg)
576
577 msg = read(`$(Base.julia_cmd()) --startup-file=yes -e $code`, String)
578 @test occursin("JULIA_RC_LOADED defined false", msg)
579 @test occursin("Main.JULIA_RC_LOADED defined true", msg)
580
581 code = "redirect_stderr(stdout); using Logging; global_logger(SimpleLogger(stdout)); import OldPkg; OldPkg.test(\"$package\")"
582
583 msg = read(`$(Base.julia_cmd()) --startup-file=no -e $code`, String)
584 @test occursin("JULIA_RC_LOADED defined false", msg)
585 @test occursin("Main.JULIA_RC_LOADED defined false", msg)
586
587 # Note: Since both the startup-file and "runtests.jl" are run in the Main
588 # module any global variables created in the startup file can be referenced.
589 msg = read(`$(Base.julia_cmd()) --startup-file=yes -e $code`, String)
590 @test occursin("JULIA_RC_LOADED defined true", msg)
591 @test occursin("Main.JULIA_RC_LOADED defined true", msg)
592 end
593 end
594
595 let package = "Output"
596 stdout_file = OldPkg.dir(package, "stdout.txt")
597 stderr_file = OldPkg.dir(package, "stderr.txt")
598 content = """
599 println(stdout, "stdout")
600 println(stderr, "stderr")
601 """
602 write_build(package, content)
603
604 code = "import OldPkg; OldPkg.build(\"$package\")"
605 msg = run(pipeline(
606 `$(Base.julia_cmd()) --startup-file=no -e $code`,
607 stdout=stdout_file, stderr=stderr_file))
608 @test last(readlines(stdout_file)) == "stdout"
609 @test last(readlines(stderr_file)) == "stderr"
610 end
611 end
612
613 @testset "Pkg functions with .jl extension" begin
614 temp_pkg_dir() do
615 @test OldPkg.installed("Example.jl") === nothing
616 OldPkg.add("Example.jl")
617 @test [keys(OldPkg.installed())...] == ["Example"]
618 iob = IOBuffer()
619 OldPkg.update("Example.jl")
620 OldPkg.checkout("Example.jl")
621 OldPkg.status("Example.jl", iob)
622 str = chomp(String(take!(iob)))
623 @test startswith(str, " - Example")
624 @test endswith(str, "master")
625 OldPkg.free("Example.jl")
626 OldPkg.status("Example.jl", iob)
627 str = chomp(String(take!(iob)))
628 @test endswith(str, string(OldPkg.installed("Example.jl")))
629 OldPkg.checkout("Example.jl")
630 OldPkg.free(("Example.jl",))
631 OldPkg.status("Example.jl", iob)
632 str = chomp(String(take!(iob)))
633 @test endswith(str, string(OldPkg.installed("Example.jl")))
634 OldPkg.rm("Example.jl")
635 @test isempty(OldPkg.installed())
636 @test !isempty(OldPkg.available("Example.jl"))
637 @test !in("Example", keys(OldPkg.installed()))
638 OldPkg.rm("Example.jl")
639 @test isempty(OldPkg.installed())
640 @test !isempty(OldPkg.available("Example.jl"))
641 @test !in("Example", keys(OldPkg.installed()))
642 OldPkg.clone("https://github.com/JuliaLang/Example.jl.git")
643 @test [keys(OldPkg.installed())...] == ["Example"]
644 OldPkg.status("Example.jl", iob)
645 str = chomp(String(take!(iob)))
646 @test startswith(str, " - Example")
647 @test endswith(str, "master")
648 OldPkg.free("Example.jl")
649 OldPkg.status("Example.jl", iob)
650 str = chomp(String(take!(iob)))
651 @test endswith(str, string(OldPkg.installed("Example.jl")))
652 OldPkg.checkout("Example.jl")
653 OldPkg.free(("Example.jl",))
654 OldPkg.status("Example.jl", iob)
655 str = chomp(String(take!(iob)))
656 @test endswith(str, string(OldPkg.installed("Example.jl")))
657 end
658 end
659
660 let io = IOBuffer()
661 Base.showerror(io, OldPkg.Entry.PkgTestError("ppp"), backtrace())
662 @test !occursin("backtrace()", String(take!(io)))
663 end
664
665 @testset "Relative path operations" begin
666 cd(tempdir()) do
667 temp_pkg_dir(randstring()) do
668 OldPkg.add("Example")
669 @test [keys(OldPkg.installed())...] == ["Example"]
670 end
671 end
672 end
673
674 temp_pkg_dir(initialize=false) do
675 write_build("Normal", "")
676 write_build("Error", "error(\"An error has occurred while building a package\")")
677 write_build("Exit", "exit()")
678
679 cd(OldPkg.dir()) do
680 errors = Dict()
681
682 # Log forwarding TODO - port these to @test_logs
683 empty!(errors)
684 @test_warn ("Building Error",
685 "Building Normal") OldPkg.Entry.build!(["Error", "Normal"], errors)
686
687 empty!(errors)
688 @test_warn ("Building Exit",
689 "Building Normal") OldPkg.Entry.build!(["Exit", "Normal"], errors)
690
691 empty!(errors)
692 @test_warn ("Building Exit",
693 "Building Normal",
694 "Building Exit",
695 "Building Normal") OldPkg.Entry.build!(["Exit", "Normal", "Exit", "Normal"], errors)
696 end
697 end
698
699 # VersionSet tests
700 import OldPkg.Types: VersionSet, VersionInterval
701
702 function chkint(a::VersionSet)
703 ints = a.intervals
704 for k = 1:length(ints)
705 ints[k].lower < ints[k].upper || return false
706 k < length(ints) && (ints[k].upper < ints[k+1].lower || return false)
707 end
708 return true
709 end
710
711 const empty_versionset = VersionSet(VersionInterval[])
712 @test isempty(empty_versionset)
713
714 # VersionSet intersections and unions
715 @test empty_versionset ∩ empty_versionset == empty_versionset
716 @test empty_versionset ∪ empty_versionset == empty_versionset
717 for t = 1:1_000
718 a = VersionSet(sort!(map(v->VersionNumber(v...), [(rand(0:8),rand(0:3)) for i = 1:rand(0:10)]))...)
719 b = VersionSet(sort!(map(v->VersionNumber(v...), [(rand(0:8),rand(0:3)) for i = 1:rand(0:10)]))...)
720 @assert chkint(a)
721 @assert chkint(b)
722 u = a ∪ b
723 @test chkint(u)
724 i = a ∩ b
725 @test chkint(i)
726 for vM = 0:9, vm = 0:5
727 v = VersionNumber(vM, vm)
728 @test (v ∈ a || v ∈ b) ? (v ∈ u) : (v ∉ u)
729 @test (v ∈ a && v ∈ b) ? (v ∈ i) : (v ∉ i)
730 end
731 end
732
733 end # module
+0
-548
stdlib/OldPkg/test/resolve.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 module PkgResolveTests
3
4 using Test
5 import OldPkg
6 using OldPkg.Types
7 using OldPkg.Query
8 using OldPkg.Resolve
9 using OldPkg.Resolve.VersionWeights
10 import OldPkg.PkgError
11
12 # Check that VersionWeight keeps the same ordering as VersionNumber
13
14 vlst = [
15 v"0.0.0",
16 v"0.0.1",
17 v"0.1.0",
18 v"0.1.1",
19 v"1.0.0",
20 v"1.0.1",
21 v"1.1.0",
22 v"1.1.1",
23 v"1.0.0-pre",
24 v"1.0.0-pre1",
25 v"1.0.1-pre",
26 v"1.0.0-0.pre.2",
27 v"1.0.0-0.pre.3",
28 v"1.0.0-0.pre1.tst",
29 v"1.0.0-pre.1+0.1",
30 v"1.0.0-pre.1+0.1plus",
31 v"1.0.0-pre.1-+0.1plus",
32 v"1.0.0-pre.1-+0.1Plus",
33 v"1.0.0-pre.1-+0.1pLUs",
34 v"1.0.0-pre.1-+0.1pluS",
35 v"1.0.0+0.1plus",
36 v"1.0.0+0.1plus-",
37 v"1.0.0+-",
38 v"1.0.0-",
39 v"1.0.0+",
40 v"1.0.0--",
41 v"1.0.0---",
42 v"1.0.0--+-",
43 v"1.0.0+--",
44 v"1.0.0+-.-",
45 v"1.0.0+0.-",
46 v"1.0.0+-.0",
47 v"1.0.0-a+--",
48 v"1.0.0-a+-.-",
49 v"1.0.0-a+0.-",
50 v"1.0.0-a+-.0"
51 ]
52
53 for v1 in vlst, v2 in vlst
54 vw1 = VersionWeight(v1)
55 vw2 = VersionWeight(v2)
56 clt = v1 < v2
57 @test clt == (vw1 < vw2)
58 ceq = v1 == v2
59 @test ceq == (vw1 == vw2)
60 end
61
62 # auxiliary functions
63
64 function deps_from_data(deps_data)
65 deps = Dict{String,Dict{VersionNumber,Available}}()
66 for d in deps_data
67 p = d[1]; vn = d[2]; r = d[3:end]
68 if !haskey(deps, p)
69 deps[p] = Dict{VersionNumber,Available}()
70 end
71 if !haskey(deps[p], vn)
72 deps[p][vn] = Available("$(p)_$(vn)_sha1", Dict{String,VersionSet}())
73 end
74 isempty(r) && continue
75 rp = r[1]
76 if length(r) > 1
77 rvs = VersionSet(VersionNumber[r[2:end]...])
78 else
79 rvs = VersionSet()
80 end
81 deps[p][vn].requires[rp] = rvs
82 end
83 deps
84 end
85 function reqs_from_data(reqs_data)
86 reqs = Dict{String,VersionSet}()
87 for r in reqs_data
88 p = r[1]
89 reqs[p] = VersionSet(VersionNumber[r[2:end]...])
90 end
91 reqs
92 end
93 function sanity_tst(deps_data, expected_result; pkgs=[])
94 deps = deps_from_data(deps_data)
95 #println("deps=$deps")
96 #println()
97 result = sanity_check(deps, Set(String[pkgs...]))
98 length(result) == length(expected_result) || return false
99 for (p, vn, pp) in result
100 (p, vn) ∈ expected_result || return false
101 end
102 return true
103 end
104 sanity_tst(deps_data; kw...) = sanity_tst(deps_data, []; kw...)
105
106 function resolve_tst(deps_data, reqs_data, want_data = nothing)
107 deps = deps_from_data(deps_data)
108 reqs = reqs_from_data(reqs_data)
109
110 #println()
111 #println("deps=$deps")
112 #println("reqs=$reqs")
113 deps = Query.prune_dependencies(reqs, deps)
114 want = resolve(reqs, deps)
115 return want == want_data
116 end
117
118 ## DEPENDENCY SCHEME 1: TWO PACKAGES, DAG
119 deps_data = Any[
120 ["A", v"1", "B", v"1"],
121 ["A", v"2", "B", v"2"],
122 ["B", v"1"],
123 ["B", v"2"]
124 ]
125
126 @test sanity_tst(deps_data)
127 @test sanity_tst(deps_data, pkgs=["A", "B"])
128 @test sanity_tst(deps_data, pkgs=["B"])
129 @test sanity_tst(deps_data, pkgs=["A"])
130
131 # require just B
132 reqs_data = Any[
133 ["B"]
134 ]
135
136 want_data = Dict("B"=>v"2")
137 @test resolve_tst(deps_data, reqs_data, want_data)
138
139 # require just A: must bring in B
140 reqs_data = Any[
141 ["A"]
142 ]
143 want_data = Dict("A"=>v"2", "B"=>v"2")
144 @test resolve_tst(deps_data, reqs_data, want_data)
145
146
147 ## DEPENDENCY SCHEME 2: TWO PACKAGES, CYCLIC
148 deps_data = Any[
149 ["A", v"1", "B", v"2"],
150 ["A", v"2", "B", v"1"],
151 ["B", v"1", "A", v"2"],
152 ["B", v"2", "A", v"1"]
153 ]
154
155 @test sanity_tst(deps_data)
156
157 # require just A
158 reqs_data = Any[
159 ["A"]
160 ]
161 want_data = Dict("A"=>v"2", "B"=>v"2")
162 @test resolve_tst(deps_data, reqs_data, want_data)
163
164 # require just B, force lower version
165 reqs_data = Any[
166 ["B", v"1", v"2"]
167 ]
168 want_data = Dict("A"=>v"2", "B"=>v"1")
169 @test resolve_tst(deps_data, reqs_data, want_data)
170
171 # require just A, force lower version
172 reqs_data = Any[
173 ["A", v"1", v"2"]
174 ]
175 want_data = Dict("A"=>v"1", "B"=>v"2")
176 @test resolve_tst(deps_data, reqs_data, want_data)
177
178
179 ## DEPENDENCY SCHEME 3: THREE PACKAGES, CYCLIC, TWO MUTUALLY EXCLUSIVE SOLUTIONS
180 deps_data = Any[
181 ["A", v"1", "B", v"2"],
182 ["A", v"2", "B", v"1", v"2"],
183 ["B", v"1", "C", v"2"],
184 ["B", v"2", "C", v"1", v"2"],
185 ["C", v"1", "A", v"1", v"2"],
186 ["C", v"2", "A", v"2"]
187 ]
188
189 @test sanity_tst(deps_data)
190
191 # require just A (must choose solution which has the highest version for A)
192 reqs_data = Any[
193 ["A"]
194 ]
195 want_data = Dict("A"=>v"2", "B"=>v"1", "C"=>v"2")
196 @test resolve_tst(deps_data, reqs_data, want_data)
197
198 # require just B (must choose solution which has the highest version for B)
199 reqs_data = Any[
200 ["B"]
201 ]
202 want_data = Dict("A"=>v"1", "B"=>v"2", "C"=>v"1")
203 @test resolve_tst(deps_data, reqs_data, want_data)
204
205 # require just A, force lower version
206 reqs_data = Any[
207 ["A", v"1", v"2"]
208 ]
209 want_data = Dict("A"=>v"1", "B"=>v"2", "C"=>v"1")
210 @test resolve_tst(deps_data, reqs_data, want_data)
211
212 # require A and C, incompatible versions
213 reqs_data = Any[
214 ["A", v"1", v"2"],
215 ["C", v"2"]
216 ]
217 @test_throws PkgError resolve_tst(deps_data, reqs_data)
218
219
220 ## DEPENDENCY SCHEME 4: TWO PACKAGES, DAG, WITH TRIVIAL INCONSISTENCY
221 deps_data = Any[
222 ["A", v"1", "B", v"2"],
223 ["B", v"1"]
224 ]
225
226 @test sanity_tst(deps_data, [("A", v"1")])
227 @test sanity_tst(deps_data, [("A", v"1")], pkgs=["B"])
228
229 # require B (must not give errors)
230 reqs_data = Any[
231 ["B"]
232 ]
233 want_data = Dict("B"=>v"1")
234 @test resolve_tst(deps_data, reqs_data, want_data)
235
236
237 ## DEPENDENCY SCHEME 5: THREE PACKAGES, DAG, WITH IMPLICIT INCONSISTENCY
238 deps_data = Any[
239 ["A", v"1", "B", v"2"],
240 ["A", v"1", "C", v"2"],
241 ["A", v"2", "B", v"1", v"2"],
242 ["A", v"2", "C", v"1", v"2"],
243 ["B", v"1", "C", v"2"],
244 ["B", v"2", "C", v"2"],
245 ["C", v"1"],
246 ["C", v"2"]
247 ]
248
249 @test sanity_tst(deps_data, [("A", v"2")])
250 @test sanity_tst(deps_data, [("A", v"2")], pkgs=["B"])
251 @test sanity_tst(deps_data, [("A", v"2")], pkgs=["C"])
252
253 # require A, any version (must use the highest non-inconsistent)
254 reqs_data = Any[
255 ["A"]
256 ]
257 want_data = Dict("A"=>v"1", "B"=>v"2", "C"=>v"2")
258 @test resolve_tst(deps_data, reqs_data, want_data)
259
260 # require A, force highest version (impossible)
261 reqs_data = Any[
262 ["A", v"2"]
263 ]
264 @test_throws PkgError resolve_tst(deps_data, reqs_data)
265
266
267 ## DEPENDENCY SCHEME 6: TWO PACKAGES, CYCLIC, TOTALLY INCONSISTENT
268 deps_data = Any[
269 ["A", v"1", "B", v"2"],
270 ["A", v"2", "B", v"1", v"2"],
271 ["B", v"1", "A", v"1", v"2"],
272 ["B", v"2", "A", v"2"]
273 ]
274
275 @test sanity_tst(deps_data, [("A", v"1"), ("A", v"2"),
276 ("B", v"1"), ("B", v"2")])
277
278 # require A (impossible)
279 reqs_data = Any[
280 ["A"]
281 ]
282 @test_throws PkgError resolve_tst(deps_data, reqs_data)
283
284 # require B (impossible)
285 reqs_data = Any[
286 ["B"]
287 ]
288 @test_throws PkgError resolve_tst(deps_data, reqs_data)
289
290
291 ## DEPENDENCY SCHEME 7: THREE PACKAGES, CYCLIC, WITH INCONSISTENCY
292 deps_data = Any[
293 ["A", v"1", "B", v"1", v"2"],
294 ["A", v"2", "B", v"2"],
295 ["B", v"1", "C", v"1", v"2"],
296 ["B", v"2", "C", v"2"],
297 ["C", v"1", "A", v"2"],
298 ["C", v"2", "A", v"2"],
299 ]
300
301 @test sanity_tst(deps_data, [("A", v"1"), ("B", v"1"),
302 ("C", v"1")])
303
304 # require A
305 reqs_data = Any[
306 ["A"]
307 ]
308 want_data = Dict("A"=>v"2", "B"=>v"2", "C"=>v"2")
309 @test resolve_tst(deps_data, reqs_data, want_data)
310
311 # require C
312 reqs_data = Any[
313 ["C"]
314 ]
315 want_data = Dict("A"=>v"2", "B"=>v"2", "C"=>v"2")
316 @test resolve_tst(deps_data, reqs_data, want_data)
317
318 # require C, lowest version (impossible)
319 reqs_data = Any[
320 ["C", v"1", v"2"]
321 ]
322 @test_throws PkgError resolve_tst(deps_data, reqs_data)
323
324
325 ## DEPENDENCY SCHEME 8: THREE PACKAGES, CYCLIC, TOTALLY INCONSISTENT
326 deps_data = Any[
327 ["A", v"1", "B", v"1", v"2"],
328 ["A", v"2", "B", v"2"],
329 ["B", v"1", "C", v"1", v"2"],
330 ["B", v"2", "C", v"2"],
331 ["C", v"1", "A", v"2"],
332 ["C", v"2", "A", v"1", v"2"],
333 ]
334
335 @test sanity_tst(deps_data, [("A", v"1"), ("A", v"2"),
336 ("B", v"1"), ("B", v"2"),
337 ("C", v"1"), ("C", v"2")])
338
339 # require A (impossible)
340 reqs_data = Any[
341 ["A"]
342 ]
343 @test_throws PkgError resolve_tst(deps_data, reqs_data)
344
345 # require B (impossible)
346 reqs_data = Any[
347 ["B"]
348 ]
349 @test_throws PkgError resolve_tst(deps_data, reqs_data)
350
351 # require C (impossible)
352 reqs_data = Any[
353 ["C"]
354 ]
355 @test_throws PkgError resolve_tst(deps_data, reqs_data)
356
357 ## DEPENDENCY SCHEME 9: SIX PACKAGES, DAG
358 deps_data = Any[
359 ["A", v"1"],
360 ["A", v"2"],
361 ["A", v"3"],
362 ["B", v"1", "A", v"1", v"2"],
363 ["B", v"2", "A"],
364 ["C", v"1", "A", v"2", v"3"],
365 ["C", v"2", "A", v"2"],
366 ["D", v"1", "B", v"1"],
367 ["D", v"2", "B", v"2"],
368 ["E", v"1", "D"],
369 ["F", v"1", "A", v"1", v"3"],
370 ["F", v"1", "E"],
371 ["F", v"2", "C", v"2"],
372 ["F", v"2", "E"],
373 ]
374
375 @test sanity_tst(deps_data)
376
377 # require just F
378 reqs_data = Any[
379 ["F"]
380 ]
381 want_data = Dict("A"=>v"3", "B"=>v"2", "C"=>v"2",
382 "D"=>v"2", "E"=>v"1", "F"=>v"2")
383 @test resolve_tst(deps_data, reqs_data, want_data)
384
385 # require just F, lower version
386 reqs_data = Any[
387 ["F", v"1", v"2"]
388 ]
389 want_data = Dict("A"=>v"2", "B"=>v"2", "D"=>v"2",
390 "E"=>v"1", "F"=>v"1")
391 @test resolve_tst(deps_data, reqs_data, want_data)
392
393 # require F and B; force lower B version -> must bring down F, A, and D versions too
394 reqs_data = Any[
395 ["F"],
396 ["B", v"1", v"2"]
397 ]
398 want_data = Dict("A"=>v"1", "B"=>v"1", "D"=>v"1",
399 "E"=>v"1", "F"=>v"1")
400 @test resolve_tst(deps_data, reqs_data, want_data)
401
402 # require F and D; force lower D version -> must not bring down F version
403 reqs_data = Any[
404 ["F"],
405 ["D", v"1", v"2"]
406 ]
407 want_data = Dict("A"=>v"3", "B"=>v"2", "C"=>v"2",
408 "D"=>v"1", "E"=>v"1", "F"=>v"2")
409 @test resolve_tst(deps_data, reqs_data, want_data)
410
411 # require F and C; force lower C version -> must bring down F and A versions
412 reqs_data = Any[
413 ["F"],
414 ["C", v"1", v"2"]
415 ]
416 want_data = Dict("A"=>v"2", "B"=>v"2", "C"=>v"1",
417 "D"=>v"2", "E"=>v"1", "F"=>v"1")
418 @test resolve_tst(deps_data, reqs_data, want_data)
419
420 ## DEPENDENCY SCHEME 10: SIX PACKAGES, DAG, WITH PRERELEASE/BUILD VERSIONS
421 deps_data = Any[
422 ["A", v"1"],
423 ["A", v"2-rc.1"],
424 ["A", v"2-rc.1+bld"],
425 ["A", v"2"],
426 ["A", v"2.1.0"],
427 ["B", v"1", "A", v"1", v"2-"],
428 ["B", v"1.0.1-beta", "A", v"2-rc"],
429 ["B", v"1.0.1", "A"],
430 ["C", v"1", "A", v"2-", v"2.1"],
431 ["C", v"1+BLD", "A", v"2-rc.1", v"2.1"],
432 ["C", v"2", "A", v"2-rc.1"],
433 ["D", v"1", "B", v"1"],
434 ["D", v"2", "B", v"1.0.1-"],
435 ["E", v"1-plztst", "D"],
436 ["E", v"1", "D"],
437 ["F", v"1.1", "A", v"1", v"2.1"],
438 ["F", v"1.1", "E", v"1"],
439 ["F", v"2-rc.1", "A", v"2-", v"2.1"],
440 ["F", v"2-rc.1", "C", v"1"],
441 ["F", v"2-rc.1", "E"],
442 ["F", v"2-rc.2", "A", v"2-", v"2.1"],
443 ["F", v"2-rc.2", "C", v"2"],
444 ["F", v"2-rc.2", "E"],
445 ["F", v"2", "C", v"2"],
446 ["F", v"2", "E"],
447 ]
448
449 @test sanity_tst(deps_data)
450
451 # require just F
452 reqs_data = Any[
453 ["F"]
454 ]
455 want_data = Dict("A"=>v"2.1", "B"=>v"1.0.1", "C"=>v"2",
456 "D"=>v"2", "E"=>v"1", "F"=>v"2")
457 @test resolve_tst(deps_data, reqs_data, want_data)
458
459 # require just F, lower version
460 reqs_data = Any[
461 ["F", v"1", v"2-"]
462 ]
463 want_data = Dict("A"=>v"2", "B"=>v"1.0.1", "D"=>v"2",
464 "E"=>v"1", "F"=>v"1.1")
465 @test resolve_tst(deps_data, reqs_data, want_data)
466
467 # require F and B; force lower B version -> must bring down F, A, and D versions too
468 reqs_data = Any[
469 ["F"],
470 ["B", v"1", v"1.0.1-"]
471 ]
472 want_data = Dict("A"=>v"1", "B"=>v"1", "D"=>v"1",
473 "E"=>v"1", "F"=>v"1.1")
474 @test resolve_tst(deps_data, reqs_data, want_data)
475
476 # require F and D; force lower D version -> must not bring down F version
477 reqs_data = Any[
478 ["F"],
479 ["D", v"1", v"2"]
480 ]
481 want_data = Dict("A"=>v"2.1", "B"=>v"1.0.1", "C"=>v"2",
482 "D"=>v"1", "E"=>v"1", "F"=>v"2")
483 @test resolve_tst(deps_data, reqs_data, want_data)
484
485 # require F and C; force lower C version -> must bring down F and A versions
486 reqs_data = Any[
487 ["F"],
488 ["C", v"1", v"2"]
489 ]
490 want_data = Dict("A"=>v"2", "B"=>v"1.0.1", "C"=>v"1+BLD",
491 "D"=>v"2", "E"=>v"1", "F"=>v"2-rc.1")
492 @test resolve_tst(deps_data, reqs_data, want_data)
493
494 ## DEPENDENCY SCHEME 11: FIVE PACKAGES, SAME AS SCHEMES 5 + 1, UNCONNECTED
495 deps_data = Any[
496 ["A", v"1", "B", v"2"],
497 ["A", v"1", "C", v"2"],
498 ["A", v"2", "B", v"1", v"2"],
499 ["A", v"2", "C", v"1", v"2"],
500 ["B", v"1", "C", v"2"],
501 ["B", v"2", "C", v"2"],
502 ["C", v"1"],
503 ["C", v"2"],
504 ["D", v"1", "E", v"1"],
505 ["D", v"2", "E", v"2"],
506 ["E", v"1"],
507 ["E", v"2"]
508 ]
509
510 @test sanity_tst(deps_data, [("A", v"2")])
511 @test sanity_tst(deps_data, [("A", v"2")], pkgs=["B"])
512 @test sanity_tst(deps_data, pkgs=["D"])
513 @test sanity_tst(deps_data, pkgs=["E"])
514 @test sanity_tst(deps_data, [("A", v"2")], pkgs=["B", "D"])
515
516 # require A, any version (must use the highest non-inconsistent)
517 reqs_data = Any[
518 ["A"]
519 ]
520 want_data = Dict("A"=>v"1", "B"=>v"2", "C"=>v"2")
521 @test resolve_tst(deps_data, reqs_data, want_data)
522
523 # require just D: must bring in E
524 reqs_data = Any[
525 ["D"]
526 ]
527 want_data = Dict("D"=>v"2", "E"=>v"2")
528 @test resolve_tst(deps_data, reqs_data, want_data)
529
530
531 # require A and D, must be the merge of the previous two cases
532 reqs_data = Any[
533 ["A"],
534 ["D"]
535 ]
536 want_data = Dict("A"=>v"1", "B"=>v"2", "C"=>v"2", "D"=>v"2", "E"=>v"2")
537 @test resolve_tst(deps_data, reqs_data, want_data)
538
539 ## DEPENDENCY SCHEME 12: A REALISTIC EXAMPLE
540 ## ref issue #21485
541
542 include("resolvedata1.jl")
543
544 @test sanity_tst(deps_data, problematic_data)
545 @test resolve_tst(deps_data, reqs_data, want_data)
546
547 end # module
+0
-2853
stdlib/OldPkg/test/resolvedata1.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 deps_data = Any[
3 ["ASTInterpreter", v"0.0.1", "AbstractTrees", v"0.0.1", v"0.1.0"],
4 ["ASTInterpreter", v"0.0.1", "JuliaParser", v"0.7.1"],
5 ["ASTInterpreter", v"0.0.3", "AbstractTrees", v"0.0.2", v"0.1.0"],
6 ["ASTInterpreter", v"0.0.3", "JuliaParser", v"0.7.2"],
7 ["ASTInterpreter", v"0.0.4", "AbstractTrees", v"0.0.4", v"0.1.0"],
8 ["ASTInterpreter", v"0.0.4", "JuliaParser", v"0.7.2"],
9 ["AbstractTrees", v"0.0.1"],
10 ["AbstractTrees", v"0.0.3"],
11 ["AbstractTrees", v"0.0.4"],
12 ["AbstractTrees", v"0.1.0", "Compat", v"0.17.0"],
13 ["AlgebraicDiffEq", v"0.0.1", "DiffEqBase"],
14 ["AlgebraicDiffEq", v"0.0.1", "Parameters", v"0.5.0"],
15 ["AlgebraicDiffEq", v"0.0.1", "Sundials", v"0.3.0"],
16 ["AlgebraicDiffEq", v"0.0.2", "DiffEqBase"],
17 ["AlgebraicDiffEq", v"0.0.2", "Parameters", v"0.5.0"],
18 ["AlgebraicDiffEq", v"0.0.2", "Sundials", v"0.3.0"],
19 ["AlgebraicDiffEq", v"0.1.0", "DiffEqBase", v"0.2.0"],
20 ["AlgebraicDiffEq", v"0.1.0", "Parameters", v"0.5.0"],
21 ["AnsiColor", v"0.0.2"],
22 ["ArgParse", v"0.2.9", "Options"],
23 ["ArgParse", v"0.2.9", "TextWrap", v"0.1.0-"],
24 ["ArgParse", v"0.2.10", "Compat"],
25 ["ArgParse", v"0.2.10", "Options"],
26 ["ArgParse", v"0.2.10", "TextWrap", v"0.1.0-"],
27 ["ArgParse", v"0.2.12", "Options"],
28 ["ArgParse", v"0.2.12", "Compat", v"0.2.9"],
29 ["ArgParse", v"0.2.12", "TextWrap", v"0.1.0-"],
30 ["ArgParse", v"0.2.13", "Options"],
31 ["ArgParse", v"0.2.13", "Compat", v"0.7.3"],
32 ["ArgParse", v"0.2.13", "TextWrap", v"0.1.4"],
33 ["ArgParse", v"0.3.0", "Compat", v"0.7.3"],
34 ["ArgParse", v"0.3.0", "TextWrap", v"0.1.4"],
35 ["ArgParse", v"0.4.0", "Compat", v"0.8.0"],
36 ["ArgParse", v"0.4.0", "TextWrap", v"0.1.4"],
37 ["ArrayViews", v"0.1.1"],
38 ["ArrayViews", v"0.3.0"],
39 ["ArrayViews", v"0.4.5"],
40 ["ArrayViews", v"0.4.7"],
41 ["ArrayViews", v"0.4.8"],
42 ["ArrayViews", v"0.4.9"],
43 ["ArrayViews", v"0.4.11"],
44 ["ArrayViews", v"0.6.3"],
45 ["ArrayViews", v"0.6.4", "Compat"],
46 ["Atom", v"0.2.1", "CodeTools"],
47 ["Atom", v"0.2.1", "Hiccup"],
48 ["Atom", v"0.2.1", "JSON"],
49 ["Atom", v"0.2.1", "LNR"],
50 ["Atom", v"0.2.1", "Lazy"],
51 ["Atom", v"0.2.1", "Media"],
52 ["Atom", v"0.4.0", "Blink"],
53 ["Atom", v"0.4.0", "CodeTools"],
54 ["Atom", v"0.4.0", "Hiccup"],
55 ["Atom", v"0.4.0", "JSON"],
56 ["Atom", v"0.4.0", "LNR"],
57 ["Atom", v"0.4.0", "Lazy"],
58 ["Atom", v"0.4.0", "Media"],
59 ["Atom", v"0.4.0", "Reexport"],
60 ["Atom", v"0.4.6", "Blink"],
61 ["Atom", v"0.4.6", "CodeTools"],
62 ["Atom", v"0.4.6", "Hiccup"],
63 ["Atom", v"0.4.6", "JSON"],
64 ["Atom", v"0.4.6", "LNR"],
65 ["Atom", v"0.4.6", "Lazy"],
66 ["Atom", v"0.4.6", "MacroTools"],
67 ["Atom", v"0.4.6", "Media"],
68 ["Atom", v"0.4.6", "Reexport"],
69 ["Atom", v"0.4.6", "Requires"],
70 ["Atom", v"0.5.0", "ASTInterpreter"],
71 ["Atom", v"0.5.0", "Blink"],
72 ["Atom", v"0.5.0", "CodeTools"],
73 ["Atom", v"0.5.0", "Gallium"],
74 ["Atom", v"0.5.0", "Hiccup"],
75 ["Atom", v"0.5.0", "JSON"],
76 ["Atom", v"0.5.0", "LNR"],
77 ["Atom", v"0.5.0", "Lazy"],
78 ["Atom", v"0.5.0", "MacroTools"],
79 ["Atom", v"0.5.0", "Media"],
80 ["Atom", v"0.5.0", "Reexport"],
81 ["Atom", v"0.5.0", "Requires"],
82 ["Atom", v"0.5.2", "ASTInterpreter"],
83 ["Atom", v"0.5.2", "Blink"],
84 ["Atom", v"0.5.2", "CodeTools"],
85 ["Atom", v"0.5.2", "Gallium"],
86 ["Atom", v"0.5.2", "Hiccup"],
87 ["Atom", v"0.5.2", "JSON"],
88 ["Atom", v"0.5.2", "Juno"],
89 ["Atom", v"0.5.2", "LNR"],
90 ["Atom", v"0.5.2", "Lazy"],
91 ["Atom", v"0.5.2", "MacroTools"],
92 ["Atom", v"0.5.2", "Media"],
93 ["Atom", v"0.5.2", "Reexport"],
94 ["Atom", v"0.5.2", "Requires"],
95 ["Atom", v"0.5.8", "ASTInterpreter"],
96 ["Atom", v"0.5.8", "Blink"],
97 ["Atom", v"0.5.8", "CodeTools"],
98 ["Atom", v"0.5.8", "Gallium"],
99 ["Atom", v"0.5.8", "Hiccup"],
100 ["Atom", v"0.5.8", "JSON"],
101 ["Atom", v"0.5.8", "Juno"],
102 ["Atom", v"0.5.8", "LNR"],
103 ["Atom", v"0.5.8", "MacroTools"],
104 ["Atom", v"0.5.8", "Media"],
105 ["Atom", v"0.5.8", "Reexport"],
106 ["Atom", v"0.5.8", "Lazy", v"0.11.3"],
107 ["Atom", v"0.5.10", "ASTInterpreter"],
108 ["Atom", v"0.5.10", "Blink"],
109 ["Atom", v"0.5.10", "CodeTools"],
110 ["Atom", v"0.5.10", "Gallium"],
111 ["Atom", v"0.5.10", "Hiccup"],
112 ["Atom", v"0.5.10", "JSON"],
113 ["Atom", v"0.5.10", "LNR"],
114 ["Atom", v"0.5.10", "MacroTools"],
115 ["Atom", v"0.5.10", "Media"],
116 ["Atom", v"0.5.10", "Reexport"],
117 ["Atom", v"0.5.10", "Juno", v"0.2.6"],
118 ["Atom", v"0.5.10", "Lazy", v"0.11.3"],
119 ["AxisAlgorithms", v"0.1.6", "WoodburyMatrices"],
120 ["AxisAlgorithms", v"0.1.6", "Compat", v"0.8.0"],
121 ["AxisArrays", v"0.0.3", "IntervalSets"],
122 ["AxisArrays", v"0.0.3", "Iterators"],
123 ["AxisArrays", v"0.0.3", "RangeArrays"],
124 ["AxisArrays", v"0.1.2", "Compat", v"0.19.0"],
125 ["AxisArrays", v"0.1.2", "IntervalSets"],
126 ["AxisArrays", v"0.1.2", "Iterators"],
127 ["AxisArrays", v"0.1.2", "RangeArrays"],
128 ["BinDeps", v"0.2.0"],
129 ["BinDeps", v"0.2.4", "URIParser"],
130 ["BinDeps", v"0.2.14", "URIParser"],
131 ["BinDeps", v"0.3.4", "URIParser"],
132 ["BinDeps", v"0.3.4", "SHA", v"0.0.0", v"0.0.3"],
133 ["BinDeps", v"0.3.5", "URIParser"],
134 ["BinDeps", v"0.3.5", "SHA", v"0.0.3"],
135 ["BinDeps", v"0.3.8", "SHA"],
136 ["BinDeps", v"0.3.8", "URIParser"],
137 ["BinDeps", v"0.3.10", "Compat", v"0.3.6"],
138 ["BinDeps", v"0.3.10", "SHA"],
139 ["BinDeps", v"0.3.10", "URIParser"],
140 ["BinDeps", v"0.3.15", "Compat", v"0.4.0"],
141 ["BinDeps", v"0.3.15", "SHA"],
142 ["BinDeps", v"0.3.15", "URIParser"],
143 ["BinDeps", v"0.3.21", "Compat", v"0.7.1"],
144 ["BinDeps", v"0.3.21", "SHA"],
145 ["BinDeps", v"0.3.21", "URIParser"],
146 ["BinDeps", v"0.3.23", "URIParser"],
147 ["BinDeps", v"0.3.23", "Compat", v"0.8.4"],
148 ["BinDeps", v"0.3.23", "SHA"],
149 ["BinDeps", v"0.4.2", "Compat", v"0.8.4"],
150 ["BinDeps", v"0.4.2", "SHA"],
151 ["BinDeps", v"0.4.2", "URIParser"],
152 ["BinDeps", v"0.4.5", "Compat", v"0.8.4"],
153 ["BinDeps", v"0.4.5", "SHA"],
154 ["BinDeps", v"0.4.5", "URIParser"],
155 ["BinDeps", v"0.4.7", "Compat", v"0.17.0"],
156 ["BinDeps", v"0.4.7", "SHA"],
157 ["BinDeps", v"0.4.7", "URIParser"],
158 ["Blink", v"0.1.4", "JSON"],
159 ["Blink", v"0.1.4", "Lazy"],
160 ["Blink", v"0.1.4", "Requires"],
161 ["Blink", v"0.1.5", "JSON"],
162 ["Blink", v"0.1.5", "Lazy"],
163 ["Blink", v"0.1.5", "MacroTools"],
164 ["Blink", v"0.1.5", "Requires"],
165 ["Blink", v"0.2.0", "HttpServer"],
166 ["Blink", v"0.2.0", "JSON"],
167 ["Blink", v"0.2.0", "Lazy"],
168 ["Blink", v"0.2.0", "MacroTools"],
169 ["Blink", v"0.2.0", "Mustache"],
170 ["Blink", v"0.2.0", "Reexport"],
171 ["Blink", v"0.2.0", "Requires"],
172 ["Blink", v"0.2.0", "WebSockets"],
173 ["Blink", v"0.2.1", "HttpServer"],
174 ["Blink", v"0.2.1", "JSON"],
175 ["Blink", v"0.2.1", "Lazy"],
176 ["Blink", v"0.2.1", "MacroTools"],
177 ["Blink", v"0.2.1", "Mustache"],
178 ["Blink", v"0.2.1", "Mux"],
179 ["Blink", v"0.2.1", "Reexport"],
180 ["Blink", v"0.2.1", "Requires"],
181 ["Blink", v"0.2.1", "WebSockets"],
182 ["Blink", v"0.3.4", "BinDeps"],
183 ["Blink", v"0.3.4", "HttpServer"],
184 ["Blink", v"0.3.4", "JSON"],
185 ["Blink", v"0.3.4", "Lazy"],
186 ["Blink", v"0.3.4", "MacroTools"],
187 ["Blink", v"0.3.4", "Mustache"],
188 ["Blink", v"0.3.4", "Mux"],
189 ["Blink", v"0.3.4", "Reexport"],
190 ["Blink", v"0.3.4", "Requires"],
191 ["Blink", v"0.3.4", "WebSockets"],
192 ["Blink", v"0.4.1", "BinDeps"],
193 ["Blink", v"0.4.1", "HttpServer"],
194 ["Blink", v"0.4.1", "Mustache"],
195 ["Blink", v"0.4.1", "Reexport"],
196 ["Blink", v"0.4.1", "Requires"],
197 ["Blink", v"0.4.1", "Compat", v"0.8.6"],
198 ["Blink", v"0.4.1", "JSON"],
199 ["Blink", v"0.4.1", "Lazy"],
200 ["Blink", v"0.4.1", "MacroTools"],
201 ["Blink", v"0.4.1", "Mux"],
202 ["Blink", v"0.4.1", "WebSockets"],
203 ["Blink", v"0.5.1", "BinDeps"],
204 ["Blink", v"0.5.1", "HttpServer"],
205 ["Blink", v"0.5.1", "Compat", v"0.8.6"],
206 ["Blink", v"0.5.1", "JSON"],
207 ["Blink", v"0.5.1", "MacroTools"],
208 ["Blink", v"0.5.1", "Mustache"],
209 ["Blink", v"0.5.1", "Lazy", v"0.11.3"],
210 ["Blink", v"0.5.1", "Mux"],
211 ["Blink", v"0.5.1", "Reexport"],
212 ["Blink", v"0.5.1", "WebSockets"],
213 ["Blocks", v"0.0.4"],
214 ["Blocks", v"0.1.0", "Compat"],
215 ["Blosc", v"0.1.1", "BinDeps"],
216 ["Blosc", v"0.1.5", "BinDeps"],
217 ["Blosc", v"0.1.5", "Compat"],
218 ["Blosc", v"0.2.0", "BinDeps"],
219 ["Blosc", v"0.2.0", "Compat", v"0.8.0"],
220 ["COFF", v"0.0.2", "DWARF"],
221 ["COFF", v"0.0.2", "ObjFileBase"],
222 ["COFF", v"0.0.2", "StructIO"],
223 ["CRC", v"0.1.0", "ArgParse"],
224 ["CRC", v"0.1.0", "Zlib"],
225 ["CRC", v"1.1.1", "ArgParse"],
226 ["CRC", v"1.1.1", "Compat"],
227 ["CRC", v"1.2.0", "ArgParse"],
228 ["Calculus", v"0.1.5"],
229 ["Calculus", v"0.1.6", "Compat"],
230 ["Calculus", v"0.1.14", "Compat", v"0.4.0"],
231 ["Calculus", v"0.1.15", "Compat", v"0.4.0"],
232 ["Calculus", v"0.2.0", "Compat", v"0.4.0"],
233 ["Calculus", v"0.2.2", "Compat", v"0.17.0"],
234 ["Calendar", v"0.4.3", "ICU"],
235 ["CatIndices", v"0.0.2", "CustomUnitRanges"],
236 ["CatIndices", v"0.0.2", "OffsetArrays"],
237 ["ChunkedArrays", v"0.0.1", "Compat"],
238 ["ChunkedArrays", v"0.0.1", "EllipsisNotation"],
239 ["ChunkedArrays", v"0.0.2", "Compat"],
240 ["ChunkedArrays", v"0.0.2", "EllipsisNotation"],
241 ["ChunkedArrays", v"0.1.0", "Compat"],
242 ["ChunkedArrays", v"0.1.0", "EllipsisNotation"],
243 ["ChunkedArrays", v"0.1.1", "EllipsisNotation", v"0.0.2"],
244 ["CodeTools", v"0.1.0", "JuliaParser"],
245 ["CodeTools", v"0.1.0", "LNR"],
246 ["CodeTools", v"0.1.0", "Lazy"],
247 ["CodeTools", v"0.1.0", "MacroTools"],
248 ["CodeTools", v"0.2.0", "Compat"],
249 ["CodeTools", v"0.2.0", "JuliaParser"],
250 ["CodeTools", v"0.2.0", "LNR"],
251 ["CodeTools", v"0.2.0", "Lazy"],
252 ["CodeTools", v"0.2.0", "MacroTools"],
253 ["CodeTools", v"0.4.1", "Compat"],
254 ["CodeTools", v"0.4.1", "JuliaParser"],
255 ["CodeTools", v"0.4.1", "LNR"],
256 ["CodeTools", v"0.4.1", "Lazy"],
257 ["CodeTools", v"0.4.1", "MacroTools"],
258 ["CodeTools", v"0.4.1", "Requires"],
259 ["CodeTools", v"0.4.3", "LNR"],
260 ["CodeTools", v"0.4.3", "Lazy"],
261 ["CodeTools", v"0.4.3", "MacroTools"],
262 ["Codecs", v"0.1.0", "Iterators"],
263 ["Codecs", v"0.1.3"],
264 ["Codecs", v"0.1.5", "Compat"],
265 ["Codecs", v"0.2.0", "Compat", v"0.7.20"],
266 ["Codecs", v"0.3.0", "Compat", v"0.17.0"],
267 ["ColorTypes", v"0.0.1", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
268 ["ColorTypes", v"0.0.1", "FixedSizeArrays"],
269 ["ColorTypes", v"0.1.7", "Compat"],
270 ["ColorTypes", v"0.1.7", "Docile"],
271 ["ColorTypes", v"0.1.7", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
272 ["ColorTypes", v"0.2.6", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
273 ["ColorTypes", v"0.2.8", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
274 ["ColorTypes", v"0.2.12", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
275 ["ColorTypes", v"0.3.0", "FixedPointNumbers", v"0.3.0"],
276 ["ColorTypes", v"0.3.2", "Compat", v"0.16.0"],
277 ["ColorTypes", v"0.3.2", "FixedPointNumbers", v"0.3.0"],
278 ["ColorTypes", v"0.3.3", "Compat", v"0.17.0"],
279 ["ColorTypes", v"0.3.3", "FixedPointNumbers", v"0.3.0"],
280 ["ColorTypes", v"0.3.5", "Compat", v"0.18.0"],
281 ["ColorTypes", v"0.3.5", "FixedPointNumbers", v"0.3.0"],
282 ["ColorTypes", v"0.4.1", "Compat", v"0.18.0"],
283 ["ColorTypes", v"0.4.1", "FixedPointNumbers", v"0.3.0"],
284 ["ColorVectorSpace", v"0.0.5", "ColorTypes"],
285 ["ColorVectorSpace", v"0.0.5", "Compat"],
286 ["ColorVectorSpace", v"0.0.5", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
287 ["ColorVectorSpace", v"0.1.7", "ColorTypes", v"0.2.0"],
288 ["ColorVectorSpace", v"0.1.7", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
289 ["ColorVectorSpace", v"0.1.8", "ColorTypes", v"0.2.0"],
290 ["ColorVectorSpace", v"0.1.8", "Compat", v"0.9.1"],
291 ["ColorVectorSpace", v"0.1.8", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
292 ["ColorVectorSpace", v"0.1.10", "ColorTypes", v"0.2.7"],
293 ["ColorVectorSpace", v"0.1.10", "Compat", v"0.9.1"],
294 ["ColorVectorSpace", v"0.1.10", "FixedPointNumbers", v"0.1.8", v"0.3.0"],
295 ["ColorVectorSpace", v"0.1.12", "ColorTypes", v"0.2.7"],
296 ["ColorVectorSpace", v"0.1.12", "Compat", v"0.9.1"],
297 ["ColorVectorSpace", v"0.1.12", "FixedPointNumbers", v"0.1.8", v"0.3.0"],
298 ["ColorVectorSpace", v"0.2.0", "ColorTypes", v"0.3.0"],
299 ["ColorVectorSpace", v"0.2.0", "Compat", v"0.9.1"],
300 ["ColorVectorSpace", v"0.2.0", "FixedPointNumbers", v"0.3.0"],
301 ["ColorVectorSpace", v"0.3.0", "ColorTypes", v"0.3.3"],
302 ["ColorVectorSpace", v"0.3.0", "Colors", v"0.7.1"],
303 ["ColorVectorSpace", v"0.3.0", "Compat", v"0.9.1"],
304 ["ColorVectorSpace", v"0.3.0", "FixedPointNumbers", v"0.3.0"],
305 ["ColorVectorSpace", v"0.3.0", "StatsBase", v"0.8.2"],
306 ["ColorVectorSpace", v"0.4.0", "ColorTypes", v"0.3.3"],
307 ["ColorVectorSpace", v"0.4.0", "Colors", v"0.7.1"],
308 ["ColorVectorSpace", v"0.4.0", "Compat", v"0.18.0"],
309 ["ColorVectorSpace", v"0.4.0", "FixedPointNumbers", v"0.3.0"],
310 ["ColorVectorSpace", v"0.4.0", "StatsBase", v"0.8.2"],
311 ["ColorVectorSpace", v"0.4.2", "ColorTypes", v"0.4.0"],
312 ["ColorVectorSpace", v"0.4.2", "Colors", v"0.7.1"],
313 ["ColorVectorSpace", v"0.4.2", "Compat", v"0.18.0"],
314 ["ColorVectorSpace", v"0.4.2", "FixedPointNumbers", v"0.3.0"],
315 ["ColorVectorSpace", v"0.4.2", "StatsBase", v"0.8.2"],
316 ["Colors", v"0.4.7", "Compat", v"0.2.0"],
317 ["Colors", v"0.4.7", "Graphics", v"0.1.0"],
318 ["Colors", v"0.4.7", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
319 ["Colors", v"0.5.0", "ColorTypes"],
320 ["Colors", v"0.5.0", "Reexport"],
321 ["Colors", v"0.5.0", "Compat", v"0.2.0"],
322 ["Colors", v"0.5.0", "Graphics", v"0.1.0"],
323 ["Colors", v"0.5.0", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
324 ["Colors", v"0.5.4", "ColorTypes"],
325 ["Colors", v"0.5.4", "Reexport"],
326 ["Colors", v"0.5.4", "Compat", v"0.2.0"],
327 ["Colors", v"0.5.4", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
328 ["Colors", v"0.6.2", "Reexport"],
329 ["Colors", v"0.6.2", "ColorTypes", v"0.2.0"],
330 ["Colors", v"0.6.2", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
331 ["Colors", v"0.6.4", "Compat"],
332 ["Colors", v"0.6.4", "Reexport"],
333 ["Colors", v"0.6.4", "ColorTypes", v"0.2.0"],
334 ["Colors", v"0.6.4", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
335 ["Colors", v"0.6.6", "Reexport"],
336 ["Colors", v"0.6.6", "ColorTypes", v"0.2.0"],
337 ["Colors", v"0.6.6", "Compat", v"0.8.0"],
338 ["Colors", v"0.6.6", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
339 ["Colors", v"0.6.7", "Reexport"],
340 ["Colors", v"0.6.7", "ColorTypes", v"0.2.0"],
341 ["Colors", v"0.6.7", "Compat", v"0.9.1"],
342 ["Colors", v"0.6.7", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
343 ["Colors", v"0.6.8", "Reexport"],
344 ["Colors", v"0.6.8", "ColorTypes", v"0.2.7"],
345 ["Colors", v"0.6.8", "Compat", v"0.9.1"],
346 ["Colors", v"0.6.8", "FixedPointNumbers", v"0.1.8", v"0.3.0"],
347 ["Colors", v"0.6.9", "Reexport"],
348 ["Colors", v"0.6.9", "ColorTypes", v"0.2.9"],
349 ["Colors", v"0.6.9", "Compat", v"0.9.1"],
350 ["Colors", v"0.6.9", "FixedPointNumbers", v"0.1.8", v"0.3.0"],
351 ["Colors", v"0.7.0", "Reexport"],
352 ["Colors", v"0.7.0", "ColorTypes", v"0.3.0"],
353 ["Colors", v"0.7.0", "Compat", v"0.9.1"],
354 ["Colors", v"0.7.0", "FixedPointNumbers", v"0.3.0"],
355 ["Colors", v"0.7.1", "Reexport"],
356 ["Colors", v"0.7.1", "ColorTypes", v"0.3.0"],
357 ["Colors", v"0.7.1", "Compat", v"0.9.1"],
358 ["Colors", v"0.7.1", "FixedPointNumbers", v"0.3.0"],
359 ["Colors", v"0.7.2", "Reexport"],
360 ["Colors", v"0.7.2", "ColorTypes", v"0.3.0"],
361 ["Colors", v"0.7.2", "Compat", v"0.17.0"],
362 ["Colors", v"0.7.2", "FixedPointNumbers", v"0.3.0"],
363 ["Colors", v"0.7.3", "ColorTypes", v"0.3.0"],
364 ["Colors", v"0.7.3", "Compat", v"0.18.0"],
365 ["Colors", v"0.7.3", "FixedPointNumbers", v"0.3.0"],
366 ["Colors", v"0.7.3", "Reexport"],
367 ["Combinatorics", v"0.2.0", "Compat"],
368 ["Combinatorics", v"0.2.0", "Iterators"],
369 ["Combinatorics", v"0.2.0", "Polynomials"],
370 ["Combinatorics", v"0.3.2", "Iterators"],
371 ["Combinatorics", v"0.3.2", "Polynomials"],
372 ["Combinatorics", v"0.4.0", "Compat", v"0.18.0"],
373 ["Combinatorics", v"0.4.0", "Iterators"],
374 ["Combinatorics", v"0.4.0", "Polynomials"],
375 ["Compat", v"0.8.1"],
376 ["Compat", v"0.8.3"],
377 ["Compat", v"0.8.4"],
378 ["Compat", v"0.8.5"],
379 ["Compat", v"0.8.6"],
380 ["Compat", v"0.8.7"],
381 ["Compat", v"0.8.8"],
382 ["Compat", v"0.9.0"],
383 ["Compat", v"0.9.1"],
384 ["Compat", v"0.9.3"],
385 ["Compat", v"0.9.4"],
386 ["Compat", v"0.10.0"],
387 ["Compat", v"0.11.0"],
388 ["Compat", v"0.12.0"],
389 ["Compat", v"0.13.0"],
390 ["Compat", v"0.15.0"],
391 ["Compat", v"0.16.2"],
392 ["Compat", v"0.17.0"],
393 ["Compat", v"0.18.0"],
394 ["Compat", v"0.23.0"],
395 ["Compat", v"0.24.0"],
396 ["ComputationalResources", v"0.0.1"],
397 ["ComputationalResources", v"0.0.2", "Compat", v"0.17.0"],
398 ["Conda", v"0.1.5", "BinDeps"],
399 ["Conda", v"0.1.5", "Compat"],
400 ["Conda", v"0.1.5", "JSON"],
401 ["Conda", v"0.1.9", "BinDeps"],
402 ["Conda", v"0.1.9", "Compat"],
403 ["Conda", v"0.1.9", "JSON"],
404 ["Conda", v"0.2.2", "BinDeps"],
405 ["Conda", v"0.2.2", "Compat", v"0.7.15"],
406 ["Conda", v"0.2.2", "JSON"],
407 ["Conda", v"0.2.4", "BinDeps"],
408 ["Conda", v"0.2.4", "Compat", v"0.8.0"],
409 ["Conda", v"0.2.4", "JSON"],
410 ["Conda", v"0.2.5", "BinDeps"],
411 ["Conda", v"0.2.5", "Compat", v"0.7.20"],
412 ["Conda", v"0.2.5", "JSON"],
413 ["Conda", v"0.3.2", "BinDeps"],
414 ["Conda", v"0.3.2", "Compat", v"0.8.0"],
415 ["Conda", v"0.3.2", "JSON"],
416 ["Conda", v"0.5.3", "BinDeps"],
417 ["Conda", v"0.5.3", "Compat", v"0.8.0"],
418 ["Conda", v"0.5.3", "JSON"],
419 ["CoordinateTransformations", v"0.1.0", "FixedSizeArrays"],
420 ["CoordinateTransformations", v"0.1.0", "Rotations"],
421 ["CoordinateTransformations", v"0.2.0", "Compat", v"0.8.0", v"0.11.0"],
422 ["CoordinateTransformations", v"0.2.0", "FixedSizeArrays", v"0.2.2"],
423 ["CoordinateTransformations", v"0.2.0", "Rotations", v"0.1.0", v"0.2.0+"],
424 ["CoordinateTransformations", v"0.3.2", "Rotations", v"0.3.0"],
425 ["CoordinateTransformations", v"0.3.2", "StaticArrays"],
426 ["CoordinateTransformations", v"0.4.0", "Rotations", v"0.3.0"],
427 ["CoordinateTransformations", v"0.4.0", "StaticArrays"],
428 ["CoordinateTransformations", v"0.4.1", "Compat", v"0.17.0"],
429 ["CoordinateTransformations", v"0.4.1", "Rotations", v"0.3.0"],
430 ["CoordinateTransformations", v"0.4.1", "StaticArrays"],
431 ["CustomUnitRanges", v"0.0.4"],
432 ["DWARF", v"0.0.0", "ELF"],
433 ["DWARF", v"0.0.0", "StrPack"],
434 ["DWARF", v"0.1.0", "AbstractTrees"],
435 ["DWARF", v"0.1.0", "ObjFileBase"],
436 ["DWARF", v"0.1.0", "StructIO"],
437 ["DataArrays", v"0.4.0", "Reexport"],
438 ["DataArrays", v"0.4.0", "SpecialFunctions"],
439 ["DataArrays", v"0.4.0", "Compat", v"0.8.6"],
440 ["DataArrays", v"0.4.0", "StatsBase", v"0.3.0"],
441 ["DataFrames", v"0.0.0", "Options"],
442 ["DataFrames", v"0.0.0", "StatsBase", v"0.0.0", v"0.8.3"],
443 ["DataFrames", v"0.2.2", "GZip"],
444 ["DataFrames", v"0.2.2", "Options"],
445 ["DataFrames", v"0.2.2", "StatsBase", v"0.0.0", v"0.8.3"],
446 ["DataFrames", v"0.3.10", "GZip"],
447 ["DataFrames", v"0.3.10", "StatsBase", v"0.0.0", v"0.8.3"],
448 ["DataFrames", v"0.3.11", "Blocks"],
449 ["DataFrames", v"0.3.11", "GZip"],
450 ["DataFrames", v"0.3.11", "StatsBase", v"0.0.0", v"0.8.3"],
451 ["DataFrames", v"0.3.16", "Blocks"],
452 ["DataFrames", v"0.3.16", "GZip"],
453 ["DataFrames", v"0.3.16", "SortingAlgorithms"],
454 ["DataFrames", v"0.3.16", "StatsBase", v"0.0.0", v"0.8.3"],
455 ["DataFrames", v"0.4.2", "Blocks"],
456 ["DataFrames", v"0.4.2", "DataArrays"],
457 ["DataFrames", v"0.4.2", "GZip"],
458 ["DataFrames", v"0.4.2", "SortingAlgorithms"],
459 ["DataFrames", v"0.4.2", "Stats"],
460 ["DataFrames", v"0.5.0", "Blocks"],
461 ["DataFrames", v"0.5.0", "GZip"],
462 ["DataFrames", v"0.5.0", "SortingAlgorithms"],
463 ["DataFrames", v"0.5.0", "DataArrays", v"0.1.0-"],
464 ["DataFrames", v"0.5.0", "StatsBase", v"0.3.0-", v"0.8.3"],
465 ["DataFrames", v"0.5.3", "Blocks"],
466 ["DataFrames", v"0.5.3", "DataArrays"],
467 ["DataFrames", v"0.5.3", "GZip"],
468 ["DataFrames", v"0.5.3", "SortingAlgorithms"],
469 ["DataFrames", v"0.5.3", "StatsBase", v"0.0.0", v"0.8.3"],
470 ["DataFrames", v"0.5.4", "Blocks"],
471 ["DataFrames", v"0.5.4", "DataArrays"],
472 ["DataFrames", v"0.5.4", "GZip"],
473 ["DataFrames", v"0.5.4", "Reexport"],
474 ["DataFrames", v"0.5.4", "SortingAlgorithms"],
475 ["DataFrames", v"0.5.4", "StatsBase", v"0.3.9+", v"0.8.3"],
476 ["DataFrames", v"0.5.11", "DataArrays"],
477 ["DataFrames", v"0.5.11", "GZip"],
478 ["DataFrames", v"0.5.11", "Reexport"],
479 ["DataFrames", v"0.5.11", "SortingAlgorithms"],
480 ["DataFrames", v"0.5.11", "StatsBase", v"0.3.9+", v"0.8.3"],
481 ["DataFrames", v"0.6.1", "Compat"],
482 ["DataFrames", v"0.6.1", "DataArrays"],
483 ["DataFrames", v"0.6.1", "GZip"],
484 ["DataFrames", v"0.6.1", "Reexport"],
485 ["DataFrames", v"0.6.1", "SortingAlgorithms"],
486 ["DataFrames", v"0.6.1", "StatsBase", v"0.3.9+", v"0.8.3"],
487 ["DataFrames", v"0.6.5", "Compat"],
488 ["DataFrames", v"0.6.5", "DataArrays"],
489 ["DataFrames", v"0.6.5", "Docile"],
490 ["DataFrames", v"0.6.5", "GZip"],
491 ["DataFrames", v"0.6.5", "Reexport"],
492 ["DataFrames", v"0.6.5", "SortingAlgorithms"],
493 ["DataFrames", v"0.6.5", "StatsBase", v"0.3.9+", v"0.8.3"],
494 ["DataFrames", v"0.6.10", "Compat"],
495 ["DataFrames", v"0.6.10", "Docile"],
496 ["DataFrames", v"0.6.10", "GZip"],
497 ["DataFrames", v"0.6.10", "Reexport"],
498 ["DataFrames", v"0.6.10", "SortingAlgorithms"],
499 ["DataFrames", v"0.6.10", "DataArrays", v"0.2.15"],
500 ["DataFrames", v"0.6.10", "StatsBase", v"0.3.9+", v"0.8.3"],
501 ["DataFrames", v"0.7.0", "Docile"],
502 ["DataFrames", v"0.7.0", "GZip"],
503 ["DataFrames", v"0.7.0", "Reexport"],
504 ["DataFrames", v"0.7.0", "SortingAlgorithms"],
505 ["DataFrames", v"0.7.0", "Compat", v"0.7.12"],
506 ["DataFrames", v"0.7.0", "DataArrays", v"0.2.15"],
507 ["DataFrames", v"0.7.0", "StatsBase", v"0.8.0", v"0.8.3"],
508 ["DataFrames", v"0.7.2", "Docile"],
509 ["DataFrames", v"0.7.2", "GZip"],
510 ["DataFrames", v"0.7.2", "Reexport"],
511 ["DataFrames", v"0.7.2", "SortingAlgorithms"],
512 ["DataFrames", v"0.7.2", "Compat", v"0.7.17"],
513 ["DataFrames", v"0.7.2", "DataArrays", v"0.2.15"],
514 ["DataFrames", v"0.7.2", "StatsBase", v"0.8.0", v"0.8.3"],
515 ["DataFrames", v"0.7.3", "Docile"],
516 ["DataFrames", v"0.7.3", "GZip"],
517 ["DataFrames", v"0.7.3", "Reexport"],
518 ["DataFrames", v"0.7.3", "SortingAlgorithms"],
519 ["DataFrames", v"0.7.3", "Compat", v"0.7.19"],
520 ["DataFrames", v"0.7.3", "DataArrays", v"0.2.15"],
521 ["DataFrames", v"0.7.3", "StatsBase", v"0.8.0", v"0.8.3"],
522 ["DataFrames", v"0.7.4", "Docile"],
523 ["DataFrames", v"0.7.4", "GZip"],
524 ["DataFrames", v"0.7.4", "Reexport"],
525 ["DataFrames", v"0.7.4", "SortingAlgorithms"],
526 ["DataFrames", v"0.7.4", "Compat", v"0.7.19"],
527 ["DataFrames", v"0.7.4", "DataArrays", v"0.3.4"],
528 ["DataFrames", v"0.7.4", "StatsBase", v"0.8.0", v"0.8.3"],
529 ["DataFrames", v"0.7.6", "Docile"],
530 ["DataFrames", v"0.7.6", "GZip"],
531 ["DataFrames", v"0.7.6", "Reexport"],
532 ["DataFrames", v"0.7.6", "SortingAlgorithms"],
533 ["DataFrames", v"0.7.6", "Compat", v"0.7.19"],
534 ["DataFrames", v"0.7.6", "DataArrays", v"0.3.4"],
535 ["DataFrames", v"0.7.6", "StatsBase", v"0.8.3"],
536 ["DataFrames", v"0.7.8", "GZip"],
537 ["DataFrames", v"0.7.8", "Reexport"],
538 ["DataFrames", v"0.7.8", "SortingAlgorithms"],
539 ["DataFrames", v"0.7.8", "Compat", v"0.8.0"],
540 ["DataFrames", v"0.7.8", "DataArrays", v"0.3.4"],
541 ["DataFrames", v"0.7.8", "StatsBase", v"0.8.3"],
542 ["DataFrames", v"0.8.0", "GZip"],
543 ["DataFrames", v"0.8.0", "Reexport"],
544 ["DataFrames", v"0.8.0", "SortingAlgorithms"],
545 ["DataFrames", v"0.8.0", "Compat", v"0.8.4"],
546 ["DataFrames", v"0.8.0", "DataArrays", v"0.3.4"],
547 ["DataFrames", v"0.8.0", "StatsBase", v"0.8.3"],
548 ["DataFrames", v"0.8.3", "GZip"],
549 ["DataFrames", v"0.8.3", "Reexport"],
550 ["DataFrames", v"0.8.3", "SortingAlgorithms"],
551 ["DataFrames", v"0.8.3", "Compat", v"0.8.4"],
552 ["DataFrames", v"0.8.3", "DataArrays", v"0.3.4"],
553 ["DataFrames", v"0.8.3", "FileIO", v"0.1.2"],
554 ["DataFrames", v"0.8.3", "StatsBase", v"0.8.3"],
555 ["DataFrames", v"0.8.4", "GZip"],
556 ["DataFrames", v"0.8.4", "Reexport"],
557 ["DataFrames", v"0.8.4", "SortingAlgorithms"],
558 ["DataFrames", v"0.8.4", "Compat", v"0.8.4"],
559 ["DataFrames", v"0.8.4", "DataArrays", v"0.3.4"],
560 ["DataFrames", v"0.8.4", "FileIO", v"0.1.2"],
561 ["DataFrames", v"0.8.4", "StatsBase", v"0.11.0"],
562 ["DataFrames", v"0.8.5", "GZip"],
563 ["DataFrames", v"0.8.5", "Reexport"],
564 ["DataFrames", v"0.8.5", "SortingAlgorithms"],
565 ["DataFrames", v"0.8.5", "Compat", v"0.8.4"],
566 ["DataFrames", v"0.8.5", "DataArrays", v"0.3.4"],
567 ["DataFrames", v"0.8.5", "FileIO", v"0.1.2"],
568 ["DataFrames", v"0.8.5", "Juno", v"0.2.4"],
569 ["DataFrames", v"0.8.5", "StatsBase", v"0.11.0"],
570 ["DataFrames", v"0.9.1", "GZip"],
571 ["DataFrames", v"0.9.1", "Reexport"],
572 ["DataFrames", v"0.9.1", "SortingAlgorithms"],
573 ["DataFrames", v"0.9.1", "Compat", v"0.18.0"],
574 ["DataFrames", v"0.9.1", "DataArrays", v"0.3.4"],
575 ["DataFrames", v"0.9.1", "FileIO", v"0.1.2"],
576 ["DataFrames", v"0.9.1", "StatsBase", v"0.11.0"],
577 ["DataStructures", v"0.4.5"],
578 ["DataStructures", v"0.4.6", "Compat", v"0.8.5"],
579 ["DataStructures", v"0.5.1", "Compat", v"0.9.4"],
580 ["DataStructures", v"0.5.2", "Compat", v"0.9.4"],
581 ["DataStructures", v"0.5.3", "Compat", v"0.17.0"],
582 ["Dates", v"0.4.4"],
583 ["DelayDiffEq", v"0.0.1", "Combinatorics"],
584 ["DelayDiffEq", v"0.0.1", "DataStructures", v"0.4.6"],
585 ["DelayDiffEq", v"0.0.1", "DiffEqBase", v"0.5.0", v"0.7.0"],
586 ["DelayDiffEq", v"0.0.1", "RecursiveArrayTools", v"0.1.2"],
587 ["DelayDiffEq", v"0.0.1", "OrdinaryDiffEq", v"1.0.0", v"1.2.0"],
588 ["DelayDiffEq", v"0.1.0", "Combinatorics"],
589 ["DelayDiffEq", v"0.1.0", "DataStructures", v"0.4.6"],
590 ["DelayDiffEq", v"0.1.0", "DiffEqBase", v"0.8.0", v"0.15.0"],
591 ["DelayDiffEq", v"0.1.0", "OrdinaryDiffEq", v"1.2.0"],
592 ["DelayDiffEq", v"0.1.0", "RecursiveArrayTools", v"0.2.0"],
593 ["DelayDiffEq", v"0.2.0", "Combinatorics"],
594 ["DelayDiffEq", v"0.2.0", "DataStructures", v"0.4.6"],
595 ["DelayDiffEq", v"0.2.0", "DiffEqBase", v"0.8.0", v"0.15.0"],
596 ["DelayDiffEq", v"0.2.0", "OrdinaryDiffEq", v"1.6.0"],
597 ["DelayDiffEq", v"0.2.0", "RecursiveArrayTools", v"0.2.0"],
598 ["DelayDiffEq", v"0.3.0", "Combinatorics"],
599 ["DelayDiffEq", v"0.3.0", "DataStructures", v"0.4.6"],
600 ["DelayDiffEq", v"0.3.0", "DiffEqBase", v"0.15.0"],
601 ["DelayDiffEq", v"0.3.0", "OrdinaryDiffEq", v"1.6.0"],
602 ["DelayDiffEq", v"0.3.0", "RecursiveArrayTools", v"0.2.0"],
603 ["DiffBase", v"0.0.2", "Compat", v"0.7.15"],
604 ["DiffBase", v"0.1.0", "Compat", v"0.7.15"],
605 ["DiffEqBase", v"0.0.1", "RecipesBase", v"0.1.0"],
606 ["DiffEqBase", v"0.0.4", "Ranges", v"0.0.1"],
607 ["DiffEqBase", v"0.0.4", "RecipesBase", v"0.1.0"],
608 ["DiffEqBase", v"0.1.0", "Parameters"],
609 ["DiffEqBase", v"0.1.0", "Ranges", v"0.0.1"],
610 ["DiffEqBase", v"0.1.0", "RecursiveArrayTools"],
611 ["DiffEqBase", v"0.1.0", "RecipesBase", v"0.1.0"],
612 ["DiffEqBase", v"0.1.1", "Parameters"],
613 ["DiffEqBase", v"0.1.1", "Ranges", v"0.0.1"],
614 ["DiffEqBase", v"0.1.1", "RecursiveArrayTools"],
615 ["DiffEqBase", v"0.1.1", "RecipesBase", v"0.1.0"],
616 ["DiffEqBase", v"0.1.2", "Parameters", v"0.5.0"],
617 ["DiffEqBase", v"0.1.2", "Ranges", v"0.0.1"],
618 ["DiffEqBase", v"0.1.2", "RecipesBase", v"0.1.0"],
619 ["DiffEqBase", v"0.1.2", "RecursiveArrayTools", v"0.0.2"],
620 ["DiffEqBase", v"0.1.3", "Parameters", v"0.5.0"],
621 ["DiffEqBase", v"0.1.3", "Ranges", v"0.0.1"],
622 ["DiffEqBase", v"0.1.3", "RecipesBase", v"0.1.0"],
623 ["DiffEqBase", v"0.1.3", "RecursiveArrayTools", v"0.0.2"],
624 ["DiffEqBase", v"0.2.0", "Parameters", v"0.5.0"],
625 ["DiffEqBase", v"0.2.0", "Ranges", v"0.0.1"],
626 ["DiffEqBase", v"0.2.0", "RecipesBase", v"0.1.0"],
627 ["DiffEqBase", v"0.2.0", "RecursiveArrayTools", v"0.0.2"],
628 ["DiffEqBase", v"0.3.2", "Parameters", v"0.5.0"],
629 ["DiffEqBase", v"0.3.2", "Ranges", v"0.0.1"],
630 ["DiffEqBase", v"0.3.2", "RecipesBase", v"0.1.0"],
631 ["DiffEqBase", v"0.3.2", "RecursiveArrayTools", v"0.0.2"],
632 ["DiffEqBase", v"0.3.2", "SimpleTraits", v"0.1.1"],
633 ["DiffEqBase", v"0.4.0", "Parameters", v"0.5.0"],
634 ["DiffEqBase", v"0.4.0", "Ranges", v"0.0.1"],
635 ["DiffEqBase", v"0.4.0", "RecipesBase", v"0.1.0"],
636 ["DiffEqBase", v"0.4.0", "RecursiveArrayTools", v"0.0.2"],
637 ["DiffEqBase", v"0.4.0", "SimpleTraits", v"0.1.1"],
638 ["DiffEqBase", v"0.4.1", "Parameters", v"0.5.0"],
639 ["DiffEqBase", v"0.4.1", "Ranges", v"0.0.1"],
640 ["DiffEqBase", v"0.4.1", "RecipesBase", v"0.1.0"],
641 ["DiffEqBase", v"0.4.1", "RecursiveArrayTools", v"0.0.2"],
642 ["DiffEqBase", v"0.4.1", "SimpleTraits", v"0.1.1"],
643 ["DiffEqBase", v"0.5.0", "Parameters", v"0.5.0"],
644 ["DiffEqBase", v"0.5.0", "Ranges", v"0.0.1"],
645 ["DiffEqBase", v"0.5.0", "RecipesBase", v"0.1.0"],
646 ["DiffEqBase", v"0.5.0", "RecursiveArrayTools", v"0.0.2"],
647 ["DiffEqBase", v"0.5.0", "SimpleTraits", v"0.1.1"],
648 ["DiffEqBase", v"0.6.0", "Parameters", v"0.5.0"],
649 ["DiffEqBase", v"0.6.0", "Ranges", v"0.0.1"],
650 ["DiffEqBase", v"0.6.0", "RecipesBase", v"0.1.0"],
651 ["DiffEqBase", v"0.6.0", "RecursiveArrayTools", v"0.0.2"],
652 ["DiffEqBase", v"0.6.0", "SimpleTraits", v"0.1.1"],
653 ["DiffEqBase", v"0.7.0", "Parameters", v"0.5.0"],
654 ["DiffEqBase", v"0.7.0", "Ranges", v"0.0.1"],
655 ["DiffEqBase", v"0.7.0", "RecipesBase", v"0.1.0"],
656 ["DiffEqBase", v"0.7.0", "RecursiveArrayTools", v"0.0.2"],
657 ["DiffEqBase", v"0.7.0", "SimpleTraits", v"0.1.1"],
658 ["DiffEqBase", v"0.10.0", "Parameters", v"0.5.0"],
659 ["DiffEqBase", v"0.10.0", "Ranges", v"0.0.1"],
660 ["DiffEqBase", v"0.10.0", "RecipesBase", v"0.1.0"],
661 ["DiffEqBase", v"0.10.0", "RecursiveArrayTools", v"0.2.0"],
662 ["DiffEqBase", v"0.10.0", "SimpleTraits", v"0.1.1"],
663 ["DiffEqBase", v"0.11.0", "Parameters", v"0.5.0"],
664 ["DiffEqBase", v"0.11.0", "Ranges", v"0.0.1"],
665 ["DiffEqBase", v"0.11.0", "RecipesBase", v"0.1.0"],
666 ["DiffEqBase", v"0.11.0", "RecursiveArrayTools", v"0.2.0"],
667 ["DiffEqBase", v"0.11.0", "SimpleTraits", v"0.1.1"],
668 ["DiffEqBase", v"0.12.1", "Compat", v"0.19.0"],
669 ["DiffEqBase", v"0.12.1", "Parameters", v"0.5.0"],
670 ["DiffEqBase", v"0.12.1", "Ranges", v"0.0.1"],
671 ["DiffEqBase", v"0.12.1", "RecipesBase", v"0.1.0"],
672 ["DiffEqBase", v"0.12.1", "RecursiveArrayTools", v"0.2.0"],
673 ["DiffEqBase", v"0.12.1", "SimpleTraits", v"0.1.1"],
674 ["DiffEqBase", v"0.13.0", "Compat", v"0.19.0"],
675 ["DiffEqBase", v"0.13.0", "Parameters", v"0.5.0"],
676 ["DiffEqBase", v"0.13.0", "Ranges", v"0.0.1"],
677 ["DiffEqBase", v"0.13.0", "RecipesBase", v"0.1.0"],
678 ["DiffEqBase", v"0.13.0", "RecursiveArrayTools", v"0.2.0"],
679 ["DiffEqBase", v"0.13.0", "SimpleTraits", v"0.1.1"],
680 ["DiffEqBase", v"0.14.0", "Compat", v"0.19.0"],
681 ["DiffEqBase", v"0.14.0", "Parameters", v"0.5.0"],
682 ["DiffEqBase", v"0.14.0", "Ranges", v"0.0.1"],
683 ["DiffEqBase", v"0.14.0", "RecipesBase", v"0.1.0"],
684 ["DiffEqBase", v"0.14.0", "RecursiveArrayTools", v"0.2.0"],
685 ["DiffEqBase", v"0.14.0", "SimpleTraits", v"0.1.1"],
686 ["DiffEqBase", v"0.15.0", "Compat", v"0.19.0"],
687 ["DiffEqBase", v"0.15.0", "Parameters", v"0.5.0"],
688 ["DiffEqBase", v"0.15.0", "Ranges", v"0.0.1"],
689 ["DiffEqBase", v"0.15.0", "RecipesBase", v"0.1.0"],
690 ["DiffEqBase", v"0.15.0", "RecursiveArrayTools", v"0.2.0"],
691 ["DiffEqBase", v"0.15.0", "SimpleTraits", v"0.1.1"],
692 ["DiffEqBiological", v"0.0.1", "DiffEqBase"],
693 ["DiffEqBiological", v"0.0.1", "DiffEqJump"],
694 ["DiffEqCallbacks", v"0.0.2", "DiffEqBase", v"0.6.0"],
695 ["DiffEqDevTools", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.5.0"],
696 ["DiffEqDevTools", v"0.0.1", "FiniteElementDiffEq"],
697 ["DiffEqDevTools", v"0.0.1", "OrdinaryDiffEq"],
698 ["DiffEqDevTools", v"0.0.1", "StochasticDiffEq"],
699 ["DiffEqDevTools", v"0.0.1", "RecipesBase", v"0.1.0"],
700 ["DiffEqDevTools", v"0.1.0", "DiffEqBase", v"0.0.0", v"0.5.0"],
701 ["DiffEqDevTools", v"0.1.0", "FiniteElementDiffEq"],
702 ["DiffEqDevTools", v"0.1.0", "OrdinaryDiffEq"],
703 ["DiffEqDevTools", v"0.1.0", "RecursiveArrayTools"],
704 ["DiffEqDevTools", v"0.1.0", "StochasticDiffEq"],
705 ["DiffEqDevTools", v"0.1.0", "RecipesBase", v"0.1.0"],
706 ["DiffEqDevTools", v"0.1.1", "DiffEqBase", v"0.1.3", v"0.5.0"],
707 ["DiffEqDevTools", v"0.1.1", "FiniteElementDiffEq", v"0.0.5"],
708 ["DiffEqDevTools", v"0.1.1", "OrdinaryDiffEq", v"0.1.1"],
709 ["DiffEqDevTools", v"0.1.1", "RecipesBase", v"0.1.0"],
710 ["DiffEqDevTools", v"0.1.1", "RecursiveArrayTools", v"0.0.2"],
711 ["DiffEqDevTools", v"0.1.1", "StochasticDiffEq", v"0.0.5"],
712 ["DiffEqDevTools", v"0.2.0", "DiffEqBase", v"0.2.0", v"0.5.0"],
713 ["DiffEqDevTools", v"0.2.0", "FiniteElementDiffEq", v"0.0.5"],
714 ["DiffEqDevTools", v"0.2.0", "RecipesBase", v"0.1.0"],
715 ["DiffEqDevTools", v"0.2.0", "RecursiveArrayTools", v"0.0.2"],
716 ["DiffEqDevTools", v"0.3.0", "DiffEqBase", v"0.3.0", v"0.5.0"],
717 ["DiffEqDevTools", v"0.3.0", "RecipesBase", v"0.1.0"],
718 ["DiffEqDevTools", v"0.3.0", "RecursiveArrayTools", v"0.0.2"],
719 ["DiffEqDevTools", v"0.4.0", "DiffEqBase", v"0.4.0", v"0.5.0"],
720 ["DiffEqDevTools", v"0.4.0", "RecipesBase", v"0.1.0"],
721 ["DiffEqDevTools", v"0.4.0", "RecursiveArrayTools", v"0.1.2"],
722 ["DiffEqDevTools", v"0.5.0", "DiffEqBase", v"0.4.0", v"0.5.0"],
723 ["DiffEqDevTools", v"0.5.0", "DiffEqPDEBase"],
724 ["DiffEqDevTools", v"0.5.0", "RecipesBase", v"0.1.0"],
725 ["DiffEqDevTools", v"0.5.0", "RecursiveArrayTools", v"0.1.2"],
726 ["DiffEqDevTools", v"0.6.0", "DiffEqBase", v"0.5.0", v"0.15.0"],
727 ["DiffEqDevTools", v"0.6.0", "DiffEqPDEBase"],
728 ["DiffEqDevTools", v"0.6.0", "RecipesBase", v"0.1.0"],
729 ["DiffEqDevTools", v"0.6.0", "RecursiveArrayTools", v"0.1.2"],
730 ["DiffEqDevTools", v"0.7.0", "DiffEqBase", v"0.15.0"],
731 ["DiffEqDevTools", v"0.7.0", "DiffEqPDEBase"],
732 ["DiffEqDevTools", v"0.7.0", "RecipesBase", v"0.1.0"],
733 ["DiffEqDevTools", v"0.7.0", "RecursiveArrayTools", v"0.1.2"],
734 ["DiffEqFinancial", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.15.0"],
735 ["DiffEqFinancial", v"0.0.1", "StochasticDiffEq"],
736 ["DiffEqFinancial", v"0.1.0", "DiffEqBase", v"0.15.0"],
737 ["DiffEqFinancial", v"0.1.0", "StochasticDiffEq"],
738 ["DiffEqJump", v"0.0.1", "DiffEqBase"],
739 ["DiffEqJump", v"0.2.0", "DiffEqBase"],
740 ["DiffEqJump", v"0.2.0", "RecursiveArrayTools"],
741 ["DiffEqJump", v"0.3.0", "DiffEqBase", v"0.13.0"],
742 ["DiffEqJump", v"0.3.0", "RecursiveArrayTools"],
743 ["DiffEqMonteCarlo", v"0.1.0", "DiffEqBase", v"0.6.0", v"0.14.0"],
744 ["DiffEqMonteCarlo", v"0.1.0", "RecipesBase", v"0.1.0"],
745 ["DiffEqMonteCarlo", v"0.2.0", "DiffEqBase", v"0.14.0"],
746 ["DiffEqPDEBase", v"0.0.1", "ChunkedArrays"],
747 ["DiffEqPDEBase", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.15.0"],
748 ["DiffEqPDEBase", v"0.0.1", "RecipesBase"],
749 ["DiffEqPDEBase", v"0.0.1", "VectorizedRoutines"],
750 ["DiffEqPDEBase", v"0.0.3", "ChunkedArrays"],
751 ["DiffEqPDEBase", v"0.0.3", "DiffEqBase", v"0.4.1", v"0.15.0"],
752 ["DiffEqPDEBase", v"0.0.3", "RecipesBase"],
753 ["DiffEqPDEBase", v"0.0.3", "VectorizedRoutines"],
754 ["DiffEqPDEBase", v"0.1.0", "ChunkedArrays"],
755 ["DiffEqPDEBase", v"0.1.0", "Compat", v"0.17.0"],
756 ["DiffEqPDEBase", v"0.1.0", "DiffEqBase", v"0.4.1", v"0.15.0"],
757 ["DiffEqPDEBase", v"0.1.0", "RecipesBase"],
758 ["DiffEqPDEBase", v"0.1.0", "VectorizedRoutines"],
759 ["DiffEqPDEBase", v"0.2.0", "ChunkedArrays"],
760 ["DiffEqPDEBase", v"0.2.0", "Compat", v"0.17.0"],
761 ["DiffEqPDEBase", v"0.2.0", "DiffEqBase", v"0.15.0"],
762 ["DiffEqPDEBase", v"0.2.0", "RecipesBase"],
763 ["DiffEqPDEBase", v"0.2.0", "VectorizedRoutines"],
764 ["DiffEqParamEstim", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.14.0"],
765 ["DiffEqParamEstim", v"0.0.1", "LossFunctions"],
766 ["DiffEqParamEstim", v"0.0.1", "LsqFit"],
767 ["DiffEqParamEstim", v"0.0.1", "OrdinaryDiffEq"],
768 ["DiffEqParamEstim", v"0.0.1", "RecursiveArrayTools"],
769 ["DiffEqParamEstim", v"0.0.2", "DiffEqBase", v"0.1.2", v"0.14.0"],
770 ["DiffEqParamEstim", v"0.0.2", "LossFunctions", v"0.0.2"],
771 ["DiffEqParamEstim", v"0.0.2", "LsqFit", v"0.0.2"],
772 ["DiffEqParamEstim", v"0.0.2", "OrdinaryDiffEq", v"0.1.1"],
773 ["DiffEqParamEstim", v"0.0.2", "RecursiveArrayTools", v"0.0.2"],
774 ["DiffEqParamEstim", v"0.0.4", "DiffEqBase", v"0.1.2", v"0.14.0"],
775 ["DiffEqParamEstim", v"0.0.4", "LossFunctions", v"0.0.2"],
776 ["DiffEqParamEstim", v"0.0.4", "LsqFit", v"0.0.2"],
777 ["DiffEqParamEstim", v"0.0.4", "RecursiveArrayTools", v"0.0.2"],
778 ["DiffEqParamEstim", v"0.1.0", "Calculus"],
779 ["DiffEqParamEstim", v"0.1.0", "DiffEqBase", v"0.1.2", v"0.14.0"],
780 ["DiffEqParamEstim", v"0.1.0", "ForwardDiff"],
781 ["DiffEqParamEstim", v"0.1.0", "LossFunctions", v"0.0.2"],
782 ["DiffEqParamEstim", v"0.1.0", "LsqFit", v"0.0.2"],
783 ["DiffEqParamEstim", v"0.1.0", "RecursiveArrayTools", v"0.0.2"],
784 ["DiffEqParamEstim", v"0.2.0", "Calculus"],
785 ["DiffEqParamEstim", v"0.2.0", "Optim"],
786 ["DiffEqParamEstim", v"0.2.0", "Compat", v"0.17.0"],
787 ["DiffEqParamEstim", v"0.2.0", "DiffEqBase", v"0.14.0"],
788 ["DiffEqParamEstim", v"0.2.0", "ForwardDiff"],
789 ["DiffEqParamEstim", v"0.2.0", "LossFunctions", v"0.0.2"],
790 ["DiffEqParamEstim", v"0.2.0", "LsqFit", v"0.0.2"],
791 ["DiffEqParamEstim", v"0.2.0", "RecursiveArrayTools", v"0.0.2"],
792 ["DiffEqProblemLibrary", v"0.0.1", "AlgebraicDiffEq"],
793 ["DiffEqProblemLibrary", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.15.0"],
794 ["DiffEqProblemLibrary", v"0.0.1", "FiniteElementDiffEq"],
795 ["DiffEqProblemLibrary", v"0.0.1", "JLD", v"0.6.5"],
796 ["DiffEqProblemLibrary", v"0.0.1", "OrdinaryDiffEq"],
797 ["DiffEqProblemLibrary", v"0.0.1", "ParameterizedFunctions", v"0.2.0"],
798 ["DiffEqProblemLibrary", v"0.0.1", "StochasticDiffEq"],
799 ["DiffEqProblemLibrary", v"0.1.0", "AlgebraicDiffEq"],
800 ["DiffEqProblemLibrary", v"0.1.0", "DiffEqBase", v"0.0.0", v"0.15.0"],
801 ["DiffEqProblemLibrary", v"0.1.0", "FiniteElementDiffEq"],
802 ["DiffEqProblemLibrary", v"0.1.0", "JLD", v"0.6.5"],
803 ["DiffEqProblemLibrary", v"0.1.0", "ParameterizedFunctions", v"0.2.0"],
804 ["DiffEqProblemLibrary", v"0.1.0", "StochasticDiffEq"],
805 ["DiffEqProblemLibrary", v"0.2.0", "AlgebraicDiffEq", v"0.0.2"],
806 ["DiffEqProblemLibrary", v"0.2.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
807 ["DiffEqProblemLibrary", v"0.2.0", "FiniteElementDiffEq", v"0.0.5"],
808 ["DiffEqProblemLibrary", v"0.2.0", "JLD", v"0.6.5"],
809 ["DiffEqProblemLibrary", v"0.2.0", "ParameterizedFunctions", v"0.2.0"],
810 ["DiffEqProblemLibrary", v"0.2.0", "StochasticDiffEq", v"0.1.0"],
811 ["DiffEqProblemLibrary", v"0.3.2", "AlgebraicDiffEq", v"0.0.2"],
812 ["DiffEqProblemLibrary", v"0.3.2", "DiffEqBase", v"0.2.0", v"0.15.0"],
813 ["DiffEqProblemLibrary", v"0.3.2", "FiniteElementDiffEq", v"0.0.5"],
814 ["DiffEqProblemLibrary", v"0.3.2", "JLD", v"0.6.5"],
815 ["DiffEqProblemLibrary", v"0.3.2", "ParameterizedFunctions", v"0.2.0"],
816 ["DiffEqProblemLibrary", v"0.4.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
817 ["DiffEqProblemLibrary", v"0.4.0", "DiffEqPDEBase"],
818 ["DiffEqProblemLibrary", v"0.4.0", "FiniteElementDiffEq", v"0.0.5"],
819 ["DiffEqProblemLibrary", v"0.4.0", "JLD", v"0.6.5"],
820 ["DiffEqProblemLibrary", v"0.4.0", "ParameterizedFunctions", v"0.5.0"],
821 ["DiffEqProblemLibrary", v"0.5.0", "DiffEqBase", v"0.15.0"],
822 ["DiffEqProblemLibrary", v"0.5.0", "DiffEqPDEBase"],
823 ["DiffEqProblemLibrary", v"0.5.0", "JLD", v"0.6.5"],
824 ["DiffEqProblemLibrary", v"0.5.0", "ParameterizedFunctions", v"0.5.0"],
825 ["DiffEqSensitivity", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.15.0"],
826 ["DiffEqSensitivity", v"0.0.2", "DiffEqBase", v"0.1.2", v"0.15.0"],
827 ["DiffEqSensitivity", v"0.0.4", "DiffEqBase", v"0.2.0", v"0.15.0"],
828 ["DiffEqSensitivity", v"0.1.0", "DiffEqBase", v"0.15.0"],
829 ["DifferentialEquations", v"0.4.0", "ChunkedArrays", v"0.0.2"],
830 ["DifferentialEquations", v"0.4.0", "Compat", v"0.8.8"],
831 ["DifferentialEquations", v"0.4.0", "DiffEqBase", v"0.0.0", v"0.15.0"],
832 ["DifferentialEquations", v"0.4.0", "ForwardDiff", v"0.2.4"],
833 ["DifferentialEquations", v"0.4.0", "GenericSVD", v"0.0.2"],
834 ["DifferentialEquations", v"0.4.0", "InplaceOps", v"0.0.5"],
835 ["DifferentialEquations", v"0.4.0", "IterativeSolvers", v"0.2.2"],
836 ["DifferentialEquations", v"0.4.0", "Parameters", v"0.3.1"],
837 ["DifferentialEquations", v"0.4.0", "OrdinaryDiffEq", v"0.0.0", v"1.2.0"],
838 ["DifferentialEquations", v"0.4.0", "Plots", v"0.9.2"],
839 ["DifferentialEquations", v"0.4.0", "SIUnits", v"0.0.6"],
840 ["DifferentialEquations", v"0.4.0", "StochasticDiffEq", v"0.0.0", v"1.0.0"],
841 ["DifferentialEquations", v"0.4.2", "ChunkedArrays", v"0.0.2"],
842 ["DifferentialEquations", v"0.4.2", "Compat", v"0.8.8"],
843 ["DifferentialEquations", v"0.4.2", "DiffEqBase", v"0.0.0", v"0.15.0"],
844 ["DifferentialEquations", v"0.4.2", "ForwardDiff", v"0.2.4"],
845 ["DifferentialEquations", v"0.4.2", "GenericSVD", v"0.0.2"],
846 ["DifferentialEquations", v"0.4.2", "InplaceOps", v"0.0.5"],
847 ["DifferentialEquations", v"0.4.2", "IterativeSolvers", v"0.2.2"],
848 ["DifferentialEquations", v"0.4.2", "Parameters", v"0.5.0"],
849 ["DifferentialEquations", v"0.4.2", "OrdinaryDiffEq", v"0.0.0", v"1.2.0"],
850 ["DifferentialEquations", v"0.4.2", "Plots", v"0.9.2"],
851 ["DifferentialEquations", v"0.4.2", "SIUnits", v"0.0.6"],
852 ["DifferentialEquations", v"0.4.2", "StochasticDiffEq", v"0.0.0", v"1.0.0"],
853 ["DifferentialEquations", v"0.5.0", "ChunkedArrays", v"0.0.2"],
854 ["DifferentialEquations", v"0.5.0", "Compat", v"0.8.8"],
855 ["DifferentialEquations", v"0.5.0", "DiffEqBase", v"0.0.0", v"0.15.0"],
856 ["DifferentialEquations", v"0.5.0", "ForwardDiff", v"0.2.4"],
857 ["DifferentialEquations", v"0.5.0", "GenericSVD", v"0.0.2"],
858 ["DifferentialEquations", v"0.5.0", "InplaceOps", v"0.0.5"],
859 ["DifferentialEquations", v"0.5.0", "IterativeSolvers", v"0.2.2"],
860 ["DifferentialEquations", v"0.5.0", "NLsolve", v"0.7.3"],
861 ["DifferentialEquations", v"0.5.0", "Parameters", v"0.5.0"],
862 ["DifferentialEquations", v"0.5.0", "OrdinaryDiffEq", v"0.0.0", v"1.2.0"],
863 ["DifferentialEquations", v"0.5.0", "Plots", v"0.9.2"],
864 ["DifferentialEquations", v"0.5.0", "Ranges", v"0.0.1"],
865 ["DifferentialEquations", v"0.5.0", "StochasticDiffEq", v"0.0.0", v"1.0.0"],
866 ["DifferentialEquations", v"0.5.0", "Sundials", v"0.3.0"],
867 ["DifferentialEquations", v"1.0.0", "AlgebraicDiffEq"],
868 ["DifferentialEquations", v"1.0.0", "DiffEqDevTools"],
869 ["DifferentialEquations", v"1.0.0", "DiffEqParamEstim"],
870 ["DifferentialEquations", v"1.0.0", "DiffEqSensitivity"],
871 ["DifferentialEquations", v"1.0.0", "FiniteElementDiffEq"],
872 ["DifferentialEquations", v"1.0.0", "Reexport"],
873 ["DifferentialEquations", v"1.0.0", "DiffEqBase", v"0.0.0", v"0.15.0"],
874 ["DifferentialEquations", v"1.0.0", "OrdinaryDiffEq", v"0.0.0", v"1.2.0"],
875 ["DifferentialEquations", v"1.0.0", "StochasticDiffEq", v"0.0.0", v"1.0.0"],
876 ["DifferentialEquations", v"1.0.0", "StokesDiffEq"],
877 ["DifferentialEquations", v"1.0.0", "Sundials"],
878 ["DifferentialEquations", v"1.1.0", "AlgebraicDiffEq", v"0.0.2"],
879 ["DifferentialEquations", v"1.1.0", "DiffEqBase", v"0.1.3", v"0.15.0"],
880 ["DifferentialEquations", v"1.1.0", "DiffEqDevTools", v"0.1.1"],
881 ["DifferentialEquations", v"1.1.0", "DiffEqParamEstim", v"0.0.2"],
882 ["DifferentialEquations", v"1.1.0", "DiffEqSensitivity", v"0.0.2"],
883 ["DifferentialEquations", v"1.1.0", "FiniteElementDiffEq", v"0.0.5"],
884 ["DifferentialEquations", v"1.1.0", "OrdinaryDiffEq", v"0.1.1", v"1.2.0"],
885 ["DifferentialEquations", v"1.1.0", "ParameterizedFunctions", v"0.3.2"],
886 ["DifferentialEquations", v"1.1.0", "Reexport", v"0.0.3"],
887 ["DifferentialEquations", v"1.1.0", "StochasticDiffEq", v"0.0.5", v"1.0.0"],
888 ["DifferentialEquations", v"1.1.0", "StokesDiffEq", v"0.0.2"],
889 ["DifferentialEquations", v"1.1.0", "Sundials", v"0.3.0"],
890 ["DifferentialEquations", v"1.4.0", "AlgebraicDiffEq", v"0.0.2"],
891 ["DifferentialEquations", v"1.4.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
892 ["DifferentialEquations", v"1.4.0", "DiffEqDevTools", v"0.2.0"],
893 ["DifferentialEquations", v"1.4.0", "DiffEqParamEstim", v"0.0.2"],
894 ["DifferentialEquations", v"1.4.0", "DiffEqProblemLibrary", v"0.2.0"],
895 ["DifferentialEquations", v"1.4.0", "DiffEqSensitivity", v"0.0.2"],
896 ["DifferentialEquations", v"1.4.0", "FiniteElementDiffEq", v"0.0.5"],
897 ["DifferentialEquations", v"1.4.0", "OrdinaryDiffEq", v"0.2.0", v"1.2.0"],
898 ["DifferentialEquations", v"1.4.0", "ParameterizedFunctions", v"0.3.2"],
899 ["DifferentialEquations", v"1.4.0", "Reexport", v"0.0.3"],
900 ["DifferentialEquations", v"1.4.0", "StochasticDiffEq", v"0.1.0", v"1.0.0"],
901 ["DifferentialEquations", v"1.4.0", "StokesDiffEq", v"0.0.2"],
902 ["DifferentialEquations", v"1.4.0", "Sundials", v"0.4.1"],
903 ["DifferentialEquations", v"1.5.0", "DiffEqPDEBase"],
904 ["DifferentialEquations", v"1.5.0", "AlgebraicDiffEq", v"0.0.2"],
905 ["DifferentialEquations", v"1.5.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
906 ["DifferentialEquations", v"1.5.0", "DiffEqDevTools", v"0.2.0"],
907 ["DifferentialEquations", v"1.5.0", "DiffEqParamEstim", v"0.0.2"],
908 ["DifferentialEquations", v"1.5.0", "DiffEqSensitivity", v"0.0.2"],
909 ["DifferentialEquations", v"1.5.0", "FiniteElementDiffEq", v"0.0.5"],
910 ["DifferentialEquations", v"1.5.0", "OrdinaryDiffEq", v"0.2.0", v"1.2.0"],
911 ["DifferentialEquations", v"1.5.0", "ParameterizedFunctions", v"0.3.2"],
912 ["DifferentialEquations", v"1.5.0", "Reexport", v"0.0.3"],
913 ["DifferentialEquations", v"1.5.0", "StochasticDiffEq", v"0.1.0", v"1.0.0"],
914 ["DifferentialEquations", v"1.5.0", "StokesDiffEq", v"0.0.2"],
915 ["DifferentialEquations", v"1.5.0", "Sundials", v"0.4.1"],
916 ["DifferentialEquations", v"1.6.0", "AlgebraicDiffEq", v"0.0.2"],
917 ["DifferentialEquations", v"1.6.0", "DelayDiffEq"],
918 ["DifferentialEquations", v"1.6.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
919 ["DifferentialEquations", v"1.6.0", "DiffEqCallbacks"],
920 ["DifferentialEquations", v"1.6.0", "DiffEqMonteCarlo"],
921 ["DifferentialEquations", v"1.6.0", "DiffEqPDEBase"],
922 ["DifferentialEquations", v"1.6.0", "DiffEqDevTools", v"0.2.0"],
923 ["DifferentialEquations", v"1.6.0", "DiffEqParamEstim", v"0.0.2"],
924 ["DifferentialEquations", v"1.6.0", "DiffEqSensitivity", v"0.0.2"],
925 ["DifferentialEquations", v"1.6.0", "FiniteElementDiffEq", v"0.0.5"],
926 ["DifferentialEquations", v"1.6.0", "Reexport", v"0.0.3"],
927 ["DifferentialEquations", v"1.6.0", "OrdinaryDiffEq", v"0.2.0", v"1.2.0"],
928 ["DifferentialEquations", v"1.6.0", "ParameterizedFunctions", v"0.3.2"],
929 ["DifferentialEquations", v"1.6.0", "StochasticDiffEq", v"0.1.0", v"1.0.0"],
930 ["DifferentialEquations", v"1.6.0", "StokesDiffEq", v"0.0.2"],
931 ["DifferentialEquations", v"1.6.0", "Sundials", v"0.4.1"],
932 ["DifferentialEquations", v"1.7.0", "DiffEqCallbacks"],
933 ["DifferentialEquations", v"1.7.0", "DiffEqMonteCarlo"],
934 ["DifferentialEquations", v"1.7.0", "DiffEqPDEBase"],
935 ["DifferentialEquations", v"1.7.0", "AlgebraicDiffEq", v"0.0.2"],
936 ["DifferentialEquations", v"1.7.0", "DelayDiffEq", v"0.1.0"],
937 ["DifferentialEquations", v"1.7.0", "DiffEqDevTools", v"0.2.0"],
938 ["DifferentialEquations", v"1.7.0", "DiffEqParamEstim", v"0.0.2"],
939 ["DifferentialEquations", v"1.7.0", "DiffEqSensitivity", v"0.0.2"],
940 ["DifferentialEquations", v"1.7.0", "FiniteElementDiffEq", v"0.0.5"],
941 ["DifferentialEquations", v"1.7.0", "OrdinaryDiffEq", v"1.2.0"],
942 ["DifferentialEquations", v"1.7.0", "ParameterizedFunctions", v"0.3.2"],
943 ["DifferentialEquations", v"1.7.0", "Reexport", v"0.0.3"],
944 ["DifferentialEquations", v"1.7.0", "DiffEqBase", v"0.8.0", v"0.15.0"],
945 ["DifferentialEquations", v"1.7.0", "StochasticDiffEq", v"1.0.0"],
946 ["DifferentialEquations", v"1.7.0", "StokesDiffEq", v"0.0.2"],
947 ["DifferentialEquations", v"1.7.0", "Sundials", v"0.4.1"],
948 ["DifferentialEquations", v"1.9.0", "DiffEqBiological"],
949 ["DifferentialEquations", v"1.9.0", "DiffEqCallbacks"],
950 ["DifferentialEquations", v"1.9.0", "AlgebraicDiffEq", v"0.0.2"],
951 ["DifferentialEquations", v"1.9.0", "DelayDiffEq", v"0.1.0"],
952 ["DifferentialEquations", v"1.9.0", "DiffEqBase", v"0.8.0", v"0.15.0"],
953 ["DifferentialEquations", v"1.9.0", "DiffEqFinancial"],
954 ["DifferentialEquations", v"1.9.0", "DiffEqJump"],
955 ["DifferentialEquations", v"1.9.0", "DiffEqMonteCarlo"],
956 ["DifferentialEquations", v"1.9.0", "DiffEqPDEBase"],
957 ["DifferentialEquations", v"1.9.0", "DiffEqDevTools", v"0.2.0"],
958 ["DifferentialEquations", v"1.9.0", "DiffEqParamEstim", v"0.0.2"],
959 ["DifferentialEquations", v"1.9.0", "DiffEqSensitivity", v"0.0.2"],
960 ["DifferentialEquations", v"1.9.0", "FiniteElementDiffEq", v"0.0.5"],
961 ["DifferentialEquations", v"1.9.0", "MultiScaleArrays"],
962 ["DifferentialEquations", v"1.9.0", "OrdinaryDiffEq", v"1.2.0"],
963 ["DifferentialEquations", v"1.9.0", "PyDSTool"],
964 ["DifferentialEquations", v"1.9.0", "ParameterizedFunctions", v"0.3.2"],
965 ["DifferentialEquations", v"1.9.0", "Reexport", v"0.0.3"],
966 ["DifferentialEquations", v"1.9.0", "StochasticDiffEq", v"1.0.0"],
967 ["DifferentialEquations", v"1.9.0", "StokesDiffEq", v"0.0.2"],
968 ["DifferentialEquations", v"1.9.0", "Sundials", v"0.4.1"],
969 ["DifferentialEquations", v"1.9.1", "DiffEqBiological"],
970 ["DifferentialEquations", v"1.9.1", "DiffEqCallbacks"],
971 ["DifferentialEquations", v"1.9.1", "AlgebraicDiffEq", v"0.0.2"],
972 ["DifferentialEquations", v"1.9.1", "DelayDiffEq", v"0.1.0"],
973 ["DifferentialEquations", v"1.9.1", "DiffEqBase", v"0.8.0", v"0.15.0"],
974 ["DifferentialEquations", v"1.9.1", "DiffEqFinancial"],
975 ["DifferentialEquations", v"1.9.1", "DiffEqJump"],
976 ["DifferentialEquations", v"1.9.1", "DiffEqMonteCarlo"],
977 ["DifferentialEquations", v"1.9.1", "DiffEqPDEBase"],
978 ["DifferentialEquations", v"1.9.1", "DiffEqDevTools", v"0.2.0"],
979 ["DifferentialEquations", v"1.9.1", "DiffEqParamEstim", v"0.0.2"],
980 ["DifferentialEquations", v"1.9.1", "DiffEqSensitivity", v"0.0.2"],
981 ["DifferentialEquations", v"1.9.1", "FiniteElementDiffEq", v"0.0.5"],
982 ["DifferentialEquations", v"1.9.1", "MultiScaleArrays"],
983 ["DifferentialEquations", v"1.9.1", "OrdinaryDiffEq", v"1.2.0"],
984 ["DifferentialEquations", v"1.9.1", "ParameterizedFunctions", v"0.3.2"],
985 ["DifferentialEquations", v"1.9.1", "Reexport", v"0.0.3"],
986 ["DifferentialEquations", v"1.9.1", "StochasticDiffEq", v"1.0.0"],
987 ["DifferentialEquations", v"1.9.1", "StokesDiffEq", v"0.0.2"],
988 ["DifferentialEquations", v"1.9.1", "Sundials", v"0.4.1"],
989 ["DifferentialEquations", v"1.10.1", "DiffEqBase", v"0.15.0"],
990 ["DifferentialEquations", v"1.10.1", "DiffEqBiological"],
991 ["DifferentialEquations", v"1.10.1", "DiffEqCallbacks"],
992 ["DifferentialEquations", v"1.10.1", "AlgebraicDiffEq", v"0.0.2"],
993 ["DifferentialEquations", v"1.10.1", "DiffEqFinancial"],
994 ["DifferentialEquations", v"1.10.1", "DiffEqJump"],
995 ["DifferentialEquations", v"1.10.1", "DiffEqMonteCarlo"],
996 ["DifferentialEquations", v"1.10.1", "DiffEqPDEBase"],
997 ["DifferentialEquations", v"1.10.1", "MultiScaleArrays"],
998 ["DifferentialEquations", v"1.10.1", "DelayDiffEq", v"0.1.0"],
999 ["DifferentialEquations", v"1.10.1", "DiffEqDevTools", v"0.2.0"],
1000 ["DifferentialEquations", v"1.10.1", "DiffEqParamEstim", v"0.0.2"],
1001 ["DifferentialEquations", v"1.10.1", "DiffEqSensitivity", v"0.0.2"],
1002 ["DifferentialEquations", v"1.10.1", "FiniteElementDiffEq", v"0.0.5"],
1003 ["DifferentialEquations", v"1.10.1", "OrdinaryDiffEq", v"1.2.0"],
1004 ["DifferentialEquations", v"1.10.1", "ParameterizedFunctions", v"0.3.2"],
1005 ["DifferentialEquations", v"1.10.1", "Reexport", v"0.0.3"],
1006 ["DifferentialEquations", v"1.10.1", "StochasticDiffEq", v"1.0.0"],
1007 ["DifferentialEquations", v"1.10.1", "StokesDiffEq", v"0.0.2"],
1008 ["DifferentialEquations", v"1.10.1", "Sundials", v"0.4.1"],
1009 ["Distances", v"0.1.1", "ArrayViews", v"0.4.0-"],
1010 ["Distances", v"0.2.0", "ArrayViews", v"0.4.8-"],
1011 ["Distances", v"0.2.2", "Compat"],
1012 ["Distances", v"0.2.2", "ArrayViews", v"0.4.8-"],
1013 ["Distances", v"0.3.2", "Compat", v"0.8.4"],
1014 ["Distances", v"0.4.0"],
1015 ["Distances", v"0.4.1", "Compat", v"0.18.0"],
1016 ["Distributions", v"0.6.4", "ArrayViews", v"0.4.8"],
1017 ["Distributions", v"0.6.4", "Compat", v"0.2.4"],
1018 ["Distributions", v"0.6.4", "PDMats", v"0.3.1", v"0.4.0"],
1019 ["Distributions", v"0.6.4", "StatsBase", v"0.6.10"],
1020 ["Distributions", v"0.6.4", "StatsFuns", v"0.0.0", v"0.3.0"],
1021 ["Distributions", v"0.6.5", "ArrayViews", v"0.4.9"],
1022 ["Distributions", v"0.6.5", "Compat", v"0.3.1"],
1023 ["Distributions", v"0.6.5", "PDMats", v"0.3.1", v"0.4.0"],
1024 ["Distributions", v"0.6.5", "StatsBase", v"0.6.10"],
1025 ["Distributions", v"0.6.5", "StatsFuns", v"0.0.0", v"0.3.0"],
1026 ["Distributions", v"0.6.7", "ArrayViews", v"0.4.10"],
1027 ["Distributions", v"0.6.7", "Compat", v"0.3.2"],
1028 ["Distributions", v"0.6.7", "PDMats", v"0.3.1", v"0.4.0"],
1029 ["Distributions", v"0.6.7", "StatsBase", v"0.6.13"],
1030 ["Distributions", v"0.6.7", "StatsFuns", v"0.0.0", v"0.3.0"],
1031 ["Distributions", v"0.7.6", "ArrayViews", v"0.4.12"],
1032 ["Distributions", v"0.7.6", "Compat", v"0.4.0"],
1033 ["Distributions", v"0.7.6", "PDMats", v"0.3.2", v"0.4.0"],
1034 ["Distributions", v"0.7.6", "StatsBase", v"0.6.14"],
1035 ["Distributions", v"0.7.6", "StatsFuns", v"0.0.0", v"0.3.0"],
1036 ["Distributions", v"0.8.9", "ArrayViews", v"0.4.12"],
1037 ["Distributions", v"0.8.9", "Compat", v"0.4.0"],
1038 ["Distributions", v"0.8.9", "PDMats", v"0.3.2", v"0.4.0"],
1039 ["Distributions", v"0.8.9", "StatsBase", v"0.7.0"],
1040 ["Distributions", v"0.8.9", "StatsFuns", v"0.1.1", v"0.3.0"],
1041 ["Distributions", v"0.8.10", "ArrayViews", v"0.4.12"],
1042 ["Distributions", v"0.8.10", "Compat", v"0.4.0"],
1043 ["Distributions", v"0.8.10", "PDMats", v"0.4.0", v"0.5.0"],
1044 ["Distributions", v"0.8.10", "StatsBase", v"0.7.0"],
1045 ["Distributions", v"0.8.10", "StatsFuns", v"0.1.1", v"0.3.0"],
1046 ["Distributions", v"0.9.0", "Compat", v"0.2.17"],
1047 ["Distributions", v"0.9.0", "PDMats", v"0.4.1", v"0.5.0"],
1048 ["Distributions", v"0.9.0", "StatsBase", v"0.7.0"],
1049 ["Distributions", v"0.9.0", "StatsFuns", v"0.1.1", v"0.3.0"],
1050 ["Distributions", v"0.10.2", "Calculus"],
1051 ["Distributions", v"0.10.2", "Compat", v"0.8.4"],
1052 ["Distributions", v"0.10.2", "PDMats", v"0.4.2", v"0.5.0"],
1053 ["Distributions", v"0.10.2", "StatsBase", v"0.8.3"],
1054 ["Distributions", v"0.10.2", "StatsFuns", v"0.3.0"],
1055 ["Distributions", v"0.11.1", "Calculus"],
1056 ["Distributions", v"0.11.1", "Compat", v"0.9.2"],
1057 ["Distributions", v"0.11.1", "PDMats", v"0.5.0"],
1058 ["Distributions", v"0.11.1", "StatsBase", v"0.8.3"],
1059 ["Distributions", v"0.11.1", "StatsFuns", v"0.3.1"],
1060 ["Distributions", v"0.12.0", "Calculus"],
1061 ["Distributions", v"0.12.0", "Compat", v"0.14.0"],
1062 ["Distributions", v"0.12.0", "PDMats", v"0.5.4"],
1063 ["Distributions", v"0.12.0", "QuadGK", v"0.1.1"],
1064 ["Distributions", v"0.12.0", "StatsBase", v"0.8.3"],
1065 ["Distributions", v"0.12.0", "StatsFuns", v"0.3.1"],
1066 ["Distributions", v"0.12.4", "Calculus"],
1067 ["Distributions", v"0.12.4", "Compat", v"0.18.0"],
1068 ["Distributions", v"0.12.4", "PDMats", v"0.5.4"],
1069 ["Distributions", v"0.12.4", "QuadGK", v"0.1.1"],
1070 ["Distributions", v"0.12.4", "SpecialFunctions", v"0.1.0"],
1071 ["Distributions", v"0.12.4", "StatsBase", v"0.8.3"],
1072 ["Distributions", v"0.12.4", "StatsFuns", v"0.3.1"],
1073 ["Distributions", v"0.12.5", "Calculus"],
1074 ["Distributions", v"0.12.5", "Compat", v"0.18.0"],
1075 ["Distributions", v"0.12.5", "PDMats", v"0.6.0"],
1076 ["Distributions", v"0.12.5", "QuadGK", v"0.1.1"],
1077 ["Distributions", v"0.12.5", "SpecialFunctions", v"0.1.0"],
1078 ["Distributions", v"0.12.5", "StatsBase", v"0.8.3"],
1079 ["Distributions", v"0.12.5", "StatsFuns", v"0.3.1"],
1080 ["Docile", v"0.1.0", "AnsiColor"],
1081 ["Docile", v"0.1.0", "Markdown"],
1082 ["Docile", v"0.3.1"],
1083 ["Docile", v"0.3.2", "Compat"],
1084 ["Docile", v"0.4.6", "Compat"],
1085 ["Docile", v"0.4.13", "Compat", v"0.3.3"],
1086 ["Docile", v"0.5.18", "Compat", v"0.3.5"],
1087 ["Docile", v"0.5.23", "Compat", v"0.7.1"],
1088 ["DualNumbers", v"0.1.0", "Calculus"],
1089 ["DualNumbers", v"0.1.3", "Calculus"],
1090 ["DualNumbers", v"0.1.3", "NaNMath"],
1091 ["DualNumbers", v"0.1.5", "Calculus"],
1092 ["DualNumbers", v"0.1.5", "Compat"],
1093 ["DualNumbers", v"0.1.5", "NaNMath"],
1094 ["DualNumbers", v"0.2.2", "Calculus"],
1095 ["DualNumbers", v"0.2.2", "NaNMath"],
1096 ["DualNumbers", v"0.3.0", "Calculus"],
1097 ["DualNumbers", v"0.3.0", "NaNMath"],
1098 ["DualNumbers", v"0.3.0", "Compat", v"0.9.1"],
1099 ["ELF", v"0.0.0", "StrPack"],
1100 ["ELF", v"0.1.0", "DWARF"],
1101 ["ELF", v"0.1.0", "FileIO"],
1102 ["ELF", v"0.1.0", "ObjFileBase"],
1103 ["ELF", v"0.1.0", "StructIO"],
1104 ["EllipsisNotation", v"0.0.1"],
1105 ["EllipsisNotation", v"0.1.0"],
1106 ["FFTViews", v"0.0.1", "CustomUnitRanges"],
1107 ["FFTViews", v"0.0.2", "CustomUnitRanges"],
1108 ["FFTViews", v"0.0.2", "Compat", v"0.17.0"],
1109 ["FactCheck", v"0.0.0"],
1110 ["FactCheck", v"0.0.2"],
1111 ["FactCheck", v"0.2.2"],
1112 ["FactCheck", v"0.4.2", "Compat"],
1113 ["FactCheck", v"0.4.3", "Compat", v"0.7.18"],
1114 ["FileIO", v"0.0.5", "Compat"],
1115 ["FileIO", v"0.0.5", "Docile"],
1116 ["FileIO", v"0.0.6", "Docile"],
1117 ["FileIO", v"0.0.6", "Compat", v"0.7.15"],
1118 ["FileIO", v"0.1.1", "Compat", v"0.7.19"],
1119 ["FileIO", v"0.2.1", "Compat", v"0.7.19"],
1120 ["FileIO", v"0.3.0", "Compat", v"0.9.5"],
1121 ["FileIO", v"0.3.1", "Compat", v"0.17.0"],
1122 ["FiniteElementDiffEq", v"0.0.3", "ChunkedArrays", v"0.1.0"],
1123 ["FiniteElementDiffEq", v"0.0.3", "DiffEqBase", v"0.0.0", v"0.15.0"],
1124 ["FiniteElementDiffEq", v"0.0.3", "ForwardDiff", v"0.2.4"],
1125 ["FiniteElementDiffEq", v"0.0.3", "GenericSVD", v"0.0.2"],
1126 ["FiniteElementDiffEq", v"0.0.3", "IterativeSolvers", v"0.2.2"],
1127 ["FiniteElementDiffEq", v"0.0.3", "NLsolve", v"0.7.3"],
1128 ["FiniteElementDiffEq", v"0.0.3", "Parameters", v"0.5.0"],
1129 ["FiniteElementDiffEq", v"0.0.3", "Plots", v"0.9.2"],
1130 ["FiniteElementDiffEq", v"0.0.3", "RecipesBase", v"0.1.0"],
1131 ["FiniteElementDiffEq", v"0.0.3", "VectorizedRoutines", v"0.0.2"],
1132 ["FiniteElementDiffEq", v"0.0.4", "ChunkedArrays", v"0.1.0"],
1133 ["FiniteElementDiffEq", v"0.0.4", "DiffEqBase", v"0.0.0", v"0.15.0"],
1134 ["FiniteElementDiffEq", v"0.0.4", "ForwardDiff", v"0.2.4"],
1135 ["FiniteElementDiffEq", v"0.0.4", "GenericSVD", v"0.0.2"],
1136 ["FiniteElementDiffEq", v"0.0.4", "IterativeSolvers", v"0.2.2"],
1137 ["FiniteElementDiffEq", v"0.0.4", "NLsolve", v"0.7.3"],
1138 ["FiniteElementDiffEq", v"0.0.4", "Parameters", v"0.5.0"],
1139 ["FiniteElementDiffEq", v"0.0.4", "RecipesBase", v"0.1.0"],
1140 ["FiniteElementDiffEq", v"0.0.4", "VectorizedRoutines", v"0.0.2"],
1141 ["FiniteElementDiffEq", v"0.0.5", "ChunkedArrays", v"0.1.0"],
1142 ["FiniteElementDiffEq", v"0.0.5", "DiffEqBase", v"0.1.1", v"0.15.0"],
1143 ["FiniteElementDiffEq", v"0.0.5", "ForwardDiff", v"0.2.4"],
1144 ["FiniteElementDiffEq", v"0.0.5", "GenericSVD", v"0.0.2"],
1145 ["FiniteElementDiffEq", v"0.0.5", "IterativeSolvers", v"0.2.2"],
1146 ["FiniteElementDiffEq", v"0.0.5", "Juno", v"0.2.4"],
1147 ["FiniteElementDiffEq", v"0.0.5", "NLsolve", v"0.7.3"],
1148 ["FiniteElementDiffEq", v"0.0.5", "Parameters", v"0.5.0"],
1149 ["FiniteElementDiffEq", v"0.0.5", "RecipesBase", v"0.1.0"],
1150 ["FiniteElementDiffEq", v"0.0.5", "VectorizedRoutines", v"0.0.2"],
1151 ["FiniteElementDiffEq", v"0.2.0", "ChunkedArrays", v"0.1.0"],
1152 ["FiniteElementDiffEq", v"0.2.0", "DiffEqBase", v"0.4.0", v"0.15.0"],
1153 ["FiniteElementDiffEq", v"0.2.0", "ForwardDiff", v"0.2.4"],
1154 ["FiniteElementDiffEq", v"0.2.0", "GenericSVD", v"0.0.2"],
1155 ["FiniteElementDiffEq", v"0.2.0", "IterativeSolvers", v"0.2.2"],
1156 ["FiniteElementDiffEq", v"0.2.0", "Juno", v"0.2.4"],
1157 ["FiniteElementDiffEq", v"0.2.0", "NLsolve", v"0.7.3"],
1158 ["FiniteElementDiffEq", v"0.2.0", "Parameters", v"0.5.0"],
1159 ["FiniteElementDiffEq", v"0.2.0", "RecipesBase", v"0.1.0"],
1160 ["FiniteElementDiffEq", v"0.2.0", "VectorizedRoutines", v"0.0.2"],
1161 ["FiniteElementDiffEq", v"0.2.1", "ChunkedArrays", v"0.1.0"],
1162 ["FiniteElementDiffEq", v"0.2.1", "DiffEqBase", v"0.4.0", v"0.15.0"],
1163 ["FiniteElementDiffEq", v"0.2.1", "DiffEqPDEBase"],
1164 ["FiniteElementDiffEq", v"0.2.1", "ForwardDiff", v"0.2.4"],
1165 ["FiniteElementDiffEq", v"0.2.1", "GenericSVD", v"0.0.2"],
1166 ["FiniteElementDiffEq", v"0.2.1", "IterativeSolvers", v"0.2.2"],
1167 ["FiniteElementDiffEq", v"0.2.1", "Juno", v"0.2.4"],
1168 ["FiniteElementDiffEq", v"0.2.1", "NLsolve", v"0.7.3"],
1169 ["FiniteElementDiffEq", v"0.2.1", "Parameters", v"0.5.0"],
1170 ["FiniteElementDiffEq", v"0.2.1", "VectorizedRoutines", v"0.0.2"],
1171 ["FiniteElementDiffEq", v"0.3.0", "ChunkedArrays", v"0.1.0"],
1172 ["FiniteElementDiffEq", v"0.3.0", "DiffEqBase", v"0.15.0"],
1173 ["FiniteElementDiffEq", v"0.3.0", "DiffEqPDEBase"],
1174 ["FiniteElementDiffEq", v"0.3.0", "ForwardDiff", v"0.2.4"],
1175 ["FiniteElementDiffEq", v"0.3.0", "GenericSVD", v"0.0.2"],
1176 ["FiniteElementDiffEq", v"0.3.0", "IterativeSolvers", v"0.2.2"],
1177 ["FiniteElementDiffEq", v"0.3.0", "Juno", v"0.2.4"],
1178 ["FiniteElementDiffEq", v"0.3.0", "NLsolve", v"0.7.3"],
1179 ["FiniteElementDiffEq", v"0.3.0", "Parameters", v"0.5.0"],
1180 ["FiniteElementDiffEq", v"0.3.0", "VectorizedRoutines", v"0.0.2"],
1181 ["FixedPointNumbers", v"0.0.5"],
1182 ["FixedPointNumbers", v"0.0.12", "Compat", v"0.2.2"],
1183 ["FixedPointNumbers", v"0.1.2"],
1184 ["FixedPointNumbers", v"0.1.4", "Compat", v"0.7.14"],
1185 ["FixedPointNumbers", v"0.1.7", "Compat", v"0.9.1"],
1186 ["FixedPointNumbers", v"0.2.1", "Compat", v"0.9.1"],
1187 ["FixedPointNumbers", v"0.3.0", "Compat", v"0.9.1"],
1188 ["FixedPointNumbers", v"0.3.2", "Compat", v"0.9.5"],
1189 ["FixedPointNumbers", v"0.3.6", "Compat", v"0.17.0"],
1190 ["FixedSizeArrays", v"0.1.0"],
1191 ["FixedSizeArrays", v"0.1.1", "Compat"],
1192 ["FixedSizeArrays", v"0.2.1", "Compat", v"0.7.15"],
1193 ["FixedSizeArrays", v"0.2.2", "Compat", v"0.7.15"],
1194 ["FixedSizeArrays", v"0.2.5", "Compat", v"0.8.7"],
1195 ["ForwardDiff", v"0.2.5", "Calculus"],
1196 ["ForwardDiff", v"0.2.5", "NaNMath"],
1197 ["ForwardDiff", v"0.2.5", "Compat", v"0.8.6"],
1198 ["ForwardDiff", v"0.3.4", "Calculus", v"0.2.0"],
1199 ["ForwardDiff", v"0.3.4", "Compat", v"0.8.6"],
1200 ["ForwardDiff", v"0.3.4", "DiffBase", v"0.0.3"],
1201 ["ForwardDiff", v"0.3.4", "NaNMath", v"0.2.2"],
1202 ["ForwardDiff", v"0.3.5", "Calculus", v"0.1.15"],
1203 ["ForwardDiff", v"0.3.5", "Compat", v"0.8.6"],
1204 ["ForwardDiff", v"0.3.5", "DiffBase", v"0.0.1"],
1205 ["ForwardDiff", v"0.3.5", "NaNMath", v"0.2.1"],
1206 ["ForwardDiff", v"0.4.2", "Calculus", v"0.2.0"],
1207 ["ForwardDiff", v"0.4.2", "Compat", v"0.19.0"],
1208 ["ForwardDiff", v"0.4.2", "DiffBase", v"0.0.3"],
1209 ["ForwardDiff", v"0.4.2", "NaNMath", v"0.2.2"],
1210 ["ForwardDiff", v"0.4.2", "SpecialFunctions", v"0.1.0"],
1211 ["GZip", v"0.2.13"],
1212 ["GZip", v"0.2.16", "Compat"],
1213 ["GZip", v"0.2.18", "Compat", v"0.4.8"],
1214 ["GZip", v"0.2.19", "Compat", v"0.7.9"],
1215 ["GZip", v"0.2.20", "Compat", v"0.8.0"],
1216 ["GZip", v"0.3.0", "Compat", v"0.9.5"],
1217 ["Gallium", v"0.0.1", "ASTInterpreter"],
1218 ["Gallium", v"0.0.1", "AbstractTrees"],
1219 ["Gallium", v"0.0.1", "DWARF"],
1220 ["Gallium", v"0.0.1", "ELF"],
1221 ["Gallium", v"0.0.1", "MachO"],
1222 ["Gallium", v"0.0.1", "TerminalUI"],
1223 ["Gallium", v"0.0.2", "ASTInterpreter"],
1224 ["Gallium", v"0.0.2", "AbstractTrees"],
1225 ["Gallium", v"0.0.2", "DWARF"],
1226 ["Gallium", v"0.0.2", "ELF"],
1227 ["Gallium", v"0.0.2", "MachO"],
1228 ["Gallium", v"0.0.2", "ObjFileBase"],
1229 ["Gallium", v"0.0.2", "TerminalUI"],
1230 ["Gallium", v"0.0.4", "ASTInterpreter"],
1231 ["Gallium", v"0.0.4", "AbstractTrees"],
1232 ["Gallium", v"0.0.4", "COFF"],
1233 ["Gallium", v"0.0.4", "CRC"],
1234 ["Gallium", v"0.0.4", "DWARF"],
1235 ["Gallium", v"0.0.4", "ELF"],
1236 ["Gallium", v"0.0.4", "MachO"],
1237 ["Gallium", v"0.0.4", "ObjFileBase"],
1238 ["Gallium", v"0.0.4", "TerminalUI"],
1239 ["GenericSVD", v"0.0.2", "Compat", v"0.8.6"],
1240 ["GnuTLS", v"0.0.1", "Nettle"],
1241 ["GnuTLS", v"0.0.1", "BinDeps", v"0.2.1-"],
1242 ["GnuTLS", v"0.0.4", "Compat"],
1243 ["GnuTLS", v"0.0.4", "Nettle"],
1244 ["GnuTLS", v"0.0.4", "BinDeps", v"0.2.1-"],
1245 ["GnuTLS", v"0.0.5", "BinDeps"],
1246 ["GnuTLS", v"0.0.5", "Compat"],
1247 ["GnuTLS", v"0.0.5", "Nettle"],
1248 ["Graphics", v"0.1.1"],
1249 ["Graphics", v"0.1.3", "Colors"],
1250 ["Graphics", v"0.1.4", "Colors"],
1251 ["Graphics", v"0.1.4", "Compat", v"0.17.0"],
1252 ["Graphics", v"0.2.0", "Colors"],
1253 ["Graphics", v"0.2.0", "Compat", v"0.17.0"],
1254 ["Graphics", v"0.2.0", "NaNMath", v"0.2.4"],
1255 ["HDF5", v"0.2.1", "StrPack"],
1256 ["HDF5", v"0.2.9"],
1257 ["HDF5", v"0.4.6", "BinDeps"],
1258 ["HDF5", v"0.5.2", "BinDeps"],
1259 ["HDF5", v"0.5.2", "Blosc"],
1260 ["HDF5", v"0.5.2", "Compat"],
1261 ["HDF5", v"0.5.5", "BinDeps"],
1262 ["HDF5", v"0.5.5", "Blosc"],
1263 ["HDF5", v"0.5.5", "Compat", v"0.4.11"],
1264 ["HDF5", v"0.6.0", "BinDeps"],
1265 ["HDF5", v"0.6.0", "Blosc"],
1266 ["HDF5", v"0.6.0", "Compat", v"0.7.1"],
1267 ["HDF5", v"0.6.1", "BinDeps"],
1268 ["HDF5", v"0.6.1", "Blosc"],
1269 ["HDF5", v"0.6.1", "Compat", v"0.7.16"],
1270 ["HDF5", v"0.7.3", "BinDeps"],
1271 ["HDF5", v"0.7.3", "Blosc"],
1272 ["HDF5", v"0.7.3", "Compat", v"0.8.0"],
1273 ["HDF5", v"0.8.0", "BinDeps"],
1274 ["HDF5", v"0.8.0", "Blosc"],
1275 ["HDF5", v"0.8.0", "Compat", v"0.17.0"],
1276 ["Hiccup", v"0.0.0", "Lazy"],
1277 ["Hiccup", v"0.0.1", "Lazy"],
1278 ["Hiccup", v"0.0.1", "MacroTools"],
1279 ["Hiccup", v"0.0.2", "Compat"],
1280 ["Hiccup", v"0.0.2", "Lazy"],
1281 ["Hiccup", v"0.0.2", "MacroTools"],
1282 ["Hiccup", v"0.0.3", "Lazy"],
1283 ["Hiccup", v"0.0.3", "MacroTools"],
1284 ["Hiccup", v"0.0.3", "Compat", v"0.8.2"],
1285 ["Hiccup", v"0.1.1", "Compat", v"0.8.2"],
1286 ["Hiccup", v"0.1.1", "MacroTools", v"0.3.4"],
1287 ["HttpCommon", v"0.0.1"],
1288 ["HttpCommon", v"0.0.2", "Calendar"],
1289 ["HttpCommon", v"0.0.2", "FactCheck", v"0.0.1"],
1290 ["HttpCommon", v"0.0.5", "Calendar"],
1291 ["HttpCommon", v"0.0.5", "FactCheck", v"0.1.0-"],
1292 ["HttpCommon", v"0.0.12", "Dates"],
1293 ["HttpCommon", v"0.1.1", "Compat"],
1294 ["HttpCommon", v"0.1.1", "Dates"],
1295 ["HttpCommon", v"0.2.0", "Compat"],
1296 ["HttpCommon", v"0.2.0", "Dates"],
1297 ["HttpCommon", v"0.2.0", "URIParser"],
1298 ["HttpCommon", v"0.2.4", "URIParser"],
1299 ["HttpCommon", v"0.2.7", "URIParser"],
1300 ["HttpCommon", v"0.2.7", "Compat", v"0.7.20"],
1301 ["HttpParser", v"0.0.0", "HttpCommon"],
1302 ["HttpParser", v"0.0.1", "BinDeps"],
1303 ["HttpParser", v"0.0.1", "HttpCommon"],
1304 ["HttpParser", v"0.0.2"],
1305 ["HttpParser", v"0.0.3", "HttpCommon"],
1306 ["HttpParser", v"0.0.3", "BinDeps", v"0.2.1-"],
1307 ["HttpParser", v"0.0.4", "HttpCommon"],
1308 ["HttpParser", v"0.0.4", "BinDeps", v"0.2.5-"],
1309 ["HttpParser", v"0.0.11", "BinDeps", v"0.2.5-"],
1310 ["HttpParser", v"0.0.11", "HttpCommon", v"0.0.3-"],
1311 ["HttpParser", v"0.1.0", "BinDeps"],
1312 ["HttpParser", v"0.1.0", "Compat"],
1313 ["HttpParser", v"0.1.0", "HttpCommon"],
1314 ["HttpParser", v"0.1.1", "BinDeps"],
1315 ["HttpParser", v"0.1.1", "HttpCommon"],
1316 ["HttpParser", v"0.2.0", "BinDeps"],
1317 ["HttpParser", v"0.2.0", "HttpCommon"],
1318 ["HttpParser", v"0.2.0", "Compat", v"0.7.20"],
1319 ["HttpServer", v"0.0.1", "HttpCommon"],
1320 ["HttpServer", v"0.0.1", "HttpParser"],
1321 ["HttpServer", v"0.0.3", "GnuTLS"],
1322 ["HttpServer", v"0.0.3", "HttpCommon"],
1323 ["HttpServer", v"0.0.3", "HttpParser"],
1324 ["HttpServer", v"0.0.7", "GnuTLS"],
1325 ["HttpServer", v"0.0.7", "HttpCommon", v"0.0.3-"],
1326 ["HttpServer", v"0.0.7", "HttpParser", v"0.0.5-"],
1327 ["HttpServer", v"0.0.8", "GnuTLS"],
1328 ["HttpServer", v"0.0.8", "HttpCommon"],
1329 ["HttpServer", v"0.0.8", "HttpParser"],
1330 ["HttpServer", v"0.0.11", "Docile"],
1331 ["HttpServer", v"0.0.11", "GnuTLS"],
1332 ["HttpServer", v"0.0.11", "HttpCommon"],
1333 ["HttpServer", v"0.0.11", "HttpParser"],
1334 ["HttpServer", v"0.1.2", "Compat"],
1335 ["HttpServer", v"0.1.2", "Docile"],
1336 ["HttpServer", v"0.1.2", "GnuTLS"],
1337 ["HttpServer", v"0.1.2", "HttpCommon"],
1338 ["HttpServer", v"0.1.2", "HttpParser"],
1339 ["HttpServer", v"0.1.5", "HttpCommon"],
1340 ["HttpServer", v"0.1.5", "HttpParser"],
1341 ["HttpServer", v"0.1.5", "MbedTLS"],
1342 ["HttpServer", v"0.1.7", "HttpCommon"],
1343 ["HttpServer", v"0.1.7", "HttpParser"],
1344 ["HttpServer", v"0.1.7", "MbedTLS"],
1345 ["HttpServer", v"0.1.7", "Compat", v"0.7.16"],
1346 ["HttpServer", v"0.2.0", "HttpCommon"],
1347 ["HttpServer", v"0.2.0", "HttpParser"],
1348 ["HttpServer", v"0.2.0", "MbedTLS"],
1349 ["HttpServer", v"0.2.0", "Compat", v"0.17.0"],
1350 ["ICU", v"0.2.1"],
1351 ["ICU", v"0.4.4", "BinDeps"],
1352 ["ImageAxes", v"0.0.2", "AxisArrays"],
1353 ["ImageAxes", v"0.0.2", "Colors"],
1354 ["ImageAxes", v"0.0.2", "ImageCore"],
1355 ["ImageAxes", v"0.0.2", "Reexport"],
1356 ["ImageAxes", v"0.0.2", "SimpleTraits"],
1357 ["ImageAxes", v"0.1.1", "AxisArrays"],
1358 ["ImageAxes", v"0.1.1", "Colors"],
1359 ["ImageAxes", v"0.1.1", "FixedPointNumbers", v"0.3.0"],
1360 ["ImageAxes", v"0.1.1", "ImageCore"],
1361 ["ImageAxes", v"0.1.1", "Reexport"],
1362 ["ImageAxes", v"0.1.1", "SimpleTraits"],
1363 ["ImageAxes", v"0.2.1", "AxisArrays"],
1364 ["ImageAxes", v"0.2.1", "Colors"],
1365 ["ImageAxes", v"0.2.1", "FixedPointNumbers", v"0.3.0"],
1366 ["ImageAxes", v"0.2.1", "MappedArrays"],
1367 ["ImageAxes", v"0.2.1", "Reexport"],
1368 ["ImageAxes", v"0.2.1", "SimpleTraits"],
1369 ["ImageAxes", v"0.2.1", "ImageCore", v"0.2.0"],
1370 ["ImageCore", v"0.0.3", "Colors"],
1371 ["ImageCore", v"0.0.3", "Graphics"],
1372 ["ImageCore", v"0.0.3", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1373 ["ImageCore", v"0.0.3", "MappedArrays"],
1374 ["ImageCore", v"0.0.4", "Colors"],
1375 ["ImageCore", v"0.0.4", "Graphics"],
1376 ["ImageCore", v"0.0.4", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1377 ["ImageCore", v"0.0.4", "MappedArrays", v"0.0.3"],
1378 ["ImageCore", v"0.0.5", "Colors"],
1379 ["ImageCore", v"0.0.5", "Graphics"],
1380 ["ImageCore", v"0.0.5", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1381 ["ImageCore", v"0.0.5", "MappedArrays", v"0.0.3"],
1382 ["ImageCore", v"0.0.5", "OffsetArrays"],
1383 ["ImageCore", v"0.0.5", "ShowItLikeYouBuildIt"],
1384 ["ImageCore", v"0.1.1", "Colors"],
1385 ["ImageCore", v"0.1.1", "Graphics"],
1386 ["ImageCore", v"0.1.1", "FixedPointNumbers", v"0.3.0"],
1387 ["ImageCore", v"0.1.1", "MappedArrays", v"0.0.3"],
1388 ["ImageCore", v"0.1.1", "OffsetArrays"],
1389 ["ImageCore", v"0.1.1", "ShowItLikeYouBuildIt"],
1390 ["ImageCore", v"0.1.2", "ColorTypes"],
1391 ["ImageCore", v"0.1.2", "Colors"],
1392 ["ImageCore", v"0.1.2", "Graphics"],
1393 ["ImageCore", v"0.1.2", "FixedPointNumbers", v"0.3.0"],
1394 ["ImageCore", v"0.1.2", "MappedArrays", v"0.0.3"],
1395 ["ImageCore", v"0.1.2", "OffsetArrays"],
1396 ["ImageCore", v"0.1.2", "ShowItLikeYouBuildIt"],
1397 ["ImageCore", v"0.1.5", "ColorTypes"],
1398 ["ImageCore", v"0.1.5", "Colors"],
1399 ["ImageCore", v"0.1.5", "Graphics"],
1400 ["ImageCore", v"0.1.5", "Compat", v"0.19.0"],
1401 ["ImageCore", v"0.1.5", "FixedPointNumbers", v"0.3.0"],
1402 ["ImageCore", v"0.1.5", "MappedArrays", v"0.0.3"],
1403 ["ImageCore", v"0.1.5", "OffsetArrays"],
1404 ["ImageCore", v"0.1.5", "ShowItLikeYouBuildIt"],
1405 ["ImageCore", v"0.2.0", "ColorTypes"],
1406 ["ImageCore", v"0.2.0", "Colors"],
1407 ["ImageCore", v"0.2.0", "Graphics"],
1408 ["ImageCore", v"0.2.0", "Compat", v"0.19.0"],
1409 ["ImageCore", v"0.2.0", "FixedPointNumbers", v"0.3.0"],
1410 ["ImageCore", v"0.2.0", "MappedArrays", v"0.0.3"],
1411 ["ImageCore", v"0.2.0", "OffsetArrays"],
1412 ["ImageCore", v"0.2.0", "ShowItLikeYouBuildIt"],
1413 ["ImageCore", v"0.3.0", "Colors"],
1414 ["ImageCore", v"0.3.0", "Graphics"],
1415 ["ImageCore", v"0.3.0", "ColorTypes", v"0.4.0"],
1416 ["ImageCore", v"0.3.0", "Compat", v"0.19.0"],
1417 ["ImageCore", v"0.3.0", "FixedPointNumbers", v"0.3.0"],
1418 ["ImageCore", v"0.3.0", "MappedArrays", v"0.0.3"],
1419 ["ImageCore", v"0.3.0", "OffsetArrays"],
1420 ["ImageCore", v"0.3.0", "ShowItLikeYouBuildIt"],
1421 ["ImageFiltering", v"0.0.2", "CatIndices"],
1422 ["ImageFiltering", v"0.0.2", "ColorVectorSpace"],
1423 ["ImageFiltering", v"0.0.2", "Colors"],
1424 ["ImageFiltering", v"0.0.2", "ComputationalResources"],
1425 ["ImageFiltering", v"0.0.2", "ImageCore"],
1426 ["ImageFiltering", v"0.0.2", "DataStructures", v"0.4.6"],
1427 ["ImageFiltering", v"0.0.2", "FFTViews"],
1428 ["ImageFiltering", v"0.0.2", "MappedArrays"],
1429 ["ImageFiltering", v"0.0.2", "OffsetArrays"],
1430 ["ImageFiltering", v"0.0.2", "StaticArrays", v"0.0.5"],
1431 ["ImageFiltering", v"0.0.2", "TiledIteration"],
1432 ["ImageFiltering", v"0.0.2", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1433 ["ImageFiltering", v"0.1.2", "CatIndices"],
1434 ["ImageFiltering", v"0.1.2", "ColorVectorSpace"],
1435 ["ImageFiltering", v"0.1.2", "Colors"],
1436 ["ImageFiltering", v"0.1.2", "ComputationalResources"],
1437 ["ImageFiltering", v"0.1.2", "FFTViews"],
1438 ["ImageFiltering", v"0.1.2", "ImageCore"],
1439 ["ImageFiltering", v"0.1.2", "DataStructures", v"0.4.6"],
1440 ["ImageFiltering", v"0.1.2", "MappedArrays"],
1441 ["ImageFiltering", v"0.1.2", "OffsetArrays"],
1442 ["ImageFiltering", v"0.1.2", "FixedPointNumbers", v"0.3.0"],
1443 ["ImageFiltering", v"0.1.2", "StaticArrays", v"0.0.5"],
1444 ["ImageFiltering", v"0.1.2", "TiledIteration"],
1445 ["ImageFiltering", v"0.1.4", "CatIndices"],
1446 ["ImageFiltering", v"0.1.4", "ColorVectorSpace"],
1447 ["ImageFiltering", v"0.1.4", "Colors"],
1448 ["ImageFiltering", v"0.1.4", "ComputationalResources"],
1449 ["ImageFiltering", v"0.1.4", "Compat", v"0.18.0"],
1450 ["ImageFiltering", v"0.1.4", "DataStructures", v"0.4.6"],
1451 ["ImageFiltering", v"0.1.4", "FFTViews"],
1452 ["ImageFiltering", v"0.1.4", "ImageCore"],
1453 ["ImageFiltering", v"0.1.4", "MappedArrays"],
1454 ["ImageFiltering", v"0.1.4", "OffsetArrays"],
1455 ["ImageFiltering", v"0.1.4", "TiledIteration"],
1456 ["ImageFiltering", v"0.1.4", "FixedPointNumbers", v"0.3.0"],
1457 ["ImageFiltering", v"0.1.4", "StaticArrays", v"0.0.5"],
1458 ["ImageMagick", v"0.0.1", "BinDeps"],
1459 ["ImageMagick", v"0.0.1", "ColorTypes"],
1460 ["ImageMagick", v"0.0.1", "Compat"],
1461 ["ImageMagick", v"0.0.1", "FileIO"],
1462 ["ImageMagick", v"0.0.1", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1463 ["ImageMagick", v"0.0.1", "Images", v"0.0.0-", v"0.6.0"],
1464 ["ImageMagick", v"0.1.3", "BinDeps"],
1465 ["ImageMagick", v"0.1.3", "ColorTypes", v"0.2.0"],
1466 ["ImageMagick", v"0.1.3", "FileIO"],
1467 ["ImageMagick", v"0.1.3", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1468 ["ImageMagick", v"0.1.3", "Images", v"0.0.0-", v"0.6.0"],
1469 ["ImageMagick", v"0.1.6", "BinDeps"],
1470 ["ImageMagick", v"0.1.6", "ColorTypes", v"0.2.0"],
1471 ["ImageMagick", v"0.1.6", "Compat", v"0.7.7"],
1472 ["ImageMagick", v"0.1.6", "FileIO"],
1473 ["ImageMagick", v"0.1.6", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1474 ["ImageMagick", v"0.1.6", "Images", v"0.0.0-", v"0.6.0"],
1475 ["ImageMagick", v"0.1.7", "BinDeps"],
1476 ["ImageMagick", v"0.1.7", "ColorTypes", v"0.2.0"],
1477 ["ImageMagick", v"0.1.7", "Compat", v"0.8.4"],
1478 ["ImageMagick", v"0.1.7", "FileIO"],
1479 ["ImageMagick", v"0.1.7", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1480 ["ImageMagick", v"0.1.7", "Images", v"0.0.0-", v"0.6.0"],
1481 ["ImageMagick", v"0.1.8", "BinDeps"],
1482 ["ImageMagick", v"0.1.8", "ColorTypes", v"0.2.7"],
1483 ["ImageMagick", v"0.1.8", "Compat", v"0.8.4"],
1484 ["ImageMagick", v"0.1.8", "FileIO"],
1485 ["ImageMagick", v"0.1.8", "FixedPointNumbers", v"0.1.8", v"0.3.0"],
1486 ["ImageMagick", v"0.1.8", "Images", v"0.0.0-", v"0.6.0"],
1487 ["ImageMagick", v"0.2.1", "BinDeps"],
1488 ["ImageMagick", v"0.2.1", "ColorTypes", v"0.2.7"],
1489 ["ImageMagick", v"0.2.1", "FileIO"],
1490 ["ImageMagick", v"0.2.1", "FixedPointNumbers", v"0.3.0"],
1491 ["ImageMagick", v"0.2.3", "BinDeps"],
1492 ["ImageMagick", v"0.2.3", "ColorTypes", v"0.2.7"],
1493 ["ImageMagick", v"0.2.3", "Compat", v"0.18.0"],
1494 ["ImageMagick", v"0.2.3", "FileIO"],
1495 ["ImageMagick", v"0.2.3", "FixedPointNumbers", v"0.3.0"],
1496 ["ImageMagick", v"0.2.3", "ImageCore", v"0.1.0"],
1497 ["ImageMagick", v"0.2.4", "BinDeps"],
1498 ["ImageMagick", v"0.2.4", "ColorTypes", v"0.2.7"],
1499 ["ImageMagick", v"0.2.4", "Compat", v"0.24.0"],
1500 ["ImageMagick", v"0.2.4", "FileIO"],
1501 ["ImageMagick", v"0.2.4", "FixedPointNumbers", v"0.3.0"],
1502 ["ImageMagick", v"0.2.4", "Images", v"0.6.0"],
1503 ["ImageMetadata", v"0.0.1", "Colors"],
1504 ["ImageMetadata", v"0.0.1", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1505 ["ImageMetadata", v"0.0.1", "ImageAxes"],
1506 ["ImageMetadata", v"0.0.1", "ColorVectorSpace", v"0.1.11"],
1507 ["ImageMetadata", v"0.0.1", "ImageCore"],
1508 ["ImageMetadata", v"0.0.1", "IndirectArrays"],
1509 ["ImageMetadata", v"0.2.0", "Colors"],
1510 ["ImageMetadata", v"0.2.0", "ImageAxes"],
1511 ["ImageMetadata", v"0.2.0", "ColorVectorSpace", v"0.1.11"],
1512 ["ImageMetadata", v"0.2.0", "FixedPointNumbers", v"0.3.0"],
1513 ["ImageMetadata", v"0.2.0", "ImageCore"],
1514 ["ImageMetadata", v"0.2.0", "IndirectArrays"],
1515 ["ImageMetadata", v"0.2.3", "Colors"],
1516 ["ImageMetadata", v"0.2.3", "ImageAxes"],
1517 ["ImageMetadata", v"0.2.3", "ColorVectorSpace", v"0.1.11"],
1518 ["ImageMetadata", v"0.2.3", "Compat", v"0.19.0"],
1519 ["ImageMetadata", v"0.2.3", "FixedPointNumbers", v"0.3.0"],
1520 ["ImageMetadata", v"0.2.3", "ImageCore"],
1521 ["ImageMetadata", v"0.2.3", "IndirectArrays"],
1522 ["ImageTransformations", v"0.0.1", "ColorVectorSpace", v"0.2.0"],
1523 ["ImageTransformations", v"0.0.1", "Colors", v"0.7.0"],
1524 ["ImageTransformations", v"0.0.1", "CoordinateTransformations", v"0.4.0"],
1525 ["ImageTransformations", v"0.0.1", "ImageCore", v"0.1.2"],
1526 ["ImageTransformations", v"0.0.1", "Interpolations", v"0.3.7"],
1527 ["ImageTransformations", v"0.0.1", "OffsetArrays"],
1528 ["ImageTransformations", v"0.0.1", "StaticArrays"],
1529 ["ImageTransformations", v"0.1.0", "ColorVectorSpace", v"0.2.0"],
1530 ["ImageTransformations", v"0.1.0", "Colors", v"0.7.0"],
1531 ["ImageTransformations", v"0.1.0", "CoordinateTransformations", v"0.4.0"],
1532 ["ImageTransformations", v"0.1.0", "FixedPointNumbers", v"0.3.0"],
1533 ["ImageTransformations", v"0.1.0", "ImageCore", v"0.1.2"],
1534 ["ImageTransformations", v"0.1.0", "Interpolations", v"0.3.7"],
1535 ["ImageTransformations", v"0.1.0", "OffsetArrays"],
1536 ["ImageTransformations", v"0.1.0", "StaticArrays"],
1537 ["ImageTransformations", v"0.2.2", "AxisAlgorithms"],
1538 ["ImageTransformations", v"0.2.2", "ColorVectorSpace", v"0.2.0"],
1539 ["ImageTransformations", v"0.2.2", "Colors", v"0.7.0"],
1540 ["ImageTransformations", v"0.2.2", "Compat", v"0.18.0"],
1541 ["ImageTransformations", v"0.2.2", "CoordinateTransformations", v"0.4.0"],
1542 ["ImageTransformations", v"0.2.2", "OffsetArrays"],
1543 ["ImageTransformations", v"0.2.2", "StaticArrays"],
1544 ["ImageTransformations", v"0.2.2", "FixedPointNumbers", v"0.3.0"],
1545 ["ImageTransformations", v"0.2.2", "ImageCore", v"0.1.2"],
1546 ["ImageTransformations", v"0.2.2", "Interpolations", v"0.4.0"],
1547 ["Images", v"0.4.50", "BinDeps"],
1548 ["Images", v"0.4.50", "ColorVectorSpace"],
1549 ["Images", v"0.4.50", "Colors"],
1550 ["Images", v"0.4.50", "SIUnits"],
1551 ["Images", v"0.4.50", "Compat", v"0.4.0"],
1552 ["Images", v"0.4.50", "FixedPointNumbers", v"0.0.0-", v"0.3.0"],
1553 ["Images", v"0.4.50", "Graphics", v"0.1.0"],
1554 ["Images", v"0.4.50", "Zlib"],
1555 ["Images", v"0.5.4", "FileIO"],
1556 ["Images", v"0.5.4", "SIUnits"],
1557 ["Images", v"0.5.4", "ColorVectorSpace", v"0.1.0"],
1558 ["Images", v"0.5.4", "Colors", v"0.6.0"],
1559 ["Images", v"0.5.4", "Graphics", v"0.1.0"],
1560 ["Images", v"0.5.4", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1561 ["Images", v"0.5.4", "Zlib"],
1562 ["Images", v"0.5.5", "ColorVectorSpace", v"0.1.0"],
1563 ["Images", v"0.5.5", "Colors", v"0.6.0"],
1564 ["Images", v"0.5.5", "Compat", v"0.7.15"],
1565 ["Images", v"0.5.5", "FileIO"],
1566 ["Images", v"0.5.5", "Graphics", v"0.1.0"],
1567 ["Images", v"0.5.5", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1568 ["Images", v"0.5.5", "SIUnits"],
1569 ["Images", v"0.5.5", "Zlib"],
1570 ["Images", v"0.5.9", "ColorVectorSpace", v"0.1.0"],
1571 ["Images", v"0.5.9", "Colors", v"0.6.0"],
1572 ["Images", v"0.5.9", "Compat", v"0.8.4"],
1573 ["Images", v"0.5.9", "FileIO"],
1574 ["Images", v"0.5.9", "Graphics", v"0.1.0"],
1575 ["Images", v"0.5.9", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1576 ["Images", v"0.5.9", "SIUnits"],
1577 ["Images", v"0.5.9", "StatsBase"],
1578 ["Images", v"0.5.9", "Zlib"],
1579 ["Images", v"0.5.14", "ColorVectorSpace", v"0.1.0"],
1580 ["Images", v"0.5.14", "Colors", v"0.6.0"],
1581 ["Images", v"0.5.14", "Compat", v"0.9.1"],
1582 ["Images", v"0.5.14", "FileIO"],
1583 ["Images", v"0.5.14", "Graphics", v"0.1.0"],
1584 ["Images", v"0.5.14", "FixedPointNumbers", v"0.1.0", v"0.3.0"],
1585 ["Images", v"0.5.14", "SIUnits"],
1586 ["Images", v"0.5.14", "StatsBase"],
1587 ["Images", v"0.5.14", "Zlib"],
1588 ["Images", v"0.6.0", "AxisArrays"],
1589 ["Images", v"0.6.0", "FileIO"],
1590 ["Images", v"0.6.0", "ImageAxes"],
1591 ["Images", v"0.6.0", "ImageCore"],
1592 ["Images", v"0.6.0", "ImageFiltering"],
1593 ["Images", v"0.6.0", "ImageMetadata"],
1594 ["Images", v"0.6.0", "IndirectArrays"],
1595 ["Images", v"0.6.0", "MappedArrays"],
1596 ["Images", v"0.6.0", "Reexport"],
1597 ["Images", v"0.6.0", "SIUnits"],
1598 ["Images", v"0.6.0", "StatsBase"],
1599 ["Images", v"0.6.0", "Zlib"],
1600 ["Images", v"0.6.0", "ColorVectorSpace", v"0.2.0"],
1601 ["Images", v"0.6.0", "Colors", v"0.7.0"],
1602 ["Images", v"0.6.0", "Compat", v"0.9.1"],
1603 ["Images", v"0.6.0", "FixedPointNumbers", v"0.3.0"],
1604 ["Images", v"0.6.0", "Graphics", v"0.1.0"],
1605 ["Images", v"0.7.0", "AxisArrays"],
1606 ["Images", v"0.7.0", "FileIO"],
1607 ["Images", v"0.7.0", "ColorVectorSpace", v"0.2.0"],
1608 ["Images", v"0.7.0", "Colors", v"0.7.0"],
1609 ["Images", v"0.7.0", "Compat", v"0.9.1"],
1610 ["Images", v"0.7.0", "Graphics", v"0.1.0"],
1611 ["Images", v"0.7.0", "ImageAxes"],
1612 ["Images", v"0.7.0", "ImageCore"],
1613 ["Images", v"0.7.0", "ImageFiltering"],
1614 ["Images", v"0.7.0", "ImageMetadata"],
1615 ["Images", v"0.7.0", "IndirectArrays"],
1616 ["Images", v"0.7.0", "MappedArrays"],
1617 ["Images", v"0.7.0", "Reexport"],
1618 ["Images", v"0.7.0", "SIUnits"],
1619 ["Images", v"0.7.0", "StatsBase"],
1620 ["Images", v"0.7.0", "FixedPointNumbers", v"0.3.0"],
1621 ["Images", v"0.8.0", "AxisArrays"],
1622 ["Images", v"0.8.0", "FileIO"],
1623 ["Images", v"0.8.0", "ImageAxes"],
1624 ["Images", v"0.8.0", "ImageCore"],
1625 ["Images", v"0.8.0", "ColorVectorSpace", v"0.2.0"],
1626 ["Images", v"0.8.0", "Colors", v"0.7.0"],
1627 ["Images", v"0.8.0", "Compat", v"0.9.1"],
1628 ["Images", v"0.8.0", "Graphics", v"0.1.0"],
1629 ["Images", v"0.8.0", "ImageFiltering"],
1630 ["Images", v"0.8.0", "ImageMetadata"],
1631 ["Images", v"0.8.0", "ImageTransformations"],
1632 ["Images", v"0.8.0", "IndirectArrays"],
1633 ["Images", v"0.8.0", "MappedArrays"],
1634 ["Images", v"0.8.0", "Reexport"],
1635 ["Images", v"0.8.0", "SIUnits"],
1636 ["Images", v"0.8.0", "StatsBase"],
1637 ["Images", v"0.8.0", "FixedPointNumbers", v"0.3.0"],
1638 ["Images", v"0.9.0", "AxisArrays"],
1639 ["Images", v"0.9.0", "FileIO"],
1640 ["Images", v"0.9.0", "Graphics", v"0.1.0"],
1641 ["Images", v"0.9.0", "ImageAxes"],
1642 ["Images", v"0.9.0", "ImageCore"],
1643 ["Images", v"0.9.0", "ColorVectorSpace", v"0.2.0"],
1644 ["Images", v"0.9.0", "Colors", v"0.7.0"],
1645 ["Images", v"0.9.0", "Compat", v"0.18.0"],
1646 ["Images", v"0.9.0", "ImageFiltering"],
1647 ["Images", v"0.9.0", "ImageMetadata"],
1648 ["Images", v"0.9.0", "ImageTransformations"],
1649 ["Images", v"0.9.0", "IndirectArrays"],
1650 ["Images", v"0.9.0", "MappedArrays"],
1651 ["Images", v"0.9.0", "Reexport"],
1652 ["Images", v"0.9.0", "SIUnits"],
1653 ["Images", v"0.9.0", "StatsBase"],
1654 ["Images", v"0.9.0", "FixedPointNumbers", v"0.3.0"],
1655 ["Images", v"0.9.1", "AxisArrays"],
1656 ["Images", v"0.9.1", "FileIO"],
1657 ["Images", v"0.9.1", "ImageAxes"],
1658 ["Images", v"0.9.1", "ImageCore"],
1659 ["Images", v"0.9.1", "ColorVectorSpace", v"0.2.0"],
1660 ["Images", v"0.9.1", "Colors", v"0.7.0"],
1661 ["Images", v"0.9.1", "Compat", v"0.19.0"],
1662 ["Images", v"0.9.1", "ImageFiltering"],
1663 ["Images", v"0.9.1", "ImageMetadata"],
1664 ["Images", v"0.9.1", "ImageTransformations"],
1665 ["Images", v"0.9.1", "IndirectArrays"],
1666 ["Images", v"0.9.1", "MappedArrays"],
1667 ["Images", v"0.9.1", "Reexport"],
1668 ["Images", v"0.9.1", "SIUnits"],
1669 ["Images", v"0.9.1", "StatsBase"],
1670 ["Images", v"0.9.1", "FixedPointNumbers", v"0.3.0"],
1671 ["Images", v"0.9.1", "Graphics", v"0.1.0"],
1672 ["IndirectArrays", v"0.1.0"],
1673 ["IndirectArrays", v"0.1.1", "Compat", v"0.19.0"],
1674 ["InplaceOps", v"0.1.0"],
1675 ["Interpolations", v"0.0.1-beta", "Compat"],
1676 ["Interpolations", v"0.0.1-beta", "WoodburyMatrices"],
1677 ["Interpolations", v"0.1.0", "WoodburyMatrices"],
1678 ["Interpolations", v"0.3.4", "AxisAlgorithms"],
1679 ["Interpolations", v"0.3.4", "Ratios"],
1680 ["Interpolations", v"0.3.4", "WoodburyMatrices", v"0.1.0"],
1681 ["Interpolations", v"0.3.5", "AxisAlgorithms"],
1682 ["Interpolations", v"0.3.5", "Ratios"],
1683 ["Interpolations", v"0.3.5", "WoodburyMatrices", v"0.1.5"],
1684 ["Interpolations", v"0.3.6", "AxisAlgorithms"],
1685 ["Interpolations", v"0.3.6", "Ratios"],
1686 ["Interpolations", v"0.3.6", "Compat", v"0.8.0"],
1687 ["Interpolations", v"0.3.6", "WoodburyMatrices", v"0.1.5"],
1688 ["Interpolations", v"0.3.7", "AxisAlgorithms"],
1689 ["Interpolations", v"0.3.7", "DualNumbers"],
1690 ["Interpolations", v"0.3.7", "Ratios"],
1691 ["Interpolations", v"0.3.7", "Compat", v"0.8.0"],
1692 ["Interpolations", v"0.3.7", "WoodburyMatrices", v"0.1.5"],
1693 ["Interpolations", v"0.3.8", "AxisAlgorithms"],
1694 ["Interpolations", v"0.3.8", "DualNumbers"],
1695 ["Interpolations", v"0.3.8", "Ratios"],
1696 ["Interpolations", v"0.3.8", "Compat", v"0.19.0"],
1697 ["Interpolations", v"0.3.8", "WoodburyMatrices", v"0.1.5"],
1698 ["Interpolations", v"0.4.0", "AxisAlgorithms"],
1699 ["Interpolations", v"0.4.0", "DualNumbers"],
1700 ["Interpolations", v"0.4.0", "Ratios"],
1701 ["Interpolations", v"0.4.0", "Compat", v"0.19.0"],
1702 ["Interpolations", v"0.4.0", "WoodburyMatrices", v"0.1.5"],
1703 ["Interpolations", v"0.5.0", "AxisAlgorithms"],
1704 ["Interpolations", v"0.5.0", "DualNumbers"],
1705 ["Interpolations", v"0.5.0", "Ratios"],
1706 ["Interpolations", v"0.5.0", "ShowItLikeYouBuildIt"],
1707 ["Interpolations", v"0.5.0", "Compat", v"0.19.0"],
1708 ["Interpolations", v"0.5.0", "WoodburyMatrices", v"0.1.5"],
1709 ["IntervalSets", v"0.0.2"],
1710 ["IntervalSets", v"0.0.5", "Compat", v"0.17.0"],
1711 ["IterativeSolvers", v"0.0.1", "Compat"],
1712 ["IterativeSolvers", v"0.0.1", "Docile"],
1713 ["IterativeSolvers", v"0.2.1", "Compat"],
1714 ["IterativeSolvers", v"0.2.2", "Compat"],
1715 ["Iterators", v"0.1.10", "Compat"],
1716 ["Iterators", v"0.3.0"],
1717 ["JLD", v"0.6.4", "Compat", v"0.8.0"],
1718 ["JLD", v"0.6.4", "FileIO"],
1719 ["JLD", v"0.6.4", "HDF5"],
1720 ["JLD", v"0.6.4", "LegacyStrings"],
1721 ["JLD", v"0.6.10", "Compat", v"0.8.0"],
1722 ["JLD", v"0.6.10", "FileIO"],
1723 ["JLD", v"0.6.10", "HDF5"],
1724 ["JLD", v"0.6.10", "LegacyStrings"],
1725 ["JSON", v"0.3.9"],
1726 ["JSON", v"0.4.4", "Compat"],
1727 ["JSON", v"0.4.5", "Compat", v"0.4.12"],
1728 ["JSON", v"0.5.0", "Compat", v"0.7.1"],
1729 ["JSON", v"0.5.4", "Compat", v"0.7.16"],
1730 ["JSON", v"0.6.0", "Compat", v"0.7.20"],
1731 ["JSON", v"0.8.0", "Compat", v"0.8.4"],
1732 ["JSON", v"0.8.2", "Compat", v"0.9.5"],
1733 ["JSON", v"0.8.3", "Compat", v"0.17.0"],
1734 ["JSON", v"0.9.0", "Compat", v"0.17.0"],
1735 ["JuliaParser", v"0.5.3", "FactCheck"],
1736 ["JuliaParser", v"0.6.4", "Compat"],
1737 ["JuliaParser", v"0.6.4", "FactCheck"],
1738 ["JuliaParser", v"0.7.0", "AbstractTrees"],
1739 ["JuliaParser", v"0.7.0", "Compat"],
1740 ["JuliaParser", v"0.7.1", "AbstractTrees"],
1741 ["JuliaParser", v"0.7.1", "Compat"],
1742 ["JuliaParser", v"0.7.4", "AbstractTrees"],
1743 ["JuliaParser", v"0.7.4", "Compat"],
1744 ["Juno", v"0.2.3", "Hiccup"],
1745 ["Juno", v"0.2.3", "MacroTools"],
1746 ["Juno", v"0.2.3", "Media"],
1747 ["Juno", v"0.2.4", "Hiccup"],
1748 ["Juno", v"0.2.4", "MacroTools"],
1749 ["Juno", v"0.2.4", "Media"],
1750 ["Juno", v"0.2.5", "Hiccup"],
1751 ["Juno", v"0.2.5", "MacroTools"],
1752 ["Juno", v"0.2.5", "Media"],
1753 ["Juno", v"0.2.7", "Hiccup"],
1754 ["Juno", v"0.2.7", "MacroTools"],
1755 ["Juno", v"0.2.7", "Media"],
1756 ["LNR", v"0.0.0"],
1757 ["LNR", v"0.0.1", "Lazy"],
1758 ["LNR", v"0.0.2", "Compat"],
1759 ["LNR", v"0.0.2", "Lazy"],
1760 ["Lazy", v"0.9.1"],
1761 ["Lazy", v"0.10.0", "MacroTools"],
1762 ["Lazy", v"0.10.1", "Compat"],
1763 ["Lazy", v"0.10.1", "MacroTools"],
1764 ["Lazy", v"0.11.2", "MacroTools"],
1765 ["Lazy", v"0.11.2", "Compat", v"0.8.0"],
1766 ["Lazy", v"0.11.6", "MacroTools"],
1767 ["Lazy", v"0.11.6", "Compat", v"0.8.0"],
1768 ["LearnBase", v"0.1.0", "StatsBase"],
1769 ["LearnBase", v"0.1.1", "Distributions"],
1770 ["LearnBase", v"0.1.1", "StatsBase"],
1771 ["LearnBase", v"0.1.2", "Distributions"],
1772 ["LearnBase", v"0.1.2", "StatsBase", v"0.8.0"],
1773 ["LearnBase", v"0.1.3", "Distributions"],
1774 ["LearnBase", v"0.1.3", "Compat", v"0.17.0"],
1775 ["LearnBase", v"0.1.3", "StatsBase", v"0.8.0"],
1776 ["LearnBase", v"0.1.5", "Distributions"],
1777 ["LearnBase", v"0.1.5", "Compat", v"0.18.0"],
1778 ["LearnBase", v"0.1.5", "StatsBase", v"0.8.0"],
1779 ["LegacyStrings", v"0.1.0"],
1780 ["LegacyStrings", v"0.2.0", "Compat", v"0.8.4"],
1781 ["LegacyStrings", v"0.2.1", "Compat", v"0.18.0"],
1782 ["LineSearches", v"0.0.2"],
1783 ["LineSearches", v"0.1.1"],
1784 ["LineSearches", v"0.1.5"],
1785 ["LossFunctions", v"0.0.1", "LearnBase", v"0.0.1", v"0.2.0"],
1786 ["LossFunctions", v"0.0.1", "RecipesBase"],
1787 ["LossFunctions", v"0.0.1", "Reexport"],
1788 ["LossFunctions", v"0.0.2", "LearnBase", v"0.0.1", v"0.2.0"],
1789 ["LossFunctions", v"0.0.2", "RecipesBase"],
1790 ["LossFunctions", v"0.0.2", "Reexport"],
1791 ["LossFunctions", v"0.0.3", "LearnBase", v"0.1.2", v"0.2.0"],
1792 ["LossFunctions", v"0.0.3", "RecipesBase"],
1793 ["LossFunctions", v"0.0.3", "StatsBase", v"0.8.0"],
1794 ["LossFunctions", v"0.1.0", "LearnBase", v"0.1.3", v"0.2.0"],
1795 ["LossFunctions", v"0.1.0", "RecipesBase"],
1796 ["LossFunctions", v"0.1.0", "StatsBase", v"0.8.0"],
1797 ["LsqFit", v"0.0.1", "Calculus"],
1798 ["LsqFit", v"0.0.1", "Distributions"],
1799 ["LsqFit", v"0.0.1", "Optim", v"0.0.0", v"0.5.0"],
1800 ["LsqFit", v"0.0.2", "Calculus"],
1801 ["LsqFit", v"0.0.2", "Distributions"],
1802 ["LsqFit", v"0.0.2", "Optim"],
1803 ["LsqFit", v"0.1.0", "Calculus"],
1804 ["LsqFit", v"0.1.0", "Distributions"],
1805 ["LsqFit", v"0.1.0", "Optim", v"0.6.0"],
1806 ["LsqFit", v"0.1.1", "Calculus"],
1807 ["LsqFit", v"0.1.1", "Distributions"],
1808 ["LsqFit", v"0.1.1", "Optim", v"0.7.0"],
1809 ["LsqFit", v"0.2.0", "Calculus"],
1810 ["LsqFit", v"0.2.0", "Distributions"],
1811 ["LsqFit", v"0.2.0", "Compat", v"0.9.1"],
1812 ["LsqFit", v"0.2.0", "Optim", v"0.7.5"],
1813 ["MachO", v"0.0.4", "ObjFileBase"],
1814 ["MachO", v"0.0.4", "StructIO"],
1815 ["MacroTools", v"0.1.0"],
1816 ["MacroTools", v"0.3.0"],
1817 ["MacroTools", v"0.3.1", "Compat"],
1818 ["MacroTools", v"0.3.3", "Compat"],
1819 ["MacroTools", v"0.3.6", "Compat", v"0.7.9"],
1820 ["MappedArrays", v"0.0.2"],
1821 ["MappedArrays", v"0.0.5"],
1822 ["MappedArrays", v"0.0.7", "Compat", v"0.19.0"],
1823 ["Markdown", v"0.1.0"],
1824 ["Markdown", v"0.3.0", "Lazy"],
1825 ["MbedTLS", v"0.2.3", "BinDeps"],
1826 ["MbedTLS", v"0.2.3", "Compat", v"0.7.9"],
1827 ["MbedTLS", v"0.3.0", "BinDeps"],
1828 ["MbedTLS", v"0.3.0", "Compat", v"0.8.0"],
1829 ["MbedTLS", v"0.4.4", "BinDeps"],
1830 ["MbedTLS", v"0.4.5", "BinDeps"],
1831 ["MbedTLS", v"0.4.5", "Compat", v"0.9.5"],
1832 ["Measures", v"0.0.2"],
1833 ["Measures", v"0.0.3", "Compat", v"0.7.15"],
1834 ["Measures", v"0.1.0", "Compat", v"0.18.0"],
1835 ["Media", v"0.1.0", "Lazy"],
1836 ["Media", v"0.1.0", "Requires"],
1837 ["Media", v"0.2.2", "Lazy"],
1838 ["Media", v"0.2.2", "MacroTools"],
1839 ["Media", v"0.2.2", "Requires"],
1840 ["Media", v"0.2.3", "MacroTools"],
1841 ["Media", v"0.2.3", "Lazy", v"0.11.3"],
1842 ["Media", v"0.2.7", "MacroTools"],
1843 ["MultiScaleArrays", v"0.0.1", "Iterators"],
1844 ["MultiScaleArrays", v"0.0.1", "RecursiveArrayTools", v"0.0.2"],
1845 ["MultiScaleArrays", v"0.1.0", "DiffEqBase", v"0.11.0"],
1846 ["MultiScaleArrays", v"0.1.0", "Iterators"],
1847 ["MultiScaleArrays", v"0.1.0", "RecursiveArrayTools", v"0.0.2"],
1848 ["Mustache", v"0.0.1", "DataFrames"],
1849 ["Mustache", v"0.0.7", "Compat"],
1850 ["Mustache", v"0.0.7", "Requires"],
1851 ["Mustache", v"0.0.14", "Requires"],
1852 ["Mustache", v"0.0.14", "Compat", v"0.4.0"],
1853 ["Mustache", v"0.1.0"],
1854 ["Mustache", v"0.1.4", "Compat", v"0.7.18"],
1855 ["Mux", v"0.0.0", "Hiccup"],
1856 ["Mux", v"0.0.0", "HttpServer"],
1857 ["Mux", v"0.0.0", "Lazy"],
1858 ["Mux", v"0.0.0", "URIParser"],
1859 ["Mux", v"0.1.1", "Compat"],
1860 ["Mux", v"0.1.1", "Hiccup"],
1861 ["Mux", v"0.1.1", "HttpCommon"],
1862 ["Mux", v"0.1.1", "HttpServer"],
1863 ["Mux", v"0.1.1", "Lazy"],
1864 ["Mux", v"0.1.1", "URIParser"],
1865 ["Mux", v"0.1.1", "WebSockets"],
1866 ["Mux", v"0.2.2", "Hiccup"],
1867 ["Mux", v"0.2.2", "HttpCommon"],
1868 ["Mux", v"0.2.2", "HttpServer"],
1869 ["Mux", v"0.2.2", "Lazy"],
1870 ["Mux", v"0.2.2", "URIParser"],
1871 ["Mux", v"0.2.2", "WebSockets"],
1872 ["Mux", v"0.2.3", "Hiccup"],
1873 ["Mux", v"0.2.3", "HttpCommon"],
1874 ["Mux", v"0.2.3", "Compat", v"0.7.9"],
1875 ["Mux", v"0.2.3", "HttpServer"],
1876 ["Mux", v"0.2.3", "Lazy"],
1877 ["Mux", v"0.2.3", "URIParser"],
1878 ["Mux", v"0.2.3", "WebSockets"],
1879 ["NLSolversBase", v"2.1.1", "Compat", v"0.17.0"],
1880 ["NLsolve", v"0.7.3", "Calculus"],
1881 ["NLsolve", v"0.7.3", "Distances"],
1882 ["NLsolve", v"0.7.3", "Optim"],
1883 ["NLsolve", v"0.7.3", "Compat", v"0.8.0"],
1884 ["NLsolve", v"0.7.3", "ForwardDiff", v"0.2.0"],
1885 ["NLsolve", v"0.7.3", "LineSearches", v"0.0.1", v"1.0.0-"],
1886 ["NLsolve", v"0.8.0", "Calculus"],
1887 ["NLsolve", v"0.8.0", "Distances"],
1888 ["NLsolve", v"0.8.0", "Optim"],
1889 ["NLsolve", v"0.8.0", "Compat", v"0.8.4"],
1890 ["NLsolve", v"0.8.0", "ForwardDiff", v"0.2.0"],
1891 ["NLsolve", v"0.8.0", "LineSearches", v"0.0.1", v"1.0.0-"],
1892 ["NLsolve", v"0.9.0", "Calculus"],
1893 ["NLsolve", v"0.9.0", "DiffBase"],
1894 ["NLsolve", v"0.9.0", "Distances"],
1895 ["NLsolve", v"0.9.0", "Optim"],
1896 ["NLsolve", v"0.9.0", "Compat", v"0.8.4"],
1897 ["NLsolve", v"0.9.0", "ForwardDiff", v"0.3.0"],
1898 ["NLsolve", v"0.9.0", "LineSearches", v"0.1.2", v"1.0.0-"],
1899 ["NLsolve", v"0.9.1", "Calculus"],
1900 ["NLsolve", v"0.9.1", "DiffBase"],
1901 ["NLsolve", v"0.9.1", "Distances"],
1902 ["NLsolve", v"0.9.1", "Optim"],
1903 ["NLsolve", v"0.9.1", "Compat", v"0.8.4"],
1904 ["NLsolve", v"0.9.1", "ForwardDiff", v"0.3.0"],
1905 ["NLsolve", v"0.9.1", "LineSearches", v"0.1.2", v"1.0.0-"],
1906 ["NaNMath", v"0.1.1", "Compat"],
1907 ["NaNMath", v"0.2.0"],
1908 ["NaNMath", v"0.2.1"],
1909 ["NaNMath", v"0.2.3", "Compat", v"0.9.1"],
1910 ["NaNMath", v"0.2.4", "Compat", v"0.9.1"],
1911 ["Nettle", v"0.1.1"],
1912 ["Nettle", v"0.1.7", "BinDeps"],
1913 ["Nettle", v"0.1.10", "BinDeps"],
1914 ["Nettle", v"0.1.10", "Compat"],
1915 ["Nettle", v"0.2.3", "BinDeps"],
1916 ["Nettle", v"0.2.3", "Compat"],
1917 ["Nettle", v"0.3.0", "BinDeps"],
1918 ["Nettle", v"0.3.0", "Compat", v"0.8.0"],
1919 ["NumericExtensions", v"0.3.6"],
1920 ["NumericExtensions", v"0.4.3", "ArrayViews", v"0.2.0-"],
1921 ["NumericExtensions", v"0.5.6", "ArrayViews", v"0.2.0-"],
1922 ["NumericExtensions", v"0.6.2", "ArrayViews", v"0.2.0-"],
1923 ["NumericExtensions", v"0.6.2", "NumericFuns", v"0.2.1-"],
1924 ["NumericFuns", v"0.2.0"],
1925 ["NumericFuns", v"0.2.3"],
1926 ["NumericFuns", v"0.2.4", "Compat"],
1927 ["ObjFileBase", v"0.0.4"],
1928 ["OffsetArrays", v"0.2.13"],
1929 ["OffsetArrays", v"0.3.0", "Compat", v"0.19.0"],
1930 ["Optim", v"0.4.6", "Calculus"],
1931 ["Optim", v"0.4.6", "Compat"],
1932 ["Optim", v"0.4.6", "DualNumbers"],
1933 ["Optim", v"0.4.6", "LineSearches", v"0.0.1", v"1.0.0-"],
1934 ["Optim", v"0.4.7", "Calculus"],
1935 ["Optim", v"0.4.7", "DualNumbers", v"0.2.0"],
1936 ["Optim", v"0.4.7", "PositiveFactorizations"],
1937 ["Optim", v"0.4.7", "LineSearches", v"0.0.1", v"1.0.0-"],
1938 ["Optim", v"0.5.0", "Calculus"],
1939 ["Optim", v"0.5.0", "PositiveFactorizations"],
1940 ["Optim", v"0.5.0", "Compat", v"0.7.16"],
1941 ["Optim", v"0.5.0", "DualNumbers", v"0.2.0"],
1942 ["Optim", v"0.5.0", "LineSearches", v"0.0.1", v"1.0.0-"],
1943 ["Optim", v"0.6.1", "Calculus"],
1944 ["Optim", v"0.6.1", "PositiveFactorizations"],
1945 ["Optim", v"0.6.1", "Compat", v"0.8.4"],
1946 ["Optim", v"0.6.1", "ForwardDiff", v"0.2.0", v"0.3.0"],
1947 ["Optim", v"0.6.1", "LineSearches", v"0.0.1", v"1.0.0-"],
1948 ["Optim", v"0.7.2", "Calculus"],
1949 ["Optim", v"0.7.2", "PositiveFactorizations"],
1950 ["Optim", v"0.7.2", "Compat", v"0.8.4"],
1951 ["Optim", v"0.7.2", "ForwardDiff", v"0.3.0", v"0.4.0"],
1952 ["Optim", v"0.7.2", "LineSearches", v"0.1.0", v"1.0.0-"],
1953 ["Optim", v"0.7.4", "Calculus"],
1954 ["Optim", v"0.7.4", "PositiveFactorizations"],
1955 ["Optim", v"0.7.4", "Compat", v"0.8.4"],
1956 ["Optim", v"0.7.4", "ForwardDiff", v"0.3.0", v"0.4.0"],
1957 ["Optim", v"0.7.4", "LineSearches", v"0.1.2", v"1.0.0-"],
1958 ["Optim", v"0.7.5", "Calculus"],
1959 ["Optim", v"0.7.5", "PositiveFactorizations"],
1960 ["Optim", v"0.7.5", "Compat", v"0.8.4"],
1961 ["Optim", v"0.7.5", "ForwardDiff", v"0.3.0", v"0.4.0"],
1962 ["Optim", v"0.7.5", "LineSearches", v"0.1.2", v"1.0.0-"],
1963 ["Optim", v"0.7.7", "Calculus"],
1964 ["Optim", v"0.7.7", "PositiveFactorizations"],
1965 ["Optim", v"0.7.7", "Compat", v"0.18.0"],
1966 ["Optim", v"0.7.7", "ForwardDiff", v"0.3.0", v"0.4.0"],
1967 ["Optim", v"0.7.7", "LineSearches", v"0.1.2", v"1.0.0-"],
1968 ["Optim", v"0.7.8", "Calculus"],
1969 ["Optim", v"0.7.8", "PositiveFactorizations"],
1970 ["Optim", v"0.7.8", "Compat", v"0.18.0"],
1971 ["Optim", v"0.7.8", "ForwardDiff", v"0.3.0", v"0.5.0"],
1972 ["Optim", v"0.7.8", "LineSearches", v"0.1.2", v"1.0.0-"],
1973 ["Options", v"0.2.6"],
1974 ["OrdinaryDiffEq", v"0.0.1", "Compat", v"0.8.8"],
1975 ["OrdinaryDiffEq", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.7.0"],
1976 ["OrdinaryDiffEq", v"0.0.1", "ForwardDiff", v"0.2.4"],
1977 ["OrdinaryDiffEq", v"0.0.1", "GenericSVD", v"0.0.2"],
1978 ["OrdinaryDiffEq", v"0.0.1", "InplaceOps", v"0.0.5"],
1979 ["OrdinaryDiffEq", v"0.0.1", "NLsolve", v"0.7.3"],
1980 ["OrdinaryDiffEq", v"0.0.1", "Parameters", v"0.5.0"],
1981 ["OrdinaryDiffEq", v"0.0.1", "Ranges", v"0.0.1"],
1982 ["OrdinaryDiffEq", v"0.0.1", "RecipesBase", v"0.1.0"],
1983 ["OrdinaryDiffEq", v"0.0.1", "Sundials", v"0.3.0"],
1984 ["OrdinaryDiffEq", v"0.0.3", "Compat", v"0.8.8"],
1985 ["OrdinaryDiffEq", v"0.0.3", "DiffEqBase", v"0.0.0", v"0.7.0"],
1986 ["OrdinaryDiffEq", v"0.0.3", "ForwardDiff", v"0.2.4"],
1987 ["OrdinaryDiffEq", v"0.0.3", "GenericSVD", v"0.0.2"],
1988 ["OrdinaryDiffEq", v"0.0.3", "InplaceOps", v"0.0.5"],
1989 ["OrdinaryDiffEq", v"0.0.3", "NLsolve", v"0.7.3"],
1990 ["OrdinaryDiffEq", v"0.0.3", "ParameterizedFunctions", v"0.1.0"],
1991 ["OrdinaryDiffEq", v"0.0.3", "Parameters", v"0.5.0"],
1992 ["OrdinaryDiffEq", v"0.0.3", "Ranges", v"0.0.1"],
1993 ["OrdinaryDiffEq", v"0.0.3", "RecipesBase", v"0.1.0"],
1994 ["OrdinaryDiffEq", v"0.0.3", "Sundials", v"0.3.0"],
1995 ["OrdinaryDiffEq", v"0.0.5", "RecursiveArrayTools"],
1996 ["OrdinaryDiffEq", v"0.0.5", "Compat", v"0.8.8"],
1997 ["OrdinaryDiffEq", v"0.0.5", "DiffEqBase", v"0.0.0", v"0.7.0"],
1998 ["OrdinaryDiffEq", v"0.0.5", "ForwardDiff", v"0.2.4"],
1999 ["OrdinaryDiffEq", v"0.0.5", "GenericSVD", v"0.0.2"],
2000 ["OrdinaryDiffEq", v"0.0.5", "InplaceOps", v"0.0.5"],
2001 ["OrdinaryDiffEq", v"0.0.5", "NLsolve", v"0.7.3"],
2002 ["OrdinaryDiffEq", v"0.0.5", "Parameters", v"0.5.0"],
2003 ["OrdinaryDiffEq", v"0.0.5", "Ranges", v"0.0.1"],
2004 ["OrdinaryDiffEq", v"0.0.5", "RecipesBase", v"0.1.0"],
2005 ["OrdinaryDiffEq", v"0.0.5", "Sundials", v"0.3.0"],
2006 ["OrdinaryDiffEq", v"0.1.0", "Compat", v"0.8.8"],
2007 ["OrdinaryDiffEq", v"0.1.0", "DiffEqBase", v"0.0.0", v"0.7.0"],
2008 ["OrdinaryDiffEq", v"0.1.0", "Juno"],
2009 ["OrdinaryDiffEq", v"0.1.0", "RecursiveArrayTools"],
2010 ["OrdinaryDiffEq", v"0.1.0", "ForwardDiff", v"0.2.4"],
2011 ["OrdinaryDiffEq", v"0.1.0", "GenericSVD", v"0.0.2"],
2012 ["OrdinaryDiffEq", v"0.1.0", "InplaceOps", v"0.0.5"],
2013 ["OrdinaryDiffEq", v"0.1.0", "NLsolve", v"0.7.3"],
2014 ["OrdinaryDiffEq", v"0.1.0", "Parameters", v"0.5.0"],
2015 ["OrdinaryDiffEq", v"0.1.0", "Ranges", v"0.0.1"],
2016 ["OrdinaryDiffEq", v"0.1.0", "RecipesBase", v"0.1.0"],
2017 ["OrdinaryDiffEq", v"0.1.1", "Compat", v"0.8.8"],
2018 ["OrdinaryDiffEq", v"0.1.1", "DiffEqBase", v"0.1.2", v"0.7.0"],
2019 ["OrdinaryDiffEq", v"0.1.1", "ForwardDiff", v"0.2.4"],
2020 ["OrdinaryDiffEq", v"0.1.1", "GenericSVD", v"0.0.2"],
2021 ["OrdinaryDiffEq", v"0.1.1", "InplaceOps", v"0.0.5"],
2022 ["OrdinaryDiffEq", v"0.1.1", "Juno", v"0.2.5"],
2023 ["OrdinaryDiffEq", v"0.1.1", "NLsolve", v"0.7.3"],
2024 ["OrdinaryDiffEq", v"0.1.1", "Parameters", v"0.5.0"],
2025 ["OrdinaryDiffEq", v"0.1.1", "Ranges", v"0.0.1"],
2026 ["OrdinaryDiffEq", v"0.1.1", "RecipesBase", v"0.1.0"],
2027 ["OrdinaryDiffEq", v"0.1.1", "RecursiveArrayTools", v"0.0.2"],
2028 ["OrdinaryDiffEq", v"0.5.0", "Calculus", v"0.1.15"],
2029 ["OrdinaryDiffEq", v"0.5.0", "Compat", v"0.8.8"],
2030 ["OrdinaryDiffEq", v"0.5.0", "DiffEqBase", v"0.2.0", v"0.7.0"],
2031 ["OrdinaryDiffEq", v"0.5.0", "ForwardDiff", v"0.2.4"],
2032 ["OrdinaryDiffEq", v"0.5.0", "GenericSVD", v"0.0.2"],
2033 ["OrdinaryDiffEq", v"0.5.0", "InplaceOps", v"0.0.5"],
2034 ["OrdinaryDiffEq", v"0.5.0", "Juno", v"0.2.5"],
2035 ["OrdinaryDiffEq", v"0.5.0", "NLsolve", v"0.7.3"],
2036 ["OrdinaryDiffEq", v"0.5.0", "Parameters", v"0.5.0"],
2037 ["OrdinaryDiffEq", v"0.5.0", "Ranges", v"0.0.1"],
2038 ["OrdinaryDiffEq", v"0.5.0", "RecipesBase", v"0.1.0"],
2039 ["OrdinaryDiffEq", v"0.5.0", "RecursiveArrayTools", v"0.0.2"],
2040 ["OrdinaryDiffEq", v"0.6.0", "Calculus", v"0.1.15"],
2041 ["OrdinaryDiffEq", v"0.6.0", "Compat", v"0.8.8"],
2042 ["OrdinaryDiffEq", v"0.6.0", "DiffEqBase", v"0.4.0", v"0.7.0"],
2043 ["OrdinaryDiffEq", v"0.6.0", "ForwardDiff", v"0.2.4"],
2044 ["OrdinaryDiffEq", v"0.6.0", "GenericSVD", v"0.0.2"],
2045 ["OrdinaryDiffEq", v"0.6.0", "InplaceOps", v"0.0.5"],
2046 ["OrdinaryDiffEq", v"0.6.0", "Juno", v"0.2.5"],
2047 ["OrdinaryDiffEq", v"0.6.0", "NLsolve", v"0.7.3"],
2048 ["OrdinaryDiffEq", v"0.6.0", "Parameters", v"0.5.0"],
2049 ["OrdinaryDiffEq", v"0.6.0", "Ranges", v"0.0.1"],
2050 ["OrdinaryDiffEq", v"0.6.0", "RecipesBase", v"0.1.0"],
2051 ["OrdinaryDiffEq", v"0.6.0", "RecursiveArrayTools", v"0.0.2"],
2052 ["OrdinaryDiffEq", v"1.0.2", "Calculus", v"0.1.15"],
2053 ["OrdinaryDiffEq", v"1.0.2", "Compat", v"0.8.8"],
2054 ["OrdinaryDiffEq", v"1.0.2", "DataStructures", v"0.4.6"],
2055 ["OrdinaryDiffEq", v"1.0.2", "DiffEqBase", v"0.6.0", v"0.8.0"],
2056 ["OrdinaryDiffEq", v"1.0.2", "ForwardDiff", v"0.2.4"],
2057 ["OrdinaryDiffEq", v"1.0.2", "GenericSVD", v"0.0.2"],
2058 ["OrdinaryDiffEq", v"1.0.2", "InplaceOps", v"0.0.5"],
2059 ["OrdinaryDiffEq", v"1.0.2", "Juno", v"0.2.5"],
2060 ["OrdinaryDiffEq", v"1.0.2", "NLsolve", v"0.9.1"],
2061 ["OrdinaryDiffEq", v"1.0.2", "Parameters", v"0.5.0"],
2062 ["OrdinaryDiffEq", v"1.0.2", "RecursiveArrayTools", v"0.1.2"],
2063 ["OrdinaryDiffEq", v"1.0.2", "Roots", v"0.2.1"],
2064 ["OrdinaryDiffEq", v"1.1.0", "Calculus", v"0.1.15"],
2065 ["OrdinaryDiffEq", v"1.1.0", "DiffEqBase", v"0.7.0", v"0.8.0"],
2066 ["OrdinaryDiffEq", v"1.1.0", "Iterators"],
2067 ["OrdinaryDiffEq", v"1.1.0", "Compat", v"0.8.8"],
2068 ["OrdinaryDiffEq", v"1.1.0", "DataStructures", v"0.4.6"],
2069 ["OrdinaryDiffEq", v"1.1.0", "ForwardDiff", v"0.2.4"],
2070 ["OrdinaryDiffEq", v"1.1.0", "GenericSVD", v"0.0.2"],
2071 ["OrdinaryDiffEq", v"1.1.0", "InplaceOps", v"0.0.5"],
2072 ["OrdinaryDiffEq", v"1.1.0", "Juno", v"0.2.5"],
2073 ["OrdinaryDiffEq", v"1.1.0", "NLsolve", v"0.9.1"],
2074 ["OrdinaryDiffEq", v"1.1.0", "Parameters", v"0.5.0"],
2075 ["OrdinaryDiffEq", v"1.1.0", "RecursiveArrayTools", v"0.1.2"],
2076 ["OrdinaryDiffEq", v"1.1.0", "Roots", v"0.2.1"],
2077 ["OrdinaryDiffEq", v"1.3.1", "Calculus", v"0.1.15"],
2078 ["OrdinaryDiffEq", v"1.3.1", "Compat", v"0.8.8"],
2079 ["OrdinaryDiffEq", v"1.3.1", "DataStructures", v"0.4.6"],
2080 ["OrdinaryDiffEq", v"1.3.1", "DiffEqBase", v"0.8.0", v"0.15.0"],
2081 ["OrdinaryDiffEq", v"1.3.1", "Iterators"],
2082 ["OrdinaryDiffEq", v"1.3.1", "ForwardDiff", v"0.2.4"],
2083 ["OrdinaryDiffEq", v"1.3.1", "GenericSVD", v"0.0.2"],
2084 ["OrdinaryDiffEq", v"1.3.1", "InplaceOps", v"0.0.5"],
2085 ["OrdinaryDiffEq", v"1.3.1", "Juno", v"0.2.5"],
2086 ["OrdinaryDiffEq", v"1.3.1", "NLsolve", v"0.9.1"],
2087 ["OrdinaryDiffEq", v"1.3.1", "Parameters", v"0.5.0"],
2088 ["OrdinaryDiffEq", v"1.3.1", "RecursiveArrayTools", v"0.2.0"],
2089 ["OrdinaryDiffEq", v"1.3.1", "Roots", v"0.2.1"],
2090 ["OrdinaryDiffEq", v"1.4.1", "Calculus", v"0.1.15"],
2091 ["OrdinaryDiffEq", v"1.4.1", "Iterators"],
2092 ["OrdinaryDiffEq", v"1.4.1", "Compat", v"0.8.8"],
2093 ["OrdinaryDiffEq", v"1.4.1", "DataStructures", v"0.4.6"],
2094 ["OrdinaryDiffEq", v"1.4.1", "DiffEqBase", v"0.11.0", v"0.15.0"],
2095 ["OrdinaryDiffEq", v"1.4.1", "ForwardDiff", v"0.2.4"],
2096 ["OrdinaryDiffEq", v"1.4.1", "GenericSVD", v"0.0.2"],
2097 ["OrdinaryDiffEq", v"1.4.1", "InplaceOps", v"0.0.5"],
2098 ["OrdinaryDiffEq", v"1.4.1", "Juno", v"0.2.5"],
2099 ["OrdinaryDiffEq", v"1.4.1", "NLsolve", v"0.9.1"],
2100 ["OrdinaryDiffEq", v"1.4.1", "Parameters", v"0.5.0"],
2101 ["OrdinaryDiffEq", v"1.4.1", "RecursiveArrayTools", v"0.2.0"],
2102 ["OrdinaryDiffEq", v"1.4.1", "Roots", v"0.2.1"],
2103 ["OrdinaryDiffEq", v"1.5.0", "Calculus", v"0.1.15"],
2104 ["OrdinaryDiffEq", v"1.5.0", "Iterators"],
2105 ["OrdinaryDiffEq", v"1.5.0", "Compat", v"0.17.0"],
2106 ["OrdinaryDiffEq", v"1.5.0", "DataStructures", v"0.4.6"],
2107 ["OrdinaryDiffEq", v"1.5.0", "DiffEqBase", v"0.11.0", v"0.15.0"],
2108 ["OrdinaryDiffEq", v"1.5.0", "ForwardDiff", v"0.2.4"],
2109 ["OrdinaryDiffEq", v"1.5.0", "GenericSVD", v"0.0.2"],
2110 ["OrdinaryDiffEq", v"1.5.0", "InplaceOps", v"0.0.5"],
2111 ["OrdinaryDiffEq", v"1.5.0", "Juno", v"0.2.5"],
2112 ["OrdinaryDiffEq", v"1.5.0", "NLsolve", v"0.9.1"],
2113 ["OrdinaryDiffEq", v"1.5.0", "Parameters", v"0.5.0"],
2114 ["OrdinaryDiffEq", v"1.5.0", "RecursiveArrayTools", v"0.2.0"],
2115 ["OrdinaryDiffEq", v"1.5.0", "Roots", v"0.2.1"],
2116 ["OrdinaryDiffEq", v"1.7.0", "Calculus", v"0.1.15"],
2117 ["OrdinaryDiffEq", v"1.7.0", "Iterators"],
2118 ["OrdinaryDiffEq", v"1.7.0", "Compat", v"0.17.0"],
2119 ["OrdinaryDiffEq", v"1.7.0", "DataStructures", v"0.4.6"],
2120 ["OrdinaryDiffEq", v"1.7.0", "DiffEqBase", v"0.13.0", v"0.15.0"],
2121 ["OrdinaryDiffEq", v"1.7.0", "ForwardDiff", v"0.2.4"],
2122 ["OrdinaryDiffEq", v"1.7.0", "GenericSVD", v"0.0.2"],
2123 ["OrdinaryDiffEq", v"1.7.0", "InplaceOps", v"0.0.5"],
2124 ["OrdinaryDiffEq", v"1.7.0", "Juno", v"0.2.5"],
2125 ["OrdinaryDiffEq", v"1.7.0", "NLsolve", v"0.9.1"],
2126 ["OrdinaryDiffEq", v"1.7.0", "Parameters", v"0.5.0"],
2127 ["OrdinaryDiffEq", v"1.7.0", "RecursiveArrayTools", v"0.2.0"],
2128 ["OrdinaryDiffEq", v"1.7.0", "Roots", v"0.2.1"],
2129 ["OrdinaryDiffEq", v"1.8.0", "Calculus", v"0.1.15"],
2130 ["OrdinaryDiffEq", v"1.8.0", "DiffEqBase", v"0.15.0"],
2131 ["OrdinaryDiffEq", v"1.8.0", "Iterators"],
2132 ["OrdinaryDiffEq", v"1.8.0", "Compat", v"0.17.0"],
2133 ["OrdinaryDiffEq", v"1.8.0", "DataStructures", v"0.4.6"],
2134 ["OrdinaryDiffEq", v"1.8.0", "ForwardDiff", v"0.2.4"],
2135 ["OrdinaryDiffEq", v"1.8.0", "GenericSVD", v"0.0.2"],
2136 ["OrdinaryDiffEq", v"1.8.0", "InplaceOps", v"0.0.5"],
2137 ["OrdinaryDiffEq", v"1.8.0", "Juno", v"0.2.5"],
2138 ["OrdinaryDiffEq", v"1.8.0", "NLsolve", v"0.9.1"],
2139 ["OrdinaryDiffEq", v"1.8.0", "Parameters", v"0.5.0"],
2140 ["OrdinaryDiffEq", v"1.8.0", "RecursiveArrayTools", v"0.2.0"],
2141 ["OrdinaryDiffEq", v"1.8.0", "Roots", v"0.2.1"],
2142 ["PDMats", v"0.1.2", "NumericExtensions", v"0.5.0-"],
2143 ["PDMats", v"0.2.5", "ArrayViews", v"0.4.0-"],
2144 ["PDMats", v"0.3.0", "ArrayViews", v"0.4.8-"],
2145 ["PDMats", v"0.3.1", "ArrayViews", v"0.4.8-"],
2146 ["PDMats", v"0.3.6", "ArrayViews", v"0.4.8-"],
2147 ["PDMats", v"0.4.0", "Compat", v"0.7.7"],
2148 ["PDMats", v"0.4.1", "Compat", v"0.7.7"],
2149 ["PDMats", v"0.4.2", "Compat", v"0.7.7"],
2150 ["PDMats", v"0.5.3", "Compat", v"0.9.2"],
2151 ["PDMats", v"0.5.4", "Compat", v"0.9.2"],
2152 ["PDMats", v"0.5.5", "Compat", v"0.17.0"],
2153 ["PDMats", v"0.5.6", "Compat", v"0.18.0"],
2154 ["PDMats", v"0.6.0", "Compat", v"0.18.0"],
2155 ["ParameterizedFunctions", v"0.0.1", "DataStructures", v"0.4.6"],
2156 ["ParameterizedFunctions", v"0.0.1", "DiffEqBase", v"0.0.0", v"0.5.0"],
2157 ["ParameterizedFunctions", v"0.0.1", "SymEngine", v"0.1.1"],
2158 ["ParameterizedFunctions", v"0.1.1", "DataStructures", v"0.4.6"],
2159 ["ParameterizedFunctions", v"0.1.1", "DiffEqBase", v"0.0.0", v"0.5.0"],
2160 ["ParameterizedFunctions", v"0.1.1", "SymEngine", v"0.1.1"],
2161 ["ParameterizedFunctions", v"0.2.2", "DataStructures", v"0.4.6"],
2162 ["ParameterizedFunctions", v"0.2.2", "DiffEqBase", v"0.0.0", v"0.5.0"],
2163 ["ParameterizedFunctions", v"0.2.2", "SymEngine", v"0.1.1"],
2164 ["ParameterizedFunctions", v"0.3.1", "DataStructures", v"0.4.6"],
2165 ["ParameterizedFunctions", v"0.3.1", "DiffEqBase", v"0.1.0", v"0.5.0"],
2166 ["ParameterizedFunctions", v"0.3.1", "SymEngine", v"0.1.2"],
2167 ["ParameterizedFunctions", v"0.3.2", "DataStructures", v"0.4.6"],
2168 ["ParameterizedFunctions", v"0.3.2", "DiffEqBase", v"0.1.0", v"0.5.0"],
2169 ["ParameterizedFunctions", v"0.3.2", "SymEngine", v"0.1.2"],
2170 ["ParameterizedFunctions", v"0.3.3", "DataStructures", v"0.4.6"],
2171 ["ParameterizedFunctions", v"0.3.3", "DiffEqBase", v"0.2.0", v"0.5.0"],
2172 ["ParameterizedFunctions", v"0.3.3", "SymEngine", v"0.1.2"],
2173 ["ParameterizedFunctions", v"0.4.2", "DataStructures", v"0.4.6"],
2174 ["ParameterizedFunctions", v"0.4.2", "SimpleTraits", v"0.1.1"],
2175 ["ParameterizedFunctions", v"0.4.2", "DiffEqBase", v"0.2.0", v"0.5.0"],
2176 ["ParameterizedFunctions", v"0.4.2", "SymEngine", v"0.1.2"],
2177 ["ParameterizedFunctions", v"0.5.1", "DataStructures", v"0.4.6"],
2178 ["ParameterizedFunctions", v"0.5.1", "SimpleTraits", v"0.1.1"],
2179 ["ParameterizedFunctions", v"0.5.1", "DiffEqBase", v"0.4.0", v"0.5.0"],
2180 ["ParameterizedFunctions", v"0.5.1", "SymEngine", v"0.1.2"],
2181 ["ParameterizedFunctions", v"1.2.0", "DataStructures", v"0.4.6"],
2182 ["ParameterizedFunctions", v"1.2.0", "SimpleTraits", v"0.1.1"],
2183 ["ParameterizedFunctions", v"1.2.0", "DiffEqBase", v"0.5.0", v"0.14.0"],
2184 ["ParameterizedFunctions", v"1.2.0", "SymEngine", v"0.1.2"],
2185 ["ParameterizedFunctions", v"1.3.0", "DataStructures", v"0.4.6"],
2186 ["ParameterizedFunctions", v"1.3.0", "DiffEqBase", v"0.14.0"],
2187 ["ParameterizedFunctions", v"1.3.0", "SimpleTraits", v"0.1.1"],
2188 ["ParameterizedFunctions", v"1.3.0", "SymEngine", v"0.1.2"],
2189 ["Parameters", v"0.5.0", "Compat", v"0.7.15"],
2190 ["Parameters", v"0.5.0", "DataStructures", v"0.4.3"],
2191 ["Parameters", v"0.6.0", "DataStructures", v"0.4.3"],
2192 ["Parameters", v"0.7.1", "Compat", v"0.17.0"],
2193 ["Parameters", v"0.7.1", "DataStructures", v"0.5.2"],
2194 ["Parameters", v"0.7.2", "DataStructures", v"0.5.2"],
2195 ["PlotThemes", v"0.1.1", "PlotUtils"],
2196 ["PlotUtils", v"0.0.1"],
2197 ["PlotUtils", v"0.3.0", "Colors"],
2198 ["PlotUtils", v"0.3.0", "Reexport"],
2199 ["Plots", v"0.1.0", "Colors"],
2200 ["Plots", v"0.1.0", "FactCheck"],
2201 ["Plots", v"0.1.0", "JSON", v"0.0.0", v"0.9.0"],
2202 ["Plots", v"0.1.3", "Colors"],
2203 ["Plots", v"0.1.3", "JSON", v"0.0.0", v"0.9.0"],
2204 ["Plots", v"0.3.0", "Colors"],
2205 ["Plots", v"0.3.0", "Reexport"],
2206 ["Plots", v"0.3.0", "JSON", v"0.0.0", v"0.9.0"],
2207 ["Plots", v"0.5.1", "Colors"],
2208 ["Plots", v"0.5.1", "Compat"],
2209 ["Plots", v"0.5.1", "Reexport"],
2210 ["Plots", v"0.5.1", "JSON", v"0.0.0", v"0.9.0"],
2211 ["Plots", v"0.5.2", "Colors"],
2212 ["Plots", v"0.5.2", "Compat"],
2213 ["Plots", v"0.5.2", "Reexport"],
2214 ["Plots", v"0.5.2", "Requires"],
2215 ["Plots", v"0.5.2", "JSON", v"0.0.0", v"0.9.0"],
2216 ["Plots", v"0.6.1", "Colors"],
2217 ["Plots", v"0.6.1", "Compat"],
2218 ["Plots", v"0.6.1", "FixedSizeArrays"],
2219 ["Plots", v"0.6.1", "Reexport"],
2220 ["Plots", v"0.6.1", "Requires"],
2221 ["Plots", v"0.6.1", "JSON", v"0.0.0", v"0.9.0"],
2222 ["Plots", v"0.6.2", "Colors"],
2223 ["Plots", v"0.6.2", "Compat"],
2224 ["Plots", v"0.6.2", "FixedSizeArrays"],
2225 ["Plots", v"0.6.2", "Reexport"],
2226 ["Plots", v"0.6.2", "Requires"],
2227 ["Plots", v"0.6.2", "JSON", v"0.0.0", v"0.9.0"],
2228 ["Plots", v"0.6.2", "RecipesBase", v"0.0.1", v"0.0.2"],
2229 ["Plots", v"0.7.5", "Colors"],
2230 ["Plots", v"0.7.5", "Compat"],
2231 ["Plots", v"0.7.5", "FixedSizeArrays"],
2232 ["Plots", v"0.7.5", "Measures"],
2233 ["Plots", v"0.7.5", "JSON", v"0.0.0", v"0.9.0"],
2234 ["Plots", v"0.7.5", "RecipesBase"],
2235 ["Plots", v"0.7.5", "Reexport"],
2236 ["Plots", v"0.8.0", "Compat"],
2237 ["Plots", v"0.8.0", "FixedSizeArrays"],
2238 ["Plots", v"0.8.0", "Measures"],
2239 ["Plots", v"0.8.0", "PlotUtils"],
2240 ["Plots", v"0.8.0", "JSON", v"0.0.0", v"0.9.0"],
2241 ["Plots", v"0.8.0", "RecipesBase"],
2242 ["Plots", v"0.8.0", "Reexport"],
2243 ["Plots", v"0.9.0", "Compat"],
2244 ["Plots", v"0.9.0", "FixedSizeArrays"],
2245 ["Plots", v"0.9.0", "Measures"],
2246 ["Plots", v"0.9.0", "PlotUtils"],
2247 ["Plots", v"0.9.0", "RecipesBase"],
2248 ["Plots", v"0.9.0", "Reexport"],
2249 ["Plots", v"0.9.0", "JSON", v"0.0.0", v"0.9.0"],
2250 ["Plots", v"0.9.0", "Showoff"],
2251 ["Plots", v"0.9.1", "Compat"],
2252 ["Plots", v"0.9.1", "FixedSizeArrays"],
2253 ["Plots", v"0.9.1", "Measures"],
2254 ["Plots", v"0.9.1", "PlotUtils"],
2255 ["Plots", v"0.9.1", "RecipesBase"],
2256 ["Plots", v"0.9.1", "Reexport"],
2257 ["Plots", v"0.9.1", "Showoff"],
2258 ["Plots", v"0.9.3", "Compat"],
2259 ["Plots", v"0.9.3", "FixedSizeArrays"],
2260 ["Plots", v"0.9.3", "Measures"],
2261 ["Plots", v"0.9.3", "PlotUtils"],
2262 ["Plots", v"0.9.3", "RecipesBase"],
2263 ["Plots", v"0.9.3", "Reexport"],
2264 ["Plots", v"0.9.3", "Showoff"],
2265 ["Plots", v"0.9.4", "FixedSizeArrays"],
2266 ["Plots", v"0.9.4", "Measures"],
2267 ["Plots", v"0.9.4", "PlotUtils"],
2268 ["Plots", v"0.9.4", "RecipesBase"],
2269 ["Plots", v"0.9.4", "Reexport"],
2270 ["Plots", v"0.9.4", "Showoff"],
2271 ["Plots", v"0.10.3", "FixedSizeArrays"],
2272 ["Plots", v"0.10.3", "Measures"],
2273 ["Plots", v"0.10.3", "PlotThemes"],
2274 ["Plots", v"0.10.3", "PlotUtils"],
2275 ["Plots", v"0.10.3", "RecipesBase"],
2276 ["Plots", v"0.10.3", "Reexport"],
2277 ["Plots", v"0.10.3", "Showoff"],
2278 ["PolynomialFactors", v"0.0.1", "Combinatorics", v"0.2.1"],
2279 ["PolynomialFactors", v"0.0.1", "Compat", v"0.7.15"],
2280 ["PolynomialFactors", v"0.0.1", "Iterators", v"0.1.0"],
2281 ["PolynomialFactors", v"0.0.1", "Primes", v"0.1.1"],
2282 ["PolynomialFactors", v"0.0.2", "Combinatorics", v"0.2.1"],
2283 ["PolynomialFactors", v"0.0.2", "Compat", v"0.7.15"],
2284 ["PolynomialFactors", v"0.0.2", "Iterators", v"0.1.0"],
2285 ["PolynomialFactors", v"0.0.2", "Polynomials", v"0.1.1"],
2286 ["PolynomialFactors", v"0.0.2", "Primes", v"0.1.1"],
2287 ["PolynomialFactors", v"0.0.4", "Combinatorics", v"0.2.1"],
2288 ["PolynomialFactors", v"0.0.4", "Compat", v"0.7.15"],
2289 ["PolynomialFactors", v"0.0.4", "Iterators", v"0.1.0"],
2290 ["PolynomialFactors", v"0.0.4", "Polynomials", v"0.1.1"],
2291 ["PolynomialFactors", v"0.0.4", "Primes", v"0.1.1"],
2292 ["Polynomials", v"0.0.2"],
2293 ["Polynomials", v"0.0.3"],
2294 ["Polynomials", v"0.0.4", "Compat"],
2295 ["Polynomials", v"0.0.5", "Compat"],
2296 ["Polynomials", v"0.1.0", "Compat", v"0.7.15"],
2297 ["Polynomials", v"0.1.1", "Compat", v"0.8.0"],
2298 ["Polynomials", v"0.1.5", "Compat", v"0.9.4"],
2299 ["PositiveFactorizations", v"0.0.1"],
2300 ["PositiveFactorizations", v"0.0.3", "Compat", v"0.8.4"],
2301 ["PositiveFactorizations", v"0.0.4", "Compat", v"0.12.0"],
2302 ["PowerSeries", v"0.1.10"],
2303 ["PowerSeries", v"0.1.14", "Compat", v"0.4.7"],
2304 ["PowerSeries", v"0.2.0"],
2305 ["Primes", v"0.1.0"],
2306 ["Primes", v"0.1.1"],
2307 ["Primes", v"0.1.3", "Compat", v"0.9.4"],
2308 ["PyCall", v"0.4.10"],
2309 ["PyCall", v"0.6.2", "Compat", v"0.2.0"],
2310 ["PyCall", v"0.7.3", "Compat", v"0.2.0"],
2311 ["PyCall", v"0.7.3", "Dates"],
2312 ["PyCall", v"0.7.4", "Compat", v"0.3.1"],
2313 ["PyCall", v"0.7.4", "Dates"],
2314 ["PyCall", v"0.7.5", "Compat", v"0.3.4"],
2315 ["PyCall", v"0.7.5", "Dates"],
2316 ["PyCall", v"0.8.1", "Compat", v"0.4.0"],
2317 ["PyCall", v"0.8.1", "Dates"],
2318 ["PyCall", v"1.0.1", "Compat", v"0.4.6"],
2319 ["PyCall", v"1.0.1", "Dates"],
2320 ["PyCall", v"1.0.3", "Compat", v"0.7.1"],
2321 ["PyCall", v"1.0.3", "Dates"],
2322 ["PyCall", v"1.4.0", "Compat", v"0.7.1"],
2323 ["PyCall", v"1.4.0", "Conda", v"0.1.6"],
2324 ["PyCall", v"1.4.0", "Dates"],
2325 ["PyCall", v"1.5.0", "Compat", v"0.7.15"],
2326 ["PyCall", v"1.5.0", "Conda", v"0.1.6"],
2327 ["PyCall", v"1.5.0", "MacroTools", v"0.2.0"],
2328 ["PyCall", v"1.6.2", "Compat", v"0.7.15"],
2329 ["PyCall", v"1.6.2", "Conda", v"0.2.0"],
2330 ["PyCall", v"1.6.2", "MacroTools", v"0.2.0"],
2331 ["PyCall", v"1.7.2", "Compat", v"0.8.0"],
2332 ["PyCall", v"1.7.2", "Conda", v"0.2.0"],
2333 ["PyCall", v"1.7.2", "MacroTools", v"0.2.0"],
2334 ["PyCall", v"1.10.0", "Compat", v"0.9.5"],
2335 ["PyCall", v"1.10.0", "Conda", v"0.2.0"],
2336 ["PyCall", v"1.10.0", "MacroTools", v"0.2.0"],
2337 ["PyCall", v"1.12.0", "Compat", v"0.18.0"],
2338 ["PyCall", v"1.12.0", "Conda", v"0.2.0"],
2339 ["PyCall", v"1.12.0", "MacroTools", v"0.2.0"],
2340 ["PyDSTool", v"0.0.1", "DataStructures"],
2341 ["PyDSTool", v"0.0.1", "PyCall"],
2342 ["PyDSTool", v"0.0.2", "Conda"],
2343 ["PyDSTool", v"0.0.2", "DataStructures"],
2344 ["PyDSTool", v"0.0.2", "PyCall"],
2345 ["PyDSTool", v"0.1.1", "Conda"],
2346 ["PyDSTool", v"0.1.1", "DataStructures"],
2347 ["PyDSTool", v"0.1.1", "DiffEqBase", v"0.11.0"],
2348 ["PyDSTool", v"0.1.1", "PyCall"],
2349 ["PyDSTool", v"0.1.1", "RecipesBase"],
2350 ["PyDSTool", v"0.1.2", "DataStructures"],
2351 ["PyDSTool", v"0.1.2", "PyCall"],
2352 ["PyDSTool", v"0.1.2", "RecipesBase"],
2353 ["PyDSTool", v"0.1.2", "Conda", v"0.2.0"],
2354 ["PyDSTool", v"0.1.2", "DiffEqBase", v"0.11.0"],
2355 ["QuadGK", v"0.1.0"],
2356 ["QuadGK", v"0.1.2", "DataStructures", v"0.5.0"],
2357 ["RangeArrays", v"0.1.1"],
2358 ["RangeArrays", v"0.1.2", "Compat", v"0.19.0"],
2359 ["Ranges", v"0.0.1"],
2360 ["Ratios", v"0.0.3"],
2361 ["Ratios", v"0.0.4", "Compat"],
2362 ["Reactive", v"0.2.4", "FactCheck"],
2363 ["Reactive", v"0.2.4", "Compat", v"0.4.0"],
2364 ["Reactive", v"0.3.4", "Compat"],
2365 ["Reactive", v"0.3.5", "Compat", v"0.9.2"],
2366 ["Reactive", v"0.3.6"],
2367 ["Reactive", v"0.3.7", "DataStructures"],
2368 ["RecipesBase", v"0.1.0"],
2369 ["RecursiveArrayTools", v"0.0.1"],
2370 ["RecursiveArrayTools", v"0.1.1"],
2371 ["RecursiveArrayTools", v"0.1.2"],
2372 ["RecursiveArrayTools", v"0.2.0"],
2373 ["Reexport", v"0.0.2"],
2374 ["Reexport", v"0.0.3"],
2375 ["Requires", v"0.2.3", "MacroTools"],
2376 ["Requires", v"0.4.1"],
2377 ["ResettableStacks", v"0.1.0"],
2378 ["Rmath", v"0.1.0", "BinDeps"],
2379 ["Rmath", v"0.1.2", "BinDeps"],
2380 ["Rmath", v"0.1.2", "Compat", v"0.8.4"],
2381 ["Rmath", v"0.1.6", "BinDeps"],
2382 ["Rmath", v"0.1.6", "Compat", v"0.9.1"],
2383 ["Roots", v"0.1.9", "Polynomials", v"0.0.3"],
2384 ["Roots", v"0.1.9", "ForwardDiff", v"0.0.0", v"0.2.0"],
2385 ["Roots", v"0.1.9", "PowerSeries", v"0.1.0"],
2386 ["Roots", v"0.1.13", "Docile", v"0.4.0"],
2387 ["Roots", v"0.1.13", "Polynomials", v"0.0.3"],
2388 ["Roots", v"0.1.13", "ForwardDiff", v"0.0.0", v"0.2.0"],
2389 ["Roots", v"0.1.13", "PowerSeries", v"0.1.11"],
2390 ["Roots", v"0.1.18", "Compat", v"0.4.0"],
2391 ["Roots", v"0.1.18", "Docile", v"0.4.0"],
2392 ["Roots", v"0.1.18", "Polynomials", v"0.0.3"],
2393 ["Roots", v"0.1.18", "ForwardDiff", v"0.0.0", v"0.2.0"],
2394 ["Roots", v"0.1.18", "PowerSeries", v"0.1.11"],
2395 ["Roots", v"0.1.22", "Compat", v"0.4.0"],
2396 ["Roots", v"0.1.22", "Docile", v"0.4.0"],
2397 ["Roots", v"0.1.22", "Polynomials", v"0.0.3"],
2398 ["Roots", v"0.1.22", "ForwardDiff", v"0.0.0", v"0.2.0"],
2399 ["Roots", v"0.1.26", "Compat", v"0.4.0"],
2400 ["Roots", v"0.1.26", "Docile", v"0.4.0"],
2401 ["Roots", v"0.1.26", "Polynomials", v"0.0.5"],
2402 ["Roots", v"0.1.26", "ForwardDiff", v"0.0.0", v"0.2.0"],
2403 ["Roots", v"0.2.0", "Primes"],
2404 ["Roots", v"0.2.0", "Compat", v"0.4.0"],
2405 ["Roots", v"0.2.0", "Docile", v"0.4.0"],
2406 ["Roots", v"0.2.0", "ForwardDiff", v"0.2.0"],
2407 ["Roots", v"0.2.0", "Polynomials", v"0.0.5"],
2408 ["Roots", v"0.2.1", "Primes"],
2409 ["Roots", v"0.2.1", "Compat", v"0.4.0"],
2410 ["Roots", v"0.2.1", "ForwardDiff", v"0.2.0"],
2411 ["Roots", v"0.2.1", "Polynomials", v"0.0.5"],
2412 ["Roots", v"0.3.0", "Compat", v"0.8.0"],
2413 ["Roots", v"0.3.0", "ForwardDiff", v"0.2.0"],
2414 ["Roots", v"0.3.0", "PolynomialFactors", v"0.0.3"],
2415 ["Roots", v"0.3.0", "Polynomials", v"0.0.5"],
2416 ["Rotations", v"0.3.4", "StaticArrays", v"0.0.3", v"0.3.0-"],
2417 ["Rotations", v"0.3.5", "StaticArrays", v"0.3.0", v"0.4.0-"],
2418 ["Rotations", v"0.4.0", "StaticArrays", v"0.4.0", v"0.5.0-"],
2419 ["SHA", v"0.0.2"],
2420 ["SHA", v"0.0.3"],
2421 ["SHA", v"0.2.0", "Compat", v"0.3.5"],
2422 ["SHA", v"0.2.1", "Compat", v"0.7.9"],
2423 ["SHA", v"0.3.1", "Compat", v"0.9.4"],
2424 ["SHA", v"0.3.2", "Compat", v"0.17.0"],
2425 ["SIUnits", v"0.0.5", "TexExtensions"],
2426 ["SIUnits", v"0.0.6", "Compat"],
2427 ["SIUnits", v"0.0.6", "TexExtensions"],
2428 ["SIUnits", v"0.1.0", "TexExtensions"],
2429 ["SIUnits", v"0.1.0", "Compat", v"0.8.0"],
2430 ["ShowItLikeYouBuildIt", v"0.0.1"],
2431 ["Showoff", v"0.0.1"],
2432 ["Showoff", v"0.0.3", "Iterators"],
2433 ["Showoff", v"0.0.7", "Compat"],
2434 ["Showoff", v"0.0.7", "Iterators"],
2435 ["Showoff", v"0.1.0", "Compat", v"0.9.5"],
2436 ["Showoff", v"0.1.1", "Compat", v"0.18.0"],
2437 ["SimpleTraits", v"0.1.0", "Compat"],
2438 ["SimpleTraits", v"0.1.1"],
2439 ["SimpleTraits", v"0.2.0", "MacroTools", v"0.3.2"],
2440 ["SimpleTraits", v"0.4.0", "Compat", v"0.19.0"],
2441 ["SimpleTraits", v"0.4.0", "MacroTools", v"0.3.2"],
2442 ["SortingAlgorithms", v"0.0.3"],
2443 ["SortingAlgorithms", v"0.0.6", "Compat"],
2444 ["SortingAlgorithms", v"0.1.0", "Compat", v"0.8.4"],
2445 ["SortingAlgorithms", v"0.1.1", "Compat", v"0.9.4"],
2446 ["SortingAlgorithms", v"0.1.1", "DataStructures", v"0.5.3"],
2447 ["SpecialFunctions", v"0.0.1", "Compat", v"0.9.1"],
2448 ["SpecialFunctions", v"0.1.0", "Compat", v"0.9.1"],
2449 ["SpecialFunctions", v"0.1.1", "Compat", v"0.18.0"],
2450 ["StaticArrays", v"0.0.2"],
2451 ["StaticArrays", v"0.0.4"],
2452 ["StaticArrays", v"0.2.1"],
2453 ["StaticArrays", v"0.3.0"],
2454 ["StaticArrays", v"0.4.0"],
2455 ["Stats", v"0.0.1", "StatsBase", v"0.3.0-"],
2456 ["Stats", v"0.1.0", "StatsBase"],
2457 ["StatsBase", v"0.2.4", "NumericExtensions"],
2458 ["StatsBase", v"0.2.9"],
2459 ["StatsBase", v"0.3.9"],
2460 ["StatsBase", v"0.4.1"],
2461 ["StatsBase", v"0.6.8", "ArrayViews", v"0.4.6-"],
2462 ["StatsBase", v"0.6.9", "ArrayViews", v"0.4.8-"],
2463 ["StatsBase", v"0.6.10", "ArrayViews", v"0.4.8-"],
2464 ["StatsBase", v"0.6.12", "ArrayViews", v"0.4.8-"],
2465 ["StatsBase", v"0.6.12", "Compat", v"0.2.11-"],
2466 ["StatsBase", v"0.6.13", "ArrayViews", v"0.4.10"],
2467 ["StatsBase", v"0.6.13", "Compat", v"0.3.2"],
2468 ["StatsBase", v"0.6.16", "ArrayViews", v"0.4.12"],
2469 ["StatsBase", v"0.6.16", "Compat", v"0.4.0"],
2470 ["StatsBase", v"0.7.4", "ArrayViews", v"0.4.12"],
2471 ["StatsBase", v"0.7.4", "Compat", v"0.4.0"],
2472 ["StatsBase", v"0.7.4", "StatsFuns", v"0.1.0"],
2473 ["StatsBase", v"0.8.1", "ArrayViews", v"0.4.12"],
2474 ["StatsBase", v"0.8.1", "Compat", v"0.4.0"],
2475 ["StatsBase", v"0.8.1", "StatsFuns", v"0.1.0"],
2476 ["StatsBase", v"0.8.2", "ArrayViews", v"0.4.12"],
2477 ["StatsBase", v"0.8.2", "Compat", v"0.4.0"],
2478 ["StatsBase", v"0.8.2", "StatsFuns", v"0.1.0"],
2479 ["StatsBase", v"0.8.3", "Compat", v"0.8.4"],
2480 ["StatsBase", v"0.8.3", "StatsFuns", v"0.1.0"],
2481 ["StatsBase", v"0.9.0", "Compat", v"0.8.4"],
2482 ["StatsBase", v"0.9.0", "StatsFuns", v"0.3.0"],
2483 ["StatsBase", v"0.10.0", "Compat", v"0.8.4"],
2484 ["StatsBase", v"0.12.0", "Compat", v"0.8.4"],
2485 ["StatsBase", v"0.13.0", "Compat", v"0.13.0"],
2486 ["StatsBase", v"0.13.0", "DataStructures", v"0.5.0"],
2487 ["StatsBase", v"0.13.1", "Compat", v"0.18.0"],
2488 ["StatsBase", v"0.13.1", "DataStructures", v"0.5.0"],
2489 ["StatsBase", v"0.13.1", "SpecialFunctions", v"0.1.0"],
2490 ["StatsFuns", v"0.0.3", "Compat", v"0.4.0"],
2491 ["StatsFuns", v"0.1.0", "Compat", v"0.4.0"],
2492 ["StatsFuns", v"0.2.1", "Compat", v"0.4.0"],
2493 ["StatsFuns", v"0.2.2", "Compat", v"0.7.18"],
2494 ["StatsFuns", v"0.3.0", "Compat", v"0.8.4"],
2495 ["StatsFuns", v"0.3.0", "Rmath", v"0.1.0"],
2496 ["StatsFuns", v"0.4.0", "Compat", v"0.9.1"],
2497 ["StatsFuns", v"0.4.0", "Rmath", v"0.1.0"],
2498 ["StatsFuns", v"0.5.0", "SpecialFunctions"],
2499 ["StatsFuns", v"0.5.0", "Compat", v"0.9.1"],
2500 ["StatsFuns", v"0.5.0", "Rmath", v"0.1.0"],
2501 ["StochasticDiffEq", v"0.0.3", "ChunkedArrays", v"0.1.0"],
2502 ["StochasticDiffEq", v"0.0.3", "DiffEqBase", v"0.0.0", v"0.8.0"],
2503 ["StochasticDiffEq", v"0.0.3", "ParameterizedFunctions", v"0.1.0"],
2504 ["StochasticDiffEq", v"0.0.3", "Parameters", v"0.5.0"],
2505 ["StochasticDiffEq", v"0.0.4", "RecursiveArrayTools"],
2506 ["StochasticDiffEq", v"0.0.4", "ChunkedArrays", v"0.1.0"],
2507 ["StochasticDiffEq", v"0.0.4", "DiffEqBase", v"0.0.0", v"0.8.0"],
2508 ["StochasticDiffEq", v"0.0.4", "ParameterizedFunctions", v"0.1.0"],
2509 ["StochasticDiffEq", v"0.0.4", "Parameters", v"0.5.0"],
2510 ["StochasticDiffEq", v"0.0.5", "RecursiveArrayTools"],
2511 ["StochasticDiffEq", v"0.0.5", "ChunkedArrays", v"0.1.0"],
2512 ["StochasticDiffEq", v"0.0.5", "DiffEqBase", v"0.0.0", v"0.8.0"],
2513 ["StochasticDiffEq", v"0.0.5", "Parameters", v"0.5.0"],
2514 ["StochasticDiffEq", v"0.2.0", "ChunkedArrays", v"0.1.0"],
2515 ["StochasticDiffEq", v"0.2.0", "DiffEqBase", v"0.2.0", v"0.8.0"],
2516 ["StochasticDiffEq", v"0.2.0", "Parameters", v"0.5.0"],
2517 ["StochasticDiffEq", v"0.2.0", "RecursiveArrayTools", v"0.0.2"],
2518 ["StochasticDiffEq", v"0.3.0", "ChunkedArrays", v"0.1.0"],
2519 ["StochasticDiffEq", v"0.3.0", "DataStructures"],
2520 ["StochasticDiffEq", v"0.3.0", "DiffEqBase", v"0.2.0", v"0.8.0"],
2521 ["StochasticDiffEq", v"0.3.0", "Juno"],
2522 ["StochasticDiffEq", v"0.3.0", "Parameters", v"0.5.0"],
2523 ["StochasticDiffEq", v"0.3.0", "RecursiveArrayTools", v"0.0.2"],
2524 ["StochasticDiffEq", v"0.3.0", "ResettableStacks"],
2525 ["StochasticDiffEq", v"0.5.0", "ChunkedArrays", v"0.1.0"],
2526 ["StochasticDiffEq", v"0.5.0", "DataStructures", v"0.4.6"],
2527 ["StochasticDiffEq", v"0.5.0", "DiffEqBase", v"0.4.0", v"0.8.0"],
2528 ["StochasticDiffEq", v"0.5.0", "Juno", v"0.2.5"],
2529 ["StochasticDiffEq", v"0.5.0", "Parameters", v"0.5.0"],
2530 ["StochasticDiffEq", v"0.5.0", "RecursiveArrayTools", v"0.1.2"],
2531 ["StochasticDiffEq", v"0.5.0", "ResettableStacks", v"0.0.1"],
2532 ["StochasticDiffEq", v"1.0.2", "Iterators"],
2533 ["StochasticDiffEq", v"1.0.2", "Roots"],
2534 ["StochasticDiffEq", v"1.0.2", "DataStructures", v"0.4.6"],
2535 ["StochasticDiffEq", v"1.0.2", "DiffEqBase", v"0.8.0", v"0.15.0"],
2536 ["StochasticDiffEq", v"1.0.2", "Juno", v"0.2.5"],
2537 ["StochasticDiffEq", v"1.0.2", "Parameters", v"0.5.0"],
2538 ["StochasticDiffEq", v"1.0.2", "RecursiveArrayTools", v"0.2.0"],
2539 ["StochasticDiffEq", v"1.0.2", "ResettableStacks", v"0.0.1"],
2540 ["StochasticDiffEq", v"1.1.0", "Iterators"],
2541 ["StochasticDiffEq", v"1.1.0", "Roots"],
2542 ["StochasticDiffEq", v"1.1.0", "DataStructures", v"0.4.6"],
2543 ["StochasticDiffEq", v"1.1.0", "DiffEqBase", v"0.11.0", v"0.15.0"],
2544 ["StochasticDiffEq", v"1.1.0", "Juno", v"0.2.5"],
2545 ["StochasticDiffEq", v"1.1.0", "Parameters", v"0.5.0"],
2546 ["StochasticDiffEq", v"1.1.0", "RecursiveArrayTools", v"0.2.0"],
2547 ["StochasticDiffEq", v"1.1.0", "ResettableStacks", v"0.0.1"],
2548 ["StochasticDiffEq", v"1.2.1", "Compat", v"0.17.0"],
2549 ["StochasticDiffEq", v"1.2.1", "Iterators"],
2550 ["StochasticDiffEq", v"1.2.1", "Roots"],
2551 ["StochasticDiffEq", v"1.2.1", "DataStructures", v"0.4.6"],
2552 ["StochasticDiffEq", v"1.2.1", "DiffEqBase", v"0.11.0", v"0.15.0"],
2553 ["StochasticDiffEq", v"1.2.1", "Juno", v"0.2.5"],
2554 ["StochasticDiffEq", v"1.2.1", "Parameters", v"0.5.0"],
2555 ["StochasticDiffEq", v"1.2.1", "RecursiveArrayTools", v"0.2.0"],
2556 ["StochasticDiffEq", v"1.2.1", "ResettableStacks", v"0.0.1"],
2557 ["StochasticDiffEq", v"1.3.0", "Compat", v"0.17.0"],
2558 ["StochasticDiffEq", v"1.3.0", "Iterators"],
2559 ["StochasticDiffEq", v"1.3.0", "Roots"],
2560 ["StochasticDiffEq", v"1.3.0", "DataStructures", v"0.4.6"],
2561 ["StochasticDiffEq", v"1.3.0", "DiffEqBase", v"0.13.0", v"0.15.0"],
2562 ["StochasticDiffEq", v"1.3.0", "Juno", v"0.2.5"],
2563 ["StochasticDiffEq", v"1.3.0", "Parameters", v"0.5.0"],
2564 ["StochasticDiffEq", v"1.3.0", "RecursiveArrayTools", v"0.2.0"],
2565 ["StochasticDiffEq", v"1.3.0", "ResettableStacks", v"0.0.1"],
2566 ["StochasticDiffEq", v"1.4.0", "Compat", v"0.17.0"],
2567 ["StochasticDiffEq", v"1.4.0", "DiffEqBase", v"0.15.0"],
2568 ["StochasticDiffEq", v"1.4.0", "Iterators"],
2569 ["StochasticDiffEq", v"1.4.0", "Roots"],
2570 ["StochasticDiffEq", v"1.4.0", "DataStructures", v"0.4.6"],
2571 ["StochasticDiffEq", v"1.4.0", "Juno", v"0.2.5"],
2572 ["StochasticDiffEq", v"1.4.0", "Parameters", v"0.5.0"],
2573 ["StochasticDiffEq", v"1.4.0", "RecursiveArrayTools", v"0.2.0"],
2574 ["StochasticDiffEq", v"1.4.0", "ResettableStacks", v"0.0.1"],
2575 ["StokesDiffEq", v"0.0.1", "DiffEqBase"],
2576 ["StokesDiffEq", v"0.0.1", "Parameters", v"0.5.0"],
2577 ["StokesDiffEq", v"0.0.1", "VectorizedRoutines", v"0.0.1"],
2578 ["StokesDiffEq", v"0.0.2", "DiffEqBase"],
2579 ["StokesDiffEq", v"0.0.2", "Parameters", v"0.5.0"],
2580 ["StokesDiffEq", v"0.0.2", "VectorizedRoutines", v"0.0.1"],
2581 ["StokesDiffEq", v"0.1.0", "DiffEqBase", v"0.4.0"],
2582 ["StokesDiffEq", v"0.1.0", "Parameters", v"0.5.0"],
2583 ["StokesDiffEq", v"0.1.0", "VectorizedRoutines", v"0.0.2"],
2584 ["StrPack", v"0.0.1"],
2585 ["StructIO", v"0.0.2"],
2586 ["Sundials", v"0.0.0"],
2587 ["Sundials", v"0.1.2", "BinDeps"],
2588 ["Sundials", v"0.2.0", "BinDeps", v"0.3.0"],
2589 ["Sundials", v"0.2.2", "Compat"],
2590 ["Sundials", v"0.2.2", "BinDeps", v"0.3.0"],
2591 ["Sundials", v"0.3.0", "BinDeps", v"0.4.3"],
2592 ["Sundials", v"0.3.0", "Compat", v"0.9.0"],
2593 ["Sundials", v"0.4.0", "BinDeps", v"0.4.3"],
2594 ["Sundials", v"0.4.0", "Compat", v"0.9.0"],
2595 ["Sundials", v"0.4.0", "DiffEqBase", v"0.0.0", v"0.2.0"],
2596 ["Sundials", v"0.9.0", "BinDeps", v"0.4.3"],
2597 ["Sundials", v"0.9.0", "Compat", v"0.9.0"],
2598 ["Sundials", v"0.9.0", "DiffEqBase", v"0.2.0", v"0.15.0"],
2599 ["Sundials", v"0.10.0", "BinDeps", v"0.4.3"],
2600 ["Sundials", v"0.10.0", "Compat", v"0.9.0"],
2601 ["Sundials", v"0.10.0", "DiffEqBase", v"0.15.0"],
2602 ["SymEngine", v"0.1.0", "BinDeps"],
2603 ["SymEngine", v"0.1.0", "Conda"],
2604 ["SymEngine", v"0.1.0", "Compat", v"0.8.5"],
2605 ["SymEngine", v"0.1.0", "RecipesBase", v"0.0.6"],
2606 ["SymEngine", v"0.1.1", "BinDeps", v"0.4.0"],
2607 ["SymEngine", v"0.1.1", "Compat", v"0.8.5"],
2608 ["SymEngine", v"0.1.1", "Conda", v"0.3.0"],
2609 ["SymEngine", v"0.1.1", "RecipesBase", v"0.0.6"],
2610 ["SymEngine", v"0.1.2", "BinDeps", v"0.4.0"],
2611 ["SymEngine", v"0.1.2", "Compat", v"0.8.5"],
2612 ["SymEngine", v"0.1.2", "Conda", v"0.4.0"],
2613 ["SymEngine", v"0.1.2", "RecipesBase", v"0.0.6"],
2614 ["SymEngine", v"0.1.5", "BinDeps", v"0.4.0"],
2615 ["SymEngine", v"0.1.5", "Compat", v"0.9.5"],
2616 ["SymEngine", v"0.1.5", "Conda", v"0.4.0"],
2617 ["SymEngine", v"0.1.5", "RecipesBase", v"0.0.6"],
2618 ["TerminalUI", v"0.0.1", "Reactive"],
2619 ["TerminalUI", v"0.0.1", "VT100"],
2620 ["TerminalUI", v"0.0.2", "AbstractTrees"],
2621 ["TerminalUI", v"0.0.2", "Colors"],
2622 ["TerminalUI", v"0.0.2", "Compat"],
2623 ["TerminalUI", v"0.0.2", "FixedPointNumbers"],
2624 ["TerminalUI", v"0.0.2", "Reactive"],
2625 ["TerminalUI", v"0.0.2", "VT100"],
2626 ["TexExtensions", v"0.0.2"],
2627 ["TexExtensions", v"0.0.3", "Compat"],
2628 ["TextWrap", v"0.0.0", "Options"],
2629 ["TextWrap", v"0.1.3"],
2630 ["TextWrap", v"0.1.4"],
2631 ["TextWrap", v"0.1.5", "Compat", v"0.7.3"],
2632 ["TextWrap", v"0.1.6", "Compat", v"0.7.15"],
2633 ["TextWrap", v"0.2.0", "Compat", v"0.9.5"],
2634 ["TiledIteration", v"0.0.2", "OffsetArrays"],
2635 ["URIParser", v"0.0.4", "Compat"],
2636 ["URIParser", v"0.0.5", "Compat", v"0.3.5"],
2637 ["URIParser", v"0.1.0", "HttpCommon"],
2638 ["URIParser", v"0.1.0", "Compat", v"0.3.5"],
2639 ["URIParser", v"0.1.3"],
2640 ["URIParser", v"0.1.6", "Compat", v"0.8.0"],
2641 ["URIParser", v"0.1.8", "Compat", v"0.9.5"],
2642 ["VT100", v"0.0.1", "Colors"],
2643 ["VT100", v"0.0.1", "Compat"],
2644 ["VT100", v"0.0.1", "FixedPointNumbers"],
2645 ["VT100", v"0.0.2", "Colors"],
2646 ["VT100", v"0.0.2", "FixedPointNumbers"],
2647 ["VT100", v"0.0.2", "Compat", v"0.7.15"],
2648 ["VT100", v"0.1.0", "ColorTypes", v"0.3.4"],
2649 ["VT100", v"0.1.0", "Compat", v"0.17.0"],
2650 ["VT100", v"0.1.0", "FixedPointNumbers", v"0.3.0"],
2651 ["VectorizedRoutines", v"0.0.1", "Distributions"],
2652 ["VectorizedRoutines", v"0.0.1", "StatsFuns"],
2653 ["VectorizedRoutines", v"0.0.2", "Distributions"],
2654 ["WebSockets", v"0.0.0", "HttpCommon"],
2655 ["WebSockets", v"0.0.0", "HttpServer"],
2656 ["WebSockets", v"0.0.1"],
2657 ["WebSockets", v"0.0.3", "Codecs"],
2658 ["WebSockets", v"0.0.3", "HttpCommon"],
2659 ["WebSockets", v"0.0.3", "HttpServer"],
2660 ["WebSockets", v"0.0.5", "Codecs"],
2661 ["WebSockets", v"0.0.5", "HttpCommon", v"0.0.3-"],
2662 ["WebSockets", v"0.0.5", "HttpServer", v"0.0.4-"],
2663 ["WebSockets", v"0.0.6", "Codecs"],
2664 ["WebSockets", v"0.0.6", "Nettle"],
2665 ["WebSockets", v"0.0.6", "HttpCommon", v"0.0.3-"],
2666 ["WebSockets", v"0.0.6", "HttpServer", v"0.0.4-"],
2667 ["WebSockets", v"0.1.0", "Codecs"],
2668 ["WebSockets", v"0.1.0", "Compat"],
2669 ["WebSockets", v"0.1.0", "Nettle"],
2670 ["WebSockets", v"0.1.0", "HttpCommon", v"0.0.3"],
2671 ["WebSockets", v"0.1.0", "HttpServer", v"0.0.4"],
2672 ["WebSockets", v"0.1.2", "Codecs"],
2673 ["WebSockets", v"0.1.2", "Compat"],
2674 ["WebSockets", v"0.1.2", "HttpCommon", v"0.0.3"],
2675 ["WebSockets", v"0.1.2", "HttpServer", v"0.0.4"],
2676 ["WebSockets", v"0.1.2", "Nettle", v"0.2.0"],
2677 ["WebSockets", v"0.2.1", "Codecs"],
2678 ["WebSockets", v"0.2.1", "MbedTLS"],
2679 ["WebSockets", v"0.2.1", "Compat", v"0.7.16"],
2680 ["WebSockets", v"0.2.1", "HttpCommon", v"0.0.3"],
2681 ["WebSockets", v"0.2.1", "HttpServer", v"0.0.4"],
2682 ["WoodburyMatrices", v"0.0.2"],
2683 ["WoodburyMatrices", v"0.1.3", "Docile"],
2684 ["WoodburyMatrices", v"0.1.4", "Compat"],
2685 ["WoodburyMatrices", v"0.1.4", "Docile"],
2686 ["WoodburyMatrices", v"0.1.5", "Compat"],
2687 ["WoodburyMatrices", v"0.1.5", "Docile"],
2688 ["WoodburyMatrices", v"0.2.1", "Compat"],
2689 ["WoodburyMatrices", v"0.2.2", "Compat", v"0.7.19"],
2690 ["Zlib", v"0.1.9"],
2691 ["Zlib", v"0.1.12", "Compat"],
2692 ]
2693
2694 problematic_data = Any[
2695 ("CoordinateTransformations", v"0.2.0"),
2696 ("Plots", v"0.6.2"),
2697 ("Roots", v"0.1.9"),
2698 ("Roots", v"0.1.13"),
2699 ("Roots", v"0.1.18"),
2700 ("Roots", v"0.1.22"),
2701 ("Roots", v"0.1.26"),
2702 ]
2703
2704 reqs_data = Any[
2705 ["Atom"],
2706 ["DifferentialEquations"],
2707 ["ImageMagick"],
2708 ["Plots"],
2709 ]
2710
2711 want_data = Dict(
2712 "ASTInterpreter"=>v"0.0.4",
2713 "AbstractTrees"=>v"0.0.4",
2714 "AlgebraicDiffEq"=>v"0.1.0",
2715 "ArgParse"=>v"0.4.0",
2716 "Atom"=>v"0.5.10",
2717 "AxisAlgorithms"=>v"0.1.6",
2718 "AxisArrays"=>v"0.1.2",
2719 "BinDeps"=>v"0.4.7",
2720 "Blink"=>v"0.5.1",
2721 "COFF"=>v"0.0.2",
2722 "CRC"=>v"1.2.0",
2723 "Calculus"=>v"0.2.2",
2724 "CatIndices"=>v"0.0.2",
2725 "ChunkedArrays"=>v"0.1.1",
2726 "CodeTools"=>v"0.4.3",
2727 "Codecs"=>v"0.3.0",
2728 "ColorTypes"=>v"0.4.1",
2729 "ColorVectorSpace"=>v"0.4.2",
2730 "Colors"=>v"0.7.3",
2731 "Combinatorics"=>v"0.4.0",
2732 "Compat"=>v"0.24.0",
2733 "ComputationalResources"=>v"0.0.2",
2734 "Conda"=>v"0.5.3",
2735 "CoordinateTransformations"=>v"0.4.1",
2736 "CustomUnitRanges"=>v"0.0.4",
2737 "DWARF"=>v"0.1.0",
2738 "DataStructures"=>v"0.5.3",
2739 "DelayDiffEq"=>v"0.3.0",
2740 "DiffBase"=>v"0.1.0",
2741 "DiffEqBase"=>v"0.15.0",
2742 "DiffEqBiological"=>v"0.0.1",
2743 "DiffEqCallbacks"=>v"0.0.2",
2744 "DiffEqDevTools"=>v"0.7.0",
2745 "DiffEqFinancial"=>v"0.1.0",
2746 "DiffEqJump"=>v"0.3.0",
2747 "DiffEqMonteCarlo"=>v"0.2.0",
2748 "DiffEqPDEBase"=>v"0.2.0",
2749 "DiffEqParamEstim"=>v"0.2.0",
2750 "DiffEqSensitivity"=>v"0.1.0",
2751 "DifferentialEquations"=>v"1.10.1",
2752 "Distances"=>v"0.4.1",
2753 "Distributions"=>v"0.12.5",
2754 "DualNumbers"=>v"0.3.0",
2755 "ELF"=>v"0.1.0",
2756 "EllipsisNotation"=>v"0.1.0",
2757 "FFTViews"=>v"0.0.2",
2758 "FileIO"=>v"0.3.1",
2759 "FiniteElementDiffEq"=>v"0.3.0",
2760 "FixedPointNumbers"=>v"0.3.6",
2761 "FixedSizeArrays"=>v"0.2.5",
2762 "ForwardDiff"=>v"0.4.2",
2763 "Gallium"=>v"0.0.4",
2764 "GenericSVD"=>v"0.0.2",
2765 "Graphics"=>v"0.2.0",
2766 "Hiccup"=>v"0.1.1",
2767 "HttpCommon"=>v"0.2.7",
2768 "HttpParser"=>v"0.2.0",
2769 "HttpServer"=>v"0.2.0",
2770 "ImageAxes"=>v"0.2.1",
2771 "ImageCore"=>v"0.3.0",
2772 "ImageFiltering"=>v"0.1.4",
2773 "ImageMagick"=>v"0.2.4",
2774 "ImageMetadata"=>v"0.2.3",
2775 "ImageTransformations"=>v"0.2.2",
2776 "Images"=>v"0.9.1",
2777 "IndirectArrays"=>v"0.1.1",
2778 "InplaceOps"=>v"0.1.0",
2779 "Interpolations"=>v"0.5.0",
2780 "IntervalSets"=>v"0.0.5",
2781 "IterativeSolvers"=>v"0.2.2",
2782 "Iterators"=>v"0.3.0",
2783 "JSON"=>v"0.9.0",
2784 "JuliaParser"=>v"0.7.4",
2785 "Juno"=>v"0.2.7",
2786 "LNR"=>v"0.0.2",
2787 "Lazy"=>v"0.11.6",
2788 "LearnBase"=>v"0.1.5",
2789 "LineSearches"=>v"0.1.5",
2790 "LossFunctions"=>v"0.1.0",
2791 "LsqFit"=>v"0.2.0",
2792 "MachO"=>v"0.0.4",
2793 "MacroTools"=>v"0.3.6",
2794 "MappedArrays"=>v"0.0.7",
2795 "MbedTLS"=>v"0.4.5",
2796 "Measures"=>v"0.1.0",
2797 "Media"=>v"0.2.7",
2798 "MultiScaleArrays"=>v"0.1.0",
2799 "Mustache"=>v"0.1.4",
2800 "Mux"=>v"0.2.3",
2801 "NLsolve"=>v"0.9.1",
2802 "NaNMath"=>v"0.2.4",
2803 "ObjFileBase"=>v"0.0.4",
2804 "OffsetArrays"=>v"0.3.0",
2805 "Optim"=>v"0.7.8",
2806 "OrdinaryDiffEq"=>v"1.8.0",
2807 "PDMats"=>v"0.6.0",
2808 "ParameterizedFunctions"=>v"1.3.0",
2809 "Parameters"=>v"0.7.2",
2810 "PlotThemes"=>v"0.1.1",
2811 "PlotUtils"=>v"0.3.0",
2812 "Plots"=>v"0.10.3",
2813 "PolynomialFactors"=>v"0.0.4",
2814 "Polynomials"=>v"0.1.5",
2815 "PositiveFactorizations"=>v"0.0.4",
2816 "Primes"=>v"0.1.3",
2817 "QuadGK"=>v"0.1.2",
2818 "RangeArrays"=>v"0.1.2",
2819 "Ranges"=>v"0.0.1",
2820 "Ratios"=>v"0.0.4",
2821 "Reactive"=>v"0.3.7",
2822 "RecipesBase"=>v"0.1.0",
2823 "RecursiveArrayTools"=>v"0.2.0",
2824 "Reexport"=>v"0.0.3",
2825 "ResettableStacks"=>v"0.1.0",
2826 "Rmath"=>v"0.1.6",
2827 "Roots"=>v"0.3.0",
2828 "Rotations"=>v"0.4.0",
2829 "SHA"=>v"0.3.2",
2830 "SIUnits"=>v"0.1.0",
2831 "ShowItLikeYouBuildIt"=>v"0.0.1",
2832 "Showoff"=>v"0.1.1",
2833 "SimpleTraits"=>v"0.4.0",
2834 "SpecialFunctions"=>v"0.1.1",
2835 "StaticArrays"=>v"0.4.0",
2836 "StatsBase"=>v"0.13.1",
2837 "StatsFuns"=>v"0.5.0",
2838 "StochasticDiffEq"=>v"1.4.0",
2839 "StokesDiffEq"=>v"0.1.0",
2840 "StructIO"=>v"0.0.2",
2841 "Sundials"=>v"0.10.0",
2842 "SymEngine"=>v"0.1.5",
2843 "TerminalUI"=>v"0.0.2",
2844 "TexExtensions"=>v"0.0.3",
2845 "TextWrap"=>v"0.2.0",
2846 "TiledIteration"=>v"0.0.2",
2847 "URIParser"=>v"0.1.8",
2848 "VT100"=>v"0.1.0",
2849 "VectorizedRoutines"=>v"0.0.2",
2850 "WebSockets"=>v"0.2.1",
2851 "WoodburyMatrices"=>v"0.2.2",
2852 )
+0
-4
stdlib/OldPkg/test/runtests.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 include("pkg.jl")
3 include("resolve.jl")
+0
-2
stdlib/OldPkg/test/testgroups less more
0 pkg
1 resolve
1919 "Logging"
2020 "Markdown"
2121 "Mmap"
22 "OldPkg"
2322 "Pkg"
2423 "Printf"
2524 "Profile"
1313 "Logging",
1414 "Markdown",
1515 "Mmap",
16 "OldPkg",
1716 "Pkg",
1817 "Printf",
1918 "Profile",
22 using TOML
33 import TOML: linecol, whitespace, comment, newline, expect, lookup, Parser, parse
44
5 if Base.isdeprecated(Base, :Test)
6 using Test
7 else
8 using Base.Test
9 end
5 using Test
106
117 macro testval(s, v)
128 f = "foo = $s"
7171 # some hard constraint is being violated
7272 validmax(a::FieldValue) = a.l0 >= 0
7373
74 # like usual indmax, but favors the highest indices
74 # like usual argmax, but favors the highest indices
7575 # in case of a tie
76 function Base.indmax(f::Field)
76 function Base.argmax(f::Field)
7777 m = typemin(FieldValue)
7878 mi = 0
7979 for j = length(f):-1:1
214214 end
215215 end
216216 newdata = UInt64[]
217 for ip in data
218 local ip::UInt64
217 for ip::UInt64 in data
219218 if haskey(newmap, ip)
220219 append!(newdata, newmap[ip])
221220 else
88 [extras]
99 Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1010 Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
11 OldPkg = "fe1c5a76-5840-53d2-82f9-288dd83ce2ce"
1211
1312 [targets]
14 test = ["Test", "Random", "OldPkg"]
13 test = ["Test", "Random"]
442442 kwtype = isdefined(ml.mt, :kwsorter) ? typeof(ml.mt.kwsorter) : nothing
443443 for method in ml
444444 ms = method.sig
445
446 # Do not suggest the default method from sysimg.jl.
447 if Base.is_default_method(method)
448 continue
449 end
450445
451446 # Check if the method's type signature intersects the input types
452447 if typeintersect(Base.rewrap_unionall(Tuple{Base.unwrap_unionall(ms).parameters[1 : min(na, end)]...}, ms), t_in) != Union{}
5757 end
5858 @test read(err.out, String) == ""
5959 #display(read(output.out, String))
60 Base._wait(t)
60 Base.wait(t)
6161 close(hard_kill)
6262 nothing
6363 end
299299
300300 # Close REPL ^D
301301 write(stdin_write, '\x04')
302 Base._wait(repltask)
302 Base.wait(repltask)
303303
304304 nothing
305305 end
670670
671671 # Close repl
672672 write(stdin_write, '\x04')
673 Base._wait(repltask)
673 Base.wait(repltask)
674674 end
675675
676676 # Simple non-standard REPL tests
710710 @test wait(c) == "a"
711711 # Close REPL ^D
712712 write(stdin_write, '\x04')
713 Base._wait(repltask)
713 Base.wait(repltask)
714714 end
715715
716716 ccall(:jl_exit_on_sigint, Cvoid, (Cint,), 1)
881881
882882 # Close REPL ^D
883883 write(stdin_write, '\x04')
884 Base._wait(repltask)
884 Base.wait(repltask)
885885
886886 # Close the history file
887887 # (otherwise trying to delete it fails on Windows)
937937
938938 # Close REPL ^D
939939 write(stdin_write, '\x04')
940 Base._wait(repltask)
940 Base.wait(repltask)
941941 end
942942
943943 # Docs.helpmode tests: we test whether the correct expressions are being generated here,
974974 readline(stdout_read)
975975 @test readline(stdout_read) == "\e[0m:((Base.Math.float)(_1))"
976976 write(stdin_write, '\x04')
977 Base._wait(repltask)
978 end
977 Base.wait(repltask)
978 end
22 using REPL.REPLCompletions
33 using Test
44 using Random
5 import OldPkg
65
76 let ex = quote
87 module CompletionFoo
6766
6867 test_y_array=[CompletionFoo.Test_y(rand()) for i in 1:10]
6968 test_dict = Dict("abc"=>1, "abcd"=>10, :bar=>2, :bar2=>9, Base=>3,
70 contains=>4, `ls`=>5, 66=>7, 67=>8, ("q",3)=>11,
69 occursin=>4, `ls`=>5, 66=>7, 67=>8, ("q",3)=>11,
7170 "α"=>12, :α=>13)
7271 test_customdict = CustomDict(test_dict)
7372
8382 end
8483 ex.head = :toplevel
8584 Core.eval(Main, ex)
86 end
87
88 function temp_pkg_dir_noinit(fn::Function)
89 # Used in tests below to set up and tear down a sandboxed package directory
90 # Unlike the version in test/pkg.jl, this does not run OldPkg.init so does not
91 # clone METADATA (only Pkg and LibGit2 tests should need internet access)
92 tmpdir = joinpath(tempdir(),randstring())
93 withenv("JULIA_PKGDIR" => tmpdir) do
94 @test !isdir(OldPkg.dir())
95 try
96 mkpath(OldPkg.dir())
97 @test isdir(OldPkg.dir())
98 fn()
99 finally
100 rm(tmpdir, recursive=true)
101 end
102 end
10385 end
10486
10587 function map_completion_text(completions)
369351 @test length(c) == 1
370352 end
371353
372 let s = "CompletionFoo.test3([1, 2] + CompletionFoo.varfloat,"
373 c, r, res = test_complete(s)
374 @test !res
375 @test c[1] == string(first(methods(Main.CompletionFoo.test3, Tuple{Array{Float64, 1}, Float64})))
376 @test length(c) == 1
354 let s = "CompletionFoo.test3([1, 2] .+ CompletionFoo.varfloat,"
355 c, r, res = test_complete(s)
356 @test !res
357 @test_broken c[1] == string(first(methods(Main.CompletionFoo.test3, Tuple{Array{Float64, 1}, Float64})))
358 @test_broken length(c) == 1
377359 end
378360
379361 let s = "CompletionFoo.test3([1.,2.], 1.,"
500482 end
501483
502484 # Test completion of packages
503 mkp(p) = ((@assert !isdir(p)); mkpath(p))
504 temp_pkg_dir_noinit() do
505 push!(LOAD_PATH, OldPkg.dir())
506 try
507 # Complete <Mod>/src/<Mod>.jl and <Mod>.jl/src/<Mod>.jl
508 # but not <Mod>/ if no corresponding .jl file is found
509 pkg_dir = OldPkg.dir("CompletionFooPackage", "src")
510 mkp(pkg_dir)
511 touch(joinpath(pkg_dir, "CompletionFooPackage.jl"))
512
513 pkg_dir = OldPkg.dir("CompletionFooPackage2.jl", "src")
514 mkp(pkg_dir)
515 touch(joinpath(pkg_dir, "CompletionFooPackage2.jl"))
516
517 touch(OldPkg.dir("CompletionFooPackage3.jl"))
518
519 mkp(OldPkg.dir("CompletionFooPackageNone"))
520 mkp(OldPkg.dir("CompletionFooPackageNone2.jl"))
521
522 s = "using Completion"
523 c,r = test_complete(s)
524 @test "CompletionFoo" in c #The module
525 @test "CompletionFooPackage" in c #The package
526 @test "CompletionFooPackage2" in c #The package
527 @test "CompletionFooPackage3" in c #The package
528 @test !("CompletionFooPackageNone" in c) #The package
529 @test !("CompletionFooPackageNone2" in c) #The package
530 @test s[r] == "Completion"
531 finally
532 @test pop!(LOAD_PATH) == OldPkg.dir()
533 end
534 end
535
536485 path = joinpath(tempdir(),randstring())
537486 pushfirst!(LOAD_PATH, path)
538487 try
871820 s = "$dict_name[Ba"
872821 c, r = test_complete(s)
873822 @test c == Any["Base]"]
874 s = "$dict_name[co"
875 c, r = test_complete(s)
876 @test c == Any["contains]"]
823 s = "$dict_name[occ"
824 c, r = test_complete(s)
825 @test c == Any["occursin]"]
877826 s = "$dict_name[`l"
878827 c, r = test_complete(s)
879828 @test c == Any["`ls`]"]
250250 # rand(r, ()) would match both this method and rand(r, dims::Dims)
251251 # moreover, a call like rand(r, NotImplementedType()) would be an infinite loop
252252
253 # this is needed to disambiguate
254 rand(r::AbstractRNG, dims::Dims) = error("rand(rng, dims) is discontinued; try rand(rng, Float64, dims)")
255
253256 rand(r::AbstractRNG, ::Type{X}, dims::Dims) where {X} = rand!(r, Array{X}(undef, dims), X)
254257 rand( ::Type{X}, dims::Dims) where {X} = rand(GLOBAL_RNG, X, dims)
255258
272275 include("generation.jl")
273276 include("normal.jl")
274277 include("misc.jl")
275 include("deprecated.jl")
276278
277279 ## rand & rand! & seed! docstrings
278280
+0
-42
stdlib/Random/src/deprecated.jl less more
0 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 # PR #25567
3 Base.@deprecate_binding dSFMT DSFMT
4
5 # PR #21359
6
7 @deprecate srand(r::MersenneTwister, filename::AbstractString, n::Integer=4) srand(r, read!(filename, Vector{UInt32}(undef, Int(n))))
8 @deprecate srand(filename::AbstractString, n::Integer=4) srand(read!(filename, Vector{UInt32}(undef, Int(n))))
9 @deprecate MersenneTwister(filename::AbstractString) srand(MersenneTwister(0), read!(filename, Vector{UInt32}(undef, Int(4))))
10
11 function randjump(mt::MersenneTwister, jumps::Integer, jumppoly::AbstractString)
12 Base.depwarn("`randjump(rng, jumps, [jumppoly::AbstractString])` is deprecated; use `Future.randjump` and `accumulate` instead", :randjump)
13 _randjump(mt, DSFMT.GF2X(jumppoly), jumps)
14 end
15
16 @deprecate randjump(mt::MersenneTwister, jumps::Integer) randjump(mt, big(10)^20, jumps)
17
18 function randjump(r::MersenneTwister, steps::Integer, len::Integer)
19 Base.depwarn("`randjump(rng, steps::Integer, len::Integer` is deprecated; use `Future.randjump` and `accumulate` instead", :randjump)
20 _randjump(r, DSFMT.calc_jump(steps), len)
21 end
22
23 function _randjump(mt::MersenneTwister, jumppoly::DSFMT.GF2X, len::Integer)
24 mts = MersenneTwister[]
25 push!(mts, mt)
26 for i in 1:len-1
27 cmt = mts[end]
28 push!(mts, _randjump(cmt, jumppoly))
29 end
30 return mts
31 end
32
33 # PR #25429
34 @deprecate rand(r::AbstractRNG, dims::Dims) rand(r, Float64, dims)
35 @deprecate rand( dims::Dims) rand(Float64, dims)
36
37 # PR #25668
38 @deprecate RandomDevice(unlimited::Bool) RandomDevice(; unlimited=unlimited)
39
40 # PR #28295
41 @deprecate srand Random.seed!
2525 end
2626
2727 Serializer(io::IO) = Serializer{typeof(io)}(io)
28
29 @deprecate SerializationState Serializer
3028
3129 ## serializing values ##
3230
336336 create_serialization_stream() do s # user-defined type array
337337 f = () -> begin task_local_storage(:v, 2); return 1+1 end
338338 t = Task(f)
339 Base._wait(schedule(t))
339 Base.wait(schedule(t))
340340 serialize(s, t)
341341 seek(s, 0)
342342 r = deserialize(s)
348348 struct MyErrorTypeTest <: Exception end
349349 create_serialization_stream() do s # user-defined type array
350350 t = Task(()->throw(MyErrorTypeTest()))
351 @test_throws MyErrorTypeTest Base._wait(schedule(t))
351 @test_throws MyErrorTypeTest Base.wait(schedule(t))
352352 serialize(s, t)
353353 seek(s, 0)
354354 r = deserialize(s)
685685
686686 end # os-test
687687
688 # 0.7 deprecations
689
690 @deprecate SharedArray(::Type{T}, dims::Dims{N}; kwargs...) where {T,N} SharedArray{T}(dims; kwargs...)
691 @deprecate SharedArray(::Type{T}, dims::Int...; kwargs...) where {T} SharedArray{T}(dims...; kwargs...)
692 @deprecate(SharedArray(filename::AbstractString, ::Type{T}, dims::NTuple{N,Int}, offset; kwargs...) where {T,N},
693 SharedArray{T}(filename, dims, offset; kwargs...))
694 @deprecate(SharedArray(filename::AbstractString, ::Type{T}, dims::NTuple, offset; kwargs...) where {T},
695 SharedArray{T}(filename, dims, offset; kwargs...))
696 @deprecate localindexes localindices
697
698688 end # module
103103 if i < 0 || i > 7
104104 throw(BoundsError())
105105 end
106 UInt16((ip.host&(UInt128(0xFFFF)<<(i*16)))>>(i*16))
106 UInt16((ip.host&(UInt128(0xFFFF)<<(i*16))) >> (i*16))
107107 end
108108
109109 show(io::IO, ip::IPv6) = print(io,"ip\"",ip,"\"")
651651 global uv_jl_connectcb = @cfunction(uv_connectcb, Cvoid, (Ptr{Cvoid}, Cint))
652652 end
653653
654 # deprecations
655
656 @deprecate convert(dt::Type{<:Integer}, ip::IPAddr) dt(ip)
657
658 @noinline function getaddrinfo(callback::Function, host::AbstractString)
659 Base.depwarn("`getaddrinfo` with a callback function is deprecated, wrap code in `@async` instead for deferred execution.", :getaddrinfo)
660 @async begin
661 r = getaddrinfo(host)
662 callback(r)
663 end
664 nothing
665 end
666
667 end
654 end
129129 @test read(client, String) == "Hello World\n" * ("a1\n"^100)
130130 end
131131 end
132 Base._wait(tsk)
132 Base.wait(tsk)
133133 end
134134
135135 mktempdir() do tmpdir
145145 end
146146 wait(c)
147147 @test read(connect(socketname), String) == "Hello World\n"
148 Base._wait(tsk)
148 Base.wait(tsk)
149149 end
150150 end
151151
205205 end
206206 @test fetch(r) === :start
207207 close(server)
208 Base._wait(tsk)
208 Base.wait(tsk)
209209 end
210210
211211 # test connecting to a named port
241241 notify(c)
242242 end
243243 send(b, ip"127.0.0.1", randport, "Hello World")
244 Base._wait(tsk2)
244 Base.wait(tsk2)
245245 end
246246 send(b, ip"127.0.0.1", randport, "Hello World")
247247 wait(c)
248 Base._wait(tsk)
248 Base.wait(tsk)
249249
250250 tsk = @async begin
251251 @test begin
254254 end
255255 end
256256 send(b, ip"127.0.0.1", randport, "Hello World")
257 Base._wait(tsk)
257 Base.wait(tsk)
258258
259259 @test_throws MethodError bind(UDPSocket(), randport)
260260
274274 end
275275 end
276276 send(b, ip"::1", randport, "Hello World")
277 Base._wait(tsk)
277 Base.wait(tsk)
278278 send(b, ip"::1", randport, "Hello World")
279 Base._wait(tsk)
279 Base.wait(tsk)
280280 end
281281 end
282282
334334 sleep(0.05)
335335 end
336336 length(recvs_check) > 0 && error("timeout")
337 map(Base._wait, recvs)
337 map(Base.wait, recvs)
338338 end
339339
340340 a, b, c = [create_socket() for i = 1:3]
380380 # on windows, the kernel fails to do even that
381381 # causing the `write` call to freeze
382382 # so we end up forced to do a slightly weaker test here
383 Sys.iswindows() || Base._wait(t)
383 Sys.iswindows() || Base.wait(t)
384384 @test isopen(P) # without an active uv_reader, P shouldn't be closed yet
385385 @test !eof(P) # should already know this,
386386 @test isopen(P) # so it still shouldn't have an active uv_reader
387387 @test readuntil(P, 'w') == "llo"
388 Sys.iswindows() && Base._wait(t)
388 Sys.iswindows() && Base.wait(t)
389389 @test eof(P)
390390 @test !isopen(P) # eof test should have closed this by now
391391 close(P) # should be a no-op, just make sure
1010 using LinearAlgebra
1111
1212 import Base: +, -, *, \, /, &, |, xor, ==
13 import LinearAlgebra: mul!, ldiv!, rdiv!, chol, adjoint!, diag, eigen, dot,
13 import LinearAlgebra: mul!, ldiv!, rdiv!, cholesky, adjoint!, diag, eigen, dot,
1414 issymmetric, istril, istriu, lu, tr, transpose!, tril!, triu!,
1515 cond, diagm, factorize, ishermitian, norm, opnorm, lmul!, rmul!, tril, triu
1616
1717 import Base: @get!, acos, acosd, acot, acotd, acsch, asech, asin, asind, asinh,
1818 atan, atand, atanh, broadcast!, conj!, cos, cosc, cosd, cosh, cospi, cot,
19 cotd, coth, count, csc, cscd, csch, done,
19 cotd, coth, count, csc, cscd, csch,
2020 exp10, exp2, findprev, findnext, floor, hash, argmin, inv,
21 log10, log2, next, sec, secd, sech, show,
22 sin, sinc, sind, sinh, sinpi, dropdims, start, sum, summary, tan,
21 log10, log2, sec, secd, sech, show,
22 sin, sinc, sind, sinh, sinpi, dropdims, sum, summary, tan,
2323 tand, tanh, trunc, abs, abs2,
2424 broadcast, ceil, complex, conj, convert, copy, copyto!, adjoint,
2525 exp, expm1, findall, findmax, findmin, float, getindex,
00 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 using Base: @deprecate, depwarn
3
4 # BEGIN 0.7 deprecations
5
6 # deprecate remaining vectorized methods over SparseVectors (zero-preserving)
7 for op in (:floor, :ceil, :trunc, :round,
8 :log1p, :expm1, :sinpi,
9 :sin, :tan, :sind, :tand,
10 :asin, :atan, :asind, :atand,
11 :sinh, :tanh, :asinh, :atanh)
12 @eval import Base.Math: $op
13 @eval @deprecate ($op)(x::AbstractSparseVector{<:Number,<:Integer}) ($op).(x)
14 end
15 # deprecate remaining vectorized methods over SparseVectors (not-zero-preserving)
16 for op in (:exp, :exp2, :exp10, :log, :log2, :log10,
17 :cos, :cosd, :acos, :cosh, :cospi,
18 :csc, :cscd, :acot, :csch, :acsch,
19 :cot, :cotd, :acosd, :coth,
20 :sec, :secd, :acotd, :sech, :asech)
21 @eval import Base.Math: $op
22 @eval @deprecate ($op)(x::AbstractSparseVector{<:Number,<:Integer}) ($op).(x)
23 end
24
25 # PR 23341
26 import LinearAlgebra: diagm
27 @deprecate diagm(A::SparseMatrixCSC) sparse(Diagonal(sparsevec(A)))
28
29 # PR #23757
30 @deprecate spdiagm(x::AbstractVector) sparse(Diagonal(x))
31 function spdiagm(x::AbstractVector, d::Number)
32 depwarn(string("`spdiagm(x::AbstractVector, d::Number)` is deprecated, use ",
33 "`spdiagm(d => x)` instead, which now returns a square matrix. To preserve the old ",
34 "behaviour, use `sparse(SparseArrays.spdiagm_internal(d => x)...)`"), :spdiagm)
35 I, J, V = spdiagm_internal(d => x)
36 return sparse(I, J, V)
37 end
38 function spdiagm(x, d)
39 depwarn(string("`spdiagm((x1, x2, ...), (d1, d2, ...))` is deprecated, use ",
40 "`spdiagm(d1 => x1, d2 => x2, ...)` instead, which now returns a square matrix. ",
41 "To preserve the old behaviour, use ",
42 "`sparse(SparseArrays.spdiagm_internal(d1 => x1, d2 => x2, ...)...)`"), :spdiagm)
43 I, J, V = spdiagm_internal((d[i] => x[i] for i in 1:length(x))...)
44 return sparse(I, J, V)
45 end
46 function spdiagm(x, d, m::Integer, n::Integer)
47 depwarn(string("`spdiagm((x1, x2, ...), (d1, d2, ...), m, n)` is deprecated, use ",
48 "`spdiagm(d1 => x1, d2 => x2, ...)` instead, which now returns a square matrix. ",
49 "To specify a non-square matrix and preserve the old behaviour, use ",
50 "`I, J, V = SparseArrays.spdiagm_internal(d1 => x1, d2 => x2, ...); sparse(I, J, V, m, n)`"), :spdiagm)
51 I, J, V = spdiagm_internal((d[i] => x[i] for i in 1:length(x))...)
52 return sparse(I, J, V, m, n)
53 end
54
55 @deprecate sparse(s::UniformScaling, m::Integer) sparse(s, m, m)
56
57 # PR #25037
58 @deprecate spones(A::SparseMatrixCSC) LinearAlgebra.fillstored!(copy(A), 1)
59 @deprecate spones(A::SparseVector) LinearAlgebra.fillstored!(copy(A), 1)
60 export spones
61
62 # full for sparse arrays
63 import Base: full
64 function full(S::Union{SparseVector,SparseMatrixCSC})
65 (arrtypestr, desttypestr) =
66 isa(S, SparseVector) ? ("SparseVector", "Vector") :
67 isa(S, SparseMatrixCSC) ? ("SparseMatrixCSC", "Matrix") :
68 error("should not be reachable!")
69 depwarn(string(
70 "`full(S::$(arrtypestr))` (and `full` in general) has been deprecated. ",
71 "To replace `full(S::$(arrtypestr))`, consider `$(desttypestr)(S)` or, ",
72 "if that option is too narrow, `Array(S)`."), :full)
73 return Array(S)
74 end
75
76 # issue #22849
77 import Base: reinterpret
78 @deprecate reinterpret(::Type{T}, a::SparseMatrixCSC{S}, dims::NTuple{N,Int}) where {T, S, N} reinterpret(T, reshape(a, dims))
79
80 # deprecate speye
81 export speye
82 function speye(n::Integer)
83 depwarn(string("`speye(n::Integer)` has been deprecated in favor of `I`, `sparse`, and ",
84 "`SparseMatrixCSC` constructor methods. For a direct replacement, consider ",
85 "`sparse(1.0I, n, n)`, `SparseMatrixCSC(1.0I, n, n)`, or `SparseMatrixCSC{Float64}(I, n, n)`. ",
86 "If `Float64` element type is not necessary, consider the shorter `sparse(I, n, n)` ",
87 "or `SparseMatrixCSC(I, n, n)` (with default `eltype(I)` of `Bool`)."), :speye)
88 return sparse(1.0I, n, n)
89 end
90 function speye(m::Integer, n::Integer)
91 depwarn(string("`speye(m::Integer, n::Integer)` has been deprecated in favor of `I`, ",
92 "`sparse`, and `SparseMatrixCSC` constructor methods. For a direct ",
93 "replacement, consider `sparse(1.0I, m, n)`, `SparseMatrixCSC(1.0I, m, n)`, ",
94 "or `SparseMatrixCSC{Float64}(I, m, n)`. If `Float64` element type is not ",
95 " necessary, consider the shorter `sparse(I, m, n)` or `SparseMatrixCSC(I, m, n)` ",
96 "(with default `eltype(I)` of `Bool`)."), :speye)
97 return sparse(1.0I, m, n)
98 end
99 function speye(::Type{T}, n::Integer) where T
100 depwarn(string("`speye(T, n::Integer)` has been deprecated in favor of `I`, `sparse`, and ",
101 "`SparseMatrixCSC` constructor methods. For a direct replacement, consider ",
102 "`sparse(T(1)I, n, n)` if `T` is concrete or `SparseMatrixCSC{T}(I, n, n)` ",
103 "if `T` is either concrete or abstract. If element type `T` is not necessary, ",
104 "consider the shorter `sparse(I, n, n)` or `SparseMatrixCSC(I, n, n)` ",
105 "(with default `eltype(I)` of `Bool`)."), :speye)
106 return SparseMatrixCSC{T}(I, n, n)
107 end
108 function speye(::Type{T}, m::Integer, n::Integer) where T
109 depwarn(string("`speye(T, m::Integer, n::Integer)` has been deprecated in favor of `I`, ",
110 "`sparse`, and `SparseMatrixCSC` constructor methods. For a direct ",
111 "replacement, consider `sparse(T(1)I, m, n)` if `T` is concrete or ",
112 "`SparseMatrixCSC{T}(I, m, n)` if `T` is either concrete or abstract. ",
113 "If element type `T` is not necessary, consider the shorter ",
114 "`sparse(I, m, n)` or `SparseMatrixCSC(I, m, n)` (with default `eltype(I)` ",
115 "of `Bool`)."), :speye)
116 return SparseMatrixCSC{T}(I, m, n)
117 end
118 function speye(S::SparseMatrixCSC{T}) where T
119 depwarn(string("`speye(S::SparseMatrixCSC{T})` has been deprecated in favor of `I`, ",
120 "`sparse`, and `SparseMatrixCSC` constructor methods. For a direct ",
121 "replacement, consider `sparse(T(1)I, size(S)...)` if `T` is concrete or ",
122 "`SparseMatrixCSC{eltype(S)}(I, size(S))` if `T` is either concrete or abstract. ",
123 "If preserving element type `T` is not necessary, consider the shorter ",
124 "`sparse(I, size(S)...)` or `SparseMatrixCSC(I, size(S))` (with default ",
125 "`eltype(I)` of `Bool`)."), :speye)
126 return SparseMatrixCSC{T}(I, size(S)...)
127 end
128
129 # former imports into SparseArrays
130 import Base: Ac_mul_B, At_mul_B
131 import Base: A_mul_Bc, A_mul_Bt, Ac_mul_Bc, At_mul_Bt
132 import Base: At_ldiv_B, Ac_ldiv_B
133 import LinearAlgebra: A_mul_B!, Ac_mul_B!, At_mul_B!, A_ldiv_B!, A_rdiv_Bt!
134 import LinearAlgebra: At_ldiv_B!, Ac_ldiv_B!, A_rdiv_B!, A_rdiv_Bc!, mul!, ldiv!, rdiv!
135
136 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/sparse/linalg.jl, to deprecate
137 using LinearAlgebra: Adjoint, Transpose
138 @deprecate Ac_ldiv_B(A::SparseMatrixCSC, B::RowVector) (\)(adjoint(A), B)
139 @deprecate At_ldiv_B(A::SparseMatrixCSC, B::RowVector) (\)(transpose(A), B)
140 @deprecate Ac_ldiv_B(A::SparseMatrixCSC, B::AbstractVecOrMat) (\)(adjoint(A), B)
141 @deprecate At_ldiv_B(A::SparseMatrixCSC, B::AbstractVecOrMat) (\)(transpose(A), B)
142 @deprecate A_rdiv_Bc!(A::SparseMatrixCSC{T}, D::Diagonal{T}) where {T} rdiv!(A, adjoint(D))
143 @deprecate A_rdiv_Bt!(A::SparseMatrixCSC{T}, D::Diagonal{T}) where {T} rdiv!(A, transpose(D))
144 @deprecate A_rdiv_B!(A::SparseMatrixCSC{T}, D::Diagonal{T}) where {T} rdiv!(A, D)
145 @deprecate A_ldiv_B!(L::LowerTriangular{T,<:SparseMatrixCSCUnion{T}}, B::StridedVecOrMat) where {T} ldiv!(L, B)
146 @deprecate A_ldiv_B!(U::UpperTriangular{T,<:SparseMatrixCSCUnion{T}}, B::StridedVecOrMat) where {T} ldiv!(U, B)
147 @deprecate A_mul_Bt(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(A, transpose(B))
148 @deprecate A_mul_Bc(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(A, adjoint(B))
149 @deprecate At_mul_B(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(transpose(A), B)
150 @deprecate Ac_mul_B(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(adjoint(A), B)
151 @deprecate At_mul_Bt(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(transpose(A), transpose(B))
152 @deprecate Ac_mul_Bc(A::SparseMatrixCSC{Tv,Ti}, B::SparseMatrixCSC{Tv,Ti}) where {Tv,Ti} (*)(adjoint(A), adjoint(B))
153 @deprecate A_mul_B!(C::StridedVecOrMat, A::SparseMatrixCSC, B::StridedVecOrMat) mul!(C, A, B)
154 @deprecate Ac_mul_B!(C::StridedVecOrMat, A::SparseMatrixCSC, B::StridedVecOrMat) mul!(C, adjoint(A), B)
155 @deprecate At_mul_B!(C::StridedVecOrMat, A::SparseMatrixCSC, B::StridedVecOrMat) mul!(C, transpose(A), B)
156 @deprecate A_mul_B!(α::Number, A::SparseMatrixCSC, B::StridedVecOrMat, β::Number, C::StridedVecOrMat) mul!(C, A, B, α, β)
157 @deprecate A_mul_B(A::SparseMatrixCSC{TA,S}, x::StridedVector{Tx}) where {TA,S,Tx} (*)(A, x)
158 @deprecate A_mul_B(A::SparseMatrixCSC{TA,S}, B::StridedMatrix{Tx}) where {TA,S,Tx} (*)(A, B)
159 @deprecate Ac_mul_B!(α::Number, A::SparseMatrixCSC, B::StridedVecOrMat, β::Number, C::StridedVecOrMat) mul!(C, adjoint(A), B, α, β)
160 @deprecate Ac_mul_B(A::SparseMatrixCSC{TA,S}, x::StridedVector{Tx}) where {TA,S,Tx} (*)(adjoint(A), x)
161 @deprecate Ac_mul_B(A::SparseMatrixCSC{TA,S}, B::StridedMatrix{Tx}) where {TA,S,Tx} (*)(adjoint(A), B)
162 @deprecate At_mul_B!(α::Number, A::SparseMatrixCSC, B::StridedVecOrMat, β::Number, C::StridedVecOrMat) mul!(C, transpose(A), B, α, β)
163 @deprecate At_mul_B(A::SparseMatrixCSC{TA,S}, x::StridedVector{Tx}) where {TA,S,Tx} (*)(transpose(A), x)
164 @deprecate At_mul_B(A::SparseMatrixCSC{TA,S}, B::StridedMatrix{Tx}) where {TA,S,Tx} (*)(transpose(A), B)
165 @deprecate A_mul_Bt(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(A, transpose(B))
166 @deprecate A_mul_Bc(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(A, adjoint(B))
167 @deprecate At_mul_B(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(transpose(A), B)
168 @deprecate Ac_mul_B(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(adjoint(A),B)
169 @deprecate At_mul_Bt(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(transpose(A), transpose(B))
170 @deprecate Ac_mul_Bc(A::SparseMatrixCSC{TvA,TiA}, B::SparseMatrixCSC{TvB,TiB}) where {TvA,TiA,TvB,TiB} (*)(adjoint(A), adjoint(B))
171
172 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/sparse/sparsevector.jl, to deprecate
173 for isunittri in (true, false), islowertri in (true, false)
174 unitstr = isunittri ? "Unit" : ""
175 halfstr = islowertri ? "Lower" : "Upper"
176 tritype = :(LinearAlgebra.$(Symbol(unitstr, halfstr, "Triangular")))
177 @eval #=Base.SparseArrays=# begin
178 using LinearAlgebra: Adjoint, Transpose
179 @deprecate At_ldiv_B(A::$tritype{TA,<:AbstractMatrix}, b::SparseVector{Tb}) where {TA<:Number,Tb<:Number} (\)(transpose(A), b)
180 @deprecate At_ldiv_B(A::$tritype{TA,<:StridedMatrix}, b::SparseVector{Tb}) where {TA<:Number,Tb<:Number} (\)(transpose(A), b)
181 @deprecate At_ldiv_B(A::$tritype, b::SparseVector) (\)(transpose(A), b)
182 @deprecate Ac_ldiv_B(A::$tritype{TA,<:AbstractMatrix}, b::SparseVector{Tb}) where {TA<:Number,Tb<:Number} (\)(adjoint(A), b)
183 @deprecate Ac_ldiv_B(A::$tritype{TA,<:StridedMatrix}, b::SparseVector{Tb}) where {TA<:Number,Tb<:Number} (\)(adjoint(A), b)
184 @deprecate Ac_ldiv_B(A::$tritype, b::SparseVector) (\)(adjoint(A), b)
185 @deprecate A_ldiv_B!(A::$tritype{<:Any,<:StridedMatrix}, b::SparseVector) ldiv!(A, b)
186 @deprecate At_ldiv_B!(A::$tritype{<:Any,<:StridedMatrix}, b::SparseVector) ldiv!(transpose(A), b)
187 @deprecate Ac_ldiv_B!(A::$tritype{<:Any,<:StridedMatrix}, b::SparseVector) ldiv!(adjoint(A), b)
188 end
189 end
190
191 using LinearAlgebra: Adjoint, Transpose
192 @deprecate Ac_mul_B(A::SparseMatrixCSC, x::AbstractSparseVector) (*)(adjoint(A), x)
193 @deprecate At_mul_B(A::SparseMatrixCSC, x::AbstractSparseVector) (*)(transpose(A), x)
194 @deprecate Ac_mul_B!(α::Number, A::SparseMatrixCSC, x::AbstractSparseVector, β::Number, y::StridedVector) mul!(y, adjoint(A), x, α, β)
195 @deprecate Ac_mul_B!(y::StridedVector{Ty}, A::SparseMatrixCSC, x::AbstractSparseVector{Tx}) where {Tx,Ty} mul!(y, adjoint(A), x)
196 @deprecate At_mul_B!(α::Number, A::SparseMatrixCSC, x::AbstractSparseVector, β::Number, y::StridedVector) mul!(y, transpose(A), x, α, β)
197 @deprecate At_mul_B!(y::StridedVector{Ty}, A::SparseMatrixCSC, x::AbstractSparseVector{Tx}) where {Tx,Ty} mul!(y, transpose(A), x)
198 @deprecate A_mul_B!(α::Number, A::SparseMatrixCSC, x::AbstractSparseVector, β::Number, y::StridedVector) mul!(y, A, x, α, β)
199 @deprecate A_mul_B!(y::StridedVector{Ty}, A::SparseMatrixCSC, x::AbstractSparseVector{Tx}) where {Tx,Ty} mul!(y, A, x)
200 @deprecate At_mul_B!(α::Number, A::StridedMatrix, x::AbstractSparseVector, β::Number, y::StridedVector) mul!(y, transpose(A), x, α, β)
201 @deprecate At_mul_B!(y::StridedVector{Ty}, A::StridedMatrix, x::AbstractSparseVector{Tx}) where {Tx,Ty} mul!(y, transpose(A), x)
202 @deprecate At_mul_B(A::StridedMatrix{Ta}, x::AbstractSparseVector{Tx}) where {Ta,Tx} (*)(transpose(A), x)
203 @deprecate A_mul_B!(α::Number, A::StridedMatrix, x::AbstractSparseVector, β::Number, y::StridedVector) mul!(y, A, x, α, β)
204 @deprecate A_mul_B!(y::StridedVector{Ty}, A::StridedMatrix, x::AbstractSparseVector{Tx}) where {Tx,Ty} mul!(y, A, x)
205
206 # methods involving RowVector from base/sparse/linalg.jl, to deprecate
207 \(::SparseMatrixCSC, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
208 \(::Adjoint{<:Any,<:SparseMatrixCSC}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
209 \(::Transpose{<:Any,<:SparseMatrixCSC}, ::RowVector) = throw(DimensionMismatch("Cannot left-divide matrix by transposed vector"))
210
211 # methods involving RowVector from base/sparse/higherorderfns.jl, to deprecate
212 @eval SparseArrays.HigherOrderFns begin
213 BroadcastStyle(::Type{<:RowVector{T,<:Vector}}) where T = Broadcast.MatrixStyle()
214 end
215
216 import Base: asyncmap
217 @deprecate asyncmap(f, s::AbstractSparseArray...; kwargs...) sparse(asyncmap(f, map(Array, s)...; kwargs...))
218
219 # PR 26347: implicit scalar broadcasting within setindex!
220 @deprecate setindex!(A::SparseMatrixCSC{<:Any,<:Any}, x, i::Union{Integer, AbstractVector{<:Integer}, Colon}, j::Union{Integer, AbstractVector{<:Integer}, Colon}) (A[i, j] .= x; A)
221
222 #25395 keywords unlocked
223 @deprecate dropzeros(x, trim) dropzeros(x, trim = trim)
224 @deprecate dropzeros!(x, trim) dropzeros!(x, trim = trim)
225 @deprecate droptol!(A, tol, trim) droptol!(A, tol, trim = trim)
226
227 Base.@deprecate_binding blkdiag blockdiag
228
229 @deprecate complex(x::AbstractSparseVector{<:Real}, y::AbstractSparseVector{<:Real}) complex.(x, y)
230 @deprecate complex(x::AbstractVector{<:Real}, y::AbstractSparseVector{<:Real}) complex.(x, y)
231 @deprecate complex(x::AbstractSparseVector{<:Real}, y::AbstractVector{<:Real}) complex.(x, y)
232
233 @deprecate diff(a::SparseMatrixCSC, dim::Integer) diff(a, dims=dim)
234
235 @deprecate findnz(A::AbstractMatrix) (I = findall(!iszero, A); (getindex.(I, 1), getindex.(I, 2), A[I]))
236
237 # END 0.7 deprecations
2381
2392 # BEGIN 1.0 deprecations
2403
12951295 ## Find methods
12961296
12971297 function findall(S::SparseMatrixCSC)
1298 if !(eltype(S) <: Bool)
1299 Base.depwarn("In the future `findall(A)` will only work on boolean collections. Use `findall(x->x!=0, A)` instead.", :findall)
1300 end
1301 return findall(x->x!=0, S)
1298 return findall(identity, S)
13021299 end
13031300
13041301 function findall(p::Function, S::SparseMatrixCSC)
687687 end
688688
689689 function findall(x::SparseVector)
690 if !(eltype(x) <: Bool)
691 Base.depwarn("In the future `findall(A)` will only work on boolean collections. Use `findall(x->x!=0, A)` instead.", :findall)
692 end
693 return findall(x->x!=0, x)
690 return findall(identity, x)
694691 end
695692
696693 function findall(p::Function, x::SparseVector{<:Any,Ti}) where Ti
10051002
10061003 # TODO: A definition similar to the third exists in base/linalg/bidiag.jl. These definitions
10071004 # should be consolidated in a more appropriate location, e.g. base/linalg/special.jl.
1008 const _SparseArrays = Union{SparseVector, SparseMatrixCSC, LinearAlgebra.RowVector{<:Any,<:SparseVector}, Adjoint{<:Any,<:SparseVector}, Transpose{<:Any,<:SparseVector}}
1005 const _SparseArrays = Union{SparseVector, SparseMatrixCSC, Adjoint{<:Any,<:SparseVector}, Transpose{<:Any,<:SparseVector}}
10091006 const _SpecialArrays = Union{Diagonal, Bidiagonal, Tridiagonal, SymTridiagonal}
10101007 const _SparseConcatArrays = Union{_SpecialArrays, _SparseArrays}
10111008
10201017 const _Annotated_DenseArrays = Union{_Triangular_DenseArrays, _Symmetric_DenseArrays, _Hermitian_DenseArrays}
10211018 const _Annotated_Typed_DenseArrays{T} = Union{_Triangular_DenseArrays{T}, _Symmetric_DenseArrays{T}, _Hermitian_DenseArrays{T}}
10221019
1023 const _SparseConcatGroup = Union{Vector, Adjoint{<:Any,<:Vector}, Transpose{<:Any,<:Vector}, LinearAlgebra.RowVector{<:Any,<:Vector}, Matrix, _SparseConcatArrays, _Annotated_SparseConcatArrays, _Annotated_DenseArrays}
1024 const _DenseConcatGroup = Union{Vector, Adjoint{<:Any,<:Vector}, Transpose{<:Any,<:Vector}, LinearAlgebra.RowVector{<:Any, <:Vector}, Matrix, _Annotated_DenseArrays}
1025 const _TypedDenseConcatGroup{T} = Union{Vector{T}, Adjoint{T,Vector{T}}, Transpose{T,Vector{T}}, LinearAlgebra.RowVector{T,Vector{T}}, Matrix{T}, _Annotated_Typed_DenseArrays{T}}
1020 const _SparseConcatGroup = Union{Vector, Adjoint{<:Any,<:Vector}, Transpose{<:Any,<:Vector}, Matrix, _SparseConcatArrays, _Annotated_SparseConcatArrays, _Annotated_DenseArrays}
1021 const _DenseConcatGroup = Union{Vector, Adjoint{<:Any,<:Vector}, Transpose{<:Any,<:Vector}, Matrix, _Annotated_DenseArrays}
1022 const _TypedDenseConcatGroup{T} = Union{Vector{T}, Adjoint{T,Vector{T}}, Transpose{T,Vector{T}}, Matrix{T}, _Annotated_Typed_DenseArrays{T}}
10261023
10271024 # Concatenations involving un/annotated sparse/special matrices/vectors should yield sparse arrays
10281025 function Base._cat(dims, Xin::_SparseConcatGroup...)
999999 return R
10001000 end
10011001
1002
1003 ##### deprecations #####
1004
1005 # PR #21709
1006 @deprecate cov(x::AbstractVector, corrected::Bool) cov(x, corrected=corrected)
1007 @deprecate cov(x::AbstractMatrix, vardim::Int, corrected::Bool) cov(x, dims=vardim, corrected=corrected)
1008 @deprecate cov(X::AbstractVector, Y::AbstractVector, corrected::Bool) cov(X, Y, corrected=corrected)
1009 @deprecate cov(X::AbstractVecOrMat, Y::AbstractVecOrMat, vardim::Int, corrected::Bool) cov(X, Y, dims=vardim, corrected=corrected)
1010
1011 # issue #25501
1012 @deprecate mean(A::AbstractArray, dims) mean(A, dims=dims)
1013 @deprecate varm(A::AbstractArray, m::AbstractArray, dims; kwargs...) varm(A, m; kwargs..., dims=dims)
1014 @deprecate var(A::AbstractArray, dims; kwargs...) var(A; kwargs..., dims=dims)
1015 @deprecate std(A::AbstractArray, dims; kwargs...) std(A; kwargs..., dims=dims)
1016 @deprecate cov(X::AbstractMatrix, dim::Int; kwargs...) cov(X; kwargs..., dims=dim)
1017 @deprecate cov(x::AbstractVecOrMat, y::AbstractVecOrMat, dim::Int; kwargs...) cov(x, y; kwargs..., dims=dim)
1018 @deprecate cor(X::AbstractMatrix, dim::Int) cor(X, dims=dim)
1019 @deprecate cor(x::AbstractVecOrMat, y::AbstractVecOrMat, dim::Int) cor(x, y, dims=dim)
1020 @deprecate median(A::AbstractArray, dims; kwargs...) median(A; kwargs..., dims=dims)
1021
10221002 end # module
17031703 end
17041704
17051705 \(adjL::Adjoint{<:Any,<:FactorComponent}, B::Union{VecOrMat,SparseVecOrMat}) = (L = adjL.parent; adjoint(L)\B)
1706 \(adjL::Adjoint{<:Any,<:FactorComponent}, B::RowVector) = (L = adjL.parent; adjoint(L)\B) # ambiguity
17071706
17081707 (\)(L::Factor{T}, B::Dense{T}) where {T<:VTypes} = solve(CHOLMOD_A, L, B)
17091708 # Explicit typevars are necessary to avoid ambiguities with defs in linalg/factorizations.jl
00 # This file is a part of Julia. License is MIT: https://julialang.org/license
1
2 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from src/cholmod.jl, to deprecate
3 @eval SuiteSparse.CHOLMOD begin
4 Base.Ac_ldiv_B(A::RealHermSymComplexHermF64SSL, B::StridedVecOrMat) = \(adjoint(A), B)
5 Base.Ac_ldiv_B(L::Factor, B::Dense) = \(adjoint(L), B)
6 Base.Ac_ldiv_B(L::Factor, B::VecOrMat) = \(adjoint(L), B)
7 Base.Ac_ldiv_B(L::Factor, B::Sparse) = \(adjoint(L), B)
8 Base.Ac_ldiv_B(L::Factor, B::SparseVecOrMat) = \(adjoint(L), B)
9 Base.Ac_ldiv_B(L::FactorComponent, B) = \(adjoint(L), B)
10 Base.Ac_ldiv_B(L::FactorComponent, B::RowVector) = \(adjoint(L), B)
11 Base.Ac_mul_B(A::Sparse, B::Dense) = *(adjoint(A), B)
12 Base.Ac_mul_B(A::Sparse, B::VecOrMat) = *(adjoint(A), B)
13 Base.Ac_mul_B(A::Sparse, B::Sparse) = *(adjoint(A), B)
14 Base.A_mul_Bc(A::Sparse{Tv}, B::Sparse{Tv}) where {Tv<:VRealTypes} = *(A, adjoint(B))
15 end
16
17 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from src/umfpack.jl, to deprecate
18 @eval SuiteSparse.UMFPACK begin
19 using LinearAlgebra: Adjoint, Transpose
20 LinearAlgebra.A_ldiv_B!(X::StridedVecOrMat{T}, lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} =
21 LinearAlgebra.ldiv!(X, lu, B)
22 LinearAlgebra.At_ldiv_B!(X::StridedVecOrMat{T}, lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} =
23 LinearAlgebra.ldiv!(X, transpose(lu), B)
24 LinearAlgebra.Ac_ldiv_B!(X::StridedVecOrMat{T}, lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} =
25 LinearAlgebra.ldiv!(X, adjoint(lu), B)
26 LinearAlgebra.A_ldiv_B!(X::StridedVecOrMat{Tb}, lu::UmfpackLU{Float64}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} =
27 LinearAlgebra.ldiv!(X, lu, B)
28 LinearAlgebra.At_ldiv_B!(X::StridedVecOrMat{Tb}, lu::UmfpackLU{Float64}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} =
29 LinearAlgebra.ldiv!(X, transpose(lu), B)
30 LinearAlgebra.Ac_ldiv_B!(X::StridedVecOrMat{Tb}, lu::UmfpackLU{Float64}, B::StridedVecOrMat{Tb}) where {Tb<:Complex} =
31 LinearAlgebra.ldiv!(X, adjoint(lu), B)
32 LinearAlgebra.A_ldiv_B!(lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = LinearAlgebra.ldiv!(B, lu, copy(B))
33 LinearAlgebra.At_ldiv_B!(lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = LinearAlgebra.ldiv!(B, transpose(lu), copy(B))
34 LinearAlgebra.Ac_ldiv_B!(lu::UmfpackLU{T}, B::StridedVecOrMat{T}) where {T<:UMFVTypes} = LinearAlgebra.ldiv!(B, adjoint(lu), copy(B))
35 LinearAlgebra.A_ldiv_B!(lu::UmfpackLU{Float64}, B::StridedVecOrMat{<:Complex}) = LinearAlgebra.ldiv!(B, lu, copy(B))
36 LinearAlgebra.At_ldiv_B!(lu::UmfpackLU{Float64}, B::StridedVecOrMat{<:Complex}) = LinearAlgebra.ldiv!(B, transpose(lu), copy(B))
37 LinearAlgebra.Ac_ldiv_B!(lu::UmfpackLU{Float64}, B::StridedVecOrMat{<:Complex}) = LinearAlgebra.ldiv!(B, adjoint(lu), copy(B))
38 end
39
40 # A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from src/spqr.jl, to deprecate
41 @eval SuiteSparse.SPQR begin
42 using LinearAlgebra: Adjoint, Transpose
43 LinearAlgebra.A_mul_Bc!(A::StridedMatrix, Q::QRSparseQ) = LinearAlgebra.mul!(A, adjoint(Q))
44 LinearAlgebra.Ac_mul_B!(Q::QRSparseQ, A::StridedVecOrMat) = LinearAlgebra.mul!(adjoint(Q), A)
45 LinearAlgebra.A_mul_B!(A::StridedMatrix, Q::QRSparseQ) = LinearAlgebra.mul!(A, Q)
46 LinearAlgebra.A_mul_B!(Q::QRSparseQ, A::StridedVecOrMat) = LinearAlgebra.mul!(Q, A)
47 end
48
49 # deprecate lufact to lu
50 @eval SuiteSparse.UMFPACK begin
51 import LinearAlgebra: lufact
52 @deprecate(lufact(A::SparseMatrixCSC), lu(A))
53 @deprecate(lufact(S::SparseMatrixCSC{<:UMFVTypes,<:UMFITypes}), lu(S))
54 @deprecate(lufact(A::SparseMatrixCSC{<:Union{Float16,Float32},Ti}) where {Ti<:UMFITypes}, lu(A))
55 @deprecate(lufact(A::SparseMatrixCSC{<:Union{ComplexF16,ComplexF32},Ti}) where {Ti<:UMFITypes}, lu(A))
56 @deprecate(lufact(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}}}) where {T<:AbstractFloat}, lu(A))
57 end
58
59 # deprecate qrfact to qr
60 @eval SuiteSparse.SPQR begin
61 import LinearAlgebra: qrfact
62 @deprecate(qrfact(A::SparseMatrixCSC{Tv}; tol = _default_tol(A)) where {Tv<:Union{ComplexF64,Float64}}, qr(A; tol=tol))
63 @deprecate(qrfact(A::SparseMatrixCSC; tol = _default_tol(A)), qr(A; tol=tol))
64 end
65
66 # deprecate ldltfact to ldlt
67 @eval SuiteSparse.CHOLMOD begin
68 import LinearAlgebra: ldltfact
69 @deprecate(ldltfact(A::Sparse; shift::Real=0.0, perm::AbstractVector{SuiteSparse_long}=SuiteSparse_long[]), ldlt(A; shift=shift, perm=perm))
70 @deprecate(ldltfact(A::Union{SparseMatrixCSC{T},SparseMatrixCSC{Complex{T}},
71 Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}},
72 Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}},
73 Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}};
74 kws...) where {T<:Real},
75 ldlt(A; kws...))
76 end
77
78 # deprecate ldltfact! to ldlt!
79 @eval SuiteSparse.CHOLMOD begin
80 import LinearAlgebra: ldltfact!
81 @deprecate(ldltfact!(F::Factor{Tv}, A::Sparse{Tv}; shift::Real=0.0) where Tv, ldlt!(F, A; shift=shift))
82 @deprecate(ldltfact!(F::Factor, A::Union{SparseMatrixCSC{T},
83 SparseMatrixCSC{Complex{T}},
84 Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}},
85 Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}},
86 Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}};
87 shift = 0.0) where {T<:Real},
88 ldlt!(F, A; shift=shift))
89 end
90
91 # deprecate cholfact to cholesky
92 @eval SuiteSparse.CHOLMOD begin
93 import LinearAlgebra: cholfact
94 @deprecate(cholfact(A::Sparse; shift::Real=0.0, perm::AbstractVector{SuiteSparse_long}=SuiteSparse_long[]), cholesky(A; shift=shift, perm=perm))
95 @deprecate(cholfact(A::Union{SparseMatrixCSC{T}, SparseMatrixCSC{Complex{T}},
96 Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}},
97 Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}},
98 Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}};
99 kws...) where {T<:Real},
100 cholesky(A; kws...))
101 end
102
103 # deprecate cholfact! to cholesky!
104 @eval SuiteSparse.CHOLMOD begin
105 import LinearAlgebra: cholfact!
106 @deprecate(cholfact!(F::Factor{Tv}, A::Sparse{Tv}; shift::Real=0.0) where Tv, cholesky!(F, A; shift=shift))
107 @deprecate(cholfact!(F::Factor, A::Union{SparseMatrixCSC{T},
108 SparseMatrixCSC{Complex{T}},
109 Symmetric{T,SparseMatrixCSC{T,SuiteSparse_long}},
110 Hermitian{Complex{T},SparseMatrixCSC{Complex{T},SuiteSparse_long}},
111 Hermitian{T,SparseMatrixCSC{T,SuiteSparse_long}}};
112 shift = 0.0) where {T<:Real},
113 cholesyk!(F, A; shift=shift))
114 end
140140 else
141141 bt_str = ""
142142 end
143 new(test_type, orig_expr, repr(value), bt_str, source)
143 new(test_type,
144 orig_expr,
145 sprint(show, value, context = :limit => true),
146 bt_str,
147 source)
144148 end
145149 end
146150 function Base.show(io::IO, t::Error)
156160 println(io, " Expression: ", t.orig_expr)
157161 print( io, " Value: ", t.value)
158162 elseif t.test_type == :test_error
159 println(io, " Test threw exception ", t.value)
163 println(io, " Test threw exception")
160164 println(io, " Expression: ", t.orig_expr)
161165 # Capture error message and indent to match
162166 print(io, join(map(line->string(" ",line),
168172 println(io, " Got correct result, please change to @test if no longer broken.")
169173 elseif t.test_type == :nontest_error
170174 # we had an error outside of a @test
171 println(io, " Got exception $(t.value) outside of a @test")
175 println(io, " Got exception outside of a @test")
172176 # Capture error message and indent to match
173177 print(io, join(map(line->string(" ",line),
174178 split(t.backtrace, "\n")), "\n"))
12551259 end
12561260
12571261 _args_and_call(args...; kwargs...) = (args[1:end-1], kwargs, args[end](args[1:end-1]...; kwargs...))
1262 _materialize_broadcasted(f, args...) = Broadcast.materialize(Broadcast.broadcasted(f, args...))
12581263 """
12591264 @inferred f(x)
12601265
12931298 ex = Expr(:call, :getindex, ex.args...)
12941299 end
12951300 Meta.isexpr(ex, :call)|| error("@inferred requires a call expression")
1296
1301 farg = ex.args[1]
1302 if isa(farg, Symbol) && first(string(farg)) == '.'
1303 farg = Symbol(string(farg)[2:end])
1304 ex = Expr(:call, GlobalRef(Test, :_materialize_broadcasted),
1305 farg, ex.args[2:end]...)
1306 end
12971307 Base.remove_linenums!(quote
12981308 let
12991309 $(if any(a->(Meta.isexpr(a, :kw) || Meta.isexpr(a, :parameters)), ex.args)
16171627
16181628 test_approx_eq(va, vb, astr, bstr) =
16191629 test_approx_eq(va, vb, 1E4*length(LinearIndices(va))*max(array_eps(va), array_eps(vb)), astr, bstr)
1620
1621 """
1622 @test_approx_eq_eps(a, b, tol)
1623
1624 Test two floating point numbers `a` and `b` for equality taking into account
1625 a margin of tolerance given by `tol`.
1626 """
1627 macro test_approx_eq_eps(a, b, c)
1628 Base.depwarn(string("@test_approx_eq_eps is deprecated, use `@test ", a, " ≈ ", b, " atol=", c, "` instead"),
1629 Symbol("@test_approx_eq_eps"))
1630 :(test_approx_eq($(esc(a)), $(esc(b)), $(esc(c)), $(string(a)), $(string(b))))
1631 end
1632 export @test_approx_eq_eps
1633
1634 """
1635 @test_approx_eq(a, b)
1636
1637 Deprecated. Test two floating point numbers `a` and `b` for equality taking into
1638 account small numerical errors.
1639 """
1640 macro test_approx_eq(a, b)
1641 Base.depwarn(string("@test_approx_eq is deprecated, use `@test ", a, " ≈ ", b, "` instead"),
1642 Symbol("@test_approx_eq"))
1643 :(test_approx_eq($(esc(a)), $(esc(b)), $(string(a)), $(string(b))))
1644 end
1645 export @test_approx_eq
16461630 end
16471631
16481632 include("logging.jl")
8080 """
8181 graphemes(s::AbstractString) = Base.Unicode.GraphemeIterator{typeof(s)}(s)
8282
83 # BEGIN 0.7 deprecations
84
85 @deprecate is_assigned_char(c::Char) Unicode.isassigned(c)
86 @deprecate normalize_string(s::AbstractString, nf::Symbol; kwargs...) Unicode.normalize(s, nf; kwargs...)
87 @deprecate normalize_string(s::AbstractString; kwargs...) Unicode.normalize(s; kwargs...)
88
89 # END 0.7 deprecations
90
9183 end
1616 @test checkbounds(Bool, A, 61) == false
1717 @test checkbounds(Bool, A, 2, 2, 2, 1) == true # extra indices
1818 @test checkbounds(Bool, A, 2, 2, 2, 2) == false
19 # @test checkbounds(Bool, A, 1, 1) == false # TODO: partial linear indexing (PLI)
20 # @test checkbounds(Bool, A, 1, 12) == false
21 # @test checkbounds(Bool, A, 5, 12) == false
22 # @test checkbounds(Bool, A, 1, 13) == false
23 # @test checkbounds(Bool, A, 6, 12) == false
19 @test checkbounds(Bool, A, 1, 1) == false
20 @test checkbounds(Bool, A, 1, 12) == false
21 @test checkbounds(Bool, A, 5, 12) == false
22 @test checkbounds(Bool, A, 1, 13) == false
23 @test checkbounds(Bool, A, 6, 12) == false
2424 end
2525
2626 @testset "single CartesianIndex" begin
3232 @test checkbounds(Bool, A, CartesianIndex((6, 4, 3))) == false
3333 @test checkbounds(Bool, A, CartesianIndex((5, 5, 3))) == false
3434 @test checkbounds(Bool, A, CartesianIndex((5, 4, 4))) == false
35 # @test checkbounds(Bool, A, CartesianIndex((1,))) == false # TODO: PLI
36 # @test checkbounds(Bool, A, CartesianIndex((60,))) == false
37 # @test checkbounds(Bool, A, CartesianIndex((61,))) == false
35 @test checkbounds(Bool, A, CartesianIndex((1,))) == false
36 @test checkbounds(Bool, A, CartesianIndex((60,))) == false
37 @test checkbounds(Bool, A, CartesianIndex((61,))) == false
3838 @test checkbounds(Bool, A, CartesianIndex((2, 2, 2, 1,))) == true
3939 @test checkbounds(Bool, A, CartesianIndex((2, 2, 2, 2,))) == false
40 # @test checkbounds(Bool, A, CartesianIndex((1, 1,))) == false # TODO: PLI
41 # @test checkbounds(Bool, A, CartesianIndex((1, 12,))) == false
42 # @test checkbounds(Bool, A, CartesianIndex((5, 12,))) == false
43 # @test checkbounds(Bool, A, CartesianIndex((1, 13,))) == false
44 # @test checkbounds(Bool, A, CartesianIndex((6, 12,))) == false
40 @test checkbounds(Bool, A, CartesianIndex((1, 1,))) == false
41 @test checkbounds(Bool, A, CartesianIndex((1, 12,))) == false
42 @test checkbounds(Bool, A, CartesianIndex((5, 12,))) == false
43 @test checkbounds(Bool, A, CartesianIndex((1, 13,))) == false
44 @test checkbounds(Bool, A, CartesianIndex((6, 12,))) == false
4545 end
4646
4747 @testset "mix of CartesianIndex and Int" begin
6767 @test checkbounds(Bool, A, 1:61) == false
6868 @test checkbounds(Bool, A, 2, 2, 2, 1:1) == true # extra indices
6969 @test checkbounds(Bool, A, 2, 2, 2, 1:2) == false
70 # @test checkbounds(Bool, A, 1:5, 1:4) == false # TODO: PLI
71 # @test checkbounds(Bool, A, 1:5, 1:12) == false
72 # @test checkbounds(Bool, A, 1:5, 1:13) == false
73 # @test checkbounds(Bool, A, 1:6, 1:12) == false
70 @test checkbounds(Bool, A, 1:5, 1:4) == false
71 @test checkbounds(Bool, A, 1:5, 1:12) == false
72 @test checkbounds(Bool, A, 1:5, 1:13) == false
73 @test checkbounds(Bool, A, 1:6, 1:12) == false
7474 end
7575
7676 @testset "logical" begin
8282 @test checkbounds(Bool, A, trues(61)) == false
8383 @test checkbounds(Bool, A, 2, 2, 2, trues(1)) == true # extra indices
8484 @test checkbounds(Bool, A, 2, 2, 2, trues(2)) == false
85 # @test checkbounds(Bool, A, trues(5), trues(12)) == false # TODO: PLI
86 # @test checkbounds(Bool, A, trues(5), trues(13)) == false
87 # @test checkbounds(Bool, A, trues(6), trues(12)) == false
85 @test checkbounds(Bool, A, trues(5), trues(12)) == false
86 @test checkbounds(Bool, A, trues(5), trues(13)) == false
87 @test checkbounds(Bool, A, trues(6), trues(12)) == false
8888 @test checkbounds(Bool, A, trues(5, 4, 3)) == true
8989 @test checkbounds(Bool, A, trues(5, 4, 2)) == false
9090 @test checkbounds(Bool, A, trues(5, 12)) == false
416416 @test A[] == B[] == 0
417417 @test A == B
418418 else
419 # TODO: Re-enable after PLI deprecation
420 # @test_throws BoundsError A[] = 0
421 # @test_throws BoundsError B[] = 0
422 # @test_throws BoundsError A[]
423 # @test_throws BoundsError B[]
419 @test_throws BoundsError A[] = 0
420 @test_throws BoundsError B[] = 0
421 @test_throws BoundsError A[]
422 @test_throws BoundsError B[]
424423 end
425424 end
426425
152152
153153 # Test that Core and Base are free of ambiguities
154154 # not using isempty so this prints more information when it fails
155 @test filter(detect_ambiguities(Core, Base; imported=true, recursive=true, ambiguous_bottom=false)) do meths
156 # start, next, done fallbacks have ambiguities, but the iteration
157 # protocol prevents those from arising in practice.
158 !(meths[1].name in (:start, :next, :done))
159 end == []
155 @test detect_ambiguities(Core, Base; imported=true, recursive=true, ambiguous_bottom=false) == []
160156 # some ambiguities involving Union{} type parameters are expected, but not required
161157 @test !isempty(detect_ambiguities(Core, Base; imported=true, ambiguous_bottom=true))
162158
23872387 test_zeros(zeros(Int, (2, 3)), Matrix{Int}, (2,3))
23882388
23892389 # #19265"
2390 @test_throws Any zeros(Float64, [1.]) # TODO: Tighten back up to MethodError once 0.7 deprecations are removed
2390 @test_throws MethodError zeros(Float64, [1.])
2391 @test_throws MethodError ones(Float64, [0, 0])
23912392 end
23922393
23932394 # issue #11053
24302431 @test_throws BoundsError checkbounds(zeros(2,3,0), 2, 3)
24312432 end
24322433
2433 # TODO: Enable this testset after the deprecations introduced in 0.7 are removed
2434 # @testset "indexing by Bool values" begin
2435 # @test_throws ArgumentError zeros(2)[false]
2436 # @test_throws ArgumentError zeros(2)[true]
2437 # end
2434 @testset "indexing by Bool values" begin
2435 @test_throws ArgumentError zeros(Float64, 2)[false]
2436 @test_throws ArgumentError zeros(Float64, 2)[true]
2437 end
24382438
24392439 @testset "issue 24707" begin
24402440 @test eltype(Vector{Tuple{V}} where V<:Integer) >: Tuple{Integer}
216216 @check_bit_operation setindex!(b1, true) T
217217 @check_bit_operation setindex!(b1, false) T
218218 else
219 # TODO: Re-enable after PLI deprecation is removed
220 # @test_throws getindex(b1)
221 # @test_throws setindex!(b1, true)
222 # @test_throws setindex!(b1, false)
219 @test_throws BoundsError getindex(b1)
220 @test_throws BoundsError setindex!(b1, true)
221 @test_throws BoundsError setindex!(b1, false)
223222 end
224223 end
225224
590590 @test broadcast(==, 1, AbstractArray) == false
591591 end
592592
593 @testset "broadcasting falls back to iteration (issues #26421, #19577, #23746)" begin
594 @test_throws ArgumentError broadcast(identity, Dict(1=>2))
595 @test_throws ArgumentError broadcast(identity, (a=1, b=2))
596 @test_throws ArgumentError length.(Dict(1 => BitSet(1:2), 2 => BitSet(1:3)))
597 @test_throws MethodError broadcast(identity, Base)
598
599 @test broadcast(identity, Iterators.filter(iseven, 1:10)) == 2:2:10
600 d = Dict([1,2] => 1.1, [3,2] => 0.1)
601 @test length.(keys(d)) == [2,2]
602 @test Set(exp.(Set([1,2,3]))) == Set(exp.([1,2,3]))
603 end
604
593605 # Test that broadcasting identity where the input and output Array shapes do not match
594606 # yields the correct result, not merely a partial copy. See pull request #19895 for discussion.
595607 let N = 5
650662 @test_throws DimensionMismatch (1, 2) .+ (1, 2, 3)
651663 end
652664
653 # TODO: Enable after deprecations introduced in 0.7 are removed.
654 # @testset "scalar .=" begin
655 # A = [[1,2,3],4:5,6]
656 # A[1] .= 0
657 # @test A[1] == [0,0,0]
658 # @test_throws ErrorException A[2] .= 0
659 # @test_throws MethodError A[3] .= 0
660 # A = [[1,2,3],4:5]
661 # A[1] .= 0
662 # @test A[1] == [0,0,0]
663 # @test_throws ErrorException A[2] .= 0
664 # end
665 @testset "scalar .=" begin
666 A = [[1,2,3],4:5,6]
667 A[1] .= 0
668 @test A[1] == [0,0,0]
669 @test_throws ErrorException A[2] .= 0
670 @test_throws MethodError A[3] .= 0
671 A = [[1,2,3],4:5]
672 A[1] .= 0
673 @test A[1] == [0,0,0]
674 @test_throws ErrorException A[2] .= 0
675 end
665676
666677 # Issue #22180
667678 @test convert.(Any, [1, 2]) == [1, 2]
13631363 @test Expr(:error, "more types than arguments for ccall") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B,),)))
13641364 @test Expr(:error, "more types than arguments for ccall") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B, C), )))
13651365 @test Expr(:error, "more types than arguments for ccall") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B..., C...), )))
1366 @test Expr(:error, "only the trailing ccall argument type should have '...'") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B..., C...), x)))
1367 @test Expr(:error, "only the trailing ccall argument type should have '...'") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B..., C...), x, y, z)))
1366 @test Expr(:error, "only the trailing ccall argument type should have \"...\"") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B..., C...), x)))
1367 @test Expr(:error, "only the trailing ccall argument type should have \"...\"") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B..., C...), x, y, z)))
13681368 @test Expr(:error, "more types than arguments for ccall") == Meta.lower(@__MODULE__, :(ccall(:fn, A, (B, C...), )))
13691369
13701370 # cfunction on non-function singleton
2020 tvals = Int[take!(c) for i in 1:10^6]
2121 @test pvals == tvals
2222
23 # Uncomment line below once deprecation support has been removed.
24 # @test_throws MethodError Channel()
23 @test_throws MethodError Channel()
2524 @test_throws ArgumentError Channel(-1)
2625 @test_throws InexactError Channel(1.5)
2726 end
229228 redirect_stderr(oldstderr)
230229 close(newstderr[2])
231230 end
232 Base._wait(t)
231 Base.wait(t)
233232 @test run[] == 3
234233 @test fetch(errstream) == """
235234 error in running finalizer: ErrorException("task switch not allowed from inside gc finalizer")
267266 testerr = ErrorException("expected")
268267 @async Base.throwto(t, testerr)
269268 @test try
270 Base._wait(t)
269 Base.wait(t)
271270 false
272271 catch ex
273272 ex
158158
159159 filter!(!in(skip_tests), tests)
160160
161 explicit_pkg = "OldPkg/pkg" in tests
162161 explicit_pkg3 = "Pkg/pkg" in tests
163162 explicit_libgit2 = "LibGit2/online" in tests
164163 new_tests = String[]
176175 end
177176 filter!(x -> (x != "stdlib" && !(x in STDLIBS)) , tests)
178177 append!(tests, new_tests)
179 explicit_pkg || filter!(x -> x != "OldPkg/pkg", tests)
180178 explicit_pkg3 || filter!(x -> x != "Pkg/pkg", tests)
181179 explicit_libgit2 || filter!(x -> x != "LibGit2/online", tests)
182180
99 # demonstrate some of the type-size limits
1010 @test Core.Compiler.limit_type_size(Ref{Complex{T} where T}, Ref, Ref, 100, 0) == Ref
1111 @test Core.Compiler.limit_type_size(Ref{Complex{T} where T}, Ref{Complex{T} where T}, Ref, 100, 0) == Ref{Complex{T} where T}
12
1213 let comparison = Tuple{X, X} where X<:Tuple
1314 sig = Tuple{X, X} where X<:comparison
1415 ref = Tuple{X, X} where X
15 @test Core.Compiler.limit_type_size(sig, comparison, comparison, 100, 10) == comparison
16 @test Core.Compiler.limit_type_size(sig, ref, comparison, 100, 10) == ref
17 @test Core.Compiler.limit_type_size(Tuple{sig}, Tuple{ref}, comparison, 100, 10) == Tuple{ref}
18 @test Core.Compiler.limit_type_size(sig, ref, Tuple{comparison}, 100, 10) == sig
19 end
16 @test Core.Compiler.limit_type_size(sig, comparison, comparison, 100, 100) == Tuple{Tuple, Tuple}
17 @test Core.Compiler.limit_type_size(sig, ref, comparison, 100, 100) == Tuple{Any, Any}
18 @test Core.Compiler.limit_type_size(Tuple{sig}, Tuple{ref}, comparison, 100, 100) == Tuple{Tuple{Any, Any}}
19 @test Core.Compiler.limit_type_size(sig, ref, Tuple{comparison}, 100, 100) == Tuple{Tuple{X, X} where X<:Tuple, Tuple{X, X} where X<:Tuple}
20 @test Core.Compiler.limit_type_size(ref, sig, Union{}, 100, 100) == ref
21 end
22
23 let ref = Tuple{T, Val{T}} where T<:Val
24 sig = Tuple{T, Val{T}} where T<:(Val{T} where T<:Val)
25 @test Core.Compiler.limit_type_size(sig, ref, Union{}, 100, 100) == Tuple{Val, Val}
26 @test Core.Compiler.limit_type_size(ref, sig, Union{}, 100, 100) == ref
27 end
28 let ref = Tuple{T, Val{T}} where T<:(Val{T} where T<:(Val{T} where T<:(Val{T} where T<:Val)))
29 sig = Tuple{T, Val{T}} where T<:(Val{T} where T<:(Val{T} where T<:(Val{T} where T<:(Val{T} where T<:Val))))
30 @test Core.Compiler.limit_type_size(sig, ref, Union{}, 100, 100) == Tuple{Val, Val}
31 @test Core.Compiler.limit_type_size(ref, sig, Union{}, 100, 100) == ref
32 end
33
2034
2135 # PR 22120
2236 function tmerge_test(a, b, r, commutative=true)
558572
559573
560574 # issue #5575: inference with abstract types on a reasonably complex method tree
561 zeros5575(::Type{T}, dims::Tuple{Vararg{Any,N}}) where {T,N} = Array{T,N}(dims)
575 zeros5575(::Type{T}, dims::Tuple{Vararg{Any,N}}) where {T,N} = Array{T,N}(undef, dims)
562576 zeros5575(dims::Tuple) = zeros5575(Float64, dims)
563577 zeros5575(::Type{T}, dims...) where {T} = zeros5575(T, dims)
564578 zeros5575(a::AbstractArray) = zeros5575(a, Float64)
570584 @test Base.return_types(f5575, ())[1] == Vector
571585
572586 g5575() = zeros(Type[Float64][1], 1)
573 @test_broken Base.return_types(g5575, ())[1] == Vector # This should be fixed by removing deprecations
587 @test Base.return_types(g5575, ())[1] == Vector
574588
575589
576590 # make sure Tuple{unknown} handles the possibility that `unknown` is a Vararg
814828
815829 # nfields tfunc on `DataType`
816830 let f = ()->Val{nfields(DataType[Int][1])}
817 @test f() == Val{0}
831 @test f() == Val{length(DataType.types)}
818832 end
819833
820834 # inference on invalid getfield call
9861000 @test isdefined_tfunc(Core.SimpleVector, Const(1)) === Const(false)
9871001 @test Const(false) ⊑ isdefined_tfunc(Const(:x), Symbol)
9881002 @test Const(false) ⊑ isdefined_tfunc(Const(:x), Const(:y))
989 @test isdefined_tfunc(Vector{Int}, Const(1)) == Bool
990 @test isdefined_tfunc(Vector{Any}, Const(1)) == Bool
1003 @test isdefined_tfunc(Vector{Int}, Const(1)) == Const(false)
1004 @test isdefined_tfunc(Vector{Any}, Const(1)) == Const(false)
9911005 @test isdefined_tfunc(Module, Any, Any) === Union{}
9921006 @test isdefined_tfunc(Module, Int) === Union{}
9931007 @test isdefined_tfunc(Tuple{Any,Vararg{Any}}, Const(0)) === Const(false)
628628 @test !isdefined(a, :foo)
629629 @test !isdefined(2, :a)
630630
631 @test_throws TypeError isdefined(2)
631 @test_throws TypeError isdefined(Base, 2)
632 @test_throws ArgumentError isdefined(2)
632633 end
633634
634635 let
24492450 # pull request #9534
24502451 @test_throws BoundsError((1, 2), 3) begin; a, b, c = 1, 2; end
24512452 let a = []
2452 @test_broken try; a[]; catch ex; (ex::BoundsError).a === a && ex.i == (1,); end # TODO: Re-enable after PLI
2453 @test try; a[]; catch ex; (ex::BoundsError).a === a && ex.i == (); end
24532454 @test_throws BoundsError(a, (1, 2)) a[1, 2]
24542455 @test_throws BoundsError(a, (10,)) a[10]
24552456 end
113113 # BEGIN 0.7 deprecations
114114
115115 @testset "parser syntax deprecations" begin
116 # Test empty logs for meta.parse depwarn argument.
117 @test_logs Meta.parse("1.+2", depwarn=false)
118
119 # #19089
120 @test (@test_deprecated Meta.parse("1.+2")) == :(1 .+ 2)
121
122 # #16356
123 @test (@test_deprecated Meta.parse("0xapi")) == :(0xa * pi)
124
125 # #22523 #22712
126 @test (@test_deprecated Meta.parse("a?b:c")) == :(a ? b : c)
127 @test (@test_deprecated Meta.parse("a ?b:c")) == :(a ? b : c)
128 @test (@test_deprecated Meta.parse("a ? b:c")) == :(a ? b : c)
129 @test (@test_deprecated Meta.parse("a ? b :c")) == :(a ? b : c)
130 @test (@test_deprecated Meta.parse("?")) == Symbol("?")
131
132 # #13079
133 @test (@test_deprecated Meta.parse("1<<2*3")) == :(1<<(2*3))
134
135 # ([#19157], [#20418]).
136 @test remove_linenums!(@test_deprecated Meta.parse("immutable A; end")) ==
137 remove_linenums!(:(struct A; end))
138 @test remove_linenums!(@test_deprecated Meta.parse("type A; end")) ==
139 remove_linenums!(:(mutable struct A; end))
140
141 # #19987
142 @test remove_linenums!(@test_deprecated Meta.parse("try ; catch f() ; end")) ==
143 remove_linenums!(:(try ; catch; f() ; end))
144
145116 # #15524
146117 # @test (@test_deprecated Meta.parse("for a=b f() end")) == :(for a=b; f() end)
147118 @test_broken length(Test.collect_test_logs(()->Meta.parse("for a=b f() end"))[1]) > 0
148
149 # #23076
150 @test (@test_deprecated Meta.parse("[a,b;]")) == :([a;b])
151
152 # #24452
153 @test (@test_deprecated Meta.parse("(a...)")) == :((a...,))
154 end
155
156
157 @testset "lowering syntax deprecations" begin
158 # #16295
159 @test_deprecated Meta.lower(@__MODULE__, :(A.(:+)(a,b) = 1))
160
161 # #11310
162 @test_deprecated r"parametric method syntax" Meta.lower(@__MODULE__, :(f{T}(x::T) = 1))
163
164 # #17623
165 @test_deprecated r"Deprecated syntax `function .+(...)`" Meta.lower(@__MODULE__, :(function .+(a,b) ; end))
166
167 # #21774 (more uniform let expressions)
168 @test_deprecated Meta.lower(@__MODULE__, Expr(:let, :a))
169 @test_deprecated Meta.lower(@__MODULE__, Expr(:let, :a, :(a=1), :(b=1)))
170
171 # #23157 (Expression heads for types renamed)
172 @test_deprecated Meta.lower(@__MODULE__, Expr(:type, true, :A, Expr(:block)))
173 @test_deprecated Meta.lower(@__MODULE__, Expr(:bitstype, 32, :A))
174
175 # #15032
176 @test_deprecated Meta.lower(@__MODULE__, :(a.(b) = 1))
177
178 # #5332
179 @test_deprecated Meta.lower(@__MODULE__, :(a.'))
180
181 # #19324
182 @test_deprecated r"implicit assignment to global" eval(
183 :(module M19324
184 x=1
185 for i=1:10
186 x += i
187 end
188 end))
189
190 # #24221
191 @test_deprecated r"underscores as an rvalue" Meta.lower(@__MODULE__, :(a=_))
192
193 # #22314
194 @test_deprecated r"Use of final value of loop variable `i`.*is deprecated. In the future the variable will be local to the loop instead." Meta.lower(@__MODULE__, :(
195 function f()
196 i=0
197 for i=1:10
198 end
199 i
200 end))
201 @test_deprecated r"Loop variable `i` overwrites a variable in an enclosing scope" eval(:(
202 module M22314
203 i=10
204 for i=1:10
205 end
206 end))
207
208 # #6080
209 @test_deprecated r"Syntax `&argument`.*is deprecated" Meta.lower(@__MODULE__, :(ccall(:a, Cvoid, (Cint,), &x)))
210 end
211
212 module LogTest
213 function bar(io)
214 info(io,"barinfo")
215 warn(io,"barwarn")
216 Base.display_error(io,"barerror",backtrace())
217 end
218 function pooh(io)
219 info(io,"poohinfo")
220 warn(io,"poohwarn")
221 Base.display_error(io,"pooherror",backtrace())
222 end
223 end
224 function foo(io)
225 info(io,"fooinfo")
226 warn(io,"foowarn")
227 Base.display_error(io,"fooerror",backtrace())
228 end
229
230 # Silence the flurry of depwarns for now.
231 with_logger(NullLogger()) do
232
233 @testset "Deprecated logging" begin
234
235 # Test info
236 @test occursin("INFO:", sprint(info, "test"))
237 @test occursin("INFO: test", sprint(info, "test"))
238 @test occursin("INFO: test 123", sprint(info, "test ", 1, 2, 3))
239 @test occursin("MYINFO: test", sprint(io->info(io,"test", prefix="MYINFO: ")))
240
241 # Test warn
242 @test occursin("WARNING: test", sprint(Base.warn_once, "test"))
243 @test isempty(sprint(Base.warn_once, "test"))
244
245 @test occursin("WARNING:", sprint(warn))
246 @test occursin("WARNING: test", sprint(warn, "test"))
247 @test occursin("WARNING: test 123", sprint(warn, "test ", 1, 2, 3))
248 @test occursin("MYWARNING: test", sprint(io->warn(io, "test", prefix="MYWARNING: ")))
249 @test occursin("WARNING: testonce", sprint(io->warn(io, "testonce", once=true)))
250 @test isempty(sprint(io->warn(io, "testonce", once=true)))
251 @test !isempty(sprint(io->warn(io, "testonce", once=true, key=hash("testonce",hash("testanother")))))
252 let bt = backtrace()
253 ws = split(chomp(sprint(io->warn(io, "test", bt = bt))), '\n')
254 bs = split(chomp(sprint(Base.show_backtrace, bt)), '\n')
255 @test occursin("WARNING: test", ws[1])
256 for (l,b) in zip(ws[2:end],bs[2:end])
257 @test occursin(b, l)
258 end
259 end
260
261 # PR #16213
262 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
263 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
264 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
265
266
267 logging(devnull, LogTest, :bar; kind=:info)
268 @test all(occursin.(["WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
269 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
270 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
271
272 logging(devnull, LogTest; kind=:info)
273 @test all(occursin.(["WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
274 @test all(occursin.(["WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
275 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
276
277 logging(devnull; kind=:info)
278 @test all(occursin.(["WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
279 @test all(occursin.(["WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
280 @test all(occursin.(["WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
281
282 logging(kind=:info)
283 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
284 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
285 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
286
287
288 logging(devnull, LogTest, :bar; kind=:warn)
289 @test all(occursin.(["INFO: barinfo", "ERROR: \"barerror\""], sprint(LogTest.bar)))
290 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
291 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
292
293 logging(devnull, LogTest; kind=:warn)
294 @test all(occursin.(["INFO: barinfo", "ERROR: \"barerror\""], sprint(LogTest.bar)))
295 @test all(occursin.(["INFO: poohinfo", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
296 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
297
298 logging(devnull; kind=:warn)
299 @test all(occursin.(["INFO: barinfo", "ERROR: \"barerror\""], sprint(LogTest.bar)))
300 @test all(occursin.(["INFO: poohinfo", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
301 @test all(occursin.(["INFO: fooinfo", "ERROR: \"fooerror\""], sprint(foo)))
302
303 logging(kind=:warn)
304 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
305 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
306 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
307
308
309 logging(devnull, LogTest, :bar; kind=:error)
310 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn"], sprint(LogTest.bar)))
311 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
312 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
313
314 logging(devnull, LogTest; kind=:error)
315 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn"], sprint(LogTest.bar)))
316 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn"], sprint(LogTest.pooh)))
317 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
318
319 logging(devnull; kind=:error)
320 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn"], sprint(LogTest.bar)))
321 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn"], sprint(LogTest.pooh)))
322 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn"], sprint(foo)))
323
324 logging(kind=:error)
325 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
326 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
327 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
328
329
330 logging(devnull, LogTest, :bar)
331 @test sprint(LogTest.bar) == ""
332 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
333 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
334
335 logging(devnull, LogTest)
336 @test sprint(LogTest.bar) == ""
337 @test sprint(LogTest.pooh) == ""
338 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
339
340 logging(devnull)
341 @test sprint(LogTest.bar) == ""
342 @test sprint(LogTest.pooh) == ""
343 @test sprint(foo) == ""
344
345 logging()
346 @test all(occursin.(["INFO: barinfo", "WARNING: barwarn", "ERROR: \"barerror\""], sprint(LogTest.bar)))
347 @test all(occursin.(["INFO: poohinfo", "WARNING: poohwarn", "ERROR: \"pooherror\""], sprint(LogTest.pooh)))
348 @test all(occursin.(["INFO: fooinfo", "WARNING: foowarn", "ERROR: \"fooerror\""], sprint(foo)))
349
350 end # @testset
351
352 end
353
354 # The old iteration protocol shims deprecation test
355 struct DelegateIterator{T}
356 x::T
357 end
358 Base.start(itr::DelegateIterator) = start(itr.x)
359 Base.next(itr::DelegateIterator, state) = next(itr.x, state)
360 Base.done(itr::DelegateIterator, state) = done(itr.x, state)
361
362 @testset "Iteration protocol" begin
363 let A = [1], B = [], C = DelegateIterator([1]), D = DelegateIterator([]), E = Any[1,"abc"]
364 @test (@test_deprecated next(A, start(A))[1]) == 1
365 @test @test_deprecated done(A, next(A, start(A))[2])
366 @test @test_deprecated done(B, start(B))
367 @test (@test_deprecated next(C, start(C))[1]) == 1
368 @test @test_deprecated done(C, next(C, start(C))[2])
369 @test @test_deprecated done(D, start(D))
370 @test (@test_deprecated next(E, next(E, start(E))[2])[1]) == "abc"
371 end
372
373 # rest with state from old iteration protocol
374 @test (@test_deprecated collect(Iterators.rest(1:6, Base.start(1:6)))) == collect(1:6)
375119 end
376120
377121 # END 0.7 deprecations
211211 @test !occursin("import Base.Array", err_str)
212212
213213 Array() = 1
214 err_str = @except_str Array(1) MethodError
214 err_str = @except_str Array([1]) MethodError
215215 @test occursin("import Base.Array", err_str)
216216
217217 end
101101 @test false
102102 end === false
103103 end
104 Base._wait(t)
104 Base.wait(t)
105105 unlock(l)
106106 @test_throws ErrorException unlock(l)
107107 end
111111 @noinline function f6597(c)
112112 t = @async nothing
113113 finalizer(t -> c[] += 1, t)
114 Base._wait(t)
114 Base.wait(t)
115115 @test c[] == 0
116 Base._wait(t)
116 Base.wait(t)
117117 nothing
118118 end
119119 let c = Ref(0),
293293 @inferred parse(Int, "12")
294294 @inferred parse(Float64, "12")
295295 @inferred parse(Complex{Int}, "12")
296 @test eltype([parse(Int, s, 16) for s in String[]]) == Int
296 @test eltype([parse(Int, s, base=16) for s in String[]]) == Int
297297 @test eltype([parse(Float64, s) for s in String[]]) == Float64
298298 @test eltype([parse(Complex{Int}, s) for s in String[]]) == Complex{Int}
299 @test eltype([tryparse(Int, s, 16) for s in String[]]) == Union{Nothing, Int}
299 @test eltype([tryparse(Int, s, base=16) for s in String[]]) == Union{Nothing, Int}
300300 @test eltype([tryparse(Float64, s) for s in String[]]) == Union{Nothing, Float64}
301301 @test eltype([tryparse(Complex{Int}, s) for s in String[]]) == Union{Nothing, Complex{Int}}
302302 end
234234 [:Base64, :CRC32c, :Dates, :DelimitedFiles, :Distributed, :FileWatching, :Markdown,
235235 :Future, :Libdl, :LinearAlgebra, :Logging, :Mmap, :Printf,
236236 :Profile, :Random, :Serialization, :SharedArrays, :SparseArrays, :SuiteSparse, :Test,
237 :Unicode, :REPL, :InteractiveUtils, :OldPkg, :Pkg, :LibGit2, :SHA, :UUIDs, :Sockets,
237 :Unicode, :REPL, :InteractiveUtils, :Pkg, :LibGit2, :SHA, :UUIDs, :Sockets,
238238 :Statistics, ]),
239239 # Plus precompilation module generated at build time
240240 let id = Base.PkgId("__PackagePrecompilationStatementModule")
130130 end
131131 empty!(open_streams)
132132 for tsk in tasks
133 Base._wait(tsk)
133 Base.wait(tsk)
134134 end
135135 empty!(tasks)
136136 end
2626 end
2727
2828 function test_code_reflections(tester, freflect)
29 test_code_reflection(freflect, contains,
30 Tuple{AbstractString, Regex}, tester) # abstract type
29 test_code_reflection(freflect, occursin,
30 Tuple{Regex, AbstractString}, tester) # abstract type
3131 test_code_reflection(freflect, +, Tuple{Int, Int}, tester) # leaftype signature
3232 test_code_reflection(freflect, +,
3333 Tuple{Array{Float32}, Array{Float32}}, tester) # incomplete types
265265 @test datatype_alignment(UInt16) == 2
266266 @test datatype_alignment(TLayout) == 4
267267 let rts = return_types(TLayout)
268 @test length(rts) >= 3 # general constructor, specific constructor, and call-to-convert adapter(s)
268 @test length(rts) == 2 # general constructor and specific constructor
269269 @test all(rts .== TLayout)
270270 end
271271
13731373 end
13741374
13751375 # issue #27352
1376 mktemp() do fname, io
1377 redirect_stdout(io) do
1378 @test_deprecated print(nothing)
1379 @test_deprecated print(stdout, nothing)
1380 @test_deprecated string(nothing)
1381 @test_deprecated string(1, "", nothing)
1382 @test_deprecated let x = nothing; "x = $x" end
1383 @test let x = nothing; "x = $(repr(x))" end == "x = nothing"
1384 @test_deprecated `/bin/foo $nothing`
1385 @test_deprecated `$nothing`
1386 end
1387 end
1376 @test_throws ArgumentError print(nothing)
1377 @test_throws ArgumentError print(stdout, nothing)
1378 @test_throws ArgumentError string(nothing)
1379 @test_throws ArgumentError string(1, "", nothing)
1380 @test_throws ArgumentError let x = nothing; "x = $x" end
1381 @test let x = nothing; "x = $(repr(x))" end == "x = nothing"
1382 @test_throws ArgumentError `/bin/foo $nothing`
1383 @test_throws ArgumentError `$nothing`
13881384
13891385 struct X28004
13901386 value::Any
5858
5959 let a, p
6060 a = Base.Condition()
61 @async begin
61 t = @async begin
6262 p = run(pipeline(yescmd,devnull), wait=false)
6363 Base.notify(a,p)
6464 @test !success(p)
6565 end
6666 p = wait(a)
6767 kill(p)
68 wait(t)
6869 end
6970
7071 if valgrind_off
143144 end
144145
145146 # Here we test that if we close a stream with pending writes, we don't lose the writes.
146 proc = open(`$catcmd -`, "r+")
147 write(proc, str)
148 close(proc.in)
149 str2 = read(proc, String)
150 @test str2 == str
147 @sync begin
148 proc = open(`$catcmd -`, "r+")
149 @async begin
150 write(proc, str) # TODO: use Base.uv_write_async to restore the intended functionality of this test
151 close(proc.in)
152 end
153 str2 = read(proc, String)
154 @test str2 == str
155 end
151156
152157 # This test hangs if the end-of-run-walk-across-uv-streams calls shutdown on a stream that is shutting down.
153158 file = tempname()
357362 @test isempty(read(out))
358363 @test eof(out)
359364 @test desc == "Pipe($infd open => $outfd active, 0 bytes waiting)"
360 Base._wait(t)
365 Base.wait(t)
361366 end
362367
363368 # issue #8529
414419 @test Base.shell_split("\"\\\\\"") == ["\\"]
415420
416421 # issue #13616
417 @test_throws ErrorException collect(eachline(pipeline(`$catcmd _doesnt_exist__111_`, stderr=devnull)))
422 pcatcmd = `$catcmd _doesnt_exist__111_`
423 let p = eachline(pipeline(`$catcmd _doesnt_exist__111_`, stderr=devnull))
424 @test_throws(ErrorException("failed process: Process($pcatcmd, ProcessExited(1)) [1]"),
425 collect(p))
426 end
418427
419428 # make sure windows_verbatim strips quotes
420429 if Sys.iswindows()
421 read(`cmd.exe /c dir /b spawn.jl`, String) == read(Cmd(`cmd.exe /c dir /b "\"spawn.jl\""`, windows_verbatim=true), String)
430 @test read(`cmd.exe /c dir /b spawn.jl`, String) == read(Cmd(`cmd.exe /c dir /b "\"spawn.jl\""`, windows_verbatim=true), String)
422431 end
423432
424433 # make sure Cmd is nestable
479488 Base.link_pipe!(out, reader_supports_async=true)
480489 Base.link_pipe!(inpt, writer_supports_async=true)
481490 p = run(pipeline(catcmd, stdin=inpt, stdout=out, stderr=devnull), wait=false)
482 @async begin # feed cat with 2 MB of data (zeros)
491 t = @async begin # feed cat with 2 MB of data (zeros)
483492 write(inpt, zeros(UInt8, 1048576 * 2))
484493 close(inpt)
485494 end
488497 close(out.in) # make sure we can still close the write end
489498 @test sizeof(read(out)) == 1048576 * 2 # make sure we get all the data
490499 @test success(p)
500 wait(t)
491501 end
492502
493503 # `kill` error conditions
593603 end
594604 end
595605 end
606
607 # Issue #27550: make sure `peek` works when slurping a Char from an AbstractPipe
608 open(`$catcmd`, "r+") do f
609 t = @async begin
610 write(f, "δ")
611 close(f.in)
612 end
613 @test read(f, Char) == 'δ'
614 wait(t)
615 end
273273 # test replace with a count for String and GenericString
274274 # check that replace is a no-op if count==0
275275 for s in ["aaa", Test.GenericString("aaa")]
276 # @test replace("aaa", 'a' => 'z', count=0) == "aaa" # enable when undeprecated
276 @test replace("aaa", 'a' => 'z', count=0) == "aaa"
277277 @test replace(s, 'a' => 'z', count=1) == "zaa"
278278 @test replace(s, 'a' => 'z', count=2) == "zza"
279279 @test replace(s, 'a' => 'z', count=3) == "zzz"
162162 @test_throws BoundsError A[end+1, 1, 1, trailing3...]
163163 @test_throws BoundsError A[1, 0, 1, trailing3...]
164164 @test_throws BoundsError A[1, end+1, 1, trailing3...]
165 # TODO: PLI (re-enable after 0.7)
166 # @test_throws BoundsError A[1, 0]
167 # @test_throws BoundsError A[1, end+1]
168 # @test_throws BoundsError A[1, 1, 0]
169 # @test_throws BoundsError A[1, 1, end+1]
170 # @test_throws BoundsError A[0, 1]
171 # @test_throws BoundsError A[end+1, 1]
172 # @test_throws BoundsError A[0, 1, 1]
173 # @test_throws BoundsError A[end+1, 1, 1]
174 # @test_throws BoundsError A[1, 0, 1]
175 # @test_throws BoundsError A[1, end+1, 1]
165 @test_throws BoundsError A[1, 0]
166 @test_throws BoundsError A[1, end+1]
167 @test_throws BoundsError A[1, 1, 0]
168 @test_throws BoundsError A[1, 1, end+1]
169 @test_throws BoundsError A[0, 1]
170 @test_throws BoundsError A[end+1, 1]
171 @test_throws BoundsError A[0, 1, 1]
172 @test_throws BoundsError A[end+1, 1, 1]
173 @test_throws BoundsError A[1, 0, 1]
174 @test_throws BoundsError A[1, end+1, 1]
176175 end
177176
178177 function dim_break_linindex(I)
520520 global x = 2
521521 local x = 1
522522 end")) == Expr(:error, "variable \"x\" declared both local and global")
523
523 #=
524524 @test Meta.lower(Main, Meta.parse("let
525525 local x = 2
526526 local x = 1
533533 @test Meta.lower(Main, Meta.parse("let x = 2
534534 local x = 1
535535 end")) == Expr(:error, "local \"x\" declared twice")
536
536 =#
537537 # issue #23673
538538 @test :(let $([:(x=1),:(y=2)]...); x+y end) == :(let x = 1, y = 2; x+y end)
539539
10831083 @test_throws ParseError Meta.parse("@ time")
10841084
10851085 # issue #7479
1086 @test Meta.lower(Main, Meta.parse("(true &&& false)")) == Expr(:error, "misplaced \"&\" expression")
1086 @test Meta.lower(Main, Meta.parse("(true &&& false)")) == Expr(:error, "invalid syntax &false")
10871087
10881088 # if an indexing expression becomes a cat expression, `end` is not special
10891089 @test_throws ParseError Meta.parse("a[end end]")
12991299 @test length(ex.args) == 3
13001300 end
13011301
1302 # TODO: enable when 0.7 deprecations are removed
1303 #@test Meta.parse("\"x\"
1304 # # extra line, not a doc string
1305 # f(x) = x", 1)[1] === "x"
1306 #@test Meta.parse("\"x\"
1307 #
1308 # f(x) = x", 1)[1] === "x"
1302 @test Meta.parse("\"x\"
1303 # extra line, not a doc string
1304 f(x) = x", 1)[1] === "x"
1305 @test Meta.parse("\"x\"
1306
1307 f(x) = x", 1)[1] === "x"
13091308
13101309 # issue #26137
13111310 # cases where parens enclose argument lists
15831582 end
15841583 @test (@macroexpand @foo28244(kw)) == Expr(:call, GlobalRef(@__MODULE__,:bar), Expr(:kw))
15851584 @test eval(:(@macroexpand @foo28244($(Symbol("let"))))) == Expr(:error, "malformed expression")
1585
1586 # #16356
1587 @test_throws ParseError Meta.parse("0xapi")
1588
1589 # #22523 #22712
1590 @test_throws ParseError Meta.parse("a?b:c")
1591 @test_throws ParseError Meta.parse("a ?b:c")
1592 @test_throws ParseError Meta.parse("a ? b:c")
1593 @test_throws ParseError Meta.parse("a ? b :c")
1594 @test_throws ParseError Meta.parse("?")
1595
1596 # #13079
1597 @test Meta.parse("1<<2*3") == :((1<<2)*3)
1598
1599 # #19987
1600 @test_throws ParseError Meta.parse("try ; catch f() ; end")
1601
1602 # #23076
1603 @test :([1,2;]) == Expr(:vect, Expr(:parameters), 1, 2)
1604
1605 # #24452
1606 @test Meta.parse("(a...)") == Expr(Symbol("..."), :a)
1607
1608 # #19324
1609 @test_throws UndefVarError(:x) eval(:(module M19324
1610 x=1
1611 for i=1:10
1612 x += i
1613 end
1614 end))
1615
1616 # #22314
1617 function f22314()
1618 i = 0
1619 for i = 1:10
1620 end
1621 i
1622 end
1623 @test f22314() == 0
1624
1625 module M22314
1626 i = 0
1627 for i = 1:10
1628 end
1629 end
1630 @test M22314.i == 0
1631
1632 # #6080
1633 @test Meta.lower(@__MODULE__, :(ccall(:a, Cvoid, (Cint,), &x))) == Expr(:error, "invalid syntax &x")
1634
1635 @test_throws ParseError Meta.parse("x.'")
1636 @test_throws ParseError Meta.parse("0.+1")
1637
1638 # #24221
1639 @test Meta.isexpr(Meta.lower(@__MODULE__, :(a=_)), :error)
1640
1641 for ex in [:([x=1]), :(T{x=1})]
1642 @test Meta.lower(@__MODULE__, ex) == Expr(:error, string("misplaced assignment statement in \"", ex, "\""))
1643 end