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

What are Gecko's Javascript interpreter engine semantics?

Edit In consideration of the answer response below regarding the reference ECMAScript Language Specification - 11.13.2 Compound Assignment Considering why these, javascript: o=""; o = o + (o+=1) ; alert(o); o=""; o = (o+=1) + o;…
Ekim
  • 353
  • 2
  • 4
7
votes
1 answer

Does Go compiler's evaluation differ for constant expression and other expression

Why does below code fail to compile? package main import ( "fmt" "unsafe" ) var x int = 1 const ( ONE int = 1 MIN_INT int = ONE << (unsafe.Sizeof(x)*8 - 1) ) func main() { fmt.Println(MIN_INT) } I get an error…
IhtkaS
  • 1,314
  • 3
  • 15
  • 31
7
votes
7 answers

Confusion in evaluating == and &

Why does the below statement: int a = 10; a&8 == 8; return false (0) ? I know that == has more precedence over &, but still it should check whether 8 == 8 and it should have evaluated true, but its evaluating as false. Can anyone please help me…
Harikesh
  • 313
  • 3
  • 14
7
votes
4 answers

Security considerations using "new Function(...)" (during rendertime, expression coming from my Javascript sources)

I'd like to use new Function(...) to generate a function from very reduced code. I'l like to do this to avoid parsing the expression on my own and being as flexible as possible. I avoid eval() whenever possible. But I'm not sure if it's secure…
try-catch-finally
  • 7,436
  • 6
  • 46
  • 67
7
votes
5 answers

Whats the best way to create interactive application prototypes?

The question should be interpreted from a general point of view and not targeted solely at web apps or desktop apps. I have been looking around to find a simple and easy way of creating interactive prototypes for web applications. I'd like to use a…
Juve
  • 10,584
  • 14
  • 63
  • 90
7
votes
1 answer

How to evaluate a nested preprocessor macro

let's say I want to select the behaviour of a certain preprocessor directive evaluating at compile time the concatenation of a constant string and the result of another macro. #define CASE1 text1 #define CASE2 text2 #define CASE3 text3 #define…
ziu
  • 2,634
  • 2
  • 24
  • 39
7
votes
4 answers

What does ' ', and " ", and no quotes mean in Javascript?

I realized I've been switching between them with no understanding as to why, and am finding it hard to search for.
expiredninja
  • 1,397
  • 4
  • 25
  • 45
7
votes
7 answers

Javascript parser for simple expression

I would like to find a javascript parser that can handle and evaluate simple expressions. The parser should be able to evaluate the regular mathematical expressions, and support custom functions with parameters. It also has to support strings…
AAA
6
votes
1 answer

Why is `splice(@_, 0, shift)` safe?

The perl 5.18.2 documentation of splice has this example: my(@a) = splice(@_,0,shift); my(@b) = splice(@_,0,shift); And I wonder: If @_ is evaluated before the shift there would be one item too much for the result to be correct. So conceptually the…
U. Windl
  • 3,480
  • 26
  • 54
6
votes
1 answer

Is it custumary to convert from infix to postfix and then build an AST on math evaluators?

I'm doing a mathematical expressions parser that parses text into an abstract syntax tree (and I don't know much about doing so). I've read on Wikipedia that one can use the Shunting-yard algorithm to parse a linear sequence of tokens into Reverse…
Gark Garcia
  • 450
  • 6
  • 14
6
votes
1 answer

mixing foldr with OR in Haskell (laziness?)

How can this function return true? foldr (||) False [True,undefined] => True The first fold looks like this: undefined || True , which should return an error So im guessing haskell gives priority to the lazyness of the OR function over doing…
6
votes
2 answers

Negative Values: Evaluate Gensim LDA with Topic Coherence

I´m currently trying to evaluate my topic models with gensim topiccoherencemodel: from gensim.models.coherencemodel import CoherenceModel cm_u_mass = CoherenceModel(model = model1, corpus = corpus1, coherence = 'u_mass') coherence_u_mass =…
Nils_Denter
  • 488
  • 1
  • 6
  • 18
6
votes
1 answer

Running mice with a formula as a variable: instant evaluation instead of later evaluation?

The R package micecomes with following example: library("mice") imp <- mice(nhanes) fit <- with(data=imp,exp=lm(bmi~hyp+chl)) I want a flexible call of with() like: model_formula <- bmi~hyp+chl fit <- with(data=imp,exp=lm(model_formula)) But this…
Qaswed
  • 3,649
  • 7
  • 27
  • 47
6
votes
1 answer

What is in data?

(I use OCaml version 4.02.3) I defined a type self # type self = Self of self;; type self = Self of self and its instance s # let rec s = Self s;; val s : self = Self Since OCaml is a strict language, I expected defining s will fall into…
letrec
  • 539
  • 5
  • 13
6
votes
3 answers

is it possible to print all reductions in Haskell - using WinHugs?

I have written the following function.. and executed using WinHugs teneven = [x | x <- [1..10], even x] My output: Main> teneven [2,4,6,8,10] :: [Integer] (63 reductions, 102 cells) is there anyway to print all the reductions.. so I can learn…
Mohan Narayanaswamy
  • 2,149
  • 6
  • 33
  • 40