0
$\begingroup$

I am facing a problem in loading the package RTGC. I want to load the file EDCRTGC.m. But when I am giving the command

EDCRTGCcode.m

it shows the following error

SetDelayed: Tag Classify in Classify[x_] is Protected.

What should I do?

$\endgroup$
  • 1
    $\begingroup$ You could try to go into the package and change each occurence of Classify to classify, RTGC Classify or any other symbol that is not built-in. $\endgroup$ – Henrik Schumacher Jun 10 '18 at 7:13
  • $\begingroup$ Inside the package Classify seems like a function acting on some argument. Is this the only way? $\endgroup$ – Khushal Jun 10 '18 at 8:18
  • $\begingroup$ Quite likely. The point is that Classify has become a built-in symbol in newer versions of Mathematica so that must not be overwritten by the package. $\endgroup$ – Henrik Schumacher Jun 10 '18 at 8:20
  • $\begingroup$ You can also try to evaluate Unprotect[Classify];ClearAll[Classify]; before loading the package. $\endgroup$ – Henrik Schumacher Jun 10 '18 at 8:28
  • 1
    $\begingroup$ It should be enough to change first occurrence of Classify symbol in package file to EDCRTGC`Classify (or whatever context this package is using). You'll get shadowing warning, and context-free Classify symbol will be red, but there's nothing wrong with that. EDCRTGC`Classify and System`Classify will be separate symbols with separate definitions living in separate contexts not interfering with each other. If you don't want to edit package file, evaluation of EDCRTGC`Classify symbol, before loading the package, should also do the trick. $\endgroup$ – jkuczm Jun 10 '18 at 14:07
2
$\begingroup$

Turning a comment into an answer

You can also try to evaluate Unprotect[Classify];ClearAll[Classify]; before loading the package.

$\endgroup$
  • $\begingroup$ Might also be worth noting how dangerous this is if they ever want to use a Classifier $\endgroup$ – b3m2a1 Jun 12 '18 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.