On Tue, 13 Jan 2015 10:06:25 +0000 bearophile via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote:
> Nordlöw: > > > Has there been any discussions on > > making map require pure functions now that we have each? > > Perhaps I'd like Phobos map and filter to be annotated with > "pure" and to have a template constraint that requires their > mapping/filtering functions to be strongly pure. that will effectively rule out any usage of some global vars or other external state, turning it into either unnecessary mess, or unusable theoretical crap. what i think should be written in big red letters in docs is "there is no guarantees about how many times labmda will be called, with which args and in which order". so if someone wants to shoot in his foot, he can ignore that warning and do crazy shooting.
signature.asc
Description: PGP signature