From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.devel Subject: Re: Help making setq work on dynamic symbol Date: Fri, 18 Oct 2024 11:02:16 -0400 Message-ID: References: <86sestmp6l.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000006bf9e00624c1977d" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14014"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 18 17:02:56 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 1t1oVE-0003V4-K1 for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Oct 2024 17:02:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1oUt-0008UT-K3; Fri, 18 Oct 2024 11:02:35 -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 1t1oUq-0008U3-Tl for emacs-devel@gnu.org; Fri, 18 Oct 2024 11:02:33 -0400 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1oUo-0004aM-80; Fri, 18 Oct 2024 11:02:32 -0400 Original-Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3e5fcf464ecso1102131b6e.0; Fri, 18 Oct 2024 08:02:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729263748; x=1729868548; darn=gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IRnQd+E95mwTL2lXQsBKyX3QhTyyu9zeoZ9pzd6vcm8=; b=jI8Rh51/AIct3iC/V0DIOHd0KnXevqYE7RVqsyGDpIz+lv/EkgNireZ7FvVrDJKm/7 TCA+mo1k7sWBqMm2BCzA4q/guaaERJpYoWr+iEphcsTqxZochR3wGht4I1+gBtVhWkW+ BbNeGKctTyIOVIC+JNYJCMu5Q303zOaeyCYzIj1VyHmhazxiFkYW7v+9cgVKypSwC3AX iVN1yKvSUZtjnDMm3zz/FF1H7ZzD8a73XNYiKh7fp1Ztqelh/3uOkGjgPmYfzIpT+mue 1dWuAVGUn2txOy4b2+Gg8mPa4CUuMDGNzk877f7jGZqbk2Qkp6aVjg/Acb2RcpqAenDO LPcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729263748; x=1729868548; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IRnQd+E95mwTL2lXQsBKyX3QhTyyu9zeoZ9pzd6vcm8=; b=dCbqLPO2VyLMtqE5dkl74EivwUJ3y2ynOxHmoNcaUnWJL6zRKTqEZEqmDpJV1hayOt 90TV3m+vCbkwHKr3N4h9fs0ffg7IB65JQViV9aD1lcV6Ly+4Vp5PndlEGBSBMMRqlZc7 LcgujALDky2unW6KO+3hG3exU8YbU9NH5QUa4ac1KLKWxBf6zzktmhNIc8zzG7S8AYHo 4SBEpwCZGYfTkgOytjHrMltvpbwFpfDj9sbIOJJJK4fqfl25SkOas255OH/v7Ve1ixDX fSyNjahKM69lNa2vugb0Qr0lS7gZcdhxJXzcBM5GI+1rFGZmkCm2qs/t8WWthy+wDVC6 DWJw== X-Gm-Message-State: AOJu0YxcWQKdilxnm2urHsQCB1fqQ2R3B3g+3Hyw3/opzor2KaJpXsbb opo/LytMgizY3NYxdJbPCDIDXD5FdY6w2vfPT+MKJeJ3ZiUn5fBvAMSMFy6Ox5+TtyE6r7bIZfd DcaHkOF3y6OcYNVhQu4gbl8aTNxJoxCK+ X-Google-Smtp-Source: AGHT+IGW9urvBFG1/r06WpqxRUbXg9zsW1UocmRnL6CwKMmLAVNlcXBl8sOZFXRIKlEtPONLOy3ZUFdOXI8MZSzGZW0= X-Received: by 2002:a05:6808:19a2:b0:3e5:fd5b:c2f1 with SMTP id 5614622812f47-3e602c8493dmr2751688b6e.13.1729263747984; Fri, 18 Oct 2024 08:02:27 -0700 (PDT) In-Reply-To: <86sestmp6l.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::234; envelope-from=shipmints@gmail.com; helo=mail-oi1-x234.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:324659 Archived-At: --0000000000006bf9e00624c1977d Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Yessir. This fails, too, in the same way when I expect it to work: (setq (intern (concat "f" "oo"))) t) On Fri, Oct 18, 2024 at 11:00=E2=80=AFAM Eli Zaretskii wrote= : > > 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. > --0000000000006bf9e00624c1977d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Yessir. This fails, too, in the same way when I expect it to work:
=

(setq (intern (con= cat "f" "oo"))) t)

On Fri, Oct 18, 2024 at 11:00= =E2=80=AFAM Eli Zaretskii <eliz@gnu.org<= /a>> wrote:
&= gt; From: Ship Mints <shipmints@gmail.com>
> Date: Fri, 18 Oct 2024 10:40:47 -0400
>
> (defmacro my/setq (name value)
>=C2=A0 =C2=A0(let ((sym (intern name)))
>=C2=A0 =C2=A0 =C2=A0`(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 &qu= ot;f" "oo"))
>=C2=A0 =C2=A0intern((concat "f" "oo"))
>=C2=A0 =C2=A0(let ((sym (intern name))) (list 'setq sym value))
>=C2=A0 =C2=A0(closure (t) (name value) (let ((sym (intern name))) (list= 'setq sym value)))((concat "f" "oo") t)
>=C2=A0 =C2=A0macroexpand((my/setq (concat "f" "oo")= t))
>=C2=A0 =C2=A0elisp--eval-last-sexp(nil)

my/setq is a macro, not a function.
--0000000000006bf9e00624c1977d--