unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Interning Symbols
@ 2009-11-11 18:47 Nordlöw
  2009-11-12  6:26 ` Kevin Rodgers
  0 siblings, 1 reply; 2+ messages in thread
From: Nordlöw @ 2009-11-11 18:47 UTC (permalink / raw)
  To: help-gnu-emacs

Is it possible to intern a symbol and make it have a property whose
value is a references to a another object like we do with setf()?

If I want to copy a symbol along with all its 4 components into
another obarray do I have to manually copy (using get and set) the
value, function def and property-list?

/Nordlöw


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Interning Symbols
  2009-11-11 18:47 Interning Symbols Nordlöw
@ 2009-11-12  6:26 ` Kevin Rodgers
  0 siblings, 0 replies; 2+ messages in thread
From: Kevin Rodgers @ 2009-11-12  6:26 UTC (permalink / raw)
  To: help-gnu-emacs

Nordlöw wrote:
> Is it possible to intern a symbol and make it have a property whose
> value is a references to a another object like we do with setf()?

Do you mean, does this work:

(setq my-obarray (make-vector 1021 0))

(setf (get (intern "foo" my-obarray) 'some-property)
       (evaluates-to-some-object))

I don't know why it wouldn't:

(require 'cl)
(macroexpand (quote ...)) =>

(let* ((--cl-var-- (intern "foo" my-obarray))) (put --cl-var-- (quote 
some-property) (evaluates-to-some-object)))

> If I want to copy a symbol along with all its 4 components into
> another obarray do I have to manually copy (using get and set) the
> value, function def and property-list?

Yes.

-- 
Kevin Rodgers
Denver, Colorado, USA





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-11-12  6:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-11 18:47 Interning Symbols Nordlöw
2009-11-12  6:26 ` Kevin Rodgers

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).