From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: Why aren't there functions such as filter, take-while, etc. "by default"? Date: Sun, 25 Apr 2010 22:27:18 +0200 Message-ID: References: <87fx2j5wle.fsf@lola.goethe.zz> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1272227271 2126 80.91.229.12 (25 Apr 2010 20:27:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 25 Apr 2010 20:27:51 +0000 (UTC) Cc: emacs-devel@gnu.org To: David Kastrup Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Apr 25 22:27:50 2010 connect(): No such file or directory Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O68Qf-0008NP-GV for ged-emacs-devel@m.gmane.org; Sun, 25 Apr 2010 22:27:49 +0200 Original-Received: from localhost ([127.0.0.1]:52486 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O68Qe-0004rx-TR for ged-emacs-devel@m.gmane.org; Sun, 25 Apr 2010 16:27:48 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O68QZ-0004rs-UE for emacs-devel@gnu.org; Sun, 25 Apr 2010 16:27:43 -0400 Original-Received: from [140.186.70.92] (port=38059 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O68QX-0004rb-MP for emacs-devel@gnu.org; Sun, 25 Apr 2010 16:27:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O68QW-00065Q-5h for emacs-devel@gnu.org; Sun, 25 Apr 2010 16:27:41 -0400 Original-Received: from mail-ww0-f41.google.com ([74.125.82.41]:50420) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O68QW-000659-1K; Sun, 25 Apr 2010 16:27:40 -0400 Original-Received: by wwb13 with SMTP id 13so24300wwb.0 for ; Sun, 25 Apr 2010 13:27:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=xYoNNlHBY8jXinwA69EVteTLKsGABiU0qa9uawhNkaI=; b=UopH/m7OrYVa0iKDIEAvChEl6PBnd83Pe7UYqRz74DB8Vjrz/JgiVCzueakNz3bU4B 7bwDehVUncG53NUPkkct19UmBayOKltLODWzkKHTfwz4hYXbaAsusju9kdqt9e87kveH UjZxKMJYqZI8yWnCjvhlqaIjsDkKhcTPYVTeQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=muwOza3qJgA8McsWntVOaepedz3orJ+ZdZhL0JjUYoVa3tDwaOrLye4X2neNfJK2rh VNMK1oQIN2qII/Ybe8v0cKZlfVAWji6hHjjH4KVskViQKCHdswr/7uKvc0bmyf/YT1bC auXX7rW2j6vu/Qjl6VZaNeToiXEIKqBK8UMlY= Original-Received: by 10.216.85.8 with SMTP id t8mr173926wee.39.1272227258239; Sun, 25 Apr 2010 13:27:38 -0700 (PDT) Original-Received: by 10.216.229.83 with HTTP; Sun, 25 Apr 2010 13:27:18 -0700 (PDT) In-Reply-To: <87fx2j5wle.fsf@lola.goethe.zz> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:124206 Archived-At: 2010/4/25 David Kastrup : > Deniz Dogan writes: > >> Why does it have to be so hard to write Emacs Lisp without requiring cl? >> >> Why aren't there functions such as filter (the equivalent of >> remove-if-not in cl-seq.el), take-while, reduce etc. "native" in >> Emacs? > > They make for no-surprise efficient programs primarily when the language > has lexical closures. > I see, I had never thought of that. What about including these functions "by default" (or other implementations of them) but with warnings in the docstrings about the possibly unexpected behavior due to the dynamic scoping? There are already functions that don't always act like one could expect, e.g. `sort' which given a list and a predicate sorts the list destructively (rendering the original list useless) and then returns a sorted copy of the original list. These two behaviors are usually mutually exclusive in other languages. (let* ((my-list (list 3 2 1)) (sorted (sort my-list '<))) my-list) ;; returns (3) -- Deniz Dogan