Anonymous functions or closures in programming languages such as Lisp, C#, C++ or Python. (Also, lambda expression.)

learn more… | top users | synonyms (1)

0
votes
3answers
20 views

SQL expressions in EF using Lambda

I would like to know if something similar to this (linq to SQL) customers.Where(c => SqlMethods.Like(c.Name, "%john%")); is possible to do in Entity Framework. Preferably using lamba ...
1
vote
3answers
53 views

Build a dynamic where clause over multiple properties

What I have is a List<string> IndexFields which contains a list of property names. My issue is that I need to build a where clause based on the elements in the list. So far I have; var sitem ...
2
votes
2answers
33 views

remove portion of string that is found in a list

I'm trying to find an elegant way to remove data that is contained in a list from a single string. A simple complete example is shown below that does not work: private string removeWebSuffixes() { ...
-9
votes
0answers
64 views

Did lambdas exist in C# before they did in VC++? [closed]

C# introduced lambda expressions with 3.0 (beta) back in 2005/2006. Since anything Windows comes from VC++, did VC++ have lambdas back then? If not, I'm wondering why they would be built into C# and ...
0
votes
1answer
40 views

Passing Func to method where the func needs parameters from inside method

So I have some sorting logic that I need to use all over the place, so I thought I'd try and create a generic method that I could call and not have to copy and paste the code 30 times. This is what I ...
2
votes
2answers
39 views

Is there any way to concatenate two Func<T, bool>?

Assume that i have thes Class: public class Order { int OrderId {get; set;} string CustomerName {get; set;} } also i declare below variables Func<Order, bool> predicate1 = ...
0
votes
1answer
34 views

Wildcard search in using Lamda in EF

I have a search with optional arguments: string id1 = HttpContext.Current.Request["id1"]; string id2 = HttpContext.Current.Request["id2"]; List<Foo> list = context.Foo.Where(l => ...
3
votes
1answer
140 views

Calling std::any_of with conditional operator on lambda gives unexpected results

Here is some code I recently wrote in VS2012: ///<summary>Lambda: Returns true if the field is significant within a baseline context</summary> const auto ...
0
votes
0answers
17 views

Strange scooping rules in for loop with lambda in Visual Studio 2012

How come this does not compile: for(size_t i;;) auto Lambda = [](size_t i) {}; 1>application_src\general_experiments.cpp(96): error C2365: 'i' : redefinition; previous definition was 'data ...
2
votes
3answers
143 views

Is it possible to use a lambda function inside of a vector's constructor?

Is there a way to initialize all values of some container using a lambda function like one would do using std::for_each? I need a 3-dimensional std::vector of random ints, and it would be nice if I ...
0
votes
2answers
31 views

lambda contains in array

My array A may be returns array of age likes int [] A = {11,12,13} or int [] A = {14,15} or int [] A = {11,14} My Person table has column likes ID Name Age --------------------- 1 ...
1
vote
2answers
24 views

C# Getting a column value with lambda and read the value on code behind

my database table looks like this i trying to retrieve the FileURL in the CRUD class file like this : public IList<string> GetSorted(int listAct) { ...
7
votes
3answers
240 views

Overhead of recursive lambdas

Do recursive lambda functions induce any overhead comparing to regular recursive functions (since we have to capture them into a std::function) ? What is the difference between this function and a ...
0
votes
2answers
44 views

Use appguid if available otherwise use hardcoded guid in LINQ

How can I write below lambda expression so it can check for a matching appguid and if it won't find any, then it will look for hardcoded guid instead? public static string ActiveDirectory(string ...
15
votes
2answers
344 views

How to compare two functions for equivalence, as in (λx.2*x) == (λx.x+x)?

Is there a way to compare two functions for equality? For example, (λx.2*x) == (λx.x+x) should return true, because those are obviously equivalent.

1 2 3 4 5 318
15 30 50 per page