August 30, 20169 yr Hi, quick question: Is there a way to clear all the evaluated variables / functions, or I mean, reset and re-initialize? For now every time I've done something wrong, I quit the whole application and then re-launch it. Would love to know if there is a better way. Yuichi
August 30, 20169 yr Do you mean "Return To Top Level"? You find few commands in the Tools menu. There is never need to quit the app in order to continue.
September 1, 20169 yr Author Well, I think "Return To Top Level" is kind of the thing you use when you are stuck in an infinite loop? I meant, for example, when I declare a variable "a" and set it to an integer 100, that "a" is forever going to be stored in the memory as 100, unless I quit the program. Is there an alternative way for clearing the memory?
September 1, 20169 yr (setf a 100) a => 100 (makunbound 'a) a => > Error: Unbound variable: a The simples way is to give the variable 'a new value. You can't clear and should not play with memory there are lots of variables which are part of the system. It is a good practise to give a more meaningful name to a variable then just a one character.
September 1, 20169 yr Author Thank you for the reply. (makunbound) seems very useful! But the reason why I brought this topic was because sometimes after working on a project for a long time, trying a lot of things (usually with messy codes ;p), it is very easy to forget what variable / function names I have used before, right? The problem is: For example, let's say there's a project on which I try really hard and finally finished over a night. Maybe I get very satisfied by the result and go to bed happily. But next the morning, the code does not work. Why? Because after struggling with some codes, adding / modifying / deleting things, I sometimes delete (or change the names of) what is necessary for the project. If I initially declare a variable like "motif" and later rename it to "motif-1", (maybe because I created multiple motifs), of course I have to rewrite all of the variable names for the entire project. But due the fact that I'm a normal human, I don't always remember to properly rewrite everything. And when I forget it, does the program give me error messages? No! Because the deleted "motif" is still there in the memory and working. This is precisely why I intentionally close everything once in 30 minutes, just so that I can check that everything is okay, by just doing "evaluate all".
September 1, 20169 yr With time you will find a way how to control all this without the need to close/restart the app. I don't remember doing this, but I do remember to have the same problems you have describe above.
Create an account or sign in to comment