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
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.
On Tuesday, 13 January 2015 at 10:21:12 UTC, Tobias Pankrath
wrote:
On Tuesday, 13 January 2015 at 10:06:26 UTC, bearophile 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
On Tue, 13 Jan 2015 10:06:25 +
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
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.
Bye,
bearophile
On Tue, 13 Jan 2015 11:26:01 +
bearophile via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
ketmar:
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.
On Tuesday, 13 January 2015 at 10:06:26 UTC, bearophile 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
ketmar:
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.
Unusable theoretical crap is better than the current trap :-)
We hare pure in D, but still we have not grown up to actually
Unusable theoretical crap is better than the current trap :-)
We hare pure in D, but still we have not grown up to actually
use it in Phobos, for higher order functions, or parallelism.
I don't think that Nordlöw presented a serious trap. This might
lead to bugs, yes, like anything else, for
ketmar:
in no way. this just turns Phobos into the same unusable crap,
removing the whole sense of having good standard library.
If your language has purity, and it doesn't use it where it
matters, you have removed its sense of having purity. So if you
are right then purity in D is useless
On Tuesday, 13 January 2015 at 07:35:53 UTC, Nordlöw wrote:
Somewhat related to
https://github.com/D-Programming-Language/phobos/pull/2024
I wonder about the soundness of `map` in
```D
import std.algorithm, std.range, std.stdio;
void main(string[] args)
{
long[] arr;
const n = 3;
Somewhat related to
https://github.com/D-Programming-Language/phobos/pull/2024
I wonder about the soundness of `map` in
```D
import std.algorithm, std.range, std.stdio;
void main(string[] args)
{
long[] arr;
const n = 3;
iota(n).map!(a = arr ~= a);
writeln(arr);
12 matches
Mail list logo