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.devel Subject: Re: [PATCH] Add atomic-box-update! function to (ice-9 atomic) Date: Wed, 21 Jun 2023 18:54:57 +0200 Message-ID: <47D08644-D34F-43C2-9B0C-24A790F3CEA7@abou-samra.fr> References: <874jn0pxtz.fsf@trop.in> Mime-Version: 1.0 (1.0) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3701"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-devel@gnu.org, Andy Wingo To: Andrew Tropin Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jun 21 18:55:56 2023 Return-path: Envelope-to: guile-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 1qC17c-0000nq-GM for guile-devel@m.gmane-mx.org; Wed, 21 Jun 2023 18:55:56 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qC175-00022V-Si; Wed, 21 Jun 2023 12:55:23 -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 1qC171-0001wO-AD for guile-devel@gnu.org; Wed, 21 Jun 2023 12:55:19 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.187]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qC16x-0002nz-8m for guile-devel@gnu.org; Wed, 21 Jun 2023 12:55:17 -0400 Original-Received: from smtpclient.apple ([37.168.145.137]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.168]) with ESMTPSA (Nemesis) id 1MmUcL-1plRiP3DV3-00iX5L; Wed, 21 Jun 2023 18:55:05 +0200 In-Reply-To: <874jn0pxtz.fsf@trop.in> X-Mailer: iPhone Mail (20E252) X-Provags-ID: V03:K1:2Amh5Zn5ixuszpANG4myFqGwioJyuUWltIoyN55pqWYOfoAPaJ9 wUtJ2V0ZArpbeuUAUaEmJ0tO82iUaEPSI5wo9ClaoQkL2vcvI7mW3z2tJEyHnLUZnz5Fnvq JfssP+7WUUz7P9tdYRl6oNFXkz5BN9KrkOpQolI4iBPQUlMlK3bipAH4+UjcsOfwTUN39fu zRhOuBPtuO6UoWd5j6vQA== UI-OutboundReport: notjunk:1;M01:P0:FCx+8x/Mckg=;ovzVHHqtzEByJCedpK76FK0f4V8 OQLQYJp3oaUKv5dxTncPmxfBCCwhDTFzoJzEYtzUpOAT+7jrwqYJlPeNkolxIiS3vDvY+/lq2 zAGi4EMlOkT0vZsH34wL8DZVmDriZfL0cf82C3CRB30CcspN7Mc5EdSadBcXaOn7XGciJaW0P W0/pCnPAyoXPupZBPCPPhOuwhFQcFI9KfXEkyzOHxoAiidGP5D4FjkML9Cq88C4UM6XLmb8FQ G3k40r+u3wcv+S4dbN6J+0wvjjoSo0yN4NT/s6hZvQVNLpHpdIkmnJnsFIl99eCIf4OqRpcXp 0lOzorhOGGuyYbQ5/MFZuZ02JmpyIdtfmlR9XexHBSG4VxQTGkMgVkfpwsULvceBpGlGNkacT JjqvLxzVLl1dnGWZYjFhYVN3cNUziDJenipI0iltmHKmOe3CJ843HPyXtEP3uvHDFFhWNCb7a RA2YJZiLz085x+7JLICVKYK5gSuD3ZwE9sTI2sm+k9P8AqiHm3OzB9tsfIcrhFnaKbFmAEA8O xTDf84Zx8XMhlDXTaJ/yubpqRzyuIIbsHQQoN7HGdpWaQpWZCw4d9NbJR3hv/kfp9ToKprFAZ kC5jEuH5gKt8Pm2v9WYs/Tt8U1//YaZDQJR7zNfMU7hc1i3B35x4D4ey5oK8A40EeOozLP/Ob cmuDVEz6TnlqrJRd3QKD5gtl88oD74kXiF5006YiAQ== Received-SPF: pass client-ip=212.227.126.187; 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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:21870 Archived-At: > Le 21 juin 2023 =C3=A0 18:46, Andrew Tropin a =C3=A9crit := >=20 > Make sense, but it's hard for me to say something valuable on this > topic. Usually, I don't use eq? and don't have enough knowledge of its > internals. *Currently*, it just checks whether the two C-level SCM values are the same b= itwise, so even implicit copies of fixnums will remain eq?. In theory, Guile= could make copies of bignums. I am not aware of it doing so. However, all that is guaranteed is that (eq? a a) when a is a non-immediate (= pair, string, vector, hashtable, etc) or one of a few constants like boolean= s, the empty list and *unspecified*. Notably, it isn't guaranteed for number= s or characters. > I went the way suggested by the manual: "Returns the > previous value of the box in either case, so you can know if the swap > worked by checking if the return value is eq? to expected." >=20 > https://www.gnu.org/software/guile/manual/html_node/Atomics.html As long as you use boxes for values for which eq? is well-defined, that is f= ine. I guess this would cover most cases, although I'm not familiar with thi= s module. But in general, eqv? seems saner.=