From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Lift {global,local}-key-binding to Lisp Date: Thu, 21 Jan 2021 20:58:54 +0200 Message-ID: References: <83zh1cbpua.fsf@gnu.org> <83lfcvb7pj.fsf@gnu.org> <684c8177-4c7f-e678-7587-6a1250af53f7@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1634"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: "emacs-devel@gnu.org" To: Drew Adams , Stefan Kangas , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Jan 21 20:00:32 2021 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 1l2fC3-0000KD-Pk for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jan 2021 20:00:31 +0100 Original-Received: from localhost ([::1]:53912 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2fC2-0008Rz-Qd for ged-emacs-devel@m.gmane-mx.org; Thu, 21 Jan 2021 14:00:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2fAd-0007wy-7d for emacs-devel@gnu.org; Thu, 21 Jan 2021 13:59:03 -0500 Original-Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:33885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l2fAb-0002Im-E5; Thu, 21 Jan 2021 13:59:03 -0500 Original-Received: by mail-wr1-x435.google.com with SMTP id g10so2806646wrx.1; Thu, 21 Jan 2021 10:59:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=qnxtXuMPQOXMLXYt0spyXR4qKJK8buyBcedyJtraeNU=; b=sPirVstYhRY9DXqfklL6rtPd6owU7j/9D7mW9equ9d8v21dduQnuNkHfAaePF6seli +QWHltMXGhAXp6GELT02uegB935sDU0oWQCv+jPNwf22YpUzTxNkU1dLFflmh1E1+jZ2 o+fcjcFB0qVmnHfJ5IUtSe1ehImlH+/l8XVLVhYxCWTVKnuZu2yN3rP1ec2AVJIz2DnO SAjxmKuasUBoQ1EKp9tCb7asmw0qcGi6AaXaW8wWCCIj5BdwIBWGJb13cIfH4L74j4em WSa+Ad4VGbQ2qIhGF4qzCAMxl3FETc+WbV4G5qV23S7KUGCEyYRI/D6Q5YfU5csItIBR +BzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=qnxtXuMPQOXMLXYt0spyXR4qKJK8buyBcedyJtraeNU=; b=au1+fKjHyzv/bEFaMfk/upvOF0sNzoEQykBq4uToHGJA0xNKKAOtbNpAKzxMM6ZsA3 VLijkK2sopWLgVnJRVCu/zUW4WfUGoXwJrYK62KqN3KwV3uLLxw2oADoZEAhwJ74OU/4 raOFKc8QcwYx338LtNdiGFkFtksxtoO921JrfaUdmNmcRZ/Kx03QrBjp+bwU8mOVZxn2 MtluSMoZ+A2ykM70jLqkAGOsoEH4/OS3Eys2ZuLO1OBTzd9ij4jJ2ll4lNQlJ+pXazwT s01DSXSPnBqubapTXW0IO8Hh745BewCmQv3wq3zPlsbrhyJ6iIrk3+Fy6E9MGFak3NxU SnCg== X-Gm-Message-State: AOAM533/CxESYSkReRvpgHafGikOtu/8B1UM4kWPPiKq1aEJ3lHhIV7W umZnzkZoMbGiGLMNq8Pd6arnIicoxLc= X-Google-Smtp-Source: ABdhPJwsuePDTQASulKCZzvXwdVuVp2DcL0/iTXqhgc8ohUq7pPv5wBCIV5jSbN/eqnKAapffNTjWQ== X-Received: by 2002:adf:fb05:: with SMTP id c5mr846953wrr.69.1611255539435; Thu, 21 Jan 2021 10:58:59 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id l12sm9154437wmj.9.2021.01.21.10.58.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Jan 2021 10:58:58 -0800 (PST) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=raaahh@gmail.com; helo=mail-wr1-x435.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, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:263249 Archived-At: On 21.01.2021 20:16, Drew Adams wrote: > The_point_ of adding those functions was to not > pay a performance penalty with a long list, just > to compare its length with some number. IOW, > short-circuit traversing the_entire_ list, as > soon as the comparison question can be answered. > Like using `or' or `and': test only as much as > you need. Perhaps you're right. At the very least, we could have added Lisp versions first, and then brought them down to C if an occasion where this matters arose some day. As it is now, I could only find one use of those functions in Emacs's source code, and (length> default 0) doesn't really deserve a low-level implementation.