From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/28253 Path: main.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: cl Date: 14 Dec 1999 17:43:21 -0500 (EST) Organization: Emacsen advocacy group Sender: owner-ding@hpc.uh.edu Message-ID: References: <9t9ln6xrdkt.fsf@mraz.iskon.hr> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by WEMIKO 1.13.9 - "Euglena tripteris") Content-Type: multipart/mixed; boundary="Multipart_Tue_Dec_14_17:43:19_1999-1" X-Trace: main.gmane.org 1035165134 28925 80.91.224.250 (21 Oct 2002 01:52:14 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 01:52:14 +0000 (UTC) Return-Path: Original-Received: from farabi.math.uh.edu (farabi.math.uh.edu [129.7.128.57]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA19271 for ; Tue, 14 Dec 1999 17:44:47 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by farabi.math.uh.edu (8.9.3/8.9.1) with ESMTP id QAB04916; Tue, 14 Dec 1999 16:44:04 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Tue, 14 Dec 1999 16:44:08 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id QAA12071 for ; Tue, 14 Dec 1999 16:43:55 -0600 (CST) Original-Received: from jpl.org (mars.web-hosting.com [209.40.104.5]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id RAA19262 for ; Tue, 14 Dec 1999 17:43:31 -0500 (EST) Original-Received: (from yamaoka@localhost) by jpl.org (8.9.3/8.9.3) id RAA25227; Tue, 14 Dec 1999 17:43:28 -0500 (EST) Original-To: ding@gnus.org X-Wanted: Free NNTP servers for news posting. User-Agent: T-gnus/6.14.0 (based on Gnus v5.8.3) (revision 11) WEMIKO/1.13.9 (Euglena tripteris) SLIM/1.13.5 (=?ISO-2022-JP?B?GyRCOzNAJSReJF8bKEI=?=) MULE XEmacs/21.2 (beta23) (Hebe) (sparc-sun-solaris2.6) X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:28253 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:28253 --Multipart_Tue_Dec_14_17:43:19_1999-1 Content-Type: text/plain; charset=US-ASCII >>>>> In >>>>> Jan Vroonhof wrote: >> +(define-compiler-macro last (&whole form x &optional n) >> + (if (or (featurep 'xemacs) >> + (and (fboundp 'last) Jan> Why not wrap the whole thing an Jan> (unless (featurep 'xemacs) ..) This is the third time lucky. :-) --Multipart_Tue_Dec_14_17:43:19_1999-1 Content-Type: application/x-patch; type=patch Content-Disposition: attachment; filename="dgnushack.el.diff" Content-Transfer-Encoding: 7bit --- dgnushack.el~ Mon Dec 6 02:04:45 1999 +++ dgnushack.el Tue Dec 14 22:41:44 1999 @@ -30,6 +30,81 @@ (require 'cl) +(unless (featurep 'xemacs) + (define-compiler-macro last (&whole form x &optional n) + (if (and (fboundp 'last) + (subrp (symbol-function 'last))) + form + (if n + `(let* ((x ,x) + (n ,n) + (m 0) + (p x)) + (while (consp p) + (incf m) + (pop p)) + (if (<= n 0) + p + (if (< n m) + (nthcdr (- m n) x) + x))) + `(let ((x ,x)) + (while (consp (cdr x)) + (pop x)) + x)))) + + (define-compiler-macro mapcon (&whole form fn seq &rest rest) + (if (and (fboundp 'mapcon) + (subrp (symbol-function 'mapcon))) + form + (if rest + `(let (res + (args (list ,seq ,@rest)) + p) + (while (not (memq nil args)) + (push (apply ,fn args) res) + (setq p args) + (while p + (setcar p (cdr (pop p))) + )) + (apply (function nconc) (nreverse res))) + `(let (res + (arg ,seq)) + (while arg + (push (funcall ,fn arg) res) + (setq arg (cdr arg))) + (apply (function nconc) (nreverse res)))))) + + (define-compiler-macro member-if (&whole form pred list) + (if (and (fboundp 'member-if) + (subrp (symbol-function 'member-if))) + form + `(let ((fn ,pred) + (seq ,list)) + (while (and seq + (not (funcall fn (car seq)))) + (pop seq)) + seq))) + + (define-compiler-macro union (&whole form list1 list2) + (if (and (fboundp 'union) + (subrp (symbol-function 'union))) + form + `(let ((a ,list1) + (b ,list2)) + (cond ((null a) b) + ((null b) a) + ((equal a b) a) + (t + (or (>= (length a) (length b)) + (setq a (prog1 b (setq b a)))) + (while b + (or (memq (car b) a) + (push (car b) a)) + (pop b)) + a))))) + ) + ;; If we are building w3 in a different directory than the source ;; directory, we must read *.el from source directory and write *.elc ;; into the building directory. For that, we define this function --Multipart_Tue_Dec_14_17:43:19_1999-1--