emacs-devel
[Top][All Lists]
Advanced

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

Re: 10 problems with Elisp, part 10


From: Eli Zaretskii
Subject: Re: 10 problems with Elisp, part 10
Date: Fri, 09 Aug 2024 13:46:08 +0300

> From: Emanuel Berg <incal@dataswamp.org>
> Date: Fri, 09 Aug 2024 10:36:58 +0200
> 
> Dr. Arne Babenhauserheide wrote:
> 
> >>   (unless end
> >>     (setq end 73))
> >>   (unless step
> >>     (setq step (min 10 (max 2 (/ end 10)))))
> >>   (unless i
> >>     (setq i 0))
> >
> > This could already be trimmed a lot:
> >
> > (setq
> >   end (or end 37)
> >   step (or step (min 10 (max 2 (/ end 10))))
> >   i (or i 0))
> >
> > → start optimizing where no syntax breakage is needed.
> 
> That's the thing, one shouldn't have to optimize anything, and
> in particular not such common and everyday things, the language
> should optimize that for you.

The above is not optimization, it is the usual Emacs Lisp style of
doing this kind of jobs.

> Please write all this in Lisp anywhere near this 88 chars, and
> then I'm even generous with the whitespace.
> 
> [
>   end  :r  0<   :d 73         :pa
>   step :rc 2-10 :d (/ end 10)    
>   i    :r  0<=  :d 0             
> ]
> 
> :r means signal error if outside of the interval.
> 
> :rc means set to min or max if outside of the interval.
> 
> Defaults should be the same for interactive and
> non-interactive use.
> 
> :pa means both M-x, C-u M-x, and C-u x M-x should work.

The very fact that you need to explain what this mean speaks volumes.

Anyway, we are not going to redesign Emacs Lisp, so this line of
discussion leads nowhere.  Please stop keeping it alive, it just adds
unnecessary noise to this already very noisy list.



reply via email to

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