From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Imports / inclusion of s.el into Emacs Date: Fri, 1 May 2020 21:36:12 +0300 Message-ID: <329b7290-e9e0-2b5a-d24f-05435d99ed67@yandex.ru> References: <266155d4-f9c0-8ed3-8df5-32feea171076@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121882"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cc: Emacs developers To: Philippe Vaucher Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 01 20:37:02 2020 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 1jUaX0-000VbE-Gk for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 20:37:02 +0200 Original-Received: from localhost ([::1]:42490 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUaWz-0005op-IZ for ged-emacs-devel@m.gmane-mx.org; Fri, 01 May 2020 14:37:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52486) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUaWK-0005GM-1j for emacs-devel@gnu.org; Fri, 01 May 2020 14:36:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jUaWI-0007BY-Bd for emacs-devel@gnu.org; Fri, 01 May 2020 14:36:19 -0400 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:36025) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jUaWG-0006yC-Pn for emacs-devel@gnu.org; Fri, 01 May 2020 14:36:17 -0400 Original-Received: by mail-wm1-x335.google.com with SMTP id u127so625762wmg.1 for ; Fri, 01 May 2020 11:36:16 -0700 (PDT) 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=SPi37qookKmHU6fv75UgICizVtxkid2Il5H6XGsTwCw=; b=qC1aWWlxp3FI7CbCZU1dHBktqUlQH4oxmmUtWEC7wGYDHowPT40nCD+rI1WZ7y2JP3 p/OWeKBYzDuVNLEiGsj4cpnIM4+HqpnJKTlAvNMjrgYybXhPVcxqDc6Zy0jNF14d3C1P 0v8fENpAtsiqygUSobLv7D8u9YE5LlEtDcY7hhPl6ziKohiH5xHvyB1/IxSgoS2r3kXH ei0pjLBQkzooKw7F0szGIaqUD65+JPxjzhRqyJENoLBvFJE7rpKrkHEW+XQxv/9T7F2v LSncu0QK5AooUzai4Yn4LoD4SF9OCPvP9ANzZ2ZGlZv46hhwfD0w98lUYci2uzje8JCa LCvg== 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=SPi37qookKmHU6fv75UgICizVtxkid2Il5H6XGsTwCw=; b=RNYzlwxHWvZxNn+syZZgZPD9NszOr0MMujjc3fawYickT14VZ8ox9jfblyREP1jXAq fjr+PYw36SYjhvsYSM1WT0jkh1dF5gDJBNlxBWtO78C/JBwfUVbnXr7OBeVZkh9vrkwd AK7C0nTiEiP3Wd5vIj50JE5RH6vA1YpqC2ubTOLUow4Y+0/+ZATBAFa9MM1YGrVJKUE6 2ZF3oY9VkdtN3Dh5wbfiYtJbvq1zymeyqFMKKeFdfPsln+5uqeNlL6IhFX3eJxx+/OR6 xYTSHwxPcq+35BRy5jClr5IoNxOOJZNfoquqkToD3+jDJwV6ti+StECgWe4ZV+lyrNoa Uxbw== X-Gm-Message-State: AGi0PubT8y7orpBBTNXNN7mhBLmRnxBrLQDb4zNXfd07JtZwdMZDfOBA f5DU/6IB2sssCUMmsuMYOtMNaIWnl3c= X-Google-Smtp-Source: APiQypLB9n7+Zkah/a/wI6FKt3u08Bf/6vRycyVLzrOla7yLNC6aVr+Vf+ylmiRE14v+CmBzNuNRdg== X-Received: by 2002:a1c:4b0a:: with SMTP id y10mr806114wma.24.1588358174424; Fri, 01 May 2020 11:36:14 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id x18sm5167309wrs.11.2020.05.01.11.36.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 May 2020 11:36:13 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=raaahh@gmail.com; helo=mail-wm1-x335.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::335 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:248333 Archived-At: On 01.05.2020 20:36, Philippe Vaucher wrote: > 1. s-prepend/s-append: trivially replaced by 'concat'. > > > Okay, that falls in the part 2 of my plan (decide which functions to > import). I note that you are against such helpers, do people generally > have the same opinion as you on this topic around here? I imagine so. And in general, Clojure tends toward more high level programming, with its protocols and optimizing VM. Emacs is more low level, so that shows in the API. And, well, it's good to encourage faster code (within the limitations of our VM). > 3. s-split: basically delegates to split-string, but wraps it in > save-match-data (which is generally against our guidelines for its use). > > > That falls in part 1 of my plan (alias existing > misnamespaced functions), so we'd simply alias split-string as string-split. That's why I suggested to propose a list of changes instead of continuing to debate intentions. > Now this point raises an interesting question about save-match-data, are > these guidelines available somewhere? Hmm. I'm not sure. There is this passage in searching.text, though: Notice that all functions are allowed to overwrite the match data unless they're explicitly documented not to do so. A consequence is that functions that are run implicitly in the background (@pxref{Timers}, and @ref{Idle Timers}) should likely save and restore the match data explicitly. And since save-match-data is not free, it makes sense to omit it. Especially it functions that are supposed to be used in a lot of code.