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: discoveribility [Re: dash.el [was: Re: Imports / inclusion of s.el into Emacs]] Date: Sat, 9 May 2020 23:36:17 +0200 Message-ID: References: <0c88192c-3c33-46ed-95cb-b4c6928016e3@default> <87wo5mc04t.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="32653"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joost Kremers , Richard Stallman , Emacs developers To: "Alfred M. Szmidt" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 09 23:37:26 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 1jXX9x-0008MB-C0 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 23:37:25 +0200 Original-Received: from localhost ([::1]:54810 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jXX9w-0002eD-DK for ged-emacs-devel@m.gmane-mx.org; Sat, 09 May 2020 17:37:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jXX9P-0002Di-4p for emacs-devel@gnu.org; Sat, 09 May 2020 17:36:51 -0400 Original-Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]:35542) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jXX9K-0008H1-Ml; Sat, 09 May 2020 17:36:47 -0400 Original-Received: by mail-lj1-x242.google.com with SMTP id g4so5412395ljl.2; Sat, 09 May 2020 14:36:45 -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=7Ed60YFIGW2++miuyi1C1gHOmSzB/R3YR2OG8uRvLGg=; b=A5G7GxNgRuDza0tOM4loY27YbbS9glfXcHXg/gPABinnL16CjMgsMyYr86THYjiYp4 Hhea01XMUgjkPm8fSU06LiBgIE5894sq2X1uzWkhndV1qBi/5v0DTCF76mX0aYwByBBA LEum1/+XhhPQ/+B8s2ZW5K0nY6Nbq+fzM+vXqnI3z8BpmsI0wzbg9KanGlqSyk059nsm 4BIQ0oT7URtJf16rV2b/ApUsW6BKHLVP8nLK8eW5Re2TiVvEsUXsW+rLB3CDu2mhEWOL 1XtDnnT+hGRdwOzI4cky7Zzwf9iSfJmnUu5LyK+u9trmH9hh0nsqDf++EzTfe2jLfFSC d8KA== 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=7Ed60YFIGW2++miuyi1C1gHOmSzB/R3YR2OG8uRvLGg=; b=t6pMDPwL13WFRIHyfA5rPCpQLQl7gUKRssUKPHVa6d4KX4Mqzh3hoBPxVzcQl0AHi9 Ooowuk8UedVcmbRQjLPu7r++503eqFzOtj7pMYwU04XdTPxgp0Mmbv1Y4MzQMRr8tRrG pMykxoHQX2m8C/ujkLnKSbQz7CP9VguCbG87nWsyhVbvbe5Uppde3TkQCwWnqMsIc6cO WbYA56DrKJrr/4p67q7A1tQqAwqBPhQ77UJq8EWV5gvwSVhhMOV5nRlnrPHvtO5sy6yd Cm33YguBV43gZaE9tSpjspLO5YmeOQvUrcebOLEL+zaFC6Caeh9g9kmCmKO8kd+5dJCb 72vQ== X-Gm-Message-State: AOAM530Vpht4mXm/3+uxpjS8ReHKct2w9k8jW01Gwkm86htrtrnfaW/l kN19GpP1JIqfn7nQm59BgSEZXo3DmjqutwZp76Z8bamxjJE= X-Google-Smtp-Source: ABdhPJzRv4i9q2nQWmd+g8o+jgTGG3Ue7Fqfw+TYYNfwOVx/K0jtYk10HOS4jmP4p58oD3h3X5X1qiab5dkClOAcknM= X-Received: by 2002:a2e:700e:: with SMTP id l14mr5717549ljc.135.1589060203472; Sat, 09 May 2020 14:36:43 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=philippe.vaucher@gmail.com; helo=mail-lj1-x242.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action 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:249581 Archived-At: > > s.el has little point, it is thin wrappers around Emacs Lisp > > functions, and it has been explained why it isn't suitable (as is). > > To me it has the point of discoverability. I understand it's not > your position. I think both positions are reasonable. > > How does it make it more discoverable? It looks like you missed the previous discussion about namespaces. I think it's simpler if you read the following posts and then continue reading here: Why I'd like namespace for discoverabilty (C-h f): https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00099.html Proposed aliases: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00379.html Summary of counter-arguments: https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg00508.html So to still reply to your one-liner: because all the function using the same prefix makes it easy for me to quickly get *the exact list* of functions for a topic using "C-h f" or other tools. In the vast majority of languages some sort of grouping is done, e.g https://ruby-doc.org/core-2.6/String.html but also Python, Clojure, Haskell, etc. > E.g., how is s-ends-with? more discoverable than string-suffix-p? When > Emacs Lisp custom is to use -p for predicates, and to use the words > suffix/prefix. To take a trivial example. > > I understand that from the point of view of a different language > s-ends-with? might make more sense since you're assuming that it will > do the same as in Ruby since they have the same name. And you will > also assume that since one such function exists, there will be more > similar functions that remind you of your previous experience in Ruby. > > But we should view it from the lense of an Emacs Lisp hacker, where > discovering that one function for predicates is named with -p and some > with ? will be a big mess. Where sometimes one uses ends/starts > instead of suffix/prefix. All true but "offtopic" ;-) > Emacs's `capitalize` is usually absent from other languages, but when > it exists it's named titleize (Ruby). > > If you come from Ruby and assume that Emacs lisp is Ruby you will trip > -- but they are not the same languages, one cannot expect them to > behave the same. Well yes I kinda expected Emacs to give us high order programming in a consistent and organized manner. If you look at the popularity of dash/s.el/f.el we are many wanting that. > I can see how wanting to rename capitalize to titleize makes people > cry from the Emacs lisp perspective and how it feels silly from the > "rest of the languages" perspective (that you have "titleize" but not > "capitalize"). > > I think it makes people cry from an English language perspective > too... One is an actual word, the other isn't! > > It also is misleading, since it will lower case all words follow the > first one, where in an actual title one would expect things like > subjects to be capitalize. E.g, the chapter title "Strings and > Characters" -- we do not want it to be "Strings and characters"! Well as I said already in every language "capitalize" means first character uppercase all the rest lowercase: https://clojuredocs.org/clojure.string/capitalize https://apidock.com/ruby/String/capitalize https://www.geeksforgeeks.org/string-capitalize-python/ Emacs lisp is the only language that names "capitalize" what is named "titleize" in other languages (when it exists) and not have the "capitalize" equivalent of other languages. > Also personnaly when I want to know how to do something in plain Emacs > lisp I go & look at the source of dash functions, so in a sense it > improves "plain Emacs lisp" discoverability for me. > > Why would you go to dash.el to understand what Emacs does? Isn't it > just C-h f away to understand what any Emacs function is doing? How > is the Emacs manual, or Emacs Lisp manuals not serving this purpose > for you? Or any of the other features that Emacs provides to look up > things. If you know what to look for yes, with dash I can just regexp search for "^-.*\?" and find the *exact list* of all the predicates that works on a list. Searching the equivalent "*-p" in emacs gives me many wrong predicates not about list (note that all the dash `?` function have aliases named `-p` to be consistent with emacs, so you can use `-any-p` instead of `-any?`).