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: Imports / inclusion of s.el into Emacs Date: Sun, 3 May 2020 16:27:52 +0200 Message-ID: References: <87ftchy0go.fsf@gnus.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c87b3005a4bf3989" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="112986"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen , Stefan Monnier , Richard Stallman , Emacs developers To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 03 16:28:54 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 1jVFbx-000TFz-KX for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 16:28:53 +0200 Original-Received: from localhost ([::1]:39150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jVFbw-0007Hg-Nd for ged-emacs-devel@m.gmane-mx.org; Sun, 03 May 2020 10:28:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jVFbS-0006ob-4k for emacs-devel@gnu.org; Sun, 03 May 2020 10:28:22 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:45175) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jVFbQ-0005OA-TU; Sun, 03 May 2020 10:28:21 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id a4so1055009lfh.12; Sun, 03 May 2020 07:28:20 -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=p2/glsvW9w9MVuWP0M03V1vrvk/jqGyIaxNi59B74z0=; b=VuI4Tcahgc4s0wewRUOyPBfpwTiuRiADp25WB5G+E7XC4KsGpXtgEQynrPD1Lkm3P7 9TA77F0S4UscrKz/83mflx/0G1y4A8GhwxLuTUdtwYxs5XL+/SYeUuDYpIxpPgcHBnmQ aufAEyGnJmNsH76zkBB2rNlvoMJLYdgVmZVDQcs2OLaRzUaKJ7kgo0vhqjBETrX0gaLn EAN2Tm0OY/Kv4xLBwQfqdHJoTLO+lvoXEJqsk8AP+r0Lv8uCOOlzc/+TpadA6ohPQEum UWq9PJNBCg2LXmi2pp8RnWSd1CLACmt4fRhuCCzFVwu7monH+PKJ7jap8zpYbALl0ql5 BUGQ== 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=p2/glsvW9w9MVuWP0M03V1vrvk/jqGyIaxNi59B74z0=; b=uHFlBabheNfqLRkU9+sseg1pkV2xXK+eHlpNQwoEjGzAGFmxz+MfpxymfZmJL4Ru07 7TE42pDkazhRIB/htDMWoPS8Xm6qGEZn51MnWdUD9M7ZKPPoX1UMB8ww4Cj+lxnX6H0r HlOuHsrL3bIY/NaOaBJ/hc14fPw+7TzQ/pLL6hpzfVfTsxoSJUetjBrAU0i2M4C6V47Y Pnd8CcxVASRY25Of5LzZYMcM6Ex4V4fmp3ncI00m0JIEEHqBTjsft0+fkCQyIOUXQ1gb YhkqWyRlVP/HBD/qw+Gx9K+6TP3KCqq8DDnKnzgHb50ymZ1IB+1dWBl//aL4mkKPm9UX vncw== X-Gm-Message-State: AGi0PubBVa+ZBUPuseZnYnqwO6F8sdMqrg6V2PbkrkFwJEIQj6najA8/ RUUZwc5IEbPaWr/uQSKuF6kQUhkjeZTPBXRVZwc= X-Google-Smtp-Source: APiQypJK3Ex0dkXb25UqpIVxhdDKYm5GYgqxZ10okk3tzWjBLdi6NZqdg+jMAVUN9J/cqXzeZKnSiG6RQybWNfy4Wio= X-Received: by 2002:a05:6512:53a:: with SMTP id o26mr8581152lfc.111.1588516098700; Sun, 03 May 2020 07:28:18 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=philippe.vaucher@gmail.com; helo=mail-lf1-x129.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, HTML_MESSAGE=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:248689 Archived-At: --000000000000c87b3005a4bf3989 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable > > > What possible genericity is there about downcase/upcase? Okay they work > on strings and on chars, > > but it's pretty clear their topic is "characters" (string) no? > > Always and forever? Are strings, one-dimensional sequences of > characters by definition, the only thing you can think about that > involves characters whose case can be mutated? > Oh, it's designed for possible future structure in mind? While an interesting point I think it's a bit far fetched. > > > Do you think this organization would be useful? What if it had a cool > > > font and some cool logos? :-) I ask because that put me off at first= , > it > > > looked mouldy.) > > > > Yes, that'd be very useful and it's more or less what we are asking > > to be able to do. Again curious, do you think they made a mistake > > when they named it `string-downcase` there and not `downcase`? > > It only works on strings in CL, but characters are defined to be "singlet= on > string designators", a common concept in CL. Maybe they couldn't > quite decide on a generic version. You see CL didn't come from > nothing, it was a giant and very expensive effort to reconcile a > _lot_ of competing Lisps. > Interesting. > > >> s-truncate (len s) > > > truncate-string-to-width (I got there with apropos truncate.*string > btw). > > > > Okay then let's alias that to string-truncate. > > To achieve what? I would only bring confusion. Also to the s.el > cool kids, they would be equally confused, since the arguments > are reversed. > Can you stop with the "cool kids" labelling? I mean we are all old farts here :-P I just happen to have learnt both ways (readings lots of C++ books then eating lots of Ruby tutorials) and both are useful depending on what you do. > > >> s-left (len s) > > >subseq > > >> s-right (len s) > > > Add an "from-end" arg to subseq? > > > > Why is there substring if there is subseq then? > > =C2=AF\_(=E3=83=84)_/=C2=AF History? substring has both optional args. > Use substring if you absolutely know your sequence > is a string, subseq otherwise. > Thanks for the clarification. > > >> s-repeat (num s) > > > (cl-loop repeat num concat s) > > > > What if I don't know cl (like I a significant number of package authors= ) > ? > > I think you might want to learn how to loop if you're going to program. > You can use while, do, etc. cl-loop is just my favourite. > I don't think this function needs to be in a library, but maybe an exampl= e > of how do this can be in one of those boring paragraphs of the manual. > The implication that I don't know how to do loops is a bit mean, but I'll let that pass. I don't know `cl` (tho I copy-pasted some in the past), but I do know loops. I was always somewhat taught that `cl` was not _really_ emacs lisp so you should not use it. Maybe that's wrong. > > >> s-contains-p (needle s &optional ignore-case) > > > string-match-p > > That can work, tho the mental path of having to do a regexp match > > while regexp-quoting the string just to do a plain text search feels > very inneficient. > > Well, I honestly had to look up the doc if "needle" was a string > or a character. So that mental path is quite worse for me. > Again very interesting: needle and haystack is also a metaphor used in many languages. It's another point where I'd have thought you were trolling if you didn't understand! > > >> s-blank-p (s) > > > ugh. nil is a string? > > "is the string blank?" is a concept in many languages, > > but I understand it can be surprising at first. > > Yes, things are suprising at first, then you learn them. > Get the hint? ;-) :-) Maybe a bit of information that can be useful for you is that I code packages since a while now, for example https://github.com/Silex/docker.el It's been years since I use Emacs. I obviously never took the proper time to learn it in full depth but I'm not a "newbie". Philippe --000000000000c87b3005a4bf3989 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
> What possible genericity is there about downcase/up= case? Okay they work on strings and on chars,
> but it's pretty clear their topic is "characters" (strin= g) no?

Always and forever? Are strings, one-dimensional sequences of
characters by definition, the only thing you can think about that
involves characters whose case can be mutated?

Oh, it's designed for possible future structure in mind? While = an interesting point I think it's a bit far fetched.

=C2=A0
> &= gt; Do you think this organization would be useful? What if it had a cool > > font and some cool logos? :-)=C2=A0 I ask because that put me off= at first, it
> > looked mouldy.)
>
> Yes, that'd be very useful and it's more or less what we are a= sking
> to be able to do. Again curious, do you think they made a mistake
> when they named it `string-downcase` there and not `downcase`?

It only works on strings in CL, but characters are defined to be "sing= leton
string designators", a common concept in CL. Maybe they couldn't quite decide on a generic version. You see CL didn't=C2=A0 come from nothing, it was a giant and very expensive effort to reconcile a
_lot_ of competing Lisps.

Interesting.<= /div>
=C2=A0
>= ; >> s-truncate (len s)
> > truncate-string-to-width (I got there with apropos truncate.*stri= ng btw).
>
> Okay then let's alias that to string-truncate.

To achieve what? I would only bring confusion.=C2=A0 Also to the s.el
cool kids, they would be equally confused, since the arguments
are reversed.

Can you stop with the &qu= ot;cool kids" labelling? I mean we are all old farts here :-P I just h= appen to have learnt both ways (readings lots of C++ books then eating lots= of Ruby tutorials) and both are useful depending on what you do.

=C2=A0
> >> s-left (len s)
> >subseq
> >> s-right (len s)
> > Add an "from-end" arg to subseq?
>
> Why is there substring if there is subseq then?

=C2=AF\_(=E3=83=84)_/=C2=AF History?=C2=A0 substring has both optional args= .
Use substring if you absolutely know your sequence
is a string, subseq otherwise.

Thanks f= or the clarification.

=C2=A0
> >> s-repeat (num s)
> > (cl-loop repeat num concat s)
>
> What if I don't know cl (like I a significant number of package au= thors) ?

I think you might want to learn how to loop if you're going to program.=
You can use while, do, etc. cl-loop is just my favourite.
I don't think this function needs to be in a library, but maybe an exam= ple
of how do this can be in one of those boring paragraphs of the manual.
<= /blockquote>

The implication that I don't know how t= o do loops is a bit mean, but I'll let that pass. I don't know `cl`= (tho I copy-pasted some in the past), but I do know loops. I was always so= mewhat taught that `cl` was not _really_ emacs lisp so you should not use i= t. Maybe that's wrong.

=C2=A0
> >> s-contains-p (needle s &optional ignore-case)
> > string-match-p
> That can work, tho the mental path of having to do a regexp match
> while regexp-quoting the string just to do a plain text search feels v= ery inneficient.

Well, I honestly had to look up the doc if "needle" was a string<= br> or a character.=C2=A0 So that mental path is quite worse for me.

Again very interesting: needle and haystack is al= so a metaphor used in many languages. It's another point where I'd = have thought you were trolling if you didn't understand!

=
=C2=A0
&g= t; >> s-blank-p (s)
> > ugh. nil is a string?
> "is the string blank?" is a concept in many languages,
> but I understand it can be surprising at first.

Yes, things are suprising at first, then you learn them.
Get the hint? ;-)

:-)

<= div>Maybe a bit of information that can be useful for you is that I code pa= ckages since a while now, for example=C2=A0https://github.com/Silex/docker.el

<= div>It's been years since I use Emacs. I obviously never took the prope= r time to learn it in full depth but I'm not a "newbie".

Philippe
--000000000000c87b3005a4bf3989--