2,148 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
1
answer
66
views
Is there a way to make an anonymous that takes the left argument and the right argument?
For example, this function:
f:{x+y}
Is not what I want because to call the function, f[2;3] is required instead of 2 f 3. Is there a way to make the function such that 2 f 3 work?
I am using ngn/k, ...
0
votes
0
answers
84
views
How to include two named functions sequentially in one anonymous function
How do you include two named functions, which are not nested, in one anonymous function?
For example, say I have a file mainFunction.m which contains
function varargout = mainFunction(in1)
% in1 is ...
-2
votes
1
answer
98
views
Is it legal to declare a lambda after the last return in a C# function? [duplicate]
I was looking through the code of AutoMapper ASP.NET Core dependency injection, and in the AddAutoMapperClasses, I saw that they declared a lambda expression after the last return:
private static ...
4
votes
1
answer
83
views
Is there a way to make an anonymous function without output? [duplicate]
Is there a way to make an anonymous function without output?
I have variable for function_handle whose starting, default value is to do nothing. So I am doing func=@()[];. But I am also curious if ...
4
votes
1
answer
77
views
How to evaluate a MATLAB anonymous function that takes an arbitrary number of variables n, given a n-dimensional vector?
I'm relatively new to MATLAB so perhaps there's something I'm missing.
The task is the following: we must program a certain algorithm for optimizing a continuous function f: Rn ---> R. The thing is,...
0
votes
1
answer
128
views
How are closures implemented in Rust?
In many languages closures are implemented using a structure in combination with a standard associated function (with a fixed name) which provides a method of making the object "callable".
...
0
votes
1
answer
66
views
Typing of anonymous function in nested dicts
I have a nested dict like this
function_dict_1 = Dict(
:f => Dict(
:func1 => x -> x^2
)
)
I want to call a strongly typed function, which receives this dict as an argument.
...
1
vote
1
answer
56
views
How to get anonymous function parameters information?
// normal function
fun something(a: String, b: String): String {
return "$a $b"
}
println(::something.parameters) <- not empty
but
// anonymous function
var something = fun(a: ...
1
vote
2
answers
99
views
Why does narrowing become forgotten inside a function expression?
I wish to define a function in a different way depending on whether a field in the provided value is null. I expect that the provided value's type will be appropriately narrowed inside the function ...
0
votes
2
answers
99
views
In PHP, how to recurse through a Closure when the variable name holding the anonymous function is a variable-variable
I have a list of about 100 articles, and within each article is a list of clauses. The clauses are a list of varying levels deep.
$clauses = array(
[
'Fields' => ['Clause' => 'clause 1', '...
0
votes
1
answer
57
views
Execute anonymous block from procedure
I have a table which consist of anonymous block in the column rule,
which needs to be executed from procedure.
Here is the sample data which looks like the real scenario.
Table emp:
create table emp (...
2
votes
3
answers
134
views
Trying to use an anonymous object in Perl
I have this script
use strict;
use warnings;
use Data::Dumper;
package Foo;
sub new {
bless { 'a' => 1,
'b' => sub { return "foo" }
}, $_[0]
};
my $foo = Foo-...
-1
votes
2
answers
108
views
Where are anonymous callback functions to setTimeout stored?
I have a simple program that looks like this:
console.log("Start of the program execution!");
setTimeout(() => {
console.log("I ran after a second!");
}, 1000);
console....
0
votes
1
answer
39
views
imap-ing over multiple glmers in R: Anonymous functions
I have this function:
mweFitModelsGLMER <- function(longData,
strModelName = "ID Rand Model",
strFormula = "phMeta_Toxicity ~ ...
1
vote
2
answers
111
views
Can I check if ReflectionType is instance of another type?
I want to check if a callable's return type is an instance of another type. For example, let's say I a have:
A class Pigeon which extends Animal.
A function addSupplier() which takes a callable ...