All Questions
12 questions
1
vote
1
answer
64
views
How to automatically detect and decurry a curried function at Runtime?
I am working with curried functions in TypeScript, and I want to figure out a way to automatically detect if a function is curried and, if it is, decurry it into a non-curried function.
Problem:
A ...
1
vote
1
answer
654
views
Is it possible to bypass/ignore an argument in a custom function [duplicate]
Just for clarification, not intended to reopen, as I will start a follow-up question:
This not a question about using an ifelse in dplyr.
This is a question about passing by an argument in a custom ...
1
vote
3
answers
91
views
Can someone help me passing a function as argument in python?
I have the following class in python. I want to pass the function get_priority as argument to access the object Task. I obtain the following error when adding the second task to taskManager:
if ...
1
vote
0
answers
20
views
R: Obtaining the formal arguments of a function when applied to a specific object [duplicate]
Suppose I have a function f(x) applied to a data object x. I need to know whether f has a certain argument, a 'na.rm' argument to be precise. I could find out by calling names(formals(f)), but f, ...
3
votes
1
answer
3k
views
Order of Evaluation of Arguments in Ocaml
I would like to know why does ocaml evaluate the calls from right to left, is that a FP principle or it doesn't matter at all to a FP language ?
A quicksort example :
let rec qs = function
| [] -...
2
votes
2
answers
50
views
Returning multiple objects and using them as arguments
I have a function which goes something like this:
def do_something(lis):
do something
return lis[0], lis[1]
and another function which needs to take those two return objects as arguments:
...
2
votes
3
answers
3k
views
OCaml - Give a function of type (int -> int) -> int
I'm completely lost on this. It was explained that functions are right justified so that let add x y = x + y;; has a function type of int -> int -> int or int -> (int -> int).
I'm not ...
0
votes
1
answer
52
views
Passing a function as argument which uses the argument of parent function but also has it's own argument
I just started playing around with functional programming and am trying to pass a function as an argument of another function. However the function that I am trying to pass also has arguments like so:
...
1
vote
6
answers
1k
views
Passing one subroutine to another subroutine
I have one function sub _where(\@ \&) which takes 2 arguments: the first is an array, and the second should be another function. This other function returns a boolean value, and I want to call it ...
3
votes
1
answer
647
views
How do I define a function def which accepts arguments and returns a value?
I would like to be able to define a function which accepts an argument (e.g. a File object), and returns something (e.g. a Boolean), and then pass that function (not the boolean!) to another function ...
7
votes
1
answer
3k
views
Too many arguments for function
I'm starting to learn Lisp with a Java background. In SICP's exercise there are many tasks where students should create abstract functions with many parameters, like
(define (filtered-accumulate ...
23
votes
3
answers
22k
views
excel vba: Special Types - Functions as Arguments of Functions
There is no special type for functions in VBA. It is hard for me to see how to add functions as arguments to functions in Excel VBA.
What I am trying to accomplish is something like this:
function f(...