Questions tagged [expression-evaluation]

Anything related to expression evaluation, i.e. the process of determining the value of an expression in running code.

Anything related to expression evaluation, i.e. the process of determining the value of an expression in running code.

189 questions
0
votes
4 answers

Evaluating List as a mathematical expression

I have a List that is full of values and operators. ["123", "+", "(", "890", "-", "15.00", ")"] I know that I can make an algorithm that will push these numbers and and operators onto a stack and pop them off and evaluate as I go. But, is…
J Lundberg
  • 2,313
  • 2
  • 20
  • 23
0
votes
2 answers

How to expand macros in strings read from a file in a ksh script?

I want to read a list of file names stored in a file, and the top level directory is a macro, since this is for a script that may be run in several environments. For example, there is a file file_list.txt holding the following fully qualified file…
yamex5
  • 195
  • 1
  • 11
0
votes
0 answers

Difference between determination & evaluation of a value of an expression

I am studying order of evaluation of expressions and I came across this paragraph, A constant expression is an expression that consists of only constant values. It is an expression whose value is determined at the compile-time but evaluated at the…
Hamza Khan
  • 21
  • 5
0
votes
3 answers

Parsing JSON and Evaluating expressions from its fields

I have a JSON document from which I have figured a way of parsing and extracting the values within it using the library of JSON-Path I have to evaluate rules/expressions using the variables in the parsed JSON. For example: {maxAge:25, minAge:20,…
Mahesh Kumar
  • 138
  • 1
  • 9
0
votes
1 answer

How avoid error on not evaluated code C++?

Apologies for the most ambiguous and bizarre title. Suppose we have 2 classes A and B. class B has interface hasSmth but class A has not. How to make this code evaluate without compile errors? class A { //..implementation int id() { return…
Eduard Rostomyan
  • 7,050
  • 2
  • 37
  • 76
0
votes
0 answers

ORA-00936 when trying to use EVALUATE

I need an evaluation of purchase contracts (Einkaufsverträge) and the corresponding sales contracts, where the Einkaufsverträge will be extended. Therefore, I want to create a query that returns a row from the nag_einkaufsverträge table if the…
0
votes
2 answers

Java primitive variable reassignment during expression

I had a question in my test that I got confused about (code attached below). To put it shortly, I thought that the variables are reassigned and then added back as a value to the expression (making the output "8, 10") but seems like the original…
0
votes
3 answers

how to evaluate a string in the format (AND, true, false, (OR, true, false, false, (AND, false, true))) in Javascript?

I have string in the format (AND, true, false, (OR, true, false, false, (AND, false, true))) for example, Is there a way in JavaScript by which we can evaluate this string to a boolean value? expression 1: (AND, true, false) => false expression 2:…
0
votes
1 answer

R evaluate character/string as the calling function name

I had a use case where I wanted to evaluate command line args as function names. For example, r_script.R print --number 2 I will take r package docopt as an example here. The arguments typically are indexed by its own names, e.g. args$print refer…
stucash
  • 1,078
  • 1
  • 12
  • 23
0
votes
2 answers

Can C++ evaluation order optimizations imply using diferent cores for diferent operands?

C++ expressions do not define an order of evaluation for the operands. This is for the sake of potential optimizations. for the very simple case : int i = f() + g(); Does such optimizations include evaluating f() and g() on different cores ? and if…
chetzacoalt
  • 145
  • 10
0
votes
1 answer

Evaluating the solution pairs of the sympy function

I have a non linear function with two variables, I want to solve the equation . But the solution itself is an equation. How do i evaluate the function at a certain point CODE: import sympy as sp sp.init_printing() x1,x2,y1,y2 =…
0
votes
3 answers

Evaluation in python?

available_items = {"health potion": 10, "cake of the cure": 5, "green elixir": 20, "strength sandwich": 25, "stamina grains": 15, "power stew": 30} health_points = 20 health_points += available_items.pop("stamina grains") When I run this code the…
Muslim
  • 45
  • 5
0
votes
1 answer

Short circuit evaluation in JavaScript - SyntaxError: Unexpected token 'return'

I would like to use short circuit evaluation syntax (with && operator) as described by example in the article: Say, I have this situation: function externalFunction() { id == ... text == ... // OK: Standard if syntax is fine if (…
0
votes
1 answer

Evaluating code which refers to function parameters

Update: The original version of this question did not fully describe the constraints of my situation. It now includes an example with some hand-waving for the sake of simplicity as well as a testable minimum example. I am trying to pass a snippet of…
0
votes
1 answer

Validate JSON against a logical expression in Java8

I have an expression in String format. String exp = "(weight > 50 && height > 150 && height < 160) || BP = 130"; I created this string from a JSON object. So it is flexible to convert to any format. And now I have one user's data in JSON format. { …
skmaran.nr.iras
  • 8,152
  • 28
  • 81
  • 116