There isn't any method that can do this because it is really difficult to quantify. As you suggest an empty let is not enough -- the expression itself may have another let statement inside it, or it may call a function which has side-effects. Furthermore, even if there are statements, they might be side-effect free. So the simplest solution is to just not try to provide the functionality.
Zach On Wed, Jul 1, 2015 at 8:04 AM, Leonard Ritter <[email protected]> wrote: > Is there an API method to find out of a quote is a pure expression? > > A pure expression would be any operator, call, constant or quote that has > an empty let-statement, and I guess there are some more traits that qualify. > > What I want to do is to optimize the lazyselect macro that we talked about > here > > https://mailman.stanford.edu/pipermail/terralang/2015-June/000440.html > > In the case that both branch expressions are pure, I want to fallback to > the faster terralib.select instruction, as it is faster when no statements > are involved. > > Thanks, > > Leonard > > _______________________________________________ > terralang mailing list > [email protected] > https://mailman.stanford.edu/mailman/listinfo/terralang > >
_______________________________________________ terralang mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/terralang
