[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pure-fns in byte-opt.el
From: |
Stefan Monnier |
Subject: |
Re: pure-fns in byte-opt.el |
Date: |
Tue, 25 Jul 2017 17:27:31 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
> Why? Its return value clearly only depends on its argument, and it doesn't
> change any global state. It's the poster child of a pure function!
(let ((s (make-string 5 ?a)))
(list (string-to-char s)
(progn
(aset s 0 ?b)
(string-to-char s))))
If string-to-char were a pure function, it would return the same value
in both calls (since the arguments are `eq').
Stefan
- pure-fns in byte-opt.el, Mark Oteiza, 2017/07/24
- Re: pure-fns in byte-opt.el, Andreas Schwab, 2017/07/25
- Re: pure-fns in byte-opt.el, Stefan Monnier, 2017/07/25
- Re: pure-fns in byte-opt.el, Philipp Stephani, 2017/07/25
- Re: pure-fns in byte-opt.el,
Stefan Monnier <=
- Re: pure-fns in byte-opt.el, Clément Pit-Claudel, 2017/07/25
- Re: pure-fns in byte-opt.el, Stefan Monnier, 2017/07/25
- Re: pure-fns in byte-opt.el, Clément Pit-Claudel, 2017/07/26
- Re: pure-fns in byte-opt.el, Stefan Monnier, 2017/07/26
- Re: pure-fns in byte-opt.el, Philipp Stephani, 2017/07/28
- Re: pure-fns in byte-opt.el, Stefan Monnier, 2017/07/28
- Re: pure-fns in byte-opt.el, Philipp Stephani, 2017/07/28
- Re: pure-fns in byte-opt.el, Stefan Monnier, 2017/07/28
Re: pure-fns in byte-opt.el, Mark Oteiza, 2017/07/25