gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] omitting duplicates in apropos and apropos-list


From: Camm Maguire
Subject: Re: [Gcl-devel] omitting duplicates in apropos and apropos-list
Date: 09 Feb 2003 21:59:57 -0500

Greetings!  Sounds great to me, but I think someone else on the list
had earlier investigated and determined that the existing behavior was
what was called for by the spec.  Comments anyone?

Take care,

John Paul Wallington <address@hidden> writes:

> How about omitting the duplicates in apropos and apropos-list output?
> 
> Index: packlib.lsp
> ===================================================================
> RCS file: /cvsroot/gcl/gcl/lsp/packlib.lsp,v
> retrieving revision 1.9
> diff -u -r1.9 packlib.lsp
> --- packlib.lsp       21 Jan 2003 16:41:49 -0000      1.9
> +++ packlib.lsp       8 Feb 2003 13:31:18 -0000
> @@ -134,24 +134,6 @@
>    (terpri))
>  
>  
> -(defun apropos (string &optional package)
> -  (setq string (string string))
> -  (cond (package
> -         (do-symbols (symbol package)
> -           (when (substringp string (string symbol))
> -                 (print-symbol-apropos symbol)))
> -         (do ((p (package-use-list package) (cdr p)))
> -             ((null p))
> -           (do-external-symbols (symbol (car p))
> -             (when (substringp string (string symbol))
> -                   (print-symbol-apropos symbol)))))
> -        (t
> -         (do-all-symbols (symbol)
> -           (when (substringp string (string symbol))
> -                 (print-symbol-apropos symbol)))))
> -  (values))
> -
> -
>  (defun apropos-list (string &optional package &aux list)
>    (setq list nil)
>    (setq string (string string))
> @@ -161,14 +143,22 @@
>                   (setq list (cons symbol list))))
>           (do ((p (package-use-list package) (cdr p)))
>               ((null p))
> -           (do-symbols (symbol (car p))
> +           (do-external-symbols (symbol (car p))
>               (when (substringp string (string symbol))
> -                   (setq list (cons symbol list))))))
> +            (setq list (cons symbol list))))))
>          (t
>           (do-all-symbols (symbol)
>             (when (substringp string (string symbol))
>                   (setq list (cons symbol list))))))
> -  list)
> +  (stable-sort (delete-duplicates list :test #'eq)
> +            #'string< :key #'symbol-name))
> +
> +
> +(defun apropos (string &optional package)
> +  (dolist (symbol (apropos-list string package))
> +    (print-symbol-apropos symbol))
> +  (values))
> +
>  
>  (defmacro with-package-iterator ((name plist &rest symbol-types) . body)
>    (let ((p (gensym)) (i (gensym)) (l (gensym)) (q (gensym)) (dum (gensym))
> 
> 
> _______________________________________________
> Gcl-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gcl-devel
> 
> 

-- 
Camm Maguire                                            address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah




reply via email to

[Prev in Thread] Current Thread [Next in Thread]