emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Clojure-like syntactic sugar for an anonymous function liter


From: Daniel Colascione
Subject: Re: [PATCH] Clojure-like syntactic sugar for an anonymous function literal
Date: Thu, 22 Jan 2015 01:53:33 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 01/22/2015 01:49 AM, David Kastrup wrote:
> René Kyllingstad <address@hidden> writes:
> 
>> On Thu, Jan 22, 2015 at 10:17 AM, David Kastrup <address@hidden> wrote:
>>> That does not mean that I am convinced we want or need short-lambda.
>>
>> Both C++ and Java have "recently" added a succinct syntax for their 
>> equivalents.
>>
>> Given the amount of work it is to add features to either platform,
>> quite a few people
>> deemed it useful there.
>>
>> At least most peoples .emacs will look a bit tidier with a succinct
>> anonymous lambda
>> as an argument to add-hook :)
> 
> You are aware that using add-hook with ad-hoc functions is a bad idea
> since it may mean that you add the same functionality several times in
> case the add-hook is executed multiple times?

I occasionally use defun for that:

  (add-hook 'some-hook (defun foo () (bar))

This way, no matter how many times we evaluate the form, we install only
one function.  It's usually clearer to just define the function out of
line though.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]