From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ivan Andrus Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal Date: Thu, 22 Jan 2015 09:57:09 -0700 Message-ID: References: <54C05269.7050602@dancol.org> <87oaprfa3t.fsf@fencepost.gnu.org> <54C0C514.8020606@dancol.org> <54C0C7E9.4050009@dancol.org> <54C0C97C.9040707@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b2ee2e90f63ff050d409033 X-Trace: ger.gmane.org 1421945846 20721 80.91.229.3 (22 Jan 2015 16:57:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Jan 2015 16:57:26 +0000 (UTC) Cc: Daniel Colascione , =?UTF-8?Q?Ren=C3=A9_Kyllingstad?= , David Kastrup , "emacs-devel@gnu.org" To: Oleh Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 22 17:57:25 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YEL4P-0007EF-D9 for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 17:57:25 +0100 Original-Received: from localhost ([::1]:54802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEL4O-00079t-PJ for ged-emacs-devel@m.gmane.org; Thu, 22 Jan 2015 11:57:24 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58471) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEL4J-00076u-Ks for emacs-devel@gnu.org; Thu, 22 Jan 2015 11:57:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YEL4I-0002Lg-9A for emacs-devel@gnu.org; Thu, 22 Jan 2015 11:57:19 -0500 Original-Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:44267) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YEL4A-0002IT-Us; Thu, 22 Jan 2015 11:57:11 -0500 Original-Received: by mail-pa0-f47.google.com with SMTP id lj1so2903547pab.6; Thu, 22 Jan 2015 08:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=3jp6SsKjGtQNAK65i6Ny3q3+3s7YRMDb9xFHkR7Yc1o=; b=j1SeD5ykYtahFTn+dieG7anPq+tD+jWwMEEO5slw18KAFJJU9/EmMuklZj4O+CGqLP OQcr2IAD3PRAJiZds50d0ifdVo37A/qLTQZHvh4hAh+vW/4ifXL7/be4g+e/cY6IX4jo sPzDysO68zpLMDAybTCYi6E9xNajgpuD/SJPYyktdjHVTbQ3K/0f+UTDON308zlrn8Jh E7lLYqEbODul7zgxhm32LIYrho9TAvumal3uxRB1naTED0q/5xKtS88QVDjipotGAXGt WmOSxlINeiln7wHYGTuapqNUFHHmc6JKykFvHfJQikp2MIeWGZRGDwup2AALJ84JWHWj YHkg== X-Received: by 10.68.222.40 with SMTP id qj8mr3648609pbc.51.1421945829547; Thu, 22 Jan 2015 08:57:09 -0800 (PST) Original-Received: by 10.70.57.170 with HTTP; Thu, 22 Jan 2015 08:57:09 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:181623 Archived-At: --047d7b2ee2e90f63ff050d409033 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Jan 22, 2015, at 3:05 AM, Oleh wrote: Sure. My point is that existence of prettify-symbols-mode and equivalent is another argument against the creation of a shorter-than-lambda function literal syntax. Note that this isn't just a lame (defalias '=CE=BB 'lambda) we're talking about here. `short-lambda' takes away a *whole* paren nesting level, which can be a lot, when there's only two (and there usually is). FWIW, if you change short-lambda to be (defmacro short-lambda (&rest structure) ...) then short-lambda can get rid of the extra level of parens. Though I have to admit that #(+ % %) is probably easier to read than (=CE=BB + % %) I=E2=80=99m personally slightly in favor of this feature (and more in favor= of reader macros). But everything we add to Emacs lisp is something must also be added to Guile before we can get EmacsGuile which I would also like. :) I have my own interactive-lambda macro that creates interactive lambdas for use in keybindings and such. It seems that making the lambdas interactive is a very important feature for the use cases I have for lambdas in Emacs. I also have an (inaccurately named) add-lambda-to-hook macro that creates a _named_ function and adds it to a hook. This prevents it from being double added and allows updating the "lambda". IOW I'm not sure a single mechanism can handle all use cases satisfactorily. -Ivan --047d7b2ee2e90f63ff050d409033 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Jan 22, 2015, at 3:05 AM, Oleh <ohwoeowho@gmail.com> wrote:
=
Sure. My point is that existence of prettify-= symbols-mode and equivalent
is another argument against the creation of = a shorter-than-lambda
function literal syntax.

Note = that this isn't just a lame

=C2=A0=C2=A0(defalias '=CE=BB &= #39;lambda)

we're talking about here. `short-lambda' takes a= way a *whole* paren
nesting level, which can be a lot, when there's = only two (and there
usually is).

FWIW, if you change= short-lambda to be

(defmacro short-lambda (&rest structure) =C2=A0...)

then short-lambda can get rid of the extra level of par= ens.=C2=A0 Though I have to admit that

#(+ % %)

is probably = easier to read than

(=CE=BB + % %)

I=E2=80=99m personally sli= ghtly in favor of this feature (and more in favor of reader macros).=C2=A0 = But everything we add to Emacs lisp is something must also be added to Guil= e before we can get EmacsGuile which I would also like. :)

I have my= own interactive-lambda macro that creates interactive lambdas for use in k= eybindings and such.=C2=A0 It seems that making the lambdas interactive is = a very important feature for the use cases I have for lambdas in Emacs.=C2= =A0 I also have an (inaccurately named) add-lambda-to-hook macro that creat= es a _named_ function and adds it to a hook.=C2=A0 This prevents it from be= ing double added and allows updating the "lambda".=C2=A0 IOW I= 9;m not sure a single mechanism can handle all use cases satisfactorily.
-Ivan
--047d7b2ee2e90f63ff050d409033--