January 14, 2015 Re: Map Lambda with Side-Effects | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nordlöw |
> Is it possible to
> - detect that a lambda is has-side-effects and that
> - the map hasn't been used?
Thing is: I'm regularly doing that on purpose.
Actually, isn't your closure even weakly pure in your example, because arr is part of the closure and thus an argument to it.
|
January 15, 2015 Re: Map Lambda with Side-Effects | ||||
---|---|---|---|---|
| ||||
Posted in reply to Tobias Pankrath | On Wednesday, 14 January 2015 at 01:15:57 UTC, Tobias Pankrath wrote: > >> Is it possible to >> - detect that a lambda is has-side-effects and that >> - the map hasn't been used? > > Thing is: I'm regularly doing that on purpose. Could you show me a code example? I'm curious. > Actually, isn't your closure even weakly pure in your example, because arr is part of the closure and thus an argument to it. I'm fully understand the meaning of weakly and strongly pure functions in D. However I'm not enough familiar with closure purity semantics in D. Could you elaborate a bit, please? |
Copyright © 1999-2021 by the D Language Foundation