Skip to content

Commit

Permalink
Revise .' deprecation message and add .'-dep TODOs to base/deprecated…
Browse files Browse the repository at this point in the history
….jl. [ci skip] (#25463)
  • Loading branch information
Sacha0 authored and mbauman committed Jan 10, 2018
1 parent 2da9ddb commit 3d64d39
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
7 changes: 7 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1737,6 +1737,13 @@ end
@deprecate RowVector{T}(n::Tuple{Int,Int}) where {T} RowVector{T}(uninitialized, n)
end

# TODOs re. .' deprecation
# (1) remove .' deprecation from src/julia-syntax.scm around line 2346
# (2) remove .' documentation from base/docs/basedocs.jl around line 255
# (3) remove .'-involving code from base/show.jl around line 1277
# (4) remove .'-involving test from test/deprecation_exec.jl around line 178
# (5) remove .'-related code from src/ast.scm and src/julia-parser.scm

# A[ct]_(mul|ldiv|rdiv)_B[ct][!] methods from base/operators.jl, to deprecate
@deprecate Ac_ldiv_Bt(a,b) (\)(adjoint(a), transpose(b))
@deprecate At_ldiv_Bt(a,b) (\)(transpose(a), transpose(b))
Expand Down
27 changes: 15 additions & 12 deletions src/julia-syntax.scm
Original file line number Diff line number Diff line change
Expand Up @@ -2349,28 +2349,31 @@
"operations, for example `A.'*B` lowering to `At_mul_B(A, B)`, "
"`A\\B.'` lowering to `A_ldiv_Bt(A, B)`, and `A.'/B.'` "
"lowering to `At_rdiv_Bt(A, B)`, has been removed "
"in favor of a lazy `Transpose` wrapper type and "
"in favor of lazy transposition via `transpose`, "
"a corresponding lazy `Transpose` wrapper type, and "
"dispatch on that type. Two rewrites for `A.'` for "
"matrix `A` exist: eager or materializing `transpose(A)`, "
"which constructs a freshly allocated matrix of `A`'s type "
"and containing the transpose of `A`, and lazy "
"`Transpose(A)`, which wraps `A` in a `Transpose` "
"view type. Which rewrite is appropriate depends on "
"matrix `A` exist: "
"`transpose(A)`, which yields a lazily transposed "
"version of `A` (often by wrapping in the `Transpose` type), "
"and `copy(transpose(A))` which lazily transposes "
"`A` as above and then materializes that lazily "
"transposed `A` into a freshly allocated matrix "
"of `A`'s type. Which rewrite is appropriate depends on "
"context: If `A.'` appears in a multiplication, "
"left-division, or right-division operation that "
"was formerly specially lowered to an `A_mul_B`-like "
"call, then the lazy `Tranpose(A)` is the correct "
"call, then the lazy `transpose(A)` is the correct "
"replacement and will result in dispatch to a method "
"equivalent to the former `A_mul_B`-like call. For "
"example, `A.'*B`, formerly yielding `At_mul_B(A, B)`, "
"should be rewritten `Transpose(A)*B`, which will "
"should be rewritten `transpose(A)*B`, which will "
"dispatch to a method equivalent to the former "
"`At_mul_B(A, B)` method. If `A.'` appears outside "
"such an operation, then `transpose(A)` is the "
"correct rewrite. For vector `A`, `A.'` already "
"transposed lazily to a `RowVector`, so `Transpose(A)`. "
"such an operation, then `copy(transpose(A))` is the "
"functionally equivalent rewrite. For vector `A`, `A.'` already "
"transposed lazily to a `RowVector`, so `transpose(A)`, "
"which now yields a `Transpose`-wrapped vector "
"behaviorally equivalent to the former `RowVector` "
"behaviorally equivalent to the former `RowVector`, "
"is always the correct rewrite for vectors. For "
"more information, see issue #5332 on Julia's "
"issue tracker on GitHub." #\newline) #f)
Expand Down

0 comments on commit 3d64d39

Please sign in to comment.