Skip to content

Commit aeb6cb7

Browse files
mbaumanJeffBezanson
authored andcommitted
Taking transpose deprecation messages seriously (#25491)
Simplfiy transpose syntax .' deprecation
1 parent 5d6dc89 commit aeb6cb7

File tree

1 file changed

+6
-34
lines changed

1 file changed

+6
-34
lines changed

src/julia-syntax.scm

Lines changed: 6 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2344,40 +2344,12 @@
23442344
`(call (top typed_vcat) ,t ,@a)))))
23452345

23462346
'|'| (lambda (e) (expand-forms `(call (top adjoint) ,(cadr e))))
2347-
'|.'| (lambda (e) (begin (deprecation-message (string "The syntax `.'` for transposition is deprecated, "
2348-
"and the special lowering of `.'` in multiplication "
2349-
"(`*`), left-division (`\\`), and right-division (`/`) "
2350-
"operations, for example `A.'*B` lowering to `At_mul_B(A, B)`, "
2351-
"`A\\B.'` lowering to `A_ldiv_Bt(A, B)`, and `A.'/B.'` "
2352-
"lowering to `At_rdiv_Bt(A, B)`, has been removed "
2353-
"in favor of lazy transposition via `transpose`, "
2354-
"a corresponding lazy `Transpose` wrapper type, and "
2355-
"dispatch on that type. Two rewrites for `A.'` for "
2356-
"matrix `A` exist: "
2357-
"`transpose(A)`, which yields a lazily transposed "
2358-
"version of `A` (often by wrapping in the `Transpose` type), "
2359-
"and `copy(transpose(A))` which lazily transposes "
2360-
"`A` as above and then materializes that lazily "
2361-
"transposed `A` into a freshly allocated matrix "
2362-
"of `A`'s type. Which rewrite is appropriate depends on "
2363-
"context: If `A.'` appears in a multiplication, "
2364-
"left-division, or right-division operation that "
2365-
"was formerly specially lowered to an `A_mul_B`-like "
2366-
"call, then the lazy `transpose(A)` is the correct "
2367-
"replacement and will result in dispatch to a method "
2368-
"equivalent to the former `A_mul_B`-like call. For "
2369-
"example, `A.'*B`, formerly yielding `At_mul_B(A, B)`, "
2370-
"should be rewritten `transpose(A)*B`, which will "
2371-
"dispatch to a method equivalent to the former "
2372-
"`At_mul_B(A, B)` method. If `A.'` appears outside "
2373-
"such an operation, then `copy(transpose(A))` is the "
2374-
"functionally equivalent rewrite. For vector `A`, `A.'` already "
2375-
"transposed lazily to a `RowVector`, so `transpose(A)`, "
2376-
"which now yields a `Transpose`-wrapped vector "
2377-
"behaviorally equivalent to the former `RowVector`, "
2378-
"is always the correct rewrite for vectors. For "
2379-
"more information, see issue #5332 on Julia's "
2380-
"issue tracker on GitHub." #\newline) #f)
2347+
'|.'| (lambda (e) (begin (deprecation-message (string "The postfix .' syntax is deprecated. "
2348+
"For vector v in v.', use transpose(v) "
2349+
"instead. For matrix A in A.', use "
2350+
"copy(transpose(A)) instead, unless A.' "
2351+
"appears as an argument of *, / or \\. In "
2352+
"those cases, use transpose(A) instead. " #\newline) #f)
23812353
(return (expand-forms `(call transpose ,(cadr e))))))
23822354

23832355
'generator

0 commit comments

Comments
 (0)