Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

In a few Mma notebooks I've seen this line:

Clear[Evaluate[Context[] <> "*"]];

I suspect that it kind of "clears" whatever there might be before using this notebook, just in case there are some rules interfering with it. But how exactly does this work? I understand the Clear and Evaluate commands, but what about the Context[] <> "*" part?

share|improve this question
6  
It clears all the definitions for symbols in the current context. A context is like a namespace. This is actually well covered in the documentation... have you tried reading the help files for Evaluate, Context and Clear? The documentation also shows this example here. You should make a stronger effort to learn things by making use of the documentation. Try to use this site only for situations where the documentation is very vague or you had difficulties understanding or if it is not covered. – rm -rf Sep 29 '12 at 19:43
3  
Except for a very convoluted line, you should be able to understand its behavior by reading the help and executing the parts of the command one at a time. That is part of the learning curve ... – belisarius Sep 29 '12 at 20:41
2  
@mbork Mathematica has a very steep learning curve, perhaps steeper than any "popular" language. We know of the difficulties on finding information on the docs, so we do accept beginner's questions, but usually if they show some effort on their part. That is just because we don't want rewriting the help system here. Good luck with your deadline! Remember that sometimes more basic and short questions can be asked in chat – belisarius Sep 29 '12 at 21:37
1  
Well, I do understand that. I admit that Mathematica is not similar to many other things, and I guess this contributes to the steep learning curve: I don't have a good mental model of how it works. (Well, I can see some similarities to Lisp, of course, and even to TeX, which - as a programming language - is even more esoteric, but has e.g. a similar notion of "expansion" (called "evaluation" in Mma); still, Mma seems to be very different. What would help is a tutorial giving some kind of broad landscape. L. Shifrin's book is very nice, but too comprehensive for that; – mbork Sep 29 '12 at 22:09
1  
I hope I didn't come off as too harsh; that wasn't the intention. It has generally been a policy to encourage users to make a good effort to read the documentation first. Beginner's questions are always welcome, but RTFM ones generally get closed. However, we do make it a point to either post an answer or explain in the comments, so the door is never shut in their face :) Please do drop by chat for simple questions. Our chatroom is pretty active and lively and people are very helpful. If someone can't help in a few mins or requires more work, then they'll encourage you to post it as a question – rm -rf Sep 30 '12 at 2:44
show 3 more comments

closed as too localized by belisarius, rcollyer, F'x, Ajasja, Mr.Wizard Sep 30 '12 at 8:29

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.