From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sam Steingold Newsgroups: gmane.emacs.devel Subject: Re: Comparing hash table objects Date: Mon, 13 Jun 2022 12:18:13 -0400 Message-ID: References: <871qvz4kdw.fsf@localhost> <87leu7tsyc.fsf@localhost> <878rq3d9wm.fsf@localhost> <87leu1l9nn.fsf@gnu.org> Reply-To: sds@gnu.org Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30333"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) To: emacs-devel@gnu.org, Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jun 13 18:19:15 2022 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 1o0mmY-0007gj-Ot for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jun 2022 18:19:14 +0200 Original-Received: from localhost ([::1]:35324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0mmX-0000Fj-Bo for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Jun 2022 12:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0mle-0007c8-60 for emacs-devel@gnu.org; Mon, 13 Jun 2022 12:18:18 -0400 Original-Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]:39617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0mlc-000724-9x; Mon, 13 Jun 2022 12:18:17 -0400 Original-Received: by mail-qt1-x833.google.com with SMTP id w13so3372248qts.6; Mon, 13 Jun 2022 09:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:user-agent :return-receipt-to:reply-to:mail-followup-to:date:message-id :mime-version; bh=3/9M5DpwKeNvxO2Murme+vs+wVjNYWJ/MY98/OG6Nto=; b=IB4YDLoCDUh6+VLitswbNw/aV4U+bzsimJxxtRZNhe+QA6nzzukBzoL5qO0t/YWAuV C7Vh98/nxMP7UeWDXLcuBIX6C4TKsyUy4CAw8hXP295HgqBI9JcXSWp3wexmRkKtTnQk 53yFP3n7kWUxCgNJbVd2Cv2XbpLpq/20pFKZWCzzNb+TWmRyIvlL4Xr3zlcCekK328nb Um/dFLMtXQIQLvGyVO5aA5llWk+cErjF6tn1s7/xGlaiJ9lN0DED6ay/hrPZ+DaeLj5H t2ykm26AgRHdNx3+4vW40bqXw+vRNWXPTEz5FWLUuOnwwEuHU21Dx9u+tlW9NUWQbqM1 Ze8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:subject:in-reply-to:references :user-agent:return-receipt-to:reply-to:mail-followup-to:date :message-id:mime-version; bh=3/9M5DpwKeNvxO2Murme+vs+wVjNYWJ/MY98/OG6Nto=; b=QZywf7PWEPOmNWJnoomj4FU+Nm1Z6Y7jAitXdZ1fjgNKz1Hh6J+KDQ4WZqgZpnCSm9 FI31yMNCKGbvRZ7asVtkJQowh7Kz07lLHYvkmqEWSDOT0gJRndYfvV46Rb2o2kz+OasC wPjeXSDHCNwnS6RavkbMPB8CKjnA9cu8IPB343sbnsRma3lfuYCskFOIlvB6zzmHcjmc n1/NM6s4s5bSyYE1DaQaQ9jZw/0XLySYwi/L21UOSrpb5wArzD5XpaQh6wuyxCwHbsKF ExYN7f6FhEw/uGNWu93xY8BF2hXszUjL4ixgybiVt5i3fS6ttSXIaJyGoNDkqnopPOis xUZA== X-Gm-Message-State: AOAM531xZfDAWEA7aDZVYCQVJCWTWq6ESijF4umNRBLDjBtoe1hqbhbK W4Xocg112Mtwwun7B/cYfO9E36FrzA== X-Google-Smtp-Source: ABdhPJx0gUIUNN8a15QFogfph0gQwY+Xa7WWkxkyCsYeu1FNeX2SjIdVmBKRstm5VZEZQlHqVzy4Jw== X-Received: by 2002:ac8:58d3:0:b0:305:20ea:2103 with SMTP id u19-20020ac858d3000000b0030520ea2103mr427594qta.39.1655137094430; Mon, 13 Jun 2022 09:18:14 -0700 (PDT) Original-Received: from 3c22fb11fdab.ant.amazon.com (pool-108-30-23-113.nycmny.fios.verizon.net. [108.30.23.113]) by smtp.gmail.com with ESMTPSA id 14-20020a37030e000000b006a6b498e23esm7400077qkd.81.2022.06.13.09.18.13 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 Jun 2022 09:18:13 -0700 (PDT) In-Reply-To: (Stefan Monnier's message of "Mon, 13 Jun 2022 09:02:41 -0400") X-Attribution: Sam X-Disclaimer: You should not expect anyone to agree with me. Mail-Followup-To: emacs-devel@gnu.org, Stefan Monnier Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=sam.steingold@gmail.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" Xref: news.gmane.io gmane.emacs.devel:291148 Archived-At: > * Stefan Monnier [2022-06-13 09:02:41 -0400]: > > Sam Steingold [2022-06-12 19:55:08] wrote: >> The way Python does it could be a good starting point: >> unless a class defines __eq__ method, the comparison is Lisp eq. >> So, if a class has structure, it should define the comparison method. >> See https://docs.python.org/3/reference/datamodel.html#object.__eq__ > > Seems like the exact same way ELisp works. including for user-defined classes?! > The problem we have right now (translated into Python) is that some please use ELisp terminology too for those who will want to read the sources. > people now want to add a `__eq__` method to the class `hash-table` > (they argue that the lack of it was an oversight). sounds about right. > It's easy to do what they ask for, but it breaks backward > compatibility. I would argue that code relying on `equal' being the same as `eq' for `hash-table' is a bug. Exposing such a bug might be painful, but it should be fixed anyway. Thank you for your clarifications. -- Sam Steingold (https://youtube.com/channel/UCiW5WB6K4Fx-NhhtZscW7Og) on darwin Ns 10.3.2113 http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com https://ij.org/ https://ffii.org https://memri.org https://jij.org He who laughs last thinks slowest.