Questions tagged [function-parameter]

The function parameters are the variable names, listed in the definition of the function.

In many programming languages, parameters are the essence of the functions. The function parameters define the variable names, listed in the definition of the function. They are often confused with (and referred to as) function arguments, which actually are the real values that are passed to and received by the function when it is being called.

314 questions
0
votes
0 answers

javascript function with multiple arrow "=>" parameters

I was reading about redux middle ware and I noticed a below function. As you see, it has three "=>". Can someone please explain how does these three "=>" work? const logger = store => next => action => { console.log('dispatching', action) let…
0
votes
1 answer

What does : => A syntax mean in method parameter declaration?

So, reading the Scala tour about implicit classes in Scala, I came across this piece of code: object Helpers { implicit class IntWithTimes(x: Int) { def times[A](f: => A): Unit = { def loop(current: Int): Unit = if(current > 0)…
Lucas Lima
  • 832
  • 11
  • 23
0
votes
0 answers

PowerShell: How to forward unparsed parameters to functions?

I'm trying to pass unparsed arguments "through" to a function call, but am having trouble getting powershell to parse them. See below code: [CmdletBinding(PositionalBinding=$false)] param([Parameter(Mandatory=$false)] [Alias("m", "mixno", "mix")]…
user2563087
  • 151
  • 1
  • 8
0
votes
1 answer

In Python functions what does a stand alone * in the parameters mean

I am going through the excellent Python 3 Metaprogramming tutorial by David Beazley. In it there is a decorator that looks as follows (slide 50): from functools import wraps, partial def debug(func=None, *, prefix=''): ''' Decorator with or…
Ama Aje My Fren
  • 256
  • 2
  • 5
0
votes
2 answers

How to use array values as function parameter

I want to pass the values of an array to a function that accepts these parameters. When I do it based on the code provided, I get an error telling me: "ByRef argument type mismatch" I understand that my array is declared as variant, but the values I…
Sunfile
  • 101
  • 1
  • 4
  • 22
0
votes
1 answer

Function's parameter that is a pointer to an argument that was declared as const, how to handle it?

I'm using MikroC for PIC, I don't know the name of the compiler. I'm using a PIC18F4550. I need to print a list of itens of a menu in a 16x4 LCD. I put here a slice of code, because the code is big to put it here, so, I tried to write here a minimal…
Daniel
  • 107
  • 6
0
votes
1 answer

Why cannot I directly use returned pointer as parameter in function call of insert?

Here's the prototype of the function: void BinaryDimonTree::insert(int x, int y, int level, TreeNode *&cur) in the function, I tried to call: insert(x, y, ++level, cur->getLeftChild()); and here's getLeftChild: TreeNode* TreeNode::getLeftChild()…
Sean
  • 1,055
  • 11
  • 10
0
votes
2 answers

Struggling to understand how the value of certain function parameters are determined

I often do not understand how the value of certain function parameters is determined. Take the following code snippet for example: function gotItAll(res) { $('#actionscreen').modal('hide') if (res.ErrorHtml != "" && res.ErrorHtml.substring(0,31)…
NickyLarson
  • 139
  • 8
0
votes
0 answers

Is it okay to send Laravel Request object to other functions as parameter?

Is it okay to send Request $request object between the functions? My Request $request object consists of around 20 inputs. At first in 'store' function, I save about 10 inputs. Then I pass this $request object to another function where I save…
0
votes
0 answers

Postgresql - Pass a table to a many-to-many insert function

I have quite a few many-to-many relationships. To simplify the process of inserting data into the respective three tables, I have the below function that I adapt for the various M:M relationships, and it works like a charm. However, for situations…
0
votes
2 answers

How do you return a changed Python numpy array size reference parameter

This is a Python function parameter passing question. I want a Python function to adjust the size a numpy array which is one of the functions reference parameters. The content of the passed array appears to change, inside and outside the function. …
mjp
  • 93
  • 10
0
votes
1 answer

"java.io.FileNotFoundException" error related to a port number 8080 that is a function patameter

I am practising a Clojure tutorial "Basic Web Development" http://clojure-doc.org/articles/tutorials/basic_web_development.html In the end, I am facing a problem. When I execute $ java -jar target/clojure-webapp-0.1.0-SNAPSHOT-standalone.jar…
trzczy
  • 1,325
  • 2
  • 18
  • 43
0
votes
1 answer

C# Passing an Optional Function to another Function

I know that in C# you can pass a function as a parameter to another function with something that looks like this: public bool DoSomething(int param1, int param2 = 0, Func f) { //Do Some work //Run function f bool i = f(true); return…
DFAD
  • 41
  • 4
0
votes
1 answer

Random bytes generation in c++11

I've written a funtion to prouduce random bytes in a uint8_t type array, unless I seed this with a random_device object it works fine but when I seed there are some compiler errors. code: #include #include #include…
Nilesh Kumar
  • 343
  • 1
  • 5
  • 18
0
votes
1 answer

swift with syntax on method parameters

I've seen this syntax in code examples and blogs, but have not seen it explained: func exampleFunc(arg1: String, withOtherArgument otherArgument: String) -> Void {} What does the with syntax do? Why is it necessary, and how is it different from…
Abraham P
  • 15,029
  • 13
  • 58
  • 126