Questions tagged [evaluation]

Anything related to evaluation of expressions, i.e. the process used to determine the value of expressions in a running program.

What is it?

Evaluation is about rules, algorithms and strategies used for the evaluation of expressions or the computation of evaluation functions.

Related tags

  • The tag may be used more specifically for the execution or invocation of evaluations.
  • For more specific questions use tags such as for example

See also:

1334 questions
18
votes
4 answers

C : is there "lazy evaluation" when using && operator, as in C++?

I would like to know if this looks correct : while((next !=NULL) && (strcmp(next->name, some_string) < 0) { //some process } I mean, if next is NULL, then the second part of the expression won't be ever tested by the compiler? I have heard that…
Pac0
  • 21,465
  • 8
  • 65
  • 74
18
votes
6 answers

Condition evaluation process in Java

Lets say I have the following condition: if ( myList == null || myList.isEmpty() || xomeX == someY ) What is the order of the evaluation of these conditions? Left or right, right to left or random each time? If the first one passes, then the others…
Kevin Rave
  • 13,876
  • 35
  • 109
  • 173
18
votes
8 answers

Best and shortest way to evaluate mathematical expressions

There are many algorithms to evaluate expressions, for example: By Recursive Descent Shunting-yard algorithm Reverse Polish notation Is there any way to evaluate any mathematical expression using C# .net reflection or other modern .net…
Arsen Mkrtchyan
  • 49,896
  • 32
  • 148
  • 184
17
votes
3 answers

Eager evaluation/applicative order and lazy evaluation/normal order

As far as I know, eager evaluation/applicative order evaluates all arguments to a function before applying it, on the other hand, lazy evaluation/normal order evaluates the arguments only when needed. So, what are the differences between the pair of…
Ryan Li
  • 9,020
  • 7
  • 33
  • 62
17
votes
1 answer

When to use `constantly` in clojure, how and when are its arguments evaluated?

In the accepted answer to another question, Setting Clojure "constants" at runtime the clojure function constantly is used. The definition of constantly looks like so: (defn constantly "Returns a function that takes any number of arguments and…
Alex Stoddard
  • 8,244
  • 4
  • 41
  • 61
17
votes
5 answers

What's the point of evaluating left operand of assignment operator in C?

According to ISO C11 - 6.5.16.3, it says that An assignment operator stores a value in the object designated by the left operand. An assignment expression has the value of the left operand after the assignment, but is not an lvalue. The type…
Jin
  • 1,902
  • 3
  • 15
  • 26
16
votes
7 answers

Streaming XPath evaluation

Are there any production-ready libraries for streaming XPath expressions evaluation against provided xml-document? My investigations show that most of existing solutions load entire DOM-tree into memory before evaluating xpath expression.
nixau
  • 1,095
  • 1
  • 14
  • 27
16
votes
2 answers

Perl6 search then replace with output of subroutine

I've combed the docs but I can't seem to find how to do this in perl6. In perl5 I would have done (just an example): sub func { ... } $str =~ s/needle/func($1)/e; i.e. to replace 'needle' with the output of a call to 'func'
iPherian
  • 908
  • 15
  • 38
16
votes
5 answers

Why is '--++a-​- ++ +b--' evaluated in this order?

Why does the following print bD aD aB aA aC aU instead of aD aB aA aC bD aU? In other words, why is b-- evaluated before --++a--++? #include using namespace std; class A { char c_; public: A(char c) : c_(c) {} A& operator++()…
16
votes
4 answers

What is the difference between execution and evaluation?

We say that expresssions "evaluate" values and statement orders computer to "execute". But to me it seems like same terminology. What is the difference between execution and evaluation in C?
Jin
  • 1,902
  • 3
  • 15
  • 26
16
votes
1 answer

How does term-rewriting based evaluation work?

The Pure programming language is apparently based on term rewriting, instead of the lambda-calculus that traditionally underlies similar-looking languages. ...what qualitative, practical difference does this make? In fact, what is the difference in…
Alex Celeste
  • 12,824
  • 10
  • 46
  • 89
15
votes
2 answers

curious about how "loop = loop" is evaluated in Haskell

I thought expressions like this would cause Haskell to evaluate forever. But the behaviors in both GHCi and the compiled program surprised me. For example, in GHCi, these expressions blocked until I Control+C, but consumed no CPU. Looked like it was…
Phil
  • 5,595
  • 5
  • 35
  • 55
15
votes
2 answers

Has the notion of 'semidet' in Prolog been settled?

Being new to Prolog, I came across a very interesting discussion that happened in late 2012. What I noticed was that there were, at the time, two notions of 'semidet' in Prolog community, namely: A computation that succeeds at most once. A…
15
votes
2 answers

Java: How to evaluate an EL expression - standalone (outside any web framework) without implementing interfaces?

I'd like to use EL in my application. But I can't find any howto. I usually end up needing some interface for which I don't have an implementation. I have a map of objects, and I want a string expression like Hello, ${person.name} to be evaluated to…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
14
votes
4 answers

Algorithm for Rating Objects Based on Amount of Votes and 5 Star Rating

I'm creating a site whereby people can rate an object of their choice by allotting a star rating (say 5 star rating). Objects are arranged in a series of tags and categories eg. electronics>graphics cards>pci express>... or…
Jamie Ramsamy
  • 141
  • 1
  • 3