Questions tagged [expression]

Combination of several programming symbols and values intending to produce a result

An expression is code before it gets evaluated. That is, evaluating an expression will give you a result.

Expressions can consists of combinations of variables, constants, operators, function calls, or whatever constructs are available in that language.

Many s have an expression data type, and an evaluation function (often called eval), where calling eval(an_expression) will calculate a result.

Related tags

7598 questions
2
votes
2 answers

Does an expression exist such that <> == <> is always false?

I'm not an expert on Haskell. And this question is not exactly a Haskell question, but I know Haskell people would have a better understanding of what I'm trying to achieve. So I'm building a dynamic language and I want it to be pure... Totally…
caeus
  • 3,084
  • 1
  • 22
  • 36
2
votes
1 answer

Can't parse an existing expression with the antlr4 grammar(see it in the question)

I have the following grammar grammar ExpressionsParserGrammar; expression : left = expression identity_operation = ( IDENTITY | NOT_IDENTITY ) right = expression # identity_operation | left = expression…
2
votes
1 answer

NiFi: Need to remove a character from an attribute while leaving all others, but having trouble with the expression

I have an attribute that contains URL encoded characters. I need to send it through a URL decode, but for some reason some of the encoded characters have an extra "%" symbol. I added an update attribute to try to fix it, but am having trouble with…
Ginger
  • 29
  • 4
2
votes
3 answers

Differences between Expression vs Function

What is the formal difference between an expression and a function? I know the difference by looking at it, but I'm looking for a thorough understanding of it. For example, showing some examples from Scheme or Python: ; scheme (display "hello") …
David542
  • 104,438
  • 178
  • 489
  • 842
2
votes
2 answers

Regular Expression to match addresses: problem with matching addresses with different structures

I am using regular expressions in order to match different part of street addresses (number of street, street, city...). So far, everything works except for the City, depending on the structure of the address: Some addresses I have in my data are…
ichbintim
  • 23
  • 3
2
votes
1 answer

is it possible to execute a code inside an expression?

I have this macro: macro superM(name, field) :(struct $(esc(name)) map(x -> (for i = 1:length(x) return $(esc(x[i][1])) end),field.args) end) end @superM test ((arg1,2),(arg2,4)) I just want to map the second argument to get the…
ahm5
  • 633
  • 5
  • 9
2
votes
2 answers

Is there a way to show an "expression" correctly in a "paste"?

I have an expression like this in R: ylabel <- expression("NO"[3]*"-N-Concentration [mg/l]") This should be the label of my y-axis on my ggboxplot. Because the y-label is too close to the axis, I use \n (new line) to create more distance to the…
PDUY
  • 23
  • 5
2
votes
1 answer

Regex: Capture everything up until a character sequence & if that character sequence doesn't exist, capture entire text

Aim: Capture everything up until a character sequence & if those character sequences don't exist, capture entire text. Character sequences: | table & | stats Ex 1: search foo bar | table _time Action Direction returns search foo bar Ex 2: search…
Johno Cown
  • 29
  • 6
2
votes
0 answers

How to evaluate Julia's anonymous functions for a value from an expression

I am trying to establish a group of anonymous functions to later call and receive a value from. Here is a basic working example of the problem I'm facing. expr = :(x+y) f = eval((x,y,z)->expr) This gives me the following response... Then when I…
Sean C
  • 165
  • 6
2
votes
1 answer

Haskell Evaluating Arithmetic Expressions and Assigning Variables

I have a datatype called expr as follows: data Expr = C Float | Expr :+ Expr | Expr :- Expr | Expr :* Expr| Expr :/ Expr What I want to do is extend the Expr datatype to allow variables and 'let' expressions
M. Freberg
  • 39
  • 1
  • 7
2
votes
1 answer

How to read function expression syntax in javascript?

function [name]([param1[, param2[, ..., paramN]]]) { statements } https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/function I am confused what and how to read the above function input values, it is a infinite params…
Manasvi Sareen
  • 916
  • 7
  • 17
2
votes
1 answer

Lambda expression as member functors in a class

I was thrilled when lambda expressions (LE) were part of the gcc starting a 4.5.1 and hoped they would grant a way of getting rid of those nasty functions pointer in C++, which were basically, to my understanding, compiled as C functions. All those…
gilgamash
  • 862
  • 10
  • 31
2
votes
5 answers

How can I concatenate a where clause using OR on LINQ?

I have this code : foreach (Package pack in Packages) { filteredResults = filteredResults.Where(o => o.ID == pack.ID); } the only problems is that I filter the result N time (so N where). What I'd like to do is to filter the result only one…
markzzz
  • 47,390
  • 120
  • 299
  • 507
2
votes
0 answers

How to get bold greek letters and brackets using latex2exp package?

I'm using the latex2exp package to create some equations that will be placed on plots or on the axes. Despite using the bold = TRUE option within the arguments of the TeX() function, the Greek letters and brackets do not appear in bold. Would anyone…
Daniel Valencia C.
  • 2,159
  • 2
  • 19
  • 38
2
votes
1 answer

error: c code: expression must be a modifiable lvalue

I have two different structs in c file, struct A and B: typedef Struct _A { float arr[4]; }A; typedef struct _B { float const x; float const y; }B; A* objA = (A*)malloc(sizeof(A)); B* objB = (B*)malloc(sizeof(B)); what I need to do is…
P Pp
  • 137
  • 1
  • 6