Questions tagged [function-call]

A function call is a line of code that executes a specific block of code defined as a function, that is, self-contained code that may optionally take arguments, defined for the purpose of code reuse.

A function call is a line of code that executes a specific block of code defined as a function, that is, self-contained code that may optionally take arguments, defined for the purpose of code reuse.

760 questions
4
votes
2 answers

Displaying the actual parameter list of the function during execution

I am trying to display the actual values of the parameters that were supplied when the function was called. `match.call' does something along the lines I want but it does not evaluate variables. For example foo <- function(x)…
Aniko
  • 18,516
  • 4
  • 48
  • 45
4
votes
2 answers

How Windows thread stack guard page mechanism works in case of uninitialized local variables?

On Windows OS for x86-32/x86-64 architecture thread stack virtual memory consist of "Reserved Part" "Commit Part", "Guard Page" and "Reserved Page". Question: Imagine that I have 1 page of commit memory, and 1MB of reserve memory for thread stack. I…
Konstantin Burlachenko
  • 5,233
  • 2
  • 41
  • 40
4
votes
5 answers

Call function for specifying columns in SQL TRANSFORM query

Here is my query: PARAMETERS ... TRANSFORM ... SELECT ... ... PIVOT Mytable.type In ("Other","Info"); This is a cross query and I need to set all the column headings with this row: PIVOT Mytable.type In ("Other","Info") and now I have hard-coded…
Johan
  • 18,814
  • 30
  • 70
  • 88
4
votes
1 answer

Cell elements as comma separated input arguments for varargin function

Imagine a function with a variable number of input arguments, alternately asking for a string and a value. myfunction('string1',value1,'string2',value2,...) e.g. myfunction('A',5,'B',10) I want to keep the ability to call the function like that…
Robert Seifert
  • 25,078
  • 11
  • 68
  • 113
4
votes
1 answer

do.call 20% slower than a normal call in R?

I am not sure if I use the do.call the right way: test <- function(test) { string <- deparse(substitute(test)) start <- regexpr("\\(", string) end <- regexpr(")", string) - 1 distribution <- substr(string, 0, start-1) string.arguments <-…
PascalVKooten
  • 20,643
  • 17
  • 103
  • 160
4
votes
4 answers

function call with default parameter

I wrote an examination about C++ programming. There was one question where I and my professor didn't agree. The question was, does the following function work or not: #include using namespace std; void f(int=4, long=10,…
tzwickl
  • 1,341
  • 2
  • 15
  • 31
4
votes
3 answers

on a fn call in c++, args are copied to the corresponding parameter. Is this initialization or assignment?

on a function call in c++, arguments are copied to the corresponding parameter. Is this initialization or assignment?
nbbk
  • 1,102
  • 2
  • 14
  • 32
4
votes
3 answers

Runtime Function Specifications Based on User Input

Ok, so it's been a while since I wrote anything big in c++ and I've grown used to some of the niceties of more modern languages. This is one that's been nagging at me and I'm sure there's an answer out there. Is there any way to call a function…
Hoyt
  • 317
  • 3
  • 7
4
votes
9 answers

How to Call Function of one class on the object of another class?

How can I call one method in one class over using another class ? I have ; class A { public : foo ( ) ; }; class B { public : bar ( ) ; }; in main : A data ; // I am creating instance of class A data . bar ( ) ; // but, I am…
user1414276
  • 87
  • 2
  • 2
  • 5
3
votes
1 answer

How does Rust return large types (before optimisation)?

With a function signature such as: pub fn hash(input: &[u8]) -> [u8; 32] how do those 32 bytes get passed to the calling function? (Before optimisation, which might place some parts in registers.) Possibilities include: On the stack, with the…
fadedbee
  • 42,671
  • 44
  • 178
  • 308
3
votes
1 answer

Can Julia's macros access nested functions?

I am playing around with Julia's macros. One thing I am particularly curious about is the ability to extract a function's reachable call graph without having to fully compile the code. By 'reachable call graph', I mean all of the functions found…
Daniel Soutar
  • 827
  • 1
  • 10
  • 24
3
votes
1 answer

Function calls n1256 6.5.2.2 p5, p6

I'm reading N1256 6.5.2.2 function call. Some parts were hard to understand to me. I googled with bold sentences or some keywords but couldn't find a straightforward answer to my question. So I ask mine. At 6.5.2.2 p5(emphasize mine) If the…
op ol
  • 705
  • 4
  • 11
3
votes
1 answer

Functions in Haskell - Understanding

I have the following code which gives out [2,4,6] : j :: [Int] j = ((\f x -> map x) (\y -> y + 3) (\z -> 2*z)) [1,2,3] Why? It seems that just the "z-function" is being used, what happens to the "y-function"? And how does map work in this…
3
votes
1 answer

When passing variable to function I get 'Invalid argument', but when I hard code it works in Apps Script

This is my test function: var testFolderId = 'di98kjsdf9...'; function testGetFolder(testFolderId){ folder = DriveApp.getFolderById(testFolderId); Logger.log("folders: " + folder); } It fails when I do this. The error says: INVALID…
AmericanMade
  • 453
  • 1
  • 9
  • 22
3
votes
3 answers

Function call with variable number of input arguments when number of input arguments is not explicitly known

I have a variable pth which is a cell array of dimension 1xn where n is a user input. Each of the elements in pth is itself a cell array and length(pth{k}) for k=1:n is variable (result of another function). Each element pth{k}{kk} where k=1:n and…
am304
  • 13,758
  • 2
  • 22
  • 40