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: Help making setq work on dynamic symbol Date: Fri, 18 Oct 2024 10:40:47 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000008a72d70624c14a3f" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4448"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Oct 18 16:41:44 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 1t1oAf-00012Q-O4 for ged-emacs-devel@m.gmane-mx.org; Fri, 18 Oct 2024 16:41:41 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t1oA2-0007T4-Hv; Fri, 18 Oct 2024 10:41:02 -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 1t1oA1-0007Se-4T for emacs-devel@gnu.org; Fri, 18 Oct 2024 10:41:01 -0400 Original-Received: from mail-ua1-x92e.google.com ([2607:f8b0:4864:20::92e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t1o9z-0002PB-Ji for emacs-devel@gnu.org; Fri, 18 Oct 2024 10:41:00 -0400 Original-Received: by mail-ua1-x92e.google.com with SMTP id a1e0cc1a2514c-84fd764f6ddso1177080241.1 for ; Fri, 18 Oct 2024 07:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729262458; x=1729867258; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=mkXzR+f5/JcQISQpG9vokPjz93Wh3V5QpuFGx+VUuYA=; b=I+giOPMBofksSFRT9cRR6JJ3P0cCVl0rfwGhwDMwhRjUw202Ec6xv/4ynmdzpBlnki laUmzlC2T4pmOLhmESMjM7ulsB2bVk3e53z9cNoczGcleRysQ8PkGm+QDAw5qbmgcgP5 aNdmvh8m8Ps0Srdbc6cYluksjQE2od0vryHdWDNCf/N2W22D5XawcoZjpr7BcEbS4Cba qyBAasz/LfkRyeFUVpaZqHRYRhT9gyuNQjaiJmEZ6WoCNQBYylgOgFHS08AFqiLfN2/D cz/mWUgblejIJ+e3qF6xXbUhhD4wKMei7L7EqvS/IaJgHnqWDGWde56EQD/i/BDyxN9w uJEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729262458; x=1729867258; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=mkXzR+f5/JcQISQpG9vokPjz93Wh3V5QpuFGx+VUuYA=; b=CFZxoRDkU0vNLA+SFU+cFfPC198JttGTzlN06R8spKGG8zJCxDLTQt7AFHm8sLx70R SiivzDLBRZrdqiVbfV7Tvx3TRsq5jGYmd92l2c/SVtq92E8nyq2k/u/S7EQtRNSjqDPH L0CPbDj5ze1FIKyDunAs7brQad4ElEngOBiW9aeO4smebQvGWvFOSJkbzR3q5e1vn1Bf UiRVr5a34T/axvfmIjL0M/utsNnLrw3Q9GrkNQk0SL/T96VH4GtPWsLSPeY6Op31qdW/ gVCEVXBWVdRSjKOrFurbSbnNnm5tzAYhrrR3EIagSZsGoKlNx7aRorQYTOMQ+VsdqBGi mg2g== X-Gm-Message-State: AOJu0Yx075dqD1pGNk/zqZxIlB8GTx9QOLT6c7qnUJV+Ciil4RRWcm5N DDDB6NnF4J499Qs8s/8uWgVCB4GDx+eegTB9HBsn+l6DfuNAttQnb/b2kBlRMLb1lXYdi/L4pY4 5EdZw10S/S7GYp33isAqQX96vNZ4xaqSZ X-Google-Smtp-Source: AGHT+IFENLr+NUwPJX4ACXAja9SyP2o03x1WJjP8eJmYF2XvZyhAvloSfemmIx0TgjOc9P8bMRswq1r4klWC3bekdvU= X-Received: by 2002:a05:6102:c4e:b0:4a4:82fd:368f with SMTP id ada2fe7eead31-4a5c493a6afmr5284571137.7.1729262458137; Fri, 18 Oct 2024 07:40:58 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::92e; envelope-from=shipmints@gmail.com; helo=mail-ua1-x92e.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:324656 Archived-At: --0000000000008a72d70624c14a3f Content-Type: text/plain; charset="UTF-8" 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 --0000000000008a72d70624c14a3f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Probably something silly but this seems esoteric enough to ask.

On Emacs 29.4:
=

(de= fmacro my/setq (name value)
=C2=A0 (let ((sym (intern name)))
=C2=A0 = =C2=A0 `(setq ,sym ,value)))
(defvar foo nil)
(my/setq "foo"= ; t) ; this works
(intern (concat "f" "oo")) ; this w= orks
(my/setq (concat "f" "oo") t) ; this fails with= ...

Debugger entered--Lisp error: (wrong-type-argument stringp (= concat "f" "oo"))
=C2=A0 intern((concat "f" "oo"))
=C2=A0 (let ((s= ym (intern name))) (list 'setq sym value))
=C2=A0 (closure (t) (name= value) (let ((sym (intern name))) (list 'setq sym value)))((concat &qu= ot;f" "oo") t)
=C2=A0 macroexpand((my/setq (concat "= f" "oo") t))
=C2=A0 elisp--eval-last-sexp(nil)

=

TIA,=

-Ste= phane
--0000000000008a72d70624c14a3f--