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: Mon, 18 May 2020 20:29:26 +0200 Message-ID: <4353C482-F4C4-4D56-9588-827E8BC37F7E@medranocalvo.com> References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <873686bbl5.fsf@russet.org.uk> <87d07963ec.fsf@fastmail.fm> <873685dq73.fsf@russet.org.uk> <87wo5gc0kb.fsf@russet.org.uk> <87lflv5yzx.fsf@bernoul.li> <433E8CA0-CC87-4877-B9D4-D348531B73F8@medranocalvo.com> <87lflsyfwu.fsf@russet.org.uk> 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="62540"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jonas@bernoul.li, Richard Stallman , joostkremers@fastmail.fm, emacs-devel@gnu.org, ohwoeowho@gmail.com, self@gkayaalp.com, Phillip Lord To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 18 20:30:20 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 1jakWp-000G8C-EN for ged-emacs-devel@m.gmane-mx.org; Mon, 18 May 2020 20:30:19 +0200 Original-Received: from localhost ([::1]:60504 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jakWo-0004NE-Gh for ged-emacs-devel@m.gmane-mx.org; Mon, 18 May 2020 14:30:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jakW8-0003rj-Fo for emacs-devel@gnu.org; Mon, 18 May 2020 14:29:36 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:36337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jakW6-00029v-MO; Mon, 18 May 2020 14:29:36 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D026E9FB; Mon, 18 May 2020 14:29:30 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Mon, 18 May 2020 14:29:31 -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=mVRIswR6Brm5AOwp9kIaScprYY8JOTTE1bL1OE 8tRx4=; b=g+dkV84AjkfqgO+loDQ3SdNVU4GYHBb4N/f/fU0QffiAwCMgMASNhF +QhXj0l9JUDnrKaYLKG8EkQKvjPfZeuTcemtKdZGHmkjx8ZdahoEBAMj19p0rrVR Rl6QIBxV89gNtUpAcgYA9YZSdZlqMSOvFWT6iQq4MH6pagNNHxyphruC1wu5GIcI jtXHwbUS5qWLd14qkhHUayHIgJ5Se8z4F3qBmPwQ1kO/aKqqJAcf/aR4qtla7ekB h2/kAa+C4lAgL4UWMTUj1dSLmqfynTHWa9qnLVIV+FdbVIVTe5amTjzeTZdJsyCz iRYeBkQ8QHgeF5m321AL+VQkkXwpIxjA== 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=mVRIswR6Brm5AOwp9kIaScprYY8JOTTE1bL1OE8tR x4=; b=kqIlEtA6mGkUhnH1IDJCj9glmd+Mpp0QFTBVsuHGtAtFtg1RZWLX34EoY PJ+5+Kvn8SguUnedasUx6sLHLqMX5dMYcZAogIaLUETKfslxNipQulZwMB4LgPgm OWqX024Bf8Ow5R0TX7p8beQ6sDib9AyaZclzkuv9CaoOKnpFCe18IJy56uj8/XX8 DQsZf6KAXH6NpBWLTgTwiSU0c23v9RM3Jms35pGyG8RHCyNchwn7XETosLuFLvh7 3nztK+PKAFuIZVShr3SHjynHA4twgYttDlk59AAXAiYygNEpsdYJZvfaRmb9vQmX 4E9uc+f7hAdXHd1zAc7JAhiAIO1Fw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedruddthedguddvgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpegtggfuhfgjfffgkfhfvffosehtqhhmtdhhtdejnecuhfhrohhmpeetughr ihojnhcuofgvughrrgpiohcuvegrlhhvohcuoegrughrihgrnhesmhgvughrrghnohgtrg hlvhhordgtohhmqeenucggtffrrghtthgvrhhnpeegkeejffetfefhveetkeeguddufeel keelgfekhfffhfeugeekiefhgeefueejhfenucfkphepjeejrddukeehrdduieeirdeike enucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhesmhgvughrrghnohgtrghlvhhordgtohhm X-ME-Proxy: Original-Received: from amcmpro.fritz.box (x4db9a644.dyn.telefonica.de [77.185.166.68]) by mail.messagingengine.com (Postfix) with ESMTPA id A2539328005D; Mon, 18 May 2020 14:29:27 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.3608.80.23.2.2) Received-SPF: pass client-ip=64.147.123.25; envelope-from=adrian@medranocalvo.com; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/18 14:11:24 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-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:250798 Archived-At: > On 18. May 2020, at 06:42, Stefan Monnier = wrote: >=20 >> However, we could implement both syntaxes, use the $ syntax in the >> short term, and convert external packages to the # syntax in a few >> years. >>=20 >> Let's see what Eli thinks about it. >=20 > FWIW, I'm not too fond of such shorthand syntax. The benefit is not > very high and it makes the language that much more difficult to learn > for newcomers. >=20 > For a programming language like Closure, it might make sense, since > most/all people writing Closure programs are actual programmers that > have to be proficient in Clojure. But Elisp lambdas are very common = in > .emacs files, so this additional complexity will be exposed to some of > our users who aren't programmers or aren't proficient in Elisp. I understand your argument, particularly as it applies to the reader syntax. On the other hand, dollar.el is just a macro: it does not complicate the syntax (for some definition of syntax); although it does complicate understanding when first presented. Being just a macro entails: It=E2=80=99s highlighted in Emacs, just like lambda. Its documentation can be queried on the spot with C-h f RET. It can be macroexpanded, in order to inspect its effect. In any case, I have no experience helping beginners, so I=E2=80=99m not sure whether the above would help them or not. > [ Yes, I know it may sound strange coming from me, since I'm to blame > for a lot of complexity in Elisp :-( > But to my defense, `pcase` and `cl-defmethod` aren't nearly as often > needed in .emacs as lambdas. ] (You=E2=80=99ve done much good, thank you.) > I can already see the discussions in forums about "what's the = difference > between #(f % 1) and (lambda (x) (f x 1))", "when should I use which", > ... >=20 > If we want to shorten anonymous functions we could start with = something > like (=CE=BB (x) (f x 1)), which you can get with > prettify-symbols-mode already. Something like this is supported by dollar.el, when using the named = variables syntax (substituting =CE=BB for $): ($ [x] (f x 1)) though the usual way would be: ($ (f $1 1)) Would prettifying lambda to =CE=BB lead to visually unexpected = indentation? (I think not, for the uses=E2=80=A6) Typing =CE=BB is a no-go, in my = opinion. I=E2=80=99m not entirely sold on the symbol $ for the macro name, but = its use for the variables is genius, in my opinion, which makes the combination =E2=80=9Cclick=E2=80=9D. Variable names starting with $ ($1, $2, etc.) = are familiar for people with experience with in Bash, Tcl or PHP. For people familiar with Haskell, $ is another form of function application, which would remind of the $ macro. Going with % and %1, %2, etc. would be fine, and would be intuitive for people with Clojure backgrounds. But % is taken. Other symbol might be more intuitive or =E2=80=9Clispy=E2=80=9D, though = I can=E2=80=99t think of any, especially that is easy to type, =E2=80=9Cfamiliar=E2=80=9D = (subjective) and intuitive (also subjective). [=E2=80=A6 This alternative occurred to me meanwhile: (\ (f \1 1)) \ is used by Haskell for its lambda expressions (it=E2=80=99s supposed = to remind of =CE=BB). \1, \2, etc is used in regular expressions to refer to = capture groups. It=E2=80=99s somewhat ugly, but makes sense.] Best regards, Adri=C3=A1n.=