unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <embe8573@student.uu.se>
To: help-gnu-emacs@gnu.org
Subject: Re: etymology of obarray
Date: Fri, 16 May 2014 20:46:01 +0200	[thread overview]
Message-ID: <87egztv9xy.fsf@debian.uxu> (raw)
In-Reply-To: ll5l7g016id@news3.newsguy.com

"B. T. Raven" <btraven@nihilo.net> writes:

>> Where does the word obarray originate?  What is
>> "ob"?
>
> I think it's 'object', i.e. anything that (type-of)
> returns. E.g.  (type-of 'type-of) returns > symbol,
> (type-of 1) returns > integer, etc.  There is or was
> also an oblist, which includes the same kind of info
> in a list rather than a vector.

The documentation - (describe-variable 'obarray) -
reads:

    Symbol table for use by `intern' and `read'.
    It is a vector whose length ought to be prime for best results.
    The vector's contents don't make sense if examined from Lisp programs;
    to find all the symbols in an obarray, use `mapatoms'.

Crystal clear! :)

Here is an example of how to use the obarray - to echo
simple variable values without fuss -

(defun describe-variable-short (var)
  (interactive
   (let*((v            (variable-at-point))
         (var-at-point (not (eq v 0)))
         (v-name       (if var-at-point (symbol-name v)))
         (v-final
          (completing-read
           (format " variable%s: " (if var-at-point
                                       (format " (default %s)" v)
                                       ""))
           obarray
           (lambda (vv)
             (or (get vv 'variable-documentation)
                 (boundp vv) ))
           t    ; require match
           nil  ; no insert to minibuffer (?)
           nil  ; no history
           v-name
          )))
   `(,(intern v-final)) ))
  (message (format " %s: %s" (symbol-name var) (symbol-value var))) )

-- 
underground experts united:
http://user.it.uu.se/~embe8573


  reply	other threads:[~2014-05-16 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1490.1400258061.1147.help-gnu-emacs@gnu.org>
2014-05-16 17:57 ` etymology of obarray Emanuel Berg
2014-05-16 18:41   ` Pascal J. Bourguignon
2014-05-16 18:25 ` B. T. Raven
2014-05-16 18:46   ` Emanuel Berg [this message]
2014-05-16 16:33 Joe Riel

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=87egztv9xy.fsf@debian.uxu \
    --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.
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).