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

c# expressions and loop beauty

This is probably pretty subjective, but how do people generally lay out their loop control in C# when the control variable is updated in the loop? The pedant in me doesn't like the separate declaration and repetition involved. eg. string line =…
GazTheDestroyer
  • 20,722
  • 9
  • 70
  • 103
2
votes
1 answer

regular expression limit hex number length by using OR

I want to limit the length of hex number to 4 OR 8. For example: 0x0001 is valid (4 hex numbers) 0x0001001F is valid (8 hex numbers) 0x00012 is invalid (5 hex numbers) I can validate a hex number with length of n (n is 4 or 8) by…
esun203
  • 167
  • 5
  • 11
2
votes
2 answers

How to use a dynamic path expression in Xquery

I'm fairly new to xquery so please bear with me as I try to best ask this question. when i use the following statement (to select a sequence) it works just fine: let $parts :=…
2
votes
2 answers

Is every literal an expression?

Let's begin with some definitions: An expression is a construct that produces (returns) a value. A literal is a notation for representing a fixed value. I could assume the literal is a expression that returns exactly one value. E.g. the literal 1…
halex
  • 16,253
  • 5
  • 58
  • 67
2
votes
2 answers

How create an indexed property acess expression in .net 3.5?

In .NET 4.0 one can write something like this: ParameterExpression objExpr = Expression.Parameter(typeof(SomeIndexedType), "Obj"); ParameterExpression indexExpr = Expression.Parameter(typeof(int), "Index"); Expression indexAccessExpr =…
Nu-hin
  • 691
  • 1
  • 7
  • 12
2
votes
2 answers

SSRS BIDS 2008 R2 Bar Chart Colour fill expression Legend

I have the above barchart with the following expression under the following section: SERIES PROPERTIES > FILL > EXPRESSION =iif(Fields!classification.Value="RFC","#56ca29","#ff6969") This works fine in terms of putting green for all the RFC's and…
JsonStatham
  • 9,770
  • 27
  • 100
  • 181
2
votes
2 answers

dynamic linq expression to query, getting issue

I an tryin to join 4 tables within a query as per requirement. where as I wanted to add the conditions in where clause dynamically so, i could able to do this for 2 table query as of now. but this 4 table join is bit the complex join here. To…
Red Swan
  • 15,157
  • 43
  • 156
  • 238
2
votes
1 answer

SSIS : How to set the TransactionOption as Expression or in Script Task?

I've tried setting the TransactionOption as an expression on a Sequence Container: @[User::Config_DevelopmentMode] ? DTSTransactionOption.Supported : DTSTransactionOption.Required --> Does not evaluate @[User::Config_DevelopmentMode] "Supported" :…
Stef Heyenrath
  • 9,335
  • 12
  • 66
  • 121
2
votes
2 answers

What is "type of expression" in C++?

I know what "category of expression" is, but I'm confused with "type of expression". According to www.cppreference.com: Expression evaluation may produce a result. So, is the type of the result the "type of expression"? But, also according to…
Yue Zhou
  • 47
  • 3
2
votes
7 answers

Correct evaluation of expression

I came across the following expression in someone else's code. I think it's terrible code for a number of reasons (not least because it fails to take into account bool.TrueString and bool.FalseString), but am curious as to how the compiler will…
Paul Suart
  • 6,505
  • 7
  • 44
  • 65
2
votes
1 answer

How to add two or more new lines in an expression in the main title in pheatmap

I have a small question about expression when I use it in the pheatmap. For example, I want to add information in the main title in a pheatmap plot with something in details. Here is my reproducible code: # main <- expression(bold(paste( # …
花落思量错
  • 352
  • 1
  • 11
2
votes
1 answer

How to use DataArray values ​as list indexes?

First of all, I'm sorry for the not very explicit title, I just couldn't find anything better. I have a silly question, but I've been stuck on it for hours. Basically I have an xarray DataSet in which is a data variable called data_index with…
Morgane
  • 23
  • 5
2
votes
3 answers

C# What construct am I Looking for Lamba / Expression / Func / Reflection for runtime property substitution?

I've a method on a generic base class that I want to execute for all superclasses of it The logic is something like: BuildAverageDateStats(List items, DateProperty1 exp, DateProperty2 exp2) { return new Stat{ Value = items.Average(c =>…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
2
votes
1 answer

How to build a lambda expression

I have lots of sub classes, inherited from IDbTypeHandler, and I want know how to convert "SetValue" to lambda expression, after that I can call Action. inteface public interface IDbTypeHandler { } …
goldii
  • 242
  • 2
  • 18
2
votes
1 answer

Is the comma in Perl associative in all contexts?

Suppose E, F, and G are expressions that don't involve operators of higher precedence than the comma. Are the expressions ((E, F), G) and (E, (F, G)) equivalent in scalar, list, and/or void contexts? More precisely, can you always replace ((E, F),…
fmg
  • 813
  • 8
  • 18