A parameter is a placeholder and an argument is a value held in place. Yes: in your example using a function plot, x and y are positional > parameters and style, width, color are keyword parameters.
"solid" is the default value for the keyword style, it becomes the keyword's argument each time plot is called without using (assigning) the style keyword. On Saturday, March 19, 2016 at 9:12:07 PM UTC-4, Ray Toal wrote: > > Hello > > The Julia documentation refers to "keyword arguments" rather than keyword > parameters. > > The term makes more sense in Python perhaps, since a keyword argument > refers to an argument in a call being passed with the parameter name, and a > keyword argument can be passed to any parameter at all. Python doesn't > distinguish parameters whose corresponding arguments must be passed > positionally or by name. > > But Julia, I think, is a little more technical here: it uses the semicolon > in the function definition to separate *parameters*. Parameters are those > things in a function *declaration*; arguments are those things in a > function *call*. So if I define a Julia function (here I'll use the > definition from the Julia docs): > > function plot(x, y; style="solid", width=1, color="black") > ### > end > > > > then would it be acceptable to say that x and y are *positional > parameters* and style, width, and height, are *keyword parameters*? > > I did notice that the authors of the documentation are very careful to use > the phrase "keyword arguments" carefully, referring always to the arguments > in a call and never to the parameters themselves. But the documentation > avoids using the modifiers "positional" and "keyword" for parameters. > > Why is that? Is it wrong to say "style is a keyword parameter, because > only a keyword argument can be passed to it"? > > >
