Jump to content

Recommended Posts

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?

 

Link to post
Share on other sites
(setf a 100)
a
=> 100

(makunbound 'a)
a
=> > Error: Unbound variable: a

 

The simples way is to give the variable 'a new value. :smile:

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.

 

Link to post
Share on other sites

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".

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

Terms of Use Privacy Policy