emacs-devel
[Top][All Lists]
Advanced

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

Re: Explain a bit more on how to configure language server in Eglot's ma


From: Augusto Stoffel
Subject: Re: Explain a bit more on how to configure language server in Eglot's manual'
Date: Thu, 09 Mar 2023 09:28:12 +0100

>> The utility function belongs to map.el.  It is called `assoc-in` in
>> Clojure.
>
> Yuri presented some pretty good arguments about how that would
> be a bad idea.  Also, not a Clojure expert, but AFAIK that
> function doesn't take dotted notation strings as input.

Good, let's not do it then.  In any case, just for fun and because it
could be useful in some other situation, I proposed in bug#62068 the
suitable additions to map.el.  Then the conversion we were discussing
looks like this:

(defun dotted-to-nested (items)
  (seq-reduce
   (pcase-lambda (map `(,ks . ,v))
     (map-insert-in map
                    (mapcar 'intern (string-split ks "\\."))
                    v
                    'plist))
   (map-pairs items)
   nil))

(dotted-to-nested '("a.b.c" 1
                    "a.b.d" 2
                    "a.e.f" 3))
=> (a (e (f 3) b (d 2 c 1)))     [modulo bug#62067]





reply via email to

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