all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: MON KEY <monkey@sandpframing.com>
To: 6488@debbugs.gnu.org
Subject: bug#6488: put `cl-floor', `cl-ceiling', `cl-truncate', `cl-round', and `cl-mod'  side-effect-free
Date: Mon, 21 Jun 2010 18:36:22 -0400	[thread overview]
Message-ID: <AANLkTinJ9opSGGmIfbPzk9odjrByh6NmsCyMGYj_Eqd5@mail.gmail.com> (raw)

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\





             reply	other threads:[~2010-06-21 22:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-21 22:36 MON KEY [this message]
2011-07-13 23:30 ` bug#6488: put `cl-floor', `cl-ceiling', `cl-truncate', `cl-round', and `cl-mod' side-effect-free Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinJ9opSGGmIfbPzk9odjrByh6NmsCyMGYj_Eqd5@mail.gmail.com \
    --to=monkey@sandpframing.com \
    --cc=6488@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.