From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.devel Subject: Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs] Date: Sun, 10 May 2020 02:02:42 +0200 Message-ID: <87d07cwtb1.fsf@fastmail.fm> References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87wo5mc04t.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="93258"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.4; emacs 27.0.91 To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 10 02:03:21 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 1jXZRA-000O8V-21 for ged-emacs-devel@m.gmane-mx.org; Sun, 10 May 2020 02:03:20 +0200 Original-Received: from localhost ([::1]:34284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXZR9-0006lL-4V for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 20:03:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXZQf-0006L8-UH for emacs-devel@gnu.org; Sat, 09 May 2020 20:02:49 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:42045) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXZQe-0003KU-M1 for emacs-devel@gnu.org; Sat, 09 May 2020 20:02:49 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 76C6C5C00DA for ; Sat, 9 May 2020 20:02:46 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 09 May 2020 20:02:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:subject:in-reply-to:date:message-id :mime-version:content-type; s=fm3; bh=BKJa6Xq04v8Ezacu54I4fElpOi o230IX/ldpf70g4s4=; b=eBC1s2tP23gmnSDRqrQuVgULQ09JerV/Dw20YbC3n/ T9YcpTp592e3o5wny5NKUtFf+ZK27Y2xiZ4LPP5uiFdKFxH08xzfuYPWF7Fu0Rcs YPZDqm1cpynwDUo3E3PRXC22Lwiv34saJM8J4vGe00i5rX+uoTjDDOP+BQiut+f8 5O8Xj/DxNjmNcOcY28QuDcZjUdwMUdyEITMiWbkpUZFkjVo42TfXOyT00i0nq9e/ 0kww4s3a+9ms7SXMHTPon6vC+Dp1NbAlSczqFnJlpPSmE5I8q2GpLD39DHfiN2gv dQ8TgID+Ve6AGfURQ6wleIo0IXJOvj+opkIbS6oQX4oA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=BKJa6X q04v8Ezacu54I4fElpOio230IX/ldpf70g4s4=; b=2kxtrES63SK6zncQATJ5rL LV0ohqod4t04MgRmlgd2YZD3U5Al4b9IdylB5UUViFcENSNeZ12hhcpj4YlXz/1o Qg9lgEOfaas84yf7sI1B0QtTQcRWf2hUVBOr6f0ln6aWyacrJye3LA0lt7RJ7cJH Fr7LVXvvZHyK3D8kddrUMtFciTnhrf0oRf8+eLhZytK9msFbxChwusKzldeRUqax sFHNMKD7heJKmw/6OX+GKvgKGnwFlTBYGQ3jBiMwELw5+qaWLZjeP7rzB/zMOgrG 6la75o2OeAsx/4IlrqAFoPM7w+lCB/dI+m750VhKKABL3928K/aJiIakmkEay6SQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrkeeigddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenuc fjughrpehffgfhvffujgffkfggtgesthdtredttdertdenucfhrhhomheplfhoohhsthcu mfhrvghmvghrshcuoehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmheqne cuggftrfgrthhtvghrnhepvdehfeevheegjeffgfduffeigfegteegtedtudfhvdeludej ueehvdekuedvgffgnecuffhomhgrihhnpeifohhrughprhgvshhsrdgtohhmnecukfhppe elhedrledtrddvtddurdeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpehjohhoshhtkhhrvghmvghrshesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: from Lenovo.fastmail.com (ip5f5ac93e.dynamic.kabel-deutschland.de [95.90.201.62]) by mail.messagingengine.com (Postfix) with ESMTPA id EABC63280067 for ; Sat, 9 May 2020 20:02:45 -0400 (EDT) In-reply-to: Received-SPF: pass client-ip=66.111.4.28; envelope-from=joostkremers@fastmail.fm; helo=out4-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/09 20:02:46 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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:249607 Archived-At: On Sun, May 10 2020, Alfred M. Szmidt wrote: [threading macros] > In these cases, I see absolutley no benefit of using ->, it just > makes > it more "magical" for no particular reason. For sure, whether to use a threading macro is a large part personal preference, but IMHO they *can* make code more readable. Basically, you can convert: (print (eval (read))) into: (-> (read) eval print) The first form is backwards, in a way: `print` is written first, but it's what happens last. With `->` you can write the functions in the order in which they're executed. For a longer discussion with more examples, see here: And I don't think it's been pointed out yet (though I may have missed some messages in this thread), that `->` and `->>` are part of Elisp since Emacs 25, except that they are called `thread-first` and `thread-last` (somewhat unfortunately, I believe, because they have nothing to do with CPU threads and are therefore unrelated to the other Elisp functions whose names start with `thread-`.) -- Joost Kremers Life has its moments