From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: map-put! and (setf (map-elt ...) ..) on lists Date: Sun, 16 Dec 2018 09:37:15 -0800 (PST) Message-ID: <8b3d6cc4-43ac-48cc-be4c-917f601faa43@default> References: <87y38p4ely.fsf@tromey.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1544982286 5731 195.159.176.226 (16 Dec 2018 17:44:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 16 Dec 2018 17:44:46 +0000 (UTC) Cc: Nicolas Petton , emacs-devel@gnu.org To: Tom Tromey , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 16 18:44:42 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gYaT3-0001Nr-Ok for ged-emacs-devel@m.gmane.org; Sun, 16 Dec 2018 18:44:41 +0100 Original-Received: from localhost ([::1]:43305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYaVA-0006EM-GC for ged-emacs-devel@m.gmane.org; Sun, 16 Dec 2018 12:46:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gYaV0-00068i-SF for emacs-devel@gnu.org; Sun, 16 Dec 2018 12:46:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gYaM0-00074U-Qp for emacs-devel@gnu.org; Sun, 16 Dec 2018 12:37:29 -0500 Original-Received: from userp2120.oracle.com ([156.151.31.85]:42084) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gYaM0-0006vD-Gk for emacs-devel@gnu.org; Sun, 16 Dec 2018 12:37:24 -0500 Original-Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBGHY8mD031927; Sun, 16 Dec 2018 17:37:21 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 : content-transfer-encoding; s=corp-2018-07-02; bh=ItkWrLHxaZDBUBayA93U9jVhs14HS4c1Jftz9tyY2Zo=; b=VFTWh2My/UWhDrU/I6l7i8yfRZnlShqhtedwRpdTppp4cE1Zv6CZqUiUTlij7DraVE/2 X9gWINhtGEd7N42xIER0o0C4smiNnObDU5Xg65YLmBYauy/bVHMfQpzgJPqb34RDb0e+ TKnQYfaSyP2X4/gi6TndiWPe6yD5wvl2Q4xIyEE3J/GsjVRn+LqZpr9RRAz7qD3tIR2j +SpBjFbC2jsqchX5Uf+FA9VPzrJ4FKljUUlJOX39JEly1XlEGR77+QAfXnflfFIVF+50 zmyG0Lddxzs+e9iRIjzoO46tBpBsCGSs7uFydXUjBYL/UtbhJBlUz4uzBBWMh8MyJb8g bQ== Original-Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2pct8qjv7j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Dec 2018 17:37:21 +0000 Original-Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id wBGHbJ7J016505 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 16 Dec 2018 17:37:19 GMT Original-Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBGHbGuu004844; Sun, 16 Dec 2018 17:37:18 GMT In-Reply-To: <87y38p4ely.fsf@tromey.com> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4771.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9109 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=334 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812160164 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.85 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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:231856 Archived-At: > I wish Emacs would not adopt the Scheme "!" convention. I find it very d= istracting when reading code, as if it is shouting all the time. > Also, IMO, it's not normally the case that modifications are so important= that they have to be called out; and anyway if they are, it would be bette= r to leave this to person reading the code rather than the person writing i= t. What Tom said. But wait, there's more... It might make some sense for Scheme, especially in its use for teaching, but it doesn't make sense for Lisp (er, non-Scheme Lisp, if you prefer), where anything pure / side-effect free is the exception rather than the rule. Not to mention that tossing even a single impure grain into an otherwise pure recipe can make the entire cake you bake unclean. Are you going to suffix the name of each function you define with `!', to warn its users that it might perform side effects? Will coders hang such "danger" signs all over the place, the `!' effect spreading by simple contact, like a virus? Of course not - in practice, only predefined Scheme functions that might modify stuff get the `!' treatment. Consistent application of such a convention REALLY!WOULD!RESULT!IN!CODE!THAT! SHOUTS!EVERYWHERE!AND!ALWAYS!!! If the goal is to forewarn users then such lack of consistency can even hav= e the opposite effect of lulling them into thinking they're "safe" as long as they don't see a `!'. Visible `!'s and hidden `!'s ... oh my! Misleading, at best. Helpful for the first day of class perhaps, but best abandoned soon thereafter, after demonstrating the nasty, explosive contagion of side effects (including structure modification). Welcome to Lisp, kids. Procedural, imperative programming. Hold onto your seats - things are about to shake! Scheme is not Haskell or lambda calculus. And Lisp is not Scheme (ducks for cover...).