unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <David.Kastrup@t-online.de>
Subject: Re: Additional side-effect-free functions
Date: 30 Mar 2002 17:58:10 +0100	[thread overview]
Message-ID: <x5g02ingbh.fsf@tupik.goethe.zz> (raw)
In-Reply-To: 3CA5ED1A.F6FB9E8C@comcast.net

jyavner@comcast.net (Jonathan Yavner) writes:

> JY>     truncate
> DK> This can raise a range-error exception.
> 
> There are two classes of side-effect-free functions.
>    (side-effect-free error-free) means function cannot signal.
>    (side-effect-free t) means function makes no assignments
> The distinction matters only if you set byte-compile-delete-errors to
> nil.
> 
> cons has (side-effect-free error-free), even though it increments the
> variable cons-cells-consed.
> 
> car is (side-effect-free t),  so why not truncate?

Sorry, I have not looked too closely into matters before replying.
Unless floating point error state is somewhat persistent in Emacs,
you would appear to be more or less right.

> JY> format-time-string
> DK> This depends on the current time
> 
> So?  It doesn't *change* the time.  If you have code like
>     (prog1 47 (format-time-string "%Y"))
> nothing goes wrong if the compiler just reduces this to 47.

But if you have code like
(format-time-string "%Y")
things go wrong if the compiler reduces this to "2002".

> JY>     make-symbol
> DK> This changes the obarray.
> 
> It shouldn't.  That's intern's job.

Probably.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Email: David.Kastrup@t-online.de

      reply	other threads:[~2002-03-30 16:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-27  4:22 Security holes in risky-local-variable system Jonathan Yavner
2002-03-30 14:47 ` Additional side-effect-free functions Jonathan Yavner
2002-03-30 15:04   ` David Kastrup
2002-03-30 16:50     ` Jonathan Yavner
2002-03-30 16:58       ` David Kastrup [this message]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=x5g02ingbh.fsf@tupik.goethe.zz \
    --to=david.kastrup@t-online.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).