all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Help making setq work on dynamic symbol
@ 2024-10-18 14:40 Ship Mints
  2024-10-18 15:00 ` Eli Zaretskii
  0 siblings, 1 reply; 7+ messages in thread
From: Ship Mints @ 2024-10-18 14:40 UTC (permalink / raw)
  To: Emacs Devel

[-- Attachment #1: Type: text/plain, Size: 658 bytes --]

Probably something silly but this seems esoteric enough to ask.

On Emacs 29.4:

(defmacro my/setq (name value)
  (let ((sym (intern name)))
    `(setq ,sym ,value)))
(defvar foo nil)
(my/setq "foo" t) ; this works
(intern (concat "f" "oo")) ; this works
(my/setq (concat "f" "oo") t) ; this fails with...

Debugger entered--Lisp error: (wrong-type-argument stringp (concat "f"
"oo"))
  intern((concat "f" "oo"))
  (let ((sym (intern name))) (list 'setq sym value))
  (closure (t) (name value) (let ((sym (intern name))) (list 'setq sym
value)))((concat "f" "oo") t)
  macroexpand((my/setq (concat "f" "oo") t))
  elisp--eval-last-sexp(nil)

TIA,

-Stephane

[-- Attachment #2: Type: text/html, Size: 1804 bytes --]

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

end of thread, other threads:[~2024-10-18 15:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-18 14:40 Help making setq work on dynamic symbol Ship Mints
2024-10-18 15:00 ` Eli Zaretskii
2024-10-18 15:02   ` Ship Mints
2024-10-18 15:18     ` Visuwesh
2024-10-18 15:20     ` Andreas Schwab
2024-10-18 15:24       ` Ship Mints
2024-10-18 15:53         ` Ship Mints

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.