Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
unintern a symbol vs set to nil
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Xah Lee  
View profile  
 More options Jun 9 2011, 6:36 pm
Newsgroups: comp.lang.lisp
From: Xah Lee <xah...@gmail.com>
Date: Thu, 9 Jun 2011 15:36:41 -0700 (PDT)
Local: Thurs, Jun 9 2011 6:36 pm
Subject: unintern a symbol vs set to nil
in a elisp program, if i have created a temp var (but not using let)
and later i want to delete the var, i can do:

(setq temp1 nil)

or is it better to do

(unintern 'temp1)

The temp1 var holds a big list, and there are few more, e.g. temp2,
temp3.

-----------------------------

Mathematica is similar to lisp in the symbol system. In Mathematica,
lisp's “unintern” is “Remove”. From my know-how, basically you don't
Remove a symbol. You just Clear it (set it to nil).

-----------------------------
if i use “let”, that means few hundred lines inside it with other
lets. Not desirable.

How do you solve this problem?

Thanks.

 Xah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Konfusius  
View profile  
 More options Jun 10 2011, 5:23 am
Newsgroups: comp.lang.lisp
From: Konfusius <wenhamm...@plus.cablesurf.de>
Date: Fri, 10 Jun 2011 02:23:00 -0700 (PDT)
Subject: Re: unintern a symbol vs set to nil
On 10 Jun., 00:36, Xah Lee <xah...@gmail.com> wrote:

you cannot delete a symbol. the garbage collection deletes objects
automatically when not referenced anymore. but since the symbol templ
is referenced by your program it cannot be deleted.

uninterning doesn't do the job either because it just causes the
reader not to recognize your symbol templ anymore. when you enter an
expression containing templ after uninterning it the reader will
create a new symbol different from your old symbol templ that just
happens to have the same name.

you also don't need to unbind templ. unbinding is done automatically
once the binding form is left.

what you actually want to do is to return templ into the state it had
when your program started. this is done by (setq templ nil).


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pascal J. Bourguignon  
View profile  
 More options Jun 12 2011, 12:44 am
Newsgroups: comp.lang.lisp
From: "Pascal J. Bourguignon" <p...@informatimago.com>
Date: Sun, 12 Jun 2011 06:44:34 +0200
Local: Sun, Jun 12 2011 12:44 am
Subject: Re: unintern a symbol vs set to nil

You shouldn't have given those explanations to Xah, now he will write
yet another article about the idiocy of lisp hackers who designed such a
system...

--
__Pascal Bourguignon__                     http://www.informatimago.com/
A bad day in () is better than a good day in {}.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jun 12 2011, 2:33 am
Newsgroups: gnu.emacs.help, comp.lang.lisp
From: Xah Lee <xah...@gmail.com>
Date: Sat, 11 Jun 2011 23:33:51 -0700 (PDT)
Local: Sun, Jun 12 2011 2:33 am
Subject: Re: unintern a symbol vs set to nil
Pascal J Bourguignon <p...@informatimago.com> wrote:

> Not at all.  (Yet some other fodder for Xah's idiocy articles, sorry).

you mean my articles describing idiots like you?

Here's a juicy passage of Pascal J Bourguignon fellow, in which you
can get a glimpse of his highness:

«Ruby's been done by some Japanese newbie...  I guess there was some
language barrier preventing him to learn from the 50 years of
occidental experience in programming language design.  At least, he
wasn't a "linguist"...  In any case, why should we suffer for THEIR
incompetences?!?»

 Xah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jun 12 2011, 8:46 am
Newsgroups: comp.lang.lisp
From: Xah Lee <xah...@gmail.com>
Date: Sun, 12 Jun 2011 05:46:27 -0700 (PDT)
Local: Sun, Jun 12 2011 8:46 am
Subject: Re: unintern a symbol vs set to nil
On Jun 10, 2:23 am, Konfusius <wenhamm...@plus.cablesurf.de> wrote:

thanks. That's useful.

 Xah


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »