expression-evaluation Questions
4
Solved
For learning and demonstrating, I need a macro which prints its parameter and evaluates it. I suspect it is a very common case, may be even a FAQ but I cannot find actual references.
My current co...
Vesicate asked 18/12, 2008 at 10:8
2
Solved
How can I unload an assemlby in .NET Core ?
Note:
.NET Core does not support AppDomains.
Background:
I have to evaluate user-generated VisualBasic expressions dynamically.
So to do this, I d...
Dyandyana asked 26/5, 2020 at 8:10
4
Solved
A friend asked me to explain the difference between operator precedence and order of evaluation in simple terms. This is how I explained it to them :-
Let's take an example -
int x;
int a = 2;
int ...
Golter asked 25/5, 2021 at 13:40
2
Solved
I have a variable and I have a function stored in it as a string:
var x = "func myFunction(y :Int) {println(y)}"
Is there a way to evaluate the string and run the function?
Humid asked 11/3, 2015 at 0:34
4
Given an expression f1() + f2()*f3() with 3 method calls, java evaluates (operands of) addition operation first:
int result = f1() + f2()*f3();
f1 working
f2 working
f3 working
I (wrongly) expe...
Torrez asked 14/8, 2019 at 20:14
1
Solved
Is a C implementation required to ignore undefined behaviors occurring during the evaluation of void expressions as if the evaluation itself never took place?
Considering C11, 6.3.2.2 §1:
If an...
Carafe asked 24/7, 2019 at 12:12
1
When I work with my favorite containers, I tend to chain operations. For instance, in the well-known Erase–remove idiom:
v.erase( std::remove_if(v.begin(), v.end(), is_odd), v.end() );
From what...
Wyckoff asked 6/9, 2018 at 11:36
2
Solved
Given this line of Haskell code, my task was to evaluate it to its most simple form.
let g h k = (\x -> k (h x)) in g (+1) (\x -> x+x) 20
I have already been given the answer (and of cour...
Estancia asked 19/1, 2018 at 15:6
11
Solved
I was reading about order of evaluation violations, and they give an example that puzzles me.
1) If a side effect on a scalar object is un-sequenced relative to another side effect on the same s...
Diecious asked 10/2, 2014 at 6:31
1
Solved
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 fu...
Chartier asked 12/9, 2017 at 13:47
6
What is the explanation that s.get() returns "ONE" the second time as well?
String x = "one";
Supplier<String> s = x::toUpperCase;
System.out.println("s.get() = " + s.get());
x = "two"...
Lott asked 8/2, 2017 at 12:19
5
Solved
I tried some code to swap two integers in Java without using a 3rd variable, using XOR.
Here are the two swap functions I tried:
package lang.numeric;
public class SwapVarsDemo {
public static...
Mann asked 26/2, 2014 at 14:19
4
Solved
I found something a little strange in C# and Java.
Let's look at this C++ code:
#include <iostream>
using namespace std;
class Simple
{
public:
static int f()
{
X = X + 10;
return 1;
}...
Wiltshire asked 15/8, 2014 at 8:11
1
Solved
I have written tokenizer and expression evaluator for a preprocessor language that I plan to use in my later projects. I started thinking that maybe I should describe the language with EBNF (Extend...
Vav asked 7/8, 2014 at 14:53
2
Solved
I'm using Boost Spirit to implement functionality in some software that allows the user to enter a mathematical equation that will be repeatedly applied to an input stream. Input stream values are ...
Fragmentation asked 28/5, 2014 at 13:12
2
Solved
Looking at this example code similar to this question:
public class A {
public static void main(String args[]){
A a = new A();
System.out.println(a.equals((a = null)));
}
}
This prints false...
Mountaineering asked 23/5, 2014 at 18:13
1
Solved
In Haskell, I might implement if like this:
if' True x y = x
if' False x y = y
spin 0 = ()
spin n = spin (n - 1)
This behaves how I expect:
haskell> if' True (spin 1000000) () -- takes a mom...
Piassava asked 18/4, 2014 at 7:31
1
Solved
I know the meaning of the strictfp modifier on methods (and on classes), according to the JLS:
JLS 8.4.3.5, strictfp methods:
The effect of the strictfp modifier is to make all float or double
...
Emmaemmalee asked 21/3, 2014 at 15:10
1
Solved
A mathematical expression is usually expressed in infix notation. For evaluation purposes, we can change it to postfix (reverse polish) notation (using algorithms like Shunting-Yard) and then evalu...
Blouse asked 26/12, 2013 at 5:32
3
Solved
The C++11 standard (5.17, expr.ass) states that
In all cases, the assignment is sequenced after the value computation
of the right and left operands, and before the value computation of
the a...
Greenfinch asked 25/10, 2013 at 10:6
2
Solved
Hi and welcome to the Evaluate() mystery
The MSDN Office Developer Reference (2013) Documentation says:
Using square brackets (for example, "[A1:C5]") is identical to calling
the Evaluate meth...
Baileybailie asked 5/7, 2013 at 8:37
2
Solved
I want to use boost spirit to parse an expression like
function1(arg1, arg2, function2(arg1, arg2, arg3),
function3(arg1,arg2))
and call corresponding c++ functions. What should be the gramm...
Consonant asked 9/6, 2013 at 18:44
1
Solved
In an exam today I was asked to create an expression evaluation tree in Haskell.
Usually the answer is as simple as:
data Expr = Value Integer
| Add Expr Expr
| Sub Expr Expr
| Mul Expr Expr
...
Hyperbola asked 20/5, 2013 at 11:10
3
Solved
I would like to know how to evaluate a string representation of an equation as if it were a real equation:
if(@"15+14==23")
{
//True statement...
}
else
{
//False statement....
}
I want to ret...
Rebozo asked 23/12, 2011 at 15:56
3
Solved
If an expression evaluates multiple && operators, and does not evaluate any operators of lower precedence (eg. ||, ?:), will the expression evaluate to 0 as soon as one of the &&s r...
Sulfonmethane asked 25/8, 2011 at 19:22
1 Next >
© 2022 - 2024 — McMap. All rights reserved.