GNU bug report logs - #6488
put `cl-floor', `cl-ceiling', `cl-truncate', `cl-round', and `cl-mod' side-effect-free

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Mon, 21 Jun 2010 22:37:01 UTC

Severity: minor

Tags: wontfix

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: MON KEY <monkey <at> sandpframing.com>
To: bug-gnu-emacs <at> gnu.org
Subject: put `cl-floor', `cl-ceiling', `cl-truncate', `cl-round', and `cl-mod' 
	side-effect-free
Date: Mon, 21 Jun 2010 18:36:22 -0400
Following fncns from lisp/emacs-lisp/cl-compat.el

`cl-floor' `cl-ceiling' `cl-truncate' `cl-round' `cl-mod'

are aliased in cl.el as `floor*' `ceiling*' `round*' `truncate*'

The definition of `Values-list' uses cl.el's `values' not
cl-compat.el's `Values'. Does this mean that all of the below is
redundant:

,----
| (defun cl-floor (a &optional b) (Values-list (floor* a b)))
| (defun cl-ceiling (a &optional b) (Values-list (ceiling* a b)))
| (defun cl-round (a &optional b) (Values-list (round* a b)))
| (defun cl-truncate (a &optional b) (Values-list (truncate* a b)))
`----

IOW, are the following not equivalent:

(Values-list (truncate* a b))
 --> (apply 'values (truncate* 17 9))
  --> (apply 'list (truncate* 17 9))
   --> (truncate* 17 9)

Or, am I missing something?

And, if not, and in the off chnace that the byte-compiler would
benefit, would it be reasonable to put the 'side-effect-free property
on `cl-floor', `cl-ceiling', `cl-truncate', `cl-round', `cl-mod' as
they currently don't have it:

(let (gthr-sef)
  (dolist (sefl '(floor*    cl-floor
                  ceiling*  cl-ceiling
                  truncate* cl-truncate
                  round*    cl-round
                  mod*      cl-mod)
                (setq gthr-sef (nreverse gthr-sef)))
    (if (get sefl 'side-effect-free)
        (push `(,sefl . side-effect-free) gthr-sef)
      (push `(,sefl . IS-NOT-side-effect-free) gthr-sef))))

--
/s_P\




This bug report was last modified 14 years and 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.