From dbceb14bf4b3febe6a9ebe976102d1185affe603 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 20 Dec 2017 13:37:10 -0500 Subject: [PATCH 1/2] remove `MethodTable` method this is not really needed, and was getting defined twice --- base/reflection.jl | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/base/reflection.jl b/base/reflection.jl index a6acf20394778..9e3882ef7172f 100644 --- a/base/reflection.jl +++ b/base/reflection.jl @@ -1089,13 +1089,8 @@ end Make method `m` uncallable and force recompilation of any methods that use(d) it. """ function delete_method(m::Method) - ccall(:jl_method_table_disable, Cvoid, (Any, Any), MethodTable(m), m) -end - -function MethodTable(m::Method) - ft = ccall(:jl_first_argument_datatype, Any, (Any,), m.sig) - ft == C_NULL && error("Method ", m, " does not correspond to a function type") - (ft::DataType).name.mt + ft = ccall(:jl_first_argument_datatype, Any, (Any,), m.sig) # should not be NULL + ccall(:jl_method_table_disable, Cvoid, (Any, Any), (ft::DataType).name.mt, m) end """ From 32ae4e8f068ec928ad5b758869a809d513b28ddc Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Wed, 20 Dec 2017 13:59:25 -0500 Subject: [PATCH 2/2] Rename `postfixapostrophize` to `apostrophe` and fix method overwrite --- base/boot.jl | 2 -- base/operators.jl | 4 ++-- src/julia-syntax.scm | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/base/boot.jl b/base/boot.jl index d9194a79f1b87..2bdea7c7f0234 100644 --- a/base/boot.jl +++ b/base/boot.jl @@ -208,8 +208,6 @@ macro _noinline_meta() Expr(:meta, :noinline) end -function postfixapostrophize end - struct BoundsError <: Exception a::Any i::Any diff --git a/base/operators.jl b/base/operators.jl index 99a7bea638a19..6c2c27ab3c54f 100644 --- a/base/operators.jl +++ b/base/operators.jl @@ -739,8 +739,8 @@ fldmod1(x::T, y::T) where {T<:Real} = (fld1(x,y), mod1(x,y)) # efficient version for integers fldmod1(x::T, y::T) where {T<:Integer} = (fld1(x,y), mod1(x,y)) -# postfix apostophre -Core.postfixapostrophize(x) = Adjoint(x) +# postfix apostrophe +apostrophe(x) = Adjoint(x) """ adjoint(A) diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 1dbd50c752d17..cb09e34edae3d 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -2378,7 +2378,7 @@ ,.(apply append rows))) `(call (top typed_vcat) ,t ,@a))))) - '|'| (lambda (e) (expand-forms `(call (core postfixapostrophize) ,(cadr e)))) + '|'| (lambda (e) (expand-forms `(call (top apostrophe) ,(cadr e)))) '|.'| (lambda (e) (begin (deprecation-message (string "The syntax `.'` for transposition is deprecated, " "and the special lowering of `.'` in multiplication " "(`*`), left-division (`\\`), and right-division (`/`) "