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
2 answers

Evaluate combination to tackle recursively (+ 1 2)

I am reading SICP's first chapter 1.1.3 Evaluating Combinations It states that To evaluate a combination, do the following: 1. Evaluate the subexpressions of the combination. 2. Apply the procedure that is the value of the leftmost…
AbstProcDo
  • 19,953
  • 19
  • 81
  • 138
0
votes
2 answers

Scheme: Proper application of the eval function?

at work I encountered a basic problem when trying to implement a configuration script with Scheme. To avoid the need of inventing an artificial and restricted language the script should contain actual code. This code shall be evaluated later on. To…
Bastian
  • 4,638
  • 6
  • 36
  • 55
0
votes
2 answers

Library to evaluate excel/other language expression evaluation in java without using excel

I have been searching the internet for a library which can evaluate excel formula-like expressions in java The formula is not embedded in the excel. Let's say, the values are not in excel either Let's say 3 variables a, b, c I want an evaluator in…
0
votes
3 answers

How to evaluate an expression in one table field into another?

I have a table, inside there is a field called x, the x field contain value of '1+2', '1+3' etc, how to get these value and calculate it and save into another field?
Kevin
  • 5
  • 3
0
votes
4 answers

If statement without '&&' works?

int n = 5; if(2<=n<=20) { cout << "hello"; } In the above code, it does not give an error, it runs successfully and gives "hello" as output. But we have to use && in this kind of equation. Can anyone explain this?
Bharat Arya
  • 119
  • 1
  • 8
0
votes
1 answer

Why isn't work when trying subtraction in postfix evaluation?

I'm trying to getting result from postfix. But it gives me wrong when subtraction, and don't know why. Please give many helps for c++ newbie. I got two operands from stack. And tried subtraction "last popped" - "first popped". /*pf_exp is postfix…
JWLee
  • 3
  • 1
0
votes
1 answer

how to print the passed argument variable in R

I want to print every argument passed to function read.table. My idea was to write some decorator that is easy in Python. But for R, I don't know how to do it, what I learned was to use trace(). However, I don't know how to print variables inside…
0
votes
1 answer

how to determine data type of arithmetic expressions involving divisions in c++

Have a look at the following programme. // Example program #include #include int main() { int n=7; std::cout <<"n/2 = "<< n/2 << std::endl; std::cout <<"n/3.3 = "<< n/3.3 << std::endl; } output : n/2 = 3 n/3.3 =…
0
votes
0 answers

How to keep a java variable a string when it begins with leading zeros

I have a string that contains value "001" that I need to evaluate as a string, however java keeps evaluating as an integer. Here is my simple sample code: String equipmentCode = "001"; boolean questionable =…
0
votes
1 answer

Get values of parameters of javascript function from Java?

For my Java application I need to be able of, given a JavaScript string, determine the actual arguments passed into a function call. For example, given this JavaScript string: const url = "http://foo.bar?q=" + location.href const method =…
fergaral
  • 2,077
  • 6
  • 17
  • 34
0
votes
5 answers

Expression Evaluation in C++

I'm writing some excel-like C++ console app for homework. My app should be able to accept formulas for it's cells, for example it should evaluate something like this: Sum(tablename\fieldname[recordnumber], fieldname[recordnumber],…
Billy Blaze
0
votes
1 answer

Matlab - Evaluate Function from String

Some Matlab functions handle string functions representation as f='a^x^b+sin(c*x)+d' --i.e. Curve Fitting, Optimization, etc.-- Suppose the variables a,b,c,d and x are given. Is there any function for evaluating f from its string representation?
Brethlosze
  • 1,533
  • 1
  • 22
  • 41
0
votes
1 answer

Evaluation of setf forms

This question is about the Common Lisp setf macro, and how it evaluates its argument forms (and subforms)--namely, only once if they happen to appear more than once. (It is also partly follow-up to an example given in the comments at Using…
davypough
  • 1,847
  • 11
  • 21
0
votes
3 answers

Using a string inside an expression in R

I need to set an attribute on a data.frame, but I want to pass the data.frame name from a variable. I have tried several combinations of quote, substitute, parse, expression with no success. How it can be done? #OK code my_data_frame <-…
Fernando Macedo
  • 355
  • 3
  • 7
0
votes
1 answer

What is the order to evaluate this and why? C++

int foo(int a, int& b, int c) { int temp = a; a = b; b = c; c = temp; return a - b; } int main() { **foo(foo(a, b, c), b, foo(a, b, foo(a, b, c)));** return 0; } which foo function call is evaluated first and why? the code…
csguy
  • 1,354
  • 2
  • 17
  • 37