all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Greg Hill <ghill@synergymicro.com>
Subject: Moving a symbol from one obarray to another
Date: Mon, 23 Dec 2002 19:22:09 -0800	[thread overview]
Message-ID: <p04310102ba2d82209f6f@[198.17.100.22]> (raw)
In-Reply-To: <Pine.LNX.4.33.0212101959450.9731-100000@mug.sys.virginia.edu>

My objective is to move a symbol from one obarray to another.  The 
following routine seems to do that ok.

(defun move-symbol (sym-name from-obarray to-obarray)
   "Move symbol named SYM-NAME from FROM-OBARRAY to TO-OBARRAY"
   (let ((old-sym (intern-soft sym-name from-obarray))
           (new-sym (intern sym-name to-obarray)) )
     (set new-sym (symbol-value old-sym))
     (fset new-sym (symbol-function old-sym))
     (setplist new-sym (symbol-plist old-sym))
     (unintern sym-name from-obarray) ))

My question is, is there a more efficient way to do that, e.g. 
without creating a whole new symbol and destroying the old one?

--Greg

  parent reply	other threads:[~2002-12-24  3:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-06 14:24 xml indenting, possibly with psgml? Bjoern
2002-12-06 15:55 ` Jim Crossley
2002-12-10 23:13   ` Bjoern
2002-12-11 20:34     ` Kai Großjohann
2002-12-06 16:19 ` Stefan Monnier <foo@acm.com>
2002-12-10 23:29   ` Bjoern
2002-12-11  0:32     ` Bjoern
2002-12-11  1:32       ` Self-documentation adjustment David Forrest
2002-12-11 14:25         ` Stefan Monnier <foo@acm.com>
2002-12-11 14:53         ` Kevin Rodgers
2002-12-24  3:22         ` Greg Hill [this message]
2003-01-10  5:33   ` xml indenting, possibly with psgml? Gman
2003-01-12 20:46     ` Stefan Monnier <foo@acm.com>
2002-12-06 21:45 ` Michael Slass

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='p04310102ba2d82209f6f@[198.17.100.22]' \
    --to=ghill@synergymicro.com \
    /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.