unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: David Kastrup <dak@gnu.org>
Subject: Re: Mis-features of let
Date: Tue, 19 Apr 2005 23:45:01 +0200	[thread overview]
Message-ID: <85zmvuh25e.fsf@lola.goethe.zz> (raw)
In-Reply-To: 1113942696.947385.229360@o13g2000cwo.googlegroups.com

"rgb" <rbielaws@i1.net> writes:

> Now that I've slept, maybe I'll understand.  Can we try again
>
> Stefan Monnier wrote:
>> > If symbols created by let refer to an abstract concept then you're
>>
>> `let' does not create symbols.
>
> Ok, semantic error.  From the point of view of a program the
> symbol is being created and destroyed but actually it must
> just be getting interned and uninterned.

Uh, no.

> I don't know of a way to tell the difference but I can't think of a
> reason I'd need to know other than to use the correct term here.
>
> So if I conceed it isn't being `created' and you replace my
> erroneous use of create with intern does it make any difference?
> If not, what explains this?
>
> (defun test ()
>   (let (foo)
>     (put 'foo 'hold "this ")
>     (symbol-plist 'foo)))
> => test
>
> (unintern "foo")
> => t
>
> (symbol-plist 'foo)
> => nil
>
> (test)
> => (hold "this ")
>
> (symbol-plist 'foo)
> => nil
>
> The lifetime of the plist is obviously limited.

Nonsense.  How would you explain this then:

(defun test ()
  (let (foo)
     (put 'foo 'hold "this ")
     (setq woozle 'foo)
     (symbol-plist 'foo)))
=> test

(unintern "foo")
=> t

(symbol-plist 'foo)
=> nil
(test)
=> (hold "this ")
(symbol-plist 'foo)
=> nil
(symbol-plist woozle)
=> (hold "this ")

The symbol is obviously still there.  It only is no longer associated
with the same name.  But as long as you took a snapshot of the symbol
before it became anonymous (that's what woozle does), you can still
refer to that snapshot, even though the symbol itself has no longer an
accessible name.  It does have a print name, though:

woozle
=> foo

Note that woozle is no longer the same as 'foo, since the association
of the symbol stored in woozle with the default obarray does no longer
exist.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2005-04-19 21:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18 12:56 Defadvice use Matthias
2005-04-18 17:11 ` rgb
2005-04-18 17:25   ` Johan Bockgård
2005-04-18 19:05     ` rgb
2005-04-18 19:43       ` Stefan Monnier
2005-04-19  0:15         ` rgb
2005-04-19  0:28           ` Stefan Monnier
2005-04-19  3:48             ` Mis-features of let (was Defadvice use) rgb
2005-04-19  4:31               ` Mis-features of let Stefan Monnier
2005-04-19  6:38                 ` rgb
2005-04-19 12:21                   ` Stefan Monnier
2005-04-19 20:31                     ` rgb
2005-04-19 21:45                       ` David Kastrup [this message]
2005-04-19 12:55                   ` Barry Margolin
2005-04-19 20:31                     ` rgb
2005-04-20  4:12                       ` Barry Margolin
2005-04-19 21:10                     ` rgb
2005-04-19 21:57                       ` Kevin Rodgers
2005-04-19 22:00                       ` David Kastrup
2005-04-20  1:04                         ` rgb
2005-04-20 10:04                           ` David Kastrup
2005-04-20 11:57                             ` Stefan Monnier
2005-04-20 14:41                           ` Thien-Thi Nguyen
2005-04-19  9:41               ` Thien-Thi Nguyen
2005-04-19  5:07           ` Defadvice use Barry Margolin
2005-04-18 17:52 ` Stefan Monnier
2005-04-18 21:07   ` Matthias
2005-04-18 23:20     ` Stefan Monnier
2005-04-18 20:28 ` Kevin Rodgers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85zmvuh25e.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).