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
11
votes
1 answer

Forcing a constant expression to be evaluated during compile-time?

A few days ago I asked by which criteria the compiler decides whether or not, to compute a constexpr function during compile time. When does a constexpr function get evaluated at compile time? As it turns out, a constexpr is only evaluated during…
Byzantian
  • 3,208
  • 4
  • 27
  • 31
10
votes
9 answers

How do I evaluate a text summarization tool?

I have written a system that summarizes a long document containing thousands of words. Are there any norms on how such a system should be evaluated in the context of a user survey? In short, is there a metric for evaluating the time that my tool has…
Legend
  • 113,822
  • 119
  • 272
  • 400
10
votes
2 answers

Segfault with strcmp

I am using strcmp in following ways Passing char[] array names Passing pointers to string literals but, the second result in seg fault. even though i have confirmed that pointers point to correct string literals, i am confused as to why i am…
Jimm
  • 8,165
  • 16
  • 69
  • 118
10
votes
2 answers

How can we evaluate a boolean expression represented by a String in Kotlin?

val exp = "( 0 == 1 && 10 > 11 ) || ( 10 < 9 ) && ( 10 == 10)" val result: Boolean = evaluate(exp) //result = true/false How can I write a simple program in Android (Kotlin) to evaluate the above string and get a boolean result? I DO NOT want to…
10
votes
1 answer

Call by name vs call by macro expansion

In non strict evaluation languages, what are the differences and advantages/disadvantages of using call by name vs call by macro expansion? Could you provide an example that explains both evaluation strategies? Thanks!
Andrés Andrade
  • 2,213
  • 2
  • 18
  • 23
10
votes
2 answers

Matching vector of default values using match.arg() with or without error [R]

I want to write a function that applies one of two different statistical methods to its input. In the process, I noticed some behavior of different functions that I do not understand. The function I want to write should have the following…
SimonG
  • 4,701
  • 3
  • 20
  • 31
10
votes
3 answers

Evaluate Bool property of optional object in if statement

I am looking for a way to evaluate a Swift Bool concisely in a single if statement, when the Bool is the property of an optional object: var objectWithBool: ClassWithBool? // ... if let obj = objectWithBool { if obj.bool { // bool ==…
Stuart
  • 36,683
  • 19
  • 101
  • 139
10
votes
4 answers

Does Python's `all` function use short circuit evaluation?

I wish to use the Python all() function to help me compute something, but this something could take substantially longer if the all() does not evaluate as soon as it hits a False. I'm thinking it probably is short-circuit evaluated, but I just…
Sylvester V Lowell
  • 1,243
  • 1
  • 12
  • 13
10
votes
4 answers

How would you go about evaluating a programmer?

A few weeks ago, I was assigned to evaluate all our programmers. I'm very uncomfortable with this since I was the one who taught everyone the shop's programming language (they all got out of college not knowing the language and as luck would have…
MrValdez
  • 8,515
  • 10
  • 56
  • 79
9
votes
4 answers

short circuiting and parenthesis

Does it matter how I group subexpressions when dealing with a single short-circuiting operator? a && b && c && d a && (b && (c && d)) (a && b) && (c && d) ((a && b) && c) && d Are the above expressions equivalent?
foobar
  • 4,968
  • 3
  • 17
  • 11
9
votes
11 answers

Evaluate in T-SQL

I've got a stored procedure that allows an IN parameter specify what database to use. I then use a pre-decided table in that database for a query. The problem I'm having is concatenating the table name to that database name within my queries. If…
Joe Phillips
  • 49,743
  • 32
  • 103
  • 159
9
votes
1 answer

How `fix f = let {x = f x} in x` is evaluated?

fix f = let {x = f x} in x Talking about let, I thought that let P = Q in R would evaluate Q -> Q' then P is replaced by Q' in R, or: R[P -> Q']. But in fix definition the Q depends on R, how to evaluate then? I imagine that this is about lazy…
geckos
  • 5,687
  • 1
  • 41
  • 53
9
votes
4 answers

Javascript evaluation order for operators

Which of the following expressions will always precede left to right in all browsers(particularly IE6+, F3+, Opera 9+, Chrome)? For example the window should always alert first function then second function. In C they always suggest not to depend…
Lime
  • 13,400
  • 11
  • 56
  • 88
9
votes
2 answers

Mathematica -- why does TreeForm[Unevaluated[4^5]] evaluate the 4^5?

If I give Mathematica the input TreeForm[Unevaluated[4^5]] I expect to see three boxes -- power, 4, and 5. Instead I see a single box with 1024. Can anyone explain?
William Jockusch
  • 26,513
  • 49
  • 182
  • 323
9
votes
3 answers

Non-standard evaluation of subset argument with mapply in R

I can not use the subset argument of xtabs or aggregate (or any function I tested, including ftable and lm) with mapply. The following calls fail with the subset argument, but they work without: mapply(FUN = xtabs, formula = list(~ wool, …
Thomas
  • 457
  • 2
  • 12