Questions tagged [arguments]

An argument is a value passed to a function, procedure, or command line program. This also refers to the Array-like `arguments` object in JavaScript.

An argument is a value passed to a function, procedure, or program. It is often used interchangeably with the word "parameter", which also has more specific definitions. Usually "argument", or "actual parameter" (as opposed to "formal parameter") is the value of the parameter used within the called routine.

In other words, parameters are used in procedure definitions, and arguments are used in procedure calls.

arguments can also refer to the Array-like object in JavaScript that is available inside functions, this object can be used to access all of the function's arguments regardless of the function's signature.

11091 questions
3
votes
3 answers

Using SSH, what is the best way to remotely execute a perl file from another perl file and pass arguments that contain spaces?

Here is what I have- A CGI script on server A gets the parameters entered in a webform, creates a remote ssh command that calls another perl file on server B and passes all parameters as arguments to the ash command. Perl file on server B parses…
Prasoon
  • 425
  • 1
  • 6
  • 18
3
votes
1 answer

Setting default value with Params::Validate if an undefined value is passed in

I am having trouble getting Params::Validate to work how I want it to. #!/usr/local/bin/perl -w use strict; use Params::Validate qw/:all/; use Data::Dumper; sub foo { my %args = validate(@_, { bar => { default => 99, …
CoffeeMonster
  • 2,160
  • 4
  • 20
  • 34
3
votes
2 answers

What is the name of this C function style?

I am confused about following C function, f_2(). It is written in .c file, code can be compiled by gcc. What is the name of this function style? How to interpret the meaning of this function? Is this standard C or some gcc extension? Thanks. void…
Dawn16
  • 140
  • 8
3
votes
1 answer

Java passing a newly created object as method argument inside the constructor of that object

I am trying to implement the UCS algorithm for a game in Java and I am now in the stage where I need to calculate the costs of each state. I made a Node class with 4 fields (a Table state, double cost, a Node parent and an ArrayList children) …
3
votes
1 answer

FastAPI add additional argument to running Uvicorn

I'm currently starting up the server with the following Uvicorn command: main:app --host 0.0.0.0 --port 8003 --access-log And I would like to add an extra argument --foo such that it works as argparse's "store_true" action so I can optionally…
DDCA567
  • 31
  • 4
3
votes
2 answers

In R, what does it mean when a function argument name ends with a single dot?

Some common R functions have argument names that end with a single dot. For example, the warning() function shows the following in the usage section when looking at the documentation with ?warning: warning(..., call. = TRUE, immediate. = FALSE,…
bluemouse
  • 360
  • 1
  • 11
3
votes
3 answers

function composition for multiple arguments and nested functions

I have a pure function that takes 18 arguments process them and returns an answer. Inside this function I call many other pure functions and those functions call other pure functions within them as deep as 6 levels. This way of composition is…
3
votes
3 answers

How do I use an object reference as an argument if it is instantiated after the class taking the argument?

So I have this code: package com.erikbalen.game.rpg; import com.erikbalen.platform.*; import javax.swing.JFrame; public class World extends Engine { public static void main(String[] args) { Gui display = new Gui(/*takes a Player…
Erik Balen
  • 275
  • 1
  • 4
  • 11
3
votes
2 answers

Parsing command line arguments in Python: getting a KeyError

I am trying execute my Python script as: python series.py supernatural 4 6 Supernatural : TV Series name 4 : season number 6 : episode number Now in my script I am using the above three arguments to fetch the title of the episode: import…
RanRag
  • 48,359
  • 38
  • 114
  • 167
3
votes
1 answer

How to test arguments for a figure or axis object in MATLAB 2022?

A function receives a figure or axis object object as parameter. I want to test this as shown in the FIXME line. Which test should be used here in order to allow all valid objects for exportgraphics? % myexportgraphics.m function…
Jonas Stein
  • 6,826
  • 7
  • 40
  • 72
3
votes
4 answers

Function with parameters but no arguments

I was reading a mergeSort from standard library in c and found that it has a compare function as an argument(i.e void msort(void *base, size_t nitems, size_t size, int (*compar)(const void , const void)) when it's defined). However, in actual use…
Solruhama
  • 101
  • 7
3
votes
1 answer

Is there a way to use python argparse with nargs='*', choices, AND default?

My use case is multiple optional positional arguments, taken from a constrained set of choices, with a default value that is a list containing two of those choices. I can't change the interface, due to backwards compatibility issues. I also have to…
narwahl
  • 63
  • 1
  • 6
3
votes
1 answer

TypeError: __init__() got an unexpected keyword argument 'progress_bar_refresh_rate'

I tried resolving this issue since two days however still facing this issue any leads would be helpful. Please refer the link for screenshot
3
votes
2 answers

SciPy: Issue passing arguments to optimize.shgo function

I am trying to use the SHGO algorithm implemented in SciPy, but I have trouble when the objective function takes more than one argument. If I understand the error correctly, I am not passing the additional arguments (parameters) to the objective…
AB8
  • 51
  • 6
3
votes
3 answers

How can I know that PowerShell function parameter is omitted

Consider such function: function Test($foo, $bar) { ... } We can call it: Test -foo $null Test How can I know when the -foo was omitted, and when it was $null?
alex2k8
  • 42,496
  • 57
  • 170
  • 221