help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Perferr cond over case?


From: Pascal J. Bourguignon
Subject: Re: Perferr cond over case?
Date: Sun, 11 Oct 2009 20:17:33 +0200
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/22.3 (darwin)

Nordlöw <per.nordlow@gmail.com> writes:

> Does the use of the cl macro case() incurr some loss of performance
> compare to using cond() instead?

(macroexpand '(case (* 2 2 2 2 3)
                (10      'one)
                ((24 42) 'two)
                ((3 33)  'three)
                (otherwise 'unknown)))
-->
(let ((--cl-var-- (* 2 2 2 2 3)))
    (cond ((eql --cl-var-- (quote 10)) (quote one))
          ((member* --cl-var-- (quote (24 42))) (quote two))
          ((member* --cl-var-- (quote (3 33))) (quote three))
          (t (quote unknown))))

What do you think?



-- 
__Pascal Bourguignon__


reply via email to

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