funq: syntax that doesn't scare off C++ developers
Ivan Čukić
ivan.cukic at kde.org
Fri Jul 25 10:18:22 UTC 2014
> undefined = defined -> returns true, has a sideeffect: the variable that was
> undefined gets assigned the value of defined
This should not be seen as a statement at all - so it should not return
anything. It just defines a substitution value for a specific name.
That is,
x = 2; x * x;
does not mean, create a variable x, set its value to 2, and return x*x;
It means x in the formula x*x is the value of 2. Return 2*2.
Here we come to purity of the language. That is, are
f(x) + f(x)
and
y = f(x);
y + y;
and
2 * f(x)
equivalent.
Aaron said that we don't want to be totally pure, but in that case we need to
make a distinction between pure parts and impure ones. If we can count on f in
above example to be pure, then we can do a graph redux and evaluate f(x) only
once. (which would make the above examples equivalent.
Cheerio,
Ivan
KDE, ivan.cukic at kde.org, http://ivan.fomentgroup.org/
gpg key id: 850B6F76, keyserver.pgp.com
More information about the Funq-devel
mailing list