Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4397

Unprotect

From Themis Matsoukas <tmatsoukas@me.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Unprotect
Date 2011-08-14 12:22 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j28elu$3ev$1@smc.vnet.net> (permalink)

Show all headers | View raw


I want to redefine a build in command. I use the following example:

Unprotect[Entropy];
Entropy[x_] := 1/x
Entropy[10.]

When I execute these commands on a fresh kernel I get:

SetDelayed::write: Tag Entropy in Entropy[x_] is Protected. >>

$Failed

Entropy::targ: Argument 10.` at position 1 should be a List, a SparseArray, or a String. >>

Entropy[10.]

If I execute a second time I get my definition to work but I still get a warning about the arguments:

Entropy::targ: Argument 10.` at position 1 should be a List, a SparseArray, or a String. >>

0.1

So, two questions:
1. Do I have to execute twice to cause a custom definition to stick?
2. How do I get rid of the warning once the custom definition works?

Running 8.01 on Lion.

{"8.0 for Mac OS X x86 (64-bit) (February 24, 2011)", 1}

Themis

Back to comp.soft-sys.math.mathematica | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Unprotect Themis Matsoukas <tmatsoukas@me.com> - 2011-08-14 12:22 +0000
  Re: Unprotect "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-08-15 00:20 +0000

csiph-web