Skip to content

revise .' deprecation message and add related TODOs to base/deprecated.jl #25463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1740,6 +1740,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