What is the word for assigning or passing into a function in programming? [closed]

I have two cases that I'd like to cover. For example you can either assign to a variable:

var x = 3;

Or you can indirectly assign to a variable with a function (passing function arguments):

my_func(3);

Is there a word to refer to both of these cases? Basically, these are the ways to "use" a value in programming, via variables or function scoping.

I want to use the word like the following:

This syntax alone is not useful but when you <WORD> it, yadda yadda...

which would be equivalent to:

This syntax alone is not useful but when you assign it to a variable or pass it into a function, yadda yadda...

The closest words I could come up with were either "use" or "store", both of which are a little bit too ambiguous. Thanks in advance!


The word is assignment in both cases.

The first example is of explicit assignment:

x = 3

The second is of implicit assignment:

my_func(3)

This is because the function invocation syntax of many languages allow for implicit assignment to function arguments by position. This is just shorthand for the explicit assignment that many languages (also) allow:

my_func( x=3, y=1)


I have PhD. in computer science, so I'm unusually well-connected to this question. :)

var x = 3;

This is indeed called assignment to a variable; it can also be called initializing a variable, since it's being done initially. (This also declares the variable x, but you were talking about the use of the value.)

function my_func (z)

begin

...

end

my_func(3);

This last line is passing in a parameter; or passing a value into a function (since 3 is a value); and if we instead say

my_func (x);

it may be called passing in a variable.

You could say we're really passing in an argument not a parameter, as 3 is an argument and z is the parameter. But I often hear "passing in a parameter."

I do not hear the latter case referred to as assignment, though it can be viewed as such.