From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.devel Subject: Re: Elisp threading macros Date: Wed, 28 Aug 2024 17:51:00 +0200 Message-ID: <87seuove6z.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13122"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Garklein Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 28 17:52:06 2024 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 1sjKxo-0003Gh-VQ for ged-emacs-devel@m.gmane-mx.org; Wed, 28 Aug 2024 17:52:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sjKwu-0001u9-9u; Wed, 28 Aug 2024 11:51:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sjKws-0001tu-BC for emacs-devel@gnu.org; Wed, 28 Aug 2024 11:51:06 -0400 Original-Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sjKwq-0008Mr-ST for emacs-devel@gnu.org; Wed, 28 Aug 2024 11:51:06 -0400 Original-Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-428119da952so60761695e9.0 for ; Wed, 28 Aug 2024 08:51:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724860262; x=1725465062; darn=gnu.org; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=xlZm9uKcUrfO8rmJq/ZK/S3X3JVRFKe+pybq/pzSWZU=; b=iEcJH4GoE9WGONxWTJpQtxfHMIGq4Cbzio4EkzBxvKdxHoRnCoXz4EzR2Utwt5wEzq gjTxdbEmzHH2JpbCd9FVWh9KpxtjctM9N2V+CrTiv+dbx468BiKLDR3PAn2ziOeGkoUY 4S0Rs3EqlvvpyTz81eyE3aoxSq4g5W0BOsmFgHyx7W3pzYvSQXuQqsOSvX5k+NmnLN69 uNMr40zWk4mY2FzTj3g076D52H3TfwGouY/731IUc/yc8xdm9Z85UF7diyW/cC/Tndn4 k4Ed4BM/0wPxmVPPSsuvMn78NqF3LVEF1utgFq0U6iSRFJ9ko1RPVV3Lyzxm3o8OEtV7 UVPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724860262; x=1725465062; h=mime-version:message-id:date:gmane-reply-to-list:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xlZm9uKcUrfO8rmJq/ZK/S3X3JVRFKe+pybq/pzSWZU=; b=k+hvGbroXZC+DEJu5C6DNhL3Sih7kX1HFa7K0bIJTXvtyfB3HDLAq1TwpXalekaOkF mv0E0jg9MyjmVNpf9cYBR30KR5ewCPe46PZs1Pur6H+ckodziv0tBxnqNH/Ebbsc0n7d Pq3ooanB6+wTI3EVRIPT2wduglOW1Vy7zmX3rAl7s9N2q8kGkVtkJaZW1pt8lZlNsbNB s4Q8PNCyoutJIazbEbX/t5oRmlHEATWCicJet4/SqS6D+Bvy14li13ZeFs6kbo4vE4iN eSNtysehdquUIfSaIDeN7E13o54D8cBx0QE7mhFmIXkCb3bwuTM7eZGMD8Jrr8SDyBLp 41GA== X-Gm-Message-State: AOJu0YzdNHBgQWZNs/UxXGHHzWmJmTLfT/giLiBXSBg05agkt8/psWtW 7WwG3/xY7ALAL1LD7iWYlEj7a26FQnA8t53ic8kXuEqTUOVUC8ao+61MYw== X-Google-Smtp-Source: AGHT+IFN/jrBTkrU/SWH7EwlnqfPe0+W0iKlh1wpp0hAgYtx7WGV+K8dOyQRWXBm4dDwC2LE+a65tw== X-Received: by 2002:a05:600c:1f06:b0:426:63b8:2cce with SMTP id 5b1f17b1804b1-42bb0281361mr617395e9.7.1724860261584; Wed, 28 Aug 2024 08:51:01 -0700 (PDT) Original-Received: from rltb ([2a01:e0a:3f3:fb51:a1f0:1387:9567:d5c]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bac7d69d0sm11493825e9.44.2024.08.28.08.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Aug 2024 08:51:01 -0700 (PDT) In-Reply-To: (Garklein's message of "Wed, 28 Aug 2024 10:08:05 -0400") Gmane-Reply-To-List: yes Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=rpluim@gmail.com; helo=mail-wm1-x32c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323155 Archived-At: >>>>> On Wed, 28 Aug 2024 10:08:05 -0400, Garklein said: Garklein> Hello, Garklein> Would it be possible to have the dash.el macros `->', `->>', `-->', Garklein> and `-some->' in subr-x.el? I find them to be really useful, and would Garklein> love to see them in the base language. Garklein> I know that `thread-first' and `thread-last' exist, but I find that my Garklein> eyes can recognize `->' and `->>' much easier. `-->' is really nice Garklein> for more complex threading. Garklein> `-some->' is useful in cases like this: Garklein> (let (foo (function-which-may-return-nil)) Garklein> (when foo Garklein> (bar foo))) Garklein> which can be rewritten, much cleaner, as Garklein> (-some-> foo function-which-may-return-nil bar) Beauty is in the eye of the beholder: (when-let ((foo (function-which-may-return-nil))) (bar foo)) Robert --