all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: obarray
Date: Tue, 17 Dec 2013 03:11:45 +0100	[thread overview]
Message-ID: <87r49cp6o5.fsf@nl106-137-194.student.uu.se> (raw)
In-Reply-To: mailman.9442.1387244871.10748.help-gnu-emacs@gnu.org

Michael Heerdegen <michael_heerdegen@web.de> writes:

>> Is there a way to confirm this? How can I access a
>> symbol's value, if the symbol isn't in the obarray?
>> If it isn't in the obarray, where is it? Is there a
>> buffer and/or "scope" (i.e. form or process)
>> local/temporary object array or anything of the
>> like?
>
> No.  They are just existing in memory, and will not be
> garage collected, as long as they can be referenced
> from Lisp.  There is also no array of all existing
> strings, of all window configurations, etc.  So you
> can't tell Lisp to give you a complete list of all
> currently existing strings, window configurations, or
> (uninterned) symbols.  There is just no need to
> organize those objects in a user visible structure.

OK.

> OTOH, an uninterned symbol can be used like any other
> symbol: it can be set, used to hold a function, etc.
>
>> You can access it the same way you can access the
>> contents of arrays and lists -- by getting to it from
>> some other variable (or cons cell or array element)
>> that references it. That's what the variable
>> uninterned-symbol is for.  (symbol-value
>> uninterned-symbol) => bar
>
> Of course, this is not very useful, it was just a
> demonstration, not a realistic use case.

Yes :)

> When using uninterned symbols in macros, you can
> "paste" these symbols in the expansion code which
> will be evaluated at run-time.  So, programs _can_
> contain uninterned symbols; you can really _use_
> uninterned symbols in code.  Not in code read from a
> file or buffer, but in code generated by macros.
> This way, you avoid that you accidentally use a
> symbol that is already "in use" (e.g. in the code the
> macro transforms).

Yes, this much I understood, only it was hard to
visualize in practice. So: the macro accept code *as
arguments* (code that isn't evaluated) and transforms
that code? Then I get it. I thought the macro just
produced new code, in what case I can't see how it
could be useful because either no one knows about the
macro so no one will use any symbols it may setup, *or*
the macro knows about itself so any references to what
is setup locally will be correct.

-- 
Emanuel Berg, programmer-for-rent. CV, projects, etc at uXu
underground experts united:  http://user.it.uu.se/~embe8573


  parent reply	other threads:[~2013-12-17  2:11 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-15  0:54 obarray Emanuel Berg
2013-12-15  1:14 ` obarray Juanma Barranquero
     [not found] ` <mailman.9268.1387070101.10748.help-gnu-emacs@gnu.org>
2013-12-15  1:37   ` obarray Emanuel Berg
2013-12-15  1:56     ` obarray Michael Heerdegen
2013-12-15  1:59     ` obarray Juanma Barranquero
     [not found]     ` <mailman.9271.1387072648.10748.help-gnu-emacs@gnu.org>
2013-12-15  4:17       ` obarray Emanuel Berg
2013-12-15  4:17     ` obarray Barry Margolin
2013-12-15  4:47       ` obarray Michael Heerdegen
2013-12-15  4:55       ` obarray Emanuel Berg
2013-12-15  6:04         ` obarray Barry Margolin
2013-12-15 17:43           ` obarray Emanuel Berg
2013-12-16 17:44             ` obarray Barry Margolin
2013-12-17  1:47               ` obarray Michael Heerdegen
     [not found]               ` <mailman.9442.1387244871.10748.help-gnu-emacs@gnu.org>
2013-12-17  2:11                 ` Emanuel Berg [this message]
2013-12-17  2:55                   ` obarray Michael Heerdegen
     [not found]                   ` <mailman.9452.1387248989.10748.help-gnu-emacs@gnu.org>
2013-12-17  3:01                     ` obarray Emanuel Berg
2013-12-17 17:32                       ` obarray Barry Margolin
2013-12-17 17:42                         ` obarray Emanuel Berg
     [not found]       ` <mailman.9279.1387082898.10748.help-gnu-emacs@gnu.org>
2013-12-15  5:11         ` obarray Emanuel Berg
2013-12-15  5:36           ` obarray Emanuel Berg
2013-12-15  6:17             ` obarray Michael Heerdegen
     [not found]             ` <mailman.9283.1387088419.10748.help-gnu-emacs@gnu.org>
2013-12-15 17:51               ` obarray Emanuel Berg
2013-12-15  6:15           ` obarray Michael Heerdegen
     [not found]           ` <mailman.9282.1387088166.10748.help-gnu-emacs@gnu.org>
2013-12-15 17:47             ` obarray Emanuel Berg
2013-12-15  5:58         ` obarray Barry Margolin
2013-12-15 17:28           ` obarray Emanuel Berg
2013-12-17 14:38 ` obarray jack-mac

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

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

  git send-email \
    --in-reply-to=87r49cp6o5.fsf@nl106-137-194.student.uu.se \
    --to=embe8573@student.uu.se \
    --cc=help-gnu-emacs@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.