Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

(Newbie question)

For every function I define I get this message:

enter image description here

When I close and reopen Mathematica, and re-enter the function definition, I don't get the message anymore. What does it mean?

share|improve this question
2  
You can see that f is already defined because it's coloured black. You can verify this using ?f too. Instead of the drastic Remove[f] you can also use Clear[f] to clear all definitions, or f =. to remove f's value if f is a simple variable (in Mathematica terms: it only has OwnValues but not DownValues). –  Szabolcs Jun 13 '12 at 7:29
    
@Szabolcs - Thanks again. I should have known better than to use a single letter as a function or variable name :-/. But this was meant to be a quickie :-) –  stevenvh Jun 13 '12 at 7:31
2  
You may find this discussion of some relevance. –  Leonid Shifrin Jun 13 '12 at 9:00

1 Answer 1

up vote 5 down vote accepted

It means you set f = 156 sometime before you executed that function definition. Executing a Remove[f] before your new definition should have fixed the problem.

share|improve this answer
    
Thanks. Makes sense. But I also got this in a new notebook. Does that mean that the scope of symbols is session-wide instead of notebook-constrained? (Not what I would expect) –  stevenvh Jun 13 '12 at 7:19
    
Yes, session-wide. If you want to constrain your symbols to a particular notebook, see this question. –  J. M. Jun 13 '12 at 7:25
2  
@stevenvh The kernel state is not specific to the notebook. You have to restart the kernel to clear its state completely. But if you want notebook-local symbols, you can use Evaluation -> Notebook's Default Context -> Unique to This Notebook. This option is available since version 6. –  Szabolcs Jun 13 '12 at 7:25
    
Thanks, J.M. and @Szabolcs. Szabolcs, I learned about it browsing through the list of SE sites at the top of another SE site's page. I'm mostly active in electronics.SE now, but registered in a dozen or so. –  stevenvh Jun 13 '12 at 7:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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