From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Help making setq work on dynamic symbol Date: Fri, 18 Oct 2024 18:00:18 +0300 Message-ID: <86sestmp6l.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8915"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ship Mints Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 18 17:01:35 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1t1oTv-00028p-Be for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Oct 2024 17:01:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1oT4-0006j7-NA; Fri, 18 Oct 2024 11:00:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1oSq-0006bv-JI for emacs-devel@gnu.org; Fri, 18 Oct 2024 11:00:34 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t1oSp-0004Lq-KZ; Fri, 18 Oct 2024 11:00:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=svulFARFiVueyxSEzgdqTMjGffAzYMJlTItOjuL/Th4=; b=rXjhSyBiyyba 7EbzuNTPjLW4Glh+PWd6dBn52iuza3qN1GwNvkHwHXMYn5hvzZ9f9XBKxGywsuLad0c+0fk+vhrGi MtOIbD9KZsXb1c33H8brV6Y/nn5c+2OMyHMlZ0IarR0u+USCPFoBiJC5ilXMKYPHOcn5c9GMXFb4P cyFuFoFHtSpSu70WlFYBQF04WeXHaKgYNn/9D9ft6ptSVGZ/qVWPXVJSC6YVrZfBjQ5dee3YDD2Yq Wn2UelnPivsLzm0K74+yaJ6Jwlwk1Ji3vhwEIfxlQwlMkg6GmrahDszfrDFmFb0wSUpVJSQXZepcH fAiemwFwB4MtAkwDSx09mA==; In-Reply-To: (message from Ship Mints on Fri, 18 Oct 2024 10:40:47 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:324657 Archived-At: > From: Ship Mints > Date: Fri, 18 Oct 2024 10:40:47 -0400 > > (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) my/setq is a macro, not a function.