From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Wells Newsgroups: gmane.emacs.devel Subject: Re: un-deprecating CL Date: Mon, 17 Sep 2007 03:25:13 +0100 Message-ID: <86k5qqgh9y.fsf@macs.hw.ac.uk> References: <864phxjj03.fsf@macs.hw.ac.uk> <87hclx834d.fsf@red-bean.com> <86ps0jiwfm.fsf@macs.hw.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1189995940 32000 80.91.229.12 (17 Sep 2007 02:25:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Sep 2007 02:25:40 +0000 (UTC) Cc: kfogel@red-bean.com, eliz@gnu.org, dto@gnu.org, emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Sep 17 04:25:37 2007 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.50) id 1IX6Ir-0001dH-9r for ged-emacs-devel@m.gmane.org; Mon, 17 Sep 2007 04:25:37 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IX6Iq-0006eP-30 for ged-emacs-devel@m.gmane.org; Sun, 16 Sep 2007 22:25:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IX6Il-0006di-FQ for emacs-devel@gnu.org; Sun, 16 Sep 2007 22:25:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IX6Ik-0006dO-Rh for emacs-devel@gnu.org; Sun, 16 Sep 2007 22:25:31 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IX6Ik-0006dL-KI for emacs-devel@gnu.org; Sun, 16 Sep 2007 22:25:30 -0400 Original-Received: from izanami.macs.hw.ac.uk ([137.195.13.6]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IX6IX-00064z-TN; Sun, 16 Sep 2007 22:25:18 -0400 Original-Received: from selene.macs.hw.ac.uk ([137.195.27.40]:46399 helo=127.0.0.1) by izanami.macs.hw.ac.uk with smtp (Exim 4.51) id 1IX6IU-000163-NU; Mon, 17 Sep 2007 03:25:14 +0100 Original-Received: (nullmailer pid 1011 invoked by uid 1001); Mon, 17 Sep 2007 02:25:14 -0000 In-Reply-To: (Richard Stallman's message of "Sun\, 16 Sep 2007 20\:21\:15 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:79070 Archived-At: Richard Stallman writes: > incf callf callf2 setf function* destructuring-bind case typecase > loop union intersection set-difference subst sort* delete* > > That is a long list. But also a good list. > destructuring-bind is ok to add, because it is simple and modular. By the way, destructuring-bind supports full Common Lisp style argument lists. > Likewise `case' and `typecase'. Hurray! These two macros are extremely useful. > I don't want to add CL argument lists, Just curious: Why not? (By the way, librep, which is derived from the GNU Emacs Lisp implementation, implements keyword arguments, optional arguments with defaults, and dotted-list notation for &rest arguments. It doesn't implement all the possibilities of CL.) > so no `function*' or `defun*'. > I don't want to add `union' or `intersection' or `set-difference' or > `subst' or `sort*' or `delete*', because they use CL keyword > arguments. Okay, but they are extremely useful functions, and people keep reimplementing this functionality. For example, typing =E2=80=9CC-h a union RET=E2=80=9D in my running Emacs r= eveals union (from cl), gnus-union and gnus-sorted-union, ediff-union, and jbw-sorted-number-list-union (my own). And I wouldn't be surprised to find other packages (which I haven't loaded in this Emacs) that also implement union. > Adding `setf' really means adding `defstruct'. By the way, setf and related functions are very useful even without defstruct. It's the =E2=80=9Cgeneralized variable=E2=80=9D notion which ma= kes them useful. Here are some examples of using =E2=80=9Cgeneralized variables=E2= =80=9D from my code that don't rely on defstruct: (setf (cadr break-style) 'line) (setf (nth 1 node) (cons (cons 'id unique-id) (nth 1 node))) (callf2 delete macro (cadr p)) (callf2 concat "[" (car return-value) "]") (push x (symbol-value tab)) (push ":active" (cdr (assq 'class munged))) (pushnew macro (cadr p) :test #'equal) Writing out the macroexpanded versions of the above would be a pain. I can also supply examples using structures. I'm just pointing out that the =E2=80=9Cgeneralized variable=E2=80=9D notion is about more than s= tructures. > That might be a good > feature to add, but it is too complex because of all the structure > options. If we get rid of most of them, `defstruct' could be simple > enough to add. I did forget to ask for defstruct! So yes, defstruct also please. > `incf' and `callf' are creeping featurism, and not worth adding. callf is marvelous and makes it much easier to program! I'd hate to have to define my own callf all the time. > `setf' is enough. But I would not mind extending `push' and `pop' > work with structs in the CL fashion. > > pushnew adjoin caaar caaddr caadr cadaddr cadar caddar cadddr caddr > cdaar defun* flet every substitute find subsetp > > `pushnew' is ok. `caaar' and so on are superfluous, I think. > Definitely not `flet'; I think its use is bad practice. > > `every', `substitute', `find' and `subsetp' have the ugly CL keyword > arguments, so I don't want to add them. Nonetheless, the functions are very useful. Richard Stallman writes: > some every notany > remove-if delete-if > > Those are useful operations, and I would like to add facilities to do > them. I'm very happy to hear this, because it is tiring to reimplement and redebug such functionality. I hope this message is helpful. --=20 Joe