From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Philippe Vaucher Newsgroups: gmane.emacs.devel Subject: Re: [ELPA] New package: transient Date: Wed, 29 Apr 2020 17:25:09 +0200 Message-ID: References: <87368npxw4.fsf@bernoul.li> <87v9ljo5d0.fsf@bernoul.li> <87ftcnxu5m.fsf@bernoul.li> <83y2qezlpd.fsf@gnu.org> <83tv12zjx1.fsf@gnu.org> <837dxyz83p.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000007d6d4905a46f8e02" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="84917"; mail-complaints-to="usenet@ciao.gmane.io" Cc: adam@alphapapa.net, kyle@kyleam.com, Jonas Bernoulli , monnier@iro.umontreal.ca, Emacs developers To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Apr 29 17:45:31 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jTotv-000Lz3-3X for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 17:45:31 +0200 Original-Received: from localhost ([::1]:36802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTotu-0005Ej-3J for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Apr 2020 11:45:30 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34410) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jTosj-0003a7-T4 for emacs-devel@gnu.org; Wed, 29 Apr 2020 11:44:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jTosj-0001cF-7I for emacs-devel@gnu.org; Wed, 29 Apr 2020 11:44:17 -0400 Original-Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]:37965) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jToaS-0004f7-W1; Wed, 29 Apr 2020 11:25:25 -0400 Original-Received: by mail-lj1-x232.google.com with SMTP id e25so3061090ljg.5; Wed, 29 Apr 2020 08:25:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LoEFV0Ve3+1QuXz85GG2PEVnEs/t0bvszrmXIMJQKVQ=; b=nb83EBxLqWE1q2UIl+Fxjz/I3eCAmu66gFE10LIiRZy+D7V7finPlqGbfFlQK1WAh8 NgvSLvMXvdrMH8xZr1/StGsE5DIfag9j2RPjJI8gvzM35yz7aNU/6bPElhYmUr65AzAi lxMR6txRvVT8PixFBtf2TUMFEazpAa9qr9cs/WusU1qYQTck3vs5616QIhDS9fax4i5p REJ9PkYXOyBwLpf/HPzcuyH1y5Mw46vdFsUqMUkLWiN9QXoQpQC/IBIoSZ2HLrUa9PAN IP/thuheYYlf58mBDrX2web4rt5MTwiPbq5zG4u1uvUaUV9+g+TV1rIovaPDlUUyXk7t hygQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LoEFV0Ve3+1QuXz85GG2PEVnEs/t0bvszrmXIMJQKVQ=; b=WjCqKIwSbu4MuMVvFqSHbrLUWfeD8MHxiDdZchM8wNlxXms6HgQ5loNcksxDXnueGE EveowJ75qw40mIYU3JoP51Cqm/ToNKQBKrljrKWS05uesPD4iufI3HcTrBdle6N6azkZ IdH0HZdqOyQDY27NxcozHtblXglZZP5Hym1i857UMhYHeY36K4PK3f864W8YfTDv1KNE kTr22bTOCCAKv5VmpAg9pyaoES2GpShG1hQN2Y0lC058CKZxkYAL6/I7J3yyJwhPByh2 4vYko51P9j+2A4aij01PLngDgMp/csfjq/OGMeNa51vsjS7YMsf8jI9P3P4gJtnCs3aA 15cw== X-Gm-Message-State: AGi0PuYMSlEyftJYALSUgbVuXVvgeFBUrFZ4FmobKCnj/TrgdEFXkTi2 TJdXELqMKeg4fmAFrN1B1GcznHKHEGRnbHAZZEZGNGic X-Google-Smtp-Source: APiQypKX8SeU1NQoY9wBNOtKyBlGPZkZCj0UE56hIpVAKZgpYT/zPcPDbosbkeleL43fpkB+scJGgNpCHP7pr5mvOdw= X-Received: by 2002:a2e:9e97:: with SMTP id f23mr21186936ljk.228.1588173922457; Wed, 29 Apr 2020 08:25:22 -0700 (PDT) In-Reply-To: <837dxyz83p.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=philippe.vaucher@gmail.com; helo=mail-lj1-x232.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::232 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:248156 Archived-At: --0000000000007d6d4905a46f8e02 Content-Type: text/plain; charset="UTF-8" > > > > * > https://www.gnu.org/software/emacs/manual/html_node/elisp/Association-Lists.html > sometimes > > assoc, > > > alist-get, assq, copy-alist. How am I supposed to use `C-h f alist > TAB` to discover the function I > > want? I > > > can't, I have to go to that webpage and read it all. > > > > I think "C-h d alist RET" is your friend. > > > > You miss the central point of my argument. > > I'm sorry to have missed that, but all I had was what you wrote: > > How am I supposed to use `C-h f alist TAB` to discover the function > I want? > I think you're not noticing that in the list above "assq" and "assoc" are not findable using "alist". > The problem is not that the doc is hard to find, it's that I *have* to > > find it to know which are the related functions. > > If "alist" is not a keyword that could be used in this case, then what > is? "associaion list"? something else? When one tries to discover > functionality, one must start with something, we cannot start with > nothing, can we? > No no, I *want* to use "alist" but cannot because it's not properly namespaced. > It is much easier for the mind to think in terms of namespaces, here are > examples from other languages: > > > > * https://clojure.github.io/clojure/clojure.string-api.html all string > functions stored under string > > * http://www.cplusplus.com/reference/cstring/ almost all string > manipulation function start with "str" > > * https://ruby-doc.org/stdlib-2.4.1/libdoc/fileutils/rdoc/FileUtils.html > all file manipulation function are stored in > > FileUtils:: > > > > I could go on but I think you should be able to understand my examples. > > I understand the examples, I just don't think you can expect the world > to be so simple. in C++ has just 20 functions, and if you > need to work with multibyte strings, you won't find them there, they > are in , which doesn't even have "string" in its name. > Focusing on exceptions is again avoiding the central argument. Let's take a simple example: shell-command-to-string. To which > "namespace" it should belong, in your opinion? It is relevant to > "shell", "commands", "programs", and "strings". > Under the "shell-" namespace is fine, the primary goal of this api is to run a shell command. Anyway, to steelman your argument yes, for some fonctions it might be complicated, especially generic ones. There are various solutions to this but the main factor in finding them is to focus on the main argument of my proposal: there are lots of domains where my proposal makes a lot of sense: process-*, file-*, directory-*, buffer-*, etc. You could start by acknowledging this. For the generic fonctions, we can either namespace them under generic-*, or alias them for each namespace like "list-lenght", "vector-length" etc. We could also not touch them at all and improve the rest where everyone agrees first, and focus on theses corner cases later. I am sure that if other langages solved it we can too, let's not be in the "perfect solution" bias ;-) Kind regards, Philippe --0000000000007d6d4905a46f8e02 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
>=C2=A0 > * https://www.gnu.org/software/emacs/manual/html_node/elisp/As= sociation-Lists.html sometimes
>=C2=A0 assoc,
>=C2=A0 >=C2=A0 alist-get, assq, copy-alist. How am I supposed to use= `C-h f alist TAB` to discover the function I
>=C2=A0 want? I
>=C2=A0 >=C2=A0 can't, I have to go to that webpage and read it a= ll.
>
>=C2=A0 I think "C-h d alist RET" is your friend.
>
> You miss the central point of my argument.

I'm sorry to have missed that, but all I had was what you wrote:

=C2=A0 How am I supposed to use `C-h f alist TAB` to discover the function<= br> =C2=A0 I want?

I think you're not noticing that in the list above "= assq" and "assoc" are not findable using "alist".<= /div>


> The prob= lem is not that the doc is hard to find, it's that I *have* to
> find it to know which are the related functions.

If "alist" is not a keyword that could be used in this case, then= what
is? "associaion list"? something else?=C2=A0 When one tries to di= scover
functionality, one must start with something, we cannot start with
nothing, can we?

No no, I *want* to use "alist" but cannot because= it's not properly namespaced.



> It is much easier fo= r the mind to think in terms of namespaces, here are examples from other la= nguages:
>
> * https://clojure.github.io= /clojure/clojure.string-api.html all string functions stored under stri= ng
> * http://www.cplusplus.com/reference/cstr= ing/ almost all string manipulation function start with "str"=
> * https://ruby= -doc.org/stdlib-2.4.1/libdoc/fileutils/rdoc/FileUtils.html all file man= ipulation function are stored in
>=C2=A0 FileUtils::
>
> I could go on but I think you should be able to understand my examples= .

I understand the examples, I just don't think you can expect the world<= br> to be so simple.=C2=A0 <cstring> in C++ has just 20 functions, and if= you
need to work with multibyte strings, you won't find them there, they are in <cwchar>, which doesn't even have "string" in it= s name.

Focusing on exceptions is again avoiding the central argument.
=


<= div class=3D"gmail_quote">
Let's take a s= imple example: shell-command-to-string.=C2=A0 To which
"namespace" it should belong, in your opinion?=C2=A0 It is releva= nt to
"shell", "commands", "programs", and "st= rings".

Under the "shell-" namespace is fine, the primary goa= l of this api is to run a shell command.

<= div dir=3D"auto">Anyway, to steelman your argument yes, for some fonctions = it might be complicated, especially generic ones. There are various solutio= ns to this but the main factor in finding them is to focus on the main argu= ment of my proposal: there are lots of domains where my proposal makes a lo= t of sense: process-*, file-*, directory-*, buffer-*, etc. You could start = by acknowledging this. For the generic fonctions, we can either namespace t= hem under generic-*, or alias them for each namespace like "list-lengh= t", "vector-length" etc.

We could also not touch them at all and improve the rest wh= ere everyone agrees first, and focus on theses corner=C2=A0cases later.

I am sure that if other lan= gages solved it we can too, let's not be in the "perfect solution&= quot; bias ;-)

Kind rega= rds,
Philippe
--0000000000007d6d4905a46f8e02--