[Mew-dist 15738] Re: profile

Tak Ota Takaaki.Ota at example.com
2001年 1月 6日 (土) 13:17:05 JST


stringp の問題は直りました。ありがとうございます。

ところで doc string にも変更が加わったついでに

Distractively => Destructively 

も直してたいですね。

更に質問があります。

(setq ent (car alst))
(setq str (car ent))
(setq alst (cdr alst))

と

(setq ent (car alst)
      str (car ent)
      alst (cdr alst))

の差は誤差の範囲でしょうか?多分ほとんど変らない気がしますけど。

__________________________ Original Message __________________________
Subject: [Mew-dist 15736] Re: profile
Author:  Kazu Yamamoto (山本和彦) (kazu at example.com)
Date:    Sat, 6 Jan 2001 12:10:04 +0900
> 
> From: Tak Ota <Takaaki.Ota at example.com>
> Subject: Re: [Mew-dist 15734] Re: profile
> 
> > (wrong-type-argument stringp nil)
> > 
> > と言われてしまいました。
> 
> すいません。以下を b94 オリジナルに当てて下さい。
> 
> --かず
> 
> Index: mew-func.el
> ===================================================================
> RCS file: /usr/home/kazu/cvsroot/Mew/mew/mew-func.el,v
> retrieving revision 1.180
> retrieving revision 1.184
> diff -c -r1.180 -r1.184
> *** mew-func.el	2001/01/04 14:37:35	1.180
> --- mew-func.el	2001/01/06 03:08:47	1.184
> ***************
> *** 59,74 ****
>   	(setq n (1+ n))))))
>   
>   (defun mew-uniq-list (lst)
> !   "Distractively uniqfy elements of LST."
>     (let ((tmp lst))
>       (while tmp (setq tmp (setcdr tmp (delete (car tmp) (cdr tmp))))))
>     lst)
>   
>   (defun mew-uniq-alist (alst)
>     "Distractively uniqfy elements of ALST."
> !   (let ((tmp alst))
> !     (while tmp (setq tmp (setcdr tmp (mew-delete (car (car tmp)) (cdr tmp))))))
> !   alst)
>   
>   (defun mew-delete (key alist)
>     "Destructively delete elements whose first member is equal to key"
> --- 59,87 ----
>   	(setq n (1+ n))))))
>   
>   (defun mew-uniq-list (lst)
> !   "Distractively uniqfy elements of LST.
> ! This is O(N^2). So, don't use this function with a large LST."
>     (let ((tmp lst))
>       (while tmp (setq tmp (setcdr tmp (delete (car tmp) (cdr tmp))))))
>     lst)
>   
>   (defun mew-uniq-alist (alst)
>     "Distractively uniqfy elements of ALST."
> !   (let ((vec (make-vector 511 0))
> ! 	ent str ret)
> !     (while alst
> !       (setq ent (car alst))
> !       (setq str (car ent))
> !       (setq alst (cdr alst))
> !       (cond
> !        ((not (stringp str))
> ! 	(setq ret (cons ent ret)))
> !        ((intern-soft str vec)
> ! 	())
> !        (t
> ! 	(setq ret (cons ent ret))
> ! 	(intern str vec))))
> !     (nreverse ret)))
>   
>   (defun mew-delete (key alist)
>     "Destructively delete elements whose first member is equal to key"



Mew-dist メーリングリストの案内