Skip to main content

Questions tagged [lambda]

Lambdas are anonymous functions (i.e. not having an identifier, like methods in a class) which can be used in a wide range of programming languages.

2 votes
2 answers
322 views

import java.util.function.Function; public interface Printable { public String print(String s); public static void main(String[] args) { Function<String, String> fn = p -> p +...
releseabe's user avatar
  • 539
0 votes
1 answer
171 views

If a lambda is frequently used, it is considered to reuse the same instance instead of creating new instances repeatedly. How can I minimize the number of captured variables in lambda expressions?
Arunabh's user avatar
-2 votes
2 answers
241 views

I am currently writing an application that is going to be an adaptive quiz-like site for studying. The idea is a user is studying some topic and they are given questions on the site and enter their ...
Logan S's user avatar
  • 11
-1 votes
2 answers
155 views

I need to work out the architecture for a NASDAQ frontend charting application (a desktop app in .Net). Note that this is NOT for real-time quotes. NASDAQ provides an api that gives historical pricing,...
rmcsharry's user avatar
  • 117
0 votes
0 answers
91 views

When working with functions that run a few short "procedures" in sequence that are not used anywhere else and it makes sense to keep it all inline, in a single function, a large part of the ...
Jake1234's user avatar
  • 129
1 vote
3 answers
212 views

I'm coding an enum strategy pattern where one of the strategies makes use of an ScheduledExecutor: class ControllerImpl { //... boolean applyStrat(StratParam param) { getStrat().apply(...
walen's user avatar
  • 355
1 vote
1 answer
779 views

If I have a discriminated union and want to write a function piecewise, the following code works just fine, but is taking advantage of some fairly tricky (at least to me) stuff involving overload ...
Daniel McLaury's user avatar
24 votes
8 answers
7k views

PEP 8 states the following about using anonymous functions (lambdas) Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier: # Correct: ...
N3buchadnezzar's user avatar
1 vote
0 answers
64 views

Our company is an aggregator of multiple payment services fragmented on the web. So instead of businesses integrating multiple services one by one, they will only need to integrate to our API, and we ...
kelvinleeweisern's user avatar
2 votes
1 answer
169 views

In the C++20 codebase that I work there are a couple of functions which have helper functions defined as lambdas. I can see the idea of locality for these helpers. By having them there in the function,...
Martin Ueding's user avatar
9 votes
5 answers
835 views

A few years ago, I wrote an application that allowed users to upload a file (it's a very specific file type) to a server. It then sends instructions to the server on how to visualise the data, and the ...
Mark's user avatar
  • 79
0 votes
0 answers
765 views

I'll describe my case: I have an aws lambda that will expose an API interface that will return json data (by topic) which is cached. This lambda will also offer private endpoints to recalculate the ...
koalaok's user avatar
  • 513
0 votes
1 answer
1k views

Is capture by value (x below) an early binding and capture by reference (y below) a late binding in C++ lambdas, or are they both early bindings—the first by value and the second by reference? #...
Géry Ogam's user avatar
0 votes
1 answer
360 views

I'm writing a microservice (in .netcore) that will handle some requests using WebAPI, but also it needs to react to some external events. I see 2 possibilities how to solve it (on a very high level): ...
Maciej Pszczolinski's user avatar
1 vote
2 answers
624 views

How are these principles applied in the context of streams and lambda expressions? In particular, the applicability with respect to the following three principles: - Single Responsibility Principle (...
L m's user avatar
  • 133

15 30 50 per page
1
2 3 4 5
7