Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [lambda]

DO NOT USE FOR THE AWS SERVICE (use [aws-lambda] for those questions!) Lambdas are anonymous functions or closures in programming languages such as Lisp, C#, C++, Lua, Python, Ruby, JavaScript, Java, Excel or Google sheets. (Also, lambda expression.)

lambda
0 votes
0 answers
14 views

Attempting to use locally cloned version of Python package in Docker throws metadata error

I am testing an experimental library version and must run it in a docker container locally rather than as a pip install. As a result, I copy all of the files from the locally cloned library into the ...
M. Nicol's user avatar
  • 113
6 votes
1 answer
95 views

Returning const reference from lambda stored as std::function segfaults [duplicate]

Here is the code: #include <vector> #include <functional> class TestClass { public: const std::vector<int> &getStuff() const { return callback(); } protected: ...
ligazetom's user avatar
  • 145
1 vote
1 answer
43 views

Different generic type overlap of lamba field and its class

Consider this example (live example): interface Foo<T> { readonly fun: (v: T) => void; // causes error below //fun(v: T): void; // works } function isNumber<T>(foo: Foo<T>...
Stack Danny's user avatar
  • 7,996
0 votes
1 answer
52 views

Count the number of arguments in generic lambda

I want to create a function that counts the number of arguments in generic lambda functions. SO user "yuri kilochek" has a great solution Count the number of arguments in a lambda but it ...
user2961927's user avatar
  • 1,654
1 vote
1 answer
55 views

How to call a function from a function in a class that is called using a button with a lambda in Python3x?

I have a class: MyClassName for example, with two functions: one to calculate a number and one to validate if a group of comboboxes (tkinter) all have selections. I'm also using tkinter for a button ...
James-Jesse Drinkard's user avatar
2 votes
1 answer
58 views

Compose Conditional Modifier Not Working Properly

I tried making an extension function on Modifier to apply changes to it only if a condition was true, since quite frequently I need to make small changes to a Modifier object in case certain things ...
Felipe Ribeiro R. Magalhaes's user avatar
0 votes
0 answers
26 views

Turborepo / Lamda / Dockerfile - Error Not Finding Internal Package

I have a monorepo using Turborepo that has a Lambda function that depends on an internal package. Basically, something like the following structure... The service is "resize" and it depends ...
Kevin's user avatar
  • 2,124
2 votes
1 answer
36 views

Python Split and assign into new Columns

I have been worked in a dataframe with one column which has data for different calls to APIs. I need to split by "," and add new columns depends of the method's name (each API contains ...
Bruno's user avatar
  • 25
0 votes
1 answer
80 views

Use of lambda to perform basic multiplication

I am trying to do basic multiplication within all the individual elements of this list, but where am I going wrong with using lambda expression here? inputData = [[2, 3], ["4", 7], [6, 4], [...
TotalGadha's user avatar
4 votes
0 answers
160 views

Using a function's argument to produce the type of another function's argument

Since C++20 abbreviated function templates are available for use with placeholder types in parameter list. And one can declare abbreviated function template g with two arguments of same reference type ...
Fedor's user avatar
  • 19.4k
2 votes
1 answer
95 views

Capture bit-fields by reference in a lambda expression

According to cppreference, bit-fields can only be captured by copy: https://en.cppreference.com/w/cpp/language/lambda. Period. At the same time, one can see certain scenarios, e.g.: struct U { int ...
Fedor's user avatar
  • 19.4k
1 vote
1 answer
106 views

How can I std::move a vector into a lambda function? [duplicate]

#include <iostream> #include <functional> int main() { std::vector<int> integers = {0, 1, 2}; std::function<void()> lambda = [integers] { printf("vector ...
Rahn's user avatar
  • 5,305
0 votes
1 answer
107 views

C++: Lambda with conditional capture clause possible?

Is there a way to define a lambda's capture clause (copy vs. reference) conditionally? Let's say we have a function taking a functor: template<typename Func> void takeFunctor( Func&& ...
RL-S's user avatar
  • 847
2 votes
1 answer
90 views

Recasting Variadic Arguments from void** Array in C++

I'm working on a project where I need to convert variadic arguments into a void** array, pass them to a lambda function, and then correctly cast them back to their original types for use in a custom ...
Andres's user avatar
  • 203
0 votes
2 answers
102 views

Google Sheets sum every Nth element from a range up to M elements

I need to calculate the sum of M elements from every Nth row from data set (column A) starting from current cell's row (column B). I've managed to do that via nested queries, but the performance is ...
Nidere's user avatar
  • 129

15 30 50 per page