From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Comparing hash table objects Date: Sun, 12 Jun 2022 17:16:36 +0800 Message-ID: <87zgiip7gr.fsf@localhost> References: <871qvz4kdw.fsf@localhost> <87leu7tsyc.fsf@localhost> <878rq3d9wm.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24576"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rms@gnu.org, schwab@suse.de, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 12 11:19:58 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 1o0JlG-0006BF-Bs for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Jun 2022 11:19:58 +0200 Original-Received: from localhost ([::1]:56056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o0JlE-0002Yl-Vp for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Jun 2022 05:19:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o0JhQ-0007ga-RJ for emacs-devel@gnu.org; Sun, 12 Jun 2022 05:16:01 -0400 Original-Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]:36522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o0JhP-0008H2-CB; Sun, 12 Jun 2022 05:16:00 -0400 Original-Received: by mail-pf1-x435.google.com with SMTP id 15so3238422pfy.3; Sun, 12 Jun 2022 02:15:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WdUNxbuSXdk31NRTLPfA6AsPAm3JdWGtY5utT4uXgTE=; b=I3Pq5yaPyZsYR6JzDEQj57EyeJNhR2B1VvecrVN67EEY7gBZDLpFbWl/nRzd+xnlUx M88Cbk+LSTZH7kZqauB7j6xHr9WsbaEr4wTDxRFZF2hkpUiK0CA6tGWV9SKBPKNqdJ21 OzOgpSDlpgrjWHsLGcY6FMqZ/Fv6gT7KghIy0vABOLjipUgWbXPkGy2baxxp9UZOMbYR WbglIcm30Pikzh20d65YobirhoD0V/j4E0HJCAF2PPneBO6v4WBCM7bwuUU+QSUY/1oZ Y0kNo/01TrkzYWDh/7tTO3T3I91yFW0PqG6bAQ1HoxrEkxrwCBqFwDSWRXB31n/c68A6 66aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WdUNxbuSXdk31NRTLPfA6AsPAm3JdWGtY5utT4uXgTE=; b=SNa8kyiwJpaPhGgYJ09fGG8zgWTdP6K4z9oNlTkvKOhUyQPhGb+CHyrbnFY1eQJsqb hdj3oOJxup6jvS67Bo4LgOwhe+StOMHLgihlpl9Fv5VWkZEqlnDxz4TqQZANOIvtAxr9 dXSznkmdnH4DeaJtk4u1aBBCeQuFrYcyJP6S/upgEyivEoAgNc3hul4vmsqZy0M/+Z27 CZfgcjJQP07UlJ7LhYs8ZhHi2aSisdUf67MWI0OPvK3ZDXpmjJxURnBlvOdaNimcBvGf L84DO0hbyarkqnElwpC3i4zXvpGQ7623M/ng5t7mTn3tfCLWtpQim5sx0D/bJdiRTzbX xVMw== X-Gm-Message-State: AOAM531YgayS0wSGAzoWeeQFB0k+qddN7BdstSwaE0NvYBNQL9DMSYpH I4CD3xUdeoG+A5CigrmVh8s= X-Google-Smtp-Source: ABdhPJy33zcRFVv5ZzfSk0H3Msme5ySkbcmUMYnQPJZ7akt5D55J4h+dSW/d6UxqmKTZQDe7vG9OlQ== X-Received: by 2002:a05:6a00:80a:b0:51c:7569:5af with SMTP id m10-20020a056a00080a00b0051c756905afmr20501597pfk.68.1655025357768; Sun, 12 Jun 2022 02:15:57 -0700 (PDT) Original-Received: from localhost ([23.27.206.157]) by smtp.gmail.com with ESMTPSA id p23-20020a1709027ed700b001678960e2ebsm2688315plb.224.2022.06.12.02.15.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Jun 2022 02:15:57 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=yantar92@gmail.com; helo=mail-pf1-x435.google.com 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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: 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:291081 Archived-At: Stefan Monnier writes: >> However, it will not help with the problem of comparing objects >> containing hash tables. Unless those obejcts also define special >> comparison function (which is inconvenient). > > This is an instance of a fairly general problem with Lisp's equality > tests (and it's not really specific to Lisp, admittedly). > > Maybe a half-sane way to solve this problem is to provide a generic > "equality driver" which takes an argument specifying which objects to > compare for structural equality (i.e. where to keep recursing). This might be an option. It would then help if cl-defstruct supported a default comparator setting the "equality driver" to be used by default when comparing the objects using equal. Best, Ihor