From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jay Kamat Newsgroups: gmane.emacs.devel Subject: Re: dolist considered harmful Date: Tue, 30 Oct 2018 16:24:10 -0700 Message-ID: <86zhuvow6d.fsf@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1540941785 21891 195.159.176.226 (30 Oct 2018 23:23:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 30 Oct 2018 23:23:05 +0000 (UTC) User-Agent: mu4e 1.1.0; emacs 26.1 Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 31 00:23:01 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 1gHdLe-0005Xp-HA for ged-emacs-devel@m.gmane.org; Wed, 31 Oct 2018 00:22:58 +0100 Original-Received: from localhost ([::1]:56027 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHdNl-0002rh-1H for ged-emacs-devel@m.gmane.org; Tue, 30 Oct 2018 19:25:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHdMt-0002pE-Dt for emacs-devel@gnu.org; Tue, 30 Oct 2018 19:24:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHdMs-0002td-PP for emacs-devel@gnu.org; Tue, 30 Oct 2018 19:24:15 -0400 Original-Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]:39360) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gHdMs-0002sr-Dx for emacs-devel@gnu.org; Tue, 30 Oct 2018 19:24:14 -0400 Original-Received: by mail-pf1-x436.google.com with SMTP id c25-v6so6629983pfe.6 for ; Tue, 30 Oct 2018 16:24:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=references:user-agent:from:to:cc:subject:in-reply-to:date :message-id:mime-version; bh=SUZszv7go8/mJAW2gM9jXLqRoRpgXuhLTCVCbSi+vZ8=; b=JlG/jbCgUqwAWbg0gSglD2zwN16WWjG3DOyIPgFlSskWmu3Vju9thDgPAnqEVOpJlE SnC64pG2vwzhzws76dpJ2D79HAjgA8WSCua1HpnjiYYrIh6KtM6nv82VL7pmnOg/ZZQL OAl1m1gKBRQ6AcVZCvzxP7rRdwBF+mG6HopB87FfzXRPWM9Tedrgt0cbAvj5guWA8XrS Bu1ySbtFIFkQD5NeVG6yJA8K7u0zbDLBda4N6zPShl9dvie+1h8byybSSBGABeP628+V fWDrvyC4/NEgYSPaakeB4YtZ1B2i+ledPeJeNnOoT2gpzzvlI/InDpakXEgDHQqf3+NX N93w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject :in-reply-to:date:message-id:mime-version; bh=SUZszv7go8/mJAW2gM9jXLqRoRpgXuhLTCVCbSi+vZ8=; b=rB6c/uVn165eoLE4W2HK//qXozaGYReNsPv839I4ay8bXHk0iI8WoVr1EizP7px0Kq dBPpL74YRNBLoN1/ey8A8p3lFw7SmRtoQq7D+vuPDKaHORcvs53Ht/sWpxjoUkCykGya 0Z/50NIutaUXCtaXT10zX/XW78zw+XgRRrN8khFgwAyefrArMlnPY1XUc7orsWuweRFC 0ylYH6DKKacrQBpIZPFtJ5WV9PUNa8zCvfgmVWjZyhW+g1mF/uWBCaTlyW4UA4mu2x8O Sd1WJ2n/RbpQcMBBrOEnul8XANktSjWJRWHEH4opjqu5OVyMucEQumu4pJ3JrIIyGKxM R+Pw== X-Gm-Message-State: AGRZ1gI/w/T6jNjSMsppKrOMDsK4oOpiRBZ+D+oaggqffwNOrnjpMaB4 AXNe9Hx2qWJNtYcz/GdKi+R906XV X-Google-Smtp-Source: AJdET5f91oOp31EBTe3bdgNfYEohAMefvqJJ+F+DZhk1vNyT8T+3svj531FRoVX1VM5z1PU8DUpDkw== X-Received: by 2002:a62:2b41:: with SMTP id r62-v6mr726991pfr.105.1540941852282; Tue, 30 Oct 2018 16:24:12 -0700 (PDT) Original-Received: from vall ([2620:10d:c090:200::6:5a9b]) by smtp.gmail.com with ESMTPSA id t3-v6sm15514403pfk.59.2018.10.30.16.24.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 16:24:11 -0700 (PDT) In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::436 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:230858 Archived-At: Stefan Monnier writes: > Since it can only be used when we're 100% sure that LIST is a LIST, > (and who can be sure of such a thing in a dynamic language like Emacs > Lisp), I think we'd be better off deprecating it and changing all uses > of dolist with a clear while+cdr loop that everyone can understand. I haven't been following the other discussion, but I think deprecating dolist is a little extreme. I use dolist a lot because it makes a lot of things I write a lot simpler (over using the loop macro or mapcar). I suspect a lot of existing code out there uses dolist, a github search suggests about 500k uses (although many of those are probably copies).