From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Re: Re: intern a top level variable Date: Wed, 16 Aug 2023 18:13:05 +0200 Message-ID: <5306923bbfa46630b22c6dc978e89b60d0565ad9.camel@abou-samra.fr> References: Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-1gzuzqTuP2dFu6nbt7Ip" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22333"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) To: Mortimer Cladwell , guile-user@gnu.org, tomas@tuxteam.de Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Aug 16 18:13:51 2023 Return-path: Envelope-to: guile-user@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 1qWJ9b-0005bq-4C for guile-user@m.gmane-mx.org; Wed, 16 Aug 2023 18:13:51 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWJ9D-0007tM-Ra; Wed, 16 Aug 2023 12:13:27 -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 1qWJ9A-0007rI-Ak for guile-user@gnu.org; Wed, 16 Aug 2023 12:13:24 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWJ90-00037X-RQ for guile-user@gnu.org; Wed, 16 Aug 2023 12:13:23 -0400 Original-Received: from [10.102.140.73] ([193.190.193.4]) by mrelayeu.kundenserver.de (mreue012 [213.165.67.103]) with ESMTPSA (Nemesis) id 1MdNwm-1pwyKA3sFU-00ZM2Z; Wed, 16 Aug 2023 18:13:07 +0200 In-Reply-To: X-Provags-ID: V03:K1:j5VxbXtl15A8s/WPe/DhGUBxtJ8UjxBmJ+Ao++1oqO63KTrgjPm OUrmW8HN589x4RWdoeDNUwbBYkHX7uTwoetfk/3wkaZvlR9ywXSYJdO4+d3AtXGgSDg3KGl ka40SIwhdkhxgqbjJffYOsysmyU3ciBDrmz/aB2dDGWJwgjn2tWXpbCH0XCy/DmwmSI/0ME 8beTZGsbdtAh20ZSQ0nqQ== UI-OutboundReport: notjunk:1;M01:P0:heat4neQhCI=;7/FVo7y9E8gfSWY5UdXfEqmqCbk gqpylpDM0kMmeWaKtHLlwukuw11ue3h95VMiqG8yF0VnRP+l/kUYCyn7qMTLc/rUdd4BJxc0U WKP49MXEFEAHCXQWMAehHS81MEHwywVixFc8dkD8FMA+qPpn3+dWio/Ywm0dXjBh41A40TiQp wkZEOHPFgHWAvt4lftfPCHoqazjvEmY9aNwrbS3fiCcIZG8gKAjY0SPhrPfKHbZRqbuj3HdJf 6iXODE1jdWIPhjzFZftdaxn53d12yYDC5/Wmut3pUl6jZGC86v+zionrk72+FqCbDlHIJz07V 3SLQKHtcGPN3KCLC7JunofPiTPKQdjogaokGSBXQ78R+RRNQBdU1rxelJ0Bru+qcUr+zPQGXc DzjcP/TUJL8F+2qRXuAX/v5toPDz3sFz6AKwLWix0Y+SW772wr/iNGYu7JJi1TUOsy02R7dmR v7mENOtGejb1lT/PK5wTYm+XscAlat8zDL+alYiE0k2ZvtmJVJ6xzxGYldfqmwQJSrRhJ1UhZ JFdcoLaXCl6IqrKijs8d8FbBC1FBXnUbjRUuDkGpBwR0OwnBv3y44BrnaYwk6063cTa2StYUz YjLDmHf0e9A3GMMj7r163mi77yQvnzihMhGmoPQkku9lozI099lv+ry4P7ILz/nh5Dq29NWfB 0ryHiGRUWeGAzax+bSBuvTZBFuGLs/qHmPiBERyHlQRIWz6QsVCuejO5X7J+nytYbt9ff2ejL noLKmf+m9Ok8FLQBPo8lPeY4d99wW2h5svJl2As96fHDTtYhHUPmD9sZTBJ2GUA2eNw+Dbxo Received-SPF: pass client-ip=212.227.126.131; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:19167 Archived-At: --=-1gzuzqTuP2dFu6nbt7Ip Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Le mercredi 16 ao=C3=BBt 2023 =C3=A0 10:55 -0400, Mortimer Cladwell a =C3= =A9crit=C2=A0: > I would like to intern and assign a value within a method: >=20 > (define (test-intern) > (let* ((name "abc") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (data "def") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (name-symbol (gensym name)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ) > =C2=A0 (pretty-print (string-append "symbol: " (symbol->string name-symbo= l))) > =C2=A0 (set! name-symbol data))) >=20 > scheme@(guile-user)> (test-intern) > "symbol: abc3301" > scheme@(guile-user)> abc3301 > ;;; : warning: possibly unbound variable `abc3301' > ERROR: In procedure module-lookup: Unbound variable: abc3301 Sorry, but it's not clear to me what you mean by "intern and assign a value= ", and I don't think it will be clear to someone else. Can you be more precise please? I don't understand why you expect "abc3301" to be bound after running (test= - intern). That (test-intern) call just creates a symbol, which is interned a= s a symbol, meaning that creating another (interned) symbol with the same name = will reuse the same symbol value. But there is no reason why it shoud be bound t= o a variable. Symbol interning just applies to symbols as values, it has nothin= g to do with variables. --=-1gzuzqTuP2dFu6nbt7Ip Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZNz1kQAKCRCj8PYLiTOX /mIfAQCgh7Gh5uKqEdDMORCZQtnAkumNTcSbxjndNsBkE6uelgEA/nbh+LDZcZun cWikJwq386dFKObQg2C1JGABlHjE1QY= =Vl8E -----END PGP SIGNATURE----- --=-1gzuzqTuP2dFu6nbt7Ip--