Questions tagged [parameter-passing]

parameter-passing is the process of assigning values to the parameters of a function

Association of actual and formal parameters upon function call. See Parameter Passing and its methods. The most widely used parameter passing methods are:

  • call-by-value
  • call-by-reference
  • call-by-value-result
  • call-by-name
  • call-by-need
  • macro expansion.
8028 questions
2
votes
1 answer

Function parameter - id vs object

I have some service that return user's data by it's id. User already stored in request(session) - no need to fetch it every time. The question is what is the best practice for parameter. Id of the user(SOLID) or user object(more…
2
votes
0 answers

Passing String to dplyr as a Function?

I am interested in the ability to pass a string not as an argument within a function but as an entire function. This may not be the smartest approach but I am simply curious so that I can understand the functionality between dplyr and how R…
LoF10
  • 1,907
  • 1
  • 23
  • 64
2
votes
2 answers

Can an Oracle stored procedure that has a nested table parameter be called from ODP.NET?

I've got a stored procedure that has a couple parameters that are nested tables. CREATE TYPE FOO_ARRAY AS TABLE OF NUMBER; CREATE TYPE BAR_ARRAY AS TABLE OF INTEGER; CREATE PROCEDURE Blah( iFoos IN FOO_ARRAY, iBars IN BAR_ARRAY, oResults OUT…
2
votes
5 answers

Is it possible to pass textboxes as a parameter?

I'm attempting to pass the name of 2 textboxes into a method so that it edits the text in them. I have tried looking for examples online but can only find people attempting to pass textbox text through. I've tried passing it in by declaring the text…
2
votes
1 answer

JQuery Widget - Pass options by reference

I have two JQuery widgets, one is a sort of 'main' widget, the other could be considered a child. The child handles gathering specific data which is required by the main. The main is used with AJAX requests. So, the main has a set of options which…
Serodis
  • 2,092
  • 4
  • 25
  • 34
2
votes
2 answers

Is there a way to pass all the table names in a database as a parameter for the SP?

I am looking to run validation script across columns for all tables in a database in MS SQL SERVER . My query now is something like this: CREATE PROCEDURE [dbo].[DDS1718_Validation] AS BEGIN SET FMTONLY OFF DECLARE @ActualTableName AS…
2
votes
4 answers

Passing of variable arguments in C

Does anybody know how variable arguments are passed in classic C? I did some debugging today and most regular arguments are passed via stack. However it seems that this does not apply for variable arguments. Are those parameters stored somewhere…
Florian Greinacher
  • 14,478
  • 1
  • 35
  • 53
2
votes
1 answer

Distinguish between "fundamental" ctypes data types and subclasses thereof?

Introduction I am working on a code generator that would generate functions around ctypes.cdll loaded functions. The generator would take information about the ctypes of the arguments and the return value, and generate something that behaves (and,…
astafan8
  • 143
  • 2
  • 7
2
votes
1 answer

Python/curve_fit: cannot pass array with init guess

I have this function to compute some sort of polynomial: def pipoly(df,pj): n=np.size(pj) p=pj[0] for j in range(1,n): p+=pj[j]*df**j return p pj is supposed to be an array that contains the initial guesses of the…
TomR
  • 133
  • 1
  • 14
2
votes
1 answer

How to properly use parameters in git aliases?

I have the following git alias in my .gitconfig file. clone-with-branches = "!cloneWithBranches() { \ git clone $1 $2 ; \ }; cloneWithBranches" I am supposed to use it as follows: git clone-with-branches folder1 folder2 (supposing…
Pat. ANDRIA
  • 2,330
  • 1
  • 13
  • 27
2
votes
2 answers

Initialization of a Fortran parameter with intent(in) argument

Consider the following programm : Subroutine foo(p,v) implicit none integer, intent(in) :: p double precision, dimension(p), intent(in) :: v !local variables integer,parameter :: n=floor(par(p)) double…
user6599829
2
votes
1 answer

Passing by value or passing by reference is more efficient in GoLang?

Let's say I have a struct implementing an interface like below: type IFace interface { Method1() Method2() Method3() } type Face struct { Prop1 string Prop2 int } // IFace implementation here... Now if I have method that accepts…
kovac
  • 4,945
  • 9
  • 47
  • 90
2
votes
3 answers

Function argument that depends on default arguments

I'm trying to write a function that has default arguments in R. The last argument is telling me how the user would like variable 'g' to be calculated. The default is "s + a" (the sum of the two previous arguments), but in principle it could be…
BGranato
  • 129
  • 1
  • 10
2
votes
0 answers

Dynamic parameter passing in python callback routines for fortran code

I have some old fortran code which I want to wrap with f2py and which I am not allowed to change. The core of the program is some subroutine that depends on user defined subroutines. All of these subroutines share common parameter arrays for…
dba
  • 453
  • 3
  • 16
2
votes
3 answers

Pass by reference in Pascal

I'm not sure if I understand correctly how pass by reference in Pascal works. Does it create an alias as in C++ (https://isocpp.org/wiki/faq/references) or does it work similarly as in C and the procedure gets a pointer to the variable and uses this…
pjSonic
  • 23
  • 1
  • 3