 Let's carry on by looking at functions with a variable number of keywords up to now We've only allowed a certain number of keywords. We've limited what keywords can be passed Now we can get beyond that by using these three dots. They are called a splat or ellipses Now they might indicate the passing of no arguments a single argument or many many arguments So let's have a look at this. We have a function that we're going to define I'm calling it funk 3 if you see 3 and I'm just using this word args. I could use anything I want but dot dot dot so there's my splat and My functions going to do something useful. It's going to use the print command And it's going to say I can tell you how many arguments you passed and then the dollar sign remember That's a placeholder and whatever value Julia generates after this dollar sign That's what's going to be passed or whatever values held in there And I'm going to use this in both length function, which is going to count Counts through lists. So it's going to tell me how many arguments I passed arcs there and it's going to return that So let's create this function. You see a generic function with a single method now Let's call just call it funk 3 and we pass no arguments What so ever and as you can well imagine it says I can tell you how many are going to pass zero So let's pass this argument. So there's one two three one two three hundred thousand So funk three one hundred thousand, but that's just a single argument. So it's telling me I passed one argument Let's pass a single string and I say well There's still just a single one now. Let's pass two arguments. You can see they separated by a comma Julia 3 comma 3 let's run that and indeed we have two arguments and We see we don't even have to keep them of the same type So I'm passing Julia is one in a million and some two of them at least are just Number values and the rest are strings and certainly it just counts through of the through those with the length Inbuilt length function and we see there are seven arguments and I just created them. I just passed them And my function was originally created with these Splats with a splat. I should say So let's get a bit show something a bit more interesting. I'm creating a new function here and I pass at a single there is a single Argument and I'm going to call that argument string array and What is it going to do? It's going to create a new Variable inside of the function called string underscore items and it's going to join Use the in inbuilt Julia function join and join is going to take that string array and it's going to concatenate it Sort of with this comma and this space and space and it's going to return this print line I like and then whatever was passed into the string items Remember, which was a join on this string array argument that I passed to the function food Okay, let's see what happens And I'm going to pass two arguments, but see here. I'm passing them as an array or a vector Let's use the term array. So it's in these square brackets and I have two Two values there in my array. So I'm calling this food Function, let's see what happens and it says I like Nutella and honey So beautiful there We see that it has joined the two arguments that I passed Well, I actually passed the single argument which was a an array and it contained two values So what happens if I forget these square brackets of an array? So I'm gonna forget these square brackets and I'm just using a string I'm just passing it a string. What is the join function going to do on a single string? Well, you might have guessed that it's going to do this n comma u comma t. Okay, so that doesn't work So to get around that so that someone does not have to pass in Ray we use the ellipses. So I didn't use args here. I used the word strings s s s strings Just to sort of Joke about that this is a split and I can pass any number of things So if I were to now create this function and pass this single argument called Nutella It keeps it all together. So that join function is now going to see what I've passed as just a single As a single argument and the join function is is not going to split the word up But I can still do that and now I can still pass more than one now It is going to be seen as three separate things. So I like Nutella honey and more Nutella good Now just for clarity's sake we can we can really do something else I'm going to say AB and then use a splat and it's just return printing the values for AB and s to the screen Let's see what happens there. So let's have this function argues and now look what happens so three and four and Then I'm passing all of this other stuff five six seven eight and a string called Julia and see what happens The rest is actually passed as the stupor So a was three b was four and then s which was a splat could take any number of values But it treats it as this stupor with five six seven eight and Julia in there So if I just call three and four and I pass nothing for the s it's just going to return this empty tuple here So let's have some a lot of fun So I've got the semicolon in this function of mine and then a splat So this means that these are keywords can pass any number of keywords now Remember the keywords. I'll just have to give them a name now as I pass them So let's call this fun function and I'm going to say bar one is Julia bar to his language and well one equals three and Lo and behold look what gets returned this one column array and it's actually these a Collection of a key and its value. So the key was bar one and its value was Julia key bar two Was what to and and it's a value is was language and the key three was well one and its value was three so More so because I created them like this as a splat and I gave them my own names They actually what what are called symbols with this colon sign in front and this becomes very useful Especially with databases or these some data sets and we'll certainly have a look at these symbols in a future lecture Okay, so we've learned what splat is and how to create a long list of functions in the next section We're just going to have a quick look at flow control inside of a function and then we're going to pass some arrays as function arguments