From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: master a6b5985: Avoid duplicated character classes in rx Date: Sat, 7 Dec 2019 07:18:36 -0800 (PST) Message-ID: References: <20191203142243.9552.27513@vcs0.savannah.gnu.org> <20191203142246.0615C20A2B@vcs0.savannah.gnu.org> <79A83C7D-610F-4CA4-B5E9-7F11FD8A9365@acm.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="__1575731918276277901abhmp0018.oracle.com" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="160832"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Eli Zaretskii , Stefan Monnier , Emacs developers To: Juanma Barranquero , Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 07 18:08:01 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iddYn-000fbV-Db for ged-emacs-devel@m.gmane.org; Sat, 07 Dec 2019 18:08:01 +0100 Original-Received: from localhost ([::1]:51768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iddYh-00013P-3g for ged-emacs-devel@m.gmane.org; Sat, 07 Dec 2019 12:07:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:32796) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iddYA-000139-Ez for emacs-devel@gnu.org; Sat, 07 Dec 2019 12:07:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iddY8-0005MF-Fo for emacs-devel@gnu.org; Sat, 07 Dec 2019 12:07:22 -0500 Original-Received: from userp2130.oracle.com ([156.151.31.86]:50836) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iddY5-0005IY-8L; Sat, 07 Dec 2019 12:07:18 -0500 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xB7FC50o083972; Sat, 7 Dec 2019 15:18:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type; s=corp-2019-08-05; bh=w6tLQEUcOc4YuQdL5/xdbzhBTIgo7fDY6017V7elyCU=; b=NqwVhZkDQT2PzYZPG1VdikUmG8g0nGOdPz+Mr46nmDiWHHnT8i4D0iotloK3jcmrlnhn EHlJbj65pXig8Fszk9lyxcM3AjRglE4MksInRzO9gKdwEN+r0xCWGMYXa5VjO5bwiWiV MdA6bLu2YAB7A0+a0cOlbOxw13Bri2BaD6LZKF+n9EGwhDlDTnffIJAJ7wR1jLy8gj7/ zVwUJ32nF4QMiaoj+pB7ob9EeYKAZAkA79zwnCboo94TMh0FL/H/yiUa3Q1LoHRPe8/d eXBIyrcpI4FoCddvsXYbOvO1ipd57mv6rCSwNSwUDPNYCU54KbTZQ5LCREAoxfjAJ7nJ cw== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2wr3gtshvu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 07 Dec 2019 15:18:40 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id xB7F8s2f080360; Sat, 7 Dec 2019 15:18:40 GMT Original-Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2wr3dygvj8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 07 Dec 2019 15:18:39 +0000 Original-Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id xB7FIcgN009246; Sat, 7 Dec 2019 15:18:38 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4927.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9463 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912070132 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9463 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-1912070132 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243214 Archived-At: --__1575731918276277901abhmp0018.oracle.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable (BTW - Even a purely functional definition of `push' would return the new s= tack/list value. And users would of course make use of that return value.) ___ =C2=A0 Besides the Hyperspec, Common Lisp the Language says this (and it's the cas= e also for the first, 1984 edition, not just CLTL2): [Macro] push=C2=A0item=C2=A0place The form=C2=A0place=C2=A0should be the name of a generalized variable conta= ining a list;=C2=A0item=C2=A0may refer to any Lisp object. The=C2=A0item=C2= =A0is consed onto the front of the list, and the augmented list is stored b= ack into=C2=A0place=C2=A0and returned. The form=C2=A0place=C2=A0may be any = form acceptable as a generalized variable to=C2=A0setf. If the list held in= =C2=A0place=C2=A0is viewed as a push-down stack, then=C2=A0push=C2=A0pushes= an element onto the top of the stack. For example: (setq x '(a (b c) d))=20 (push 5 (cadr x)) =3D> (5 b c)=C2=A0 and now x =3D> (a (5 b c) d) The effect of=C2=A0(push=C2=A0item=C2=A0place)=C2=A0is roughly equivalent t= o (setf place (cons item place)) except that the latter would evaluate any subforms of=C2=A0place=C2=A0twice= , while=C2=A0push=C2=A0takes care to evaluate them only once. Moreover, for= certain=C2=A0place=C2=A0forms=C2=A0push=C2=A0may be significantly more eff= icient than the=C2=A0setf=C2=A0version. =C2=A0 On Sat, Dec 7, 2019 at 5:48 AM Richard Stallman wrote: > What does Common Lisp say about the return value of 'push'? >From the Common Lisp Hyperspec: =C2=A0 Macro=C2=A0PUSH Syntax: push=C2=A0item place=C2=A0=3D>=C2=A0new-place-value Arguments and Values: item---an=C2=A0object. place---a=C2=A0place, the=C2=A0value=C2=A0of which may be any=C2=A0object. new-place-value---a=C2=A0list=C2=A0(the new=C2=A0value=C2=A0of=C2=A0place). Description: HYPERLINK \l "push=C2=A0prepends=C2=A0item=C2=A0to the=C2=A0list=C2=A0that = is stored in=C2=A0place, stores the resulting=C2=A0list=C2=A0in=C2=A0place,= and returns the=C2=A0list. > If Common Lisp describes a certain return value for 'push', > people will tend to use it that way, Yes, though as I said, it is very rarely used, at least on our sources. 34 = uses out of ~4,100. There are also a lot like (and test-1=C2=A0test-2=C2=A0... (push item place)) but don't really depend on the return value of `push', they're just using `= and' as a conditional. =C2=A0 > and I think it would be a waste of time changing all code that ever depen= ds on that return value. =C2=A0 At least for our sources, that time's already been wasted, whether we apply= my patch or not. =C2=A0 Emacs Lisp is not just for "our sources". It's for Emacs users. What we sho= w as the doc of a function matters for users, not just for Emacs internal d= evelopers. =C2=A0 > It would be easier to document that return value. =C2=A0 Not just easier. Better, including for users. I tend to agree, because I don't like gratuitously discarding CL=C2=A0compa= tibility. --__1575731918276277901abhmp0018.oracle.com Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable

(BTW -= Even a purely functional definition of `push' would return the new stack/l= ist value. And users would of course make use of that return value.)

___

 

Besides the Hyperspec, Common Lisp the Language says this= (and it's the case also for the first, 1984 edition, not just CLTL2):=

[Macro]
push item place

The form pl= ace should be the name of a generalized variable containing a list= ; item may refer to any Lisp object. The item&= nbsp;is consed onto the front of the list, and the augmented list is stored back into pl= ace and returned. The form place may be any form acceptable as a = generalized variable to setf. If the list held in place is viewed a= s a push-down stack, then push pushes an element onto the top of the stack. For= example:

(setq x '(a (b c) d))

(push 5 (cadr x)) =3D> (5 b c)=C2=A0 and now x = =3D> (a (5 b c) d)

The effect of (push&nbs= p;item place) is roughly equivalent to

(setf place (cons item place))

except that the latter would evaluate any subfo= rms of place twice, while push takes care to evaluate them onl= y once. Moreover, for certain place forms pu= sh may be signific= antly more efficient than the setf version.

 

On Sat, Dec 7, 2019 at 5:48 AM Richard Stallman <rms@gnu.org> wrote:

> What does Common Lisp say about the return value of = 'push'?

From the Common Lisp Hyperspec:

 

<= p>Syntax:

push=  item place =3D>=  new-place-value

Arguments and Values:

ite= m---an object.

place---a place, the value of which may be any object.

new-place-value---a list (the new&n= bsp;value of place).

Desc= ription:

=

push = prepends item to the list that is stored in place, stores the resultin= g list in place<= /i>, and returns the list.

> If Common Lisp describes a certai= n return value for 'push',
> people will tend to use it that way,
=
Yes, though as I said, it is very rarely used, at least on our sources.= 34 uses
out of ~4,100.

There are also a lot like(and test-1 test-2 ... (pu= sh item place))

but don't really depend on the return value of `push= ', they're just using `and'
as a conditional.

 

> and I think it would be a waste of time chan= ging all code that ever depends on that return value.

&n= bsp;

At least for our sources, that time's already bee= n wasted, whether we apply my <= span style=3D'font-family:"Courier New",serif'>patch or not.

=  

Emacs Lisp is no= t just for "our sources". It's for Emacs users. What we show as t= he doc of a function matters for users, not just for Emacs internal develop= ers.

 =

 

Not just eas= ier. Better, including for users.

I tend to agree, because I don't like gratuitously dis= carding CL compatibility.

=
--__1575731918276277901abhmp0018.oracle.com--