From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: Surprising behavior of eq? Date: Sun, 20 Sep 2020 17:42:27 -0400 Message-ID: References: <8e1d9874-4659-cca5-03da-c2c0df102c56@posteo.de> <40d06884-73d4-4992-81ce-962bf59ac196@www.fastmail.com> Mime-Version: 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="40779"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 20 23:42:58 2020 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 1kK76n-000ARZ-Jd for guile-user@m.gmane-mx.org; Sun, 20 Sep 2020 23:42:57 +0200 Original-Received: from localhost ([::1]:42768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kK76m-0002QP-Lv for guile-user@m.gmane-mx.org; Sun, 20 Sep 2020 17:42:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kK76X-0002QD-Px for guile-user@gnu.org; Sun, 20 Sep 2020 17:42:42 -0400 Original-Received: from mail-qt1-x82a.google.com ([2607:f8b0:4864:20::82a]:38370) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kK76V-0003so-Jr for guile-user@gnu.org; Sun, 20 Sep 2020 17:42:41 -0400 Original-Received: by mail-qt1-x82a.google.com with SMTP id c18so10679114qtw.5 for ; Sun, 20 Sep 2020 14:42:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=grAJAAo9E2DK4kPd5gKm9zIDTeFgVCRUWPHvfrqb2ds=; b=SPrGBMEd06GPQY84jxtzyk6GPTCYt72ZGF47m0DDIKFOGqKiKSdat3Emx7kPHWx5md iQHkxpE3So7iHFNshzCjAkAM1whV6oDFPhgS3KedyvGs4D61lAar37hWuBf3/jqkyros s1Z7BDCNz7/Ng7smjomsgtB79+dwWZnrkX5COvxOrCt69NKqxzjsvgFoadS2fAY77vV5 yXxdUD9qAAE060k19hc0kljKKZBxAzW47L5jpygWMhHF9Nbhip3Mq0hrEH6FSpWVX7zH HAdBxEQI4ID8bOGO8ND3B/HWVDZOkiDfKW//tp85M+9mRshRHIcvIr5jCtYmOo6oWlm2 BwCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=grAJAAo9E2DK4kPd5gKm9zIDTeFgVCRUWPHvfrqb2ds=; b=LX2Lm2eELV9aJLkRYvUZJ6dScMbSfD1lQbd2SMr06jwj7YbAktLLi9wev1yFO+Jtkj NbVAb4mFGZIXHQmnIC7QciD9yt3kQ5lL9pyiq4BPuEbPOsA48SJ2ECaNnnfltWKCXhtQ DGqnkhNQPvz2bVvfWgzK2D5PviF9tOtkmOxc8Bg3Se/le8iw7jKY4HJ7eAHblfEFe0lH hJNDV1xFl5QLADRfS26w/Oak0fTItbO6PgVlF00esZHbhRDYPSQEbSTVYfkk+ZxX/xBr x7OHHjpBm65/xztjJUJ2zhD+Fu2nRcXgmNDNAXolRxs0Xp4cYF3wxiBAkuyWGHLzHyvB Tvgg== X-Gm-Message-State: AOAM531+UVRrbOmyAREuE4Lf50wl9mpbMbeRoOJ/5A1zyACGfK9t/QQK ljUFJry4xGE7OBflk9RKJ4wAVpkF3pcNzZ/LImM/7w== X-Google-Smtp-Source: ABdhPJzvzcm+feFywKTTVoQirmHRSVCLs3GZThg8cZUW3vW1Q0ARhO6xomjQW0u7BdRVp16zFdLFMBuKmlFnrZMnhv4= X-Received: by 2002:ac8:7c90:: with SMTP id y16mr29754787qtv.45.1600638158128; Sun, 20 Sep 2020 14:42:38 -0700 (PDT) In-Reply-To: <40d06884-73d4-4992-81ce-962bf59ac196@www.fastmail.com> Received-SPF: pass client-ip=2607:f8b0:4864:20::82a; envelope-from=cowan@ccil.org; helo=mail-qt1-x82a.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, 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-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.lisp.guile.user:16942 Archived-At: On Sun, Sep 20, 2020 at 4:52 PM Linus Bj=C3=B6rnstam wrote: Just a quick note on guile: if you are testing equality against literals > guile will optimize to the fastest kind. (equal? b 27) becomes (eq? b 27)= . Indeed, it's a Good Thing if equal? starts out with an eqv? test (which should be inlined except for number comparisons) and eqv? starts out with an eq? test (which also should be inlined). If the more fine-grained test returns #t, the more coarse-grained one can safely return #t also. This is independent of literals, and should IMO be done by every Scheme.