emacs-devel
[Top][All Lists]
Advanced

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

Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]


From: 조성빈
Subject: Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]
Date: Sat, 9 May 2020 13:26:28 +0900

> 2020. 5. 9. 오후 12:56, Richard Stallman <address@hidden> 작성:
> 
> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
> 
>> But you just described what dash does. ;-) It is just a collection 
>> of list-handling functions such as they exist in modern functional 
>> programming languages. If you're used to thinking in this paradigm 
>> and then come (back) to Emacs Lisp, it feels like a hopelessly 
>> clunky language. `dash.el` was written to remedy this.
> 
> That sounds like they could be useful facilities.  Since they are real
> features, not mere aliases and trivialities, they would not have the
> main flaw of s.el.

How is s.el ‘mere aliases and trivialities’ and dash.el isn’t? Both provides 
convenience APIs for easier use...

Below is a random long function in s.el... 
(defun s-shared-end (s1 s2)
  "Returns the longest suffix S1 and S2 have in common."
  (declare (pure t) (side-effect-free t))
  (let* ((l1 (length s1))
         (l2 (length s2))
         (search-length (min l1 l2))
         (i 0))
    (while (and (< i search-length)
                (= (aref s1 (- l1 i 1)) (aref s2 (- l2 i 1))))
      (setq i (1+ i)))
    ;; If I is 0, then it means that there's no common suffix between
    ;; S1 and S2.
    ;;
    ;; However, since (substring s (- 0)) will return the whole
    ;; string, `s-shared-end' should simply return the empty string
    ;; when I is 0.
    (if (zerop i)
        ""
      (substring s1 (- i)))))

And below is a random short function from dash.el...

(defun -map (fn list)
  "Return a new list consisting of the result of applying FN to the items in 
LIST."
  (mapcar fn list))

Just that some aliases exist for  consistency doesn’t mean that the whole 
package is filled with aliases.

> However, we should look carefully at the specific interfaces
> of the entry points.  Including something into Emacs is a time
> for regularizing little details.
> 
> Also, I get the impression the names don't fit Emacs's conventions.
> 
> -- 
> Dr Richard Stallman
> Chief GNUisance of the GNU Project (https://gnu.org)
> Founder, Free Software Foundation (https://fsf.org)
> Internet Hall-of-Famer (https://internethalloffame.org)
> 
> 
> 



reply via email to

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