From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Newsgroups: gmane.emacs.devel Subject: Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs] Date: Thu, 14 May 2020 09:26:23 +0200 Message-ID: <433E8CA0-CC87-4877-B9D4-D348531B73F8@medranocalvo.com> References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87wo5mc04t.fsf@fastmail.fm> <873686bbl5.fsf@russet.org.uk> <87d07963ec.fsf@fastmail.fm> <873685dq73.fsf@russet.org.uk> <87wo5gc0kb.fsf@russet.org.uk> <87lflv5yzx.fsf@bernoul.li> Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="64997"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Jonas Bernoulli , Joost Kremers , emacs-devel@gnu.org, Oleh Krehel , =?utf-8?Q?G=C3=B6ktu=C4=9F_Kayaalp?= , Phillip Lord To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 14 15:13:24 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 1jZDfv-000GmJ-TT for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 15:13:24 +0200 Original-Received: from localhost ([::1]:60114 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZDfu-0001Yw-Tz for ged-emacs-devel@m.gmane-mx.org; Thu, 14 May 2020 09:13:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZ8GF-0000ip-Ac for emacs-devel@gnu.org; Thu, 14 May 2020 03:26:31 -0400 Original-Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:34255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZ8GE-0004aB-1P for emacs-devel@gnu.org; Thu, 14 May 2020 03:26:31 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 895D69F1; Thu, 14 May 2020 03:26:26 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 14 May 2020 03:26:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= medranocalvo.com; h=content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id :references:to; s=fm2; bh=JWTln8gSF1LP4dcnwHYjW79ypEmMkFOWM6l6Ug KorEg=; b=d+ehRd7oMtdfSZiTY4dhmvezmRDlIL3ylGLcsqywC2FH10/rt18qoL fJLNMkhNfM51Mi7Cnv3983O7TctHS71/CRPTjMLO9/ixn9jzHXDEqItnBxhlXnhe v+V4Tc0xmM6jm18FwO4hXgqHey4Uw7PQWC22SgNdcewJfGQ5mcA4dy/IIZHJF0fA TgyTpRoVwn5g5CUigPZg4X4Z/7IHy2YeJAsmHgerh22gLcJLkp6y+jKQKtri/u4g U/pNnIMcnp1JSGIXZMg3NNRjvhm/SqYcJh1BSeT8htBwyu9t6zBgRqwxMWFsKAbq FVNlu9nPbLlGUpieMtJNwBv3LXjCX7+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=JWTln8gSF1LP4dcnwHYjW79ypEmMkFOWM6l6UgKor Eg=; b=MEut9H0g2asHT70i/LYkksjRa12WCLuSZG+UW8o2/WefHPIlxOt+QFSmu NWV0xMoNMOsH2tvd3E2MzqSkPsATlXGiuKFLY77RM8PEEJb85RtId3a/TtrdT/rW +s21kh9X376d9q9qWt0YAHWZobB9PSyatiF7YJpaiV3gQU1mucprTRBCb1yqJzsO ArEaOlVffY8Th/DEcrFNfmjyaN2GB+7cngtXSJbrapNgdDCOGrofcq9Kukw5jKvv yFGWFfx+eDLZqsuJ+zFFE94TG2uC0QqmwQ1JQulu0rTvKt2TsZEADGBnkC1xNfyz ddrvOrItf1be50LrSQrwur5ww3EQA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrleehgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptggguffhjgffgffkfhfvofesthhqmhdthhdtjeenucfhrhhomheptegurhhi johnucfovggurhgriphoucevrghlvhhouceorggurhhirghnsehmvggurhgrnhhotggrlh hvohdrtghomheqnecuggftrfgrthhtvghrnhepheeivdduieekvdefgeejfeeuleegkeff tdfhfeefjeevgeejfeejkeduudfhuefgnecuffhomhgrihhnpehgihhthhhusgdrtghomh enucfkphepjeejrddujeelrdduieeirdduieegnecuvehluhhsthgvrhfuihiivgeptden ucfrrghrrghmpehmrghilhhfrhhomheprggurhhirghnsehmvggurhgrnhhotggrlhhvoh drtghomh X-ME-Proxy: Original-Received: from amcmpro.fritz.box (x4db3a6a4.dyn.telefonica.de [77.179.166.164]) by mail.messagingengine.com (Postfix) with ESMTPA id B811F328005D; Thu, 14 May 2020 03:26:24 -0400 (EDT) In-Reply-To: <87lflv5yzx.fsf@bernoul.li> X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=64.147.123.24; envelope-from=adrian@medranocalvo.com; helo=wout1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/14 03:26:27 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=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-Mailman-Approved-At: Thu, 14 May 2020 09:12:35 -0400 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:250237 Archived-At: > On 13. May 2020, at 23:03, Jonas Bernoulli wrote: >=20 > Stefan Monnier writes: >=20 >>> You said that there is a macro like this already in Emacs? >>=20 >> I don't think it's in Emacs, but I remember seeing something like >> that somewhere. >=20 > You were probably thinking of Oleh Krehel's short-lambda package. >=20 > https://github.com/abo-abo/short-lambda There=E2=80=99s also dollar.el, by G=C3=B6ktu=C4=9F Kayaalp (CC=E2=80=99d)= : https://github.com/cadadr/elisp/blob/devel/dollar.el I find it very elegant: it=E2=80=99s just a macro. ;;; Commentary: ;; This package provides a macro named $ where in its body symbols in ;; the form $N where N is a positive integer are to stand for ;; positional arguments to the generated lambda. ;; If the car of the body is a vector though, that vector becomes the ;; argument list of the new lambda. For example: ($ (+ $1 $2)) expands to: (lambda ($1 $2 &rest $_) (let (($* (cons (vector $1 $2) $_))) (+ $1 $2))) =09 (funcall ($ + $1 $2) 4 6) 10 Example usage: (seq-map ($ (* $1 $1)) '(1 2 3)) (1 4 9) Using named arguments: (seq-map ($ [n] (* n n)) '(1 2 3)) (1 4 9) At first glance, I=E2=80=99d do away with &rest $_ and collecting the = arguments in the $* variable, for better performance. The former could = be left to the named arguments mechanism. G=C3=B6ktu=C4=9F Kayaalp, would you be willing to include dollar.el in = Emacs or GNU ELPA? Thank you all and best regards, Adri=C3=A1n.=