Any way to get Mathematica to remove the Locked attribute?

Obviously, Mathematica can remove this attribute; it just didn't let me. Does anyone know any hacks to get Mathematica to do what I say?

+5
source share
1 answer

This is not a positive answer.

One particular use case that might require the removal of an attribute Lockedwould be a local character modification, for example. InternalInheritedBlock`. Often this definition scheme is used to change / remove attributes of locally system characters to give different behavior for the block area (see, for example, this answer ).

, , 38 Locked ( , Quiet[Needs /@ Contexts[]]!) , , , (, Flat, Orderless, Hold*** ..) Options, . , System`, . I, List True. 3 , , :

(* Symbol *)                 (* Attributes *)              (* Options *)
Remove                       {HoldAll, Locked, Protected}  {}
$ProductInformation          {Locked, Protected}           {"ProductIDName" -> "Mathematica", "ProductKernelName" -> "Mathematica 9 Kernel", "ProductVersion" -> "9.0 for Microsoft Windows (64-bit) (January 25, 2013)", "ProductVersionNumber" -> 9.}
Developer`StartProtectedMode {Locked, Protected}           {"Allow" -> Null, "Deny" -> Null, "Execute" -> {}, "Read" -> {}, "ReadWrite" -> {}, "Write" -> {}}

, , , , Locked - . iff, ReadProtected, , Mathematica, (, , ). ( , ):

I                    (* with {Locked, Protected, ReadProtected} *)
$InputStreamMethods  (* with {Locked, Protected, ReadProtected} *)
$OutputStreamMethods (* with {Locked, Protected, ReadProtected} *)

, Locked / , , I $Input , .

, Locked Locked ( v9, v8 Protected), , . Locked = Sequence[] . Attributes SetAttributes , , , .

, , , , . , , , , , Locked.

+3

All Articles