# Yet another "how to pass multiple parameters to a function" post

**URL:** https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095
**Category:** New to Julia
**Tags:** question, parametersjl, function-parameters
**Created:** [March 18, 2025, 1:46pm UTC](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095 "2025-03-18T13:46:45Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Boris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/boris/32/3306_2.png) [@Boris](https://discourse.julialang.org/u/Boris)
#### Post date: [March 19, 2025, 7:13am UTC](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095/5 "2025-03-19T07:13:56Z")

</div>

Interesting, so this is an alternative to the @unpack macro? For the macro I do need to load the package, right? At least I get an error.

Could you tell me why there is semicolon in the last line? I don’t understand the syntax.

`s = MyStruct(1,"test")` creates a tuple, correct?  
where can I read about the `;` in `(; x, y) = s`?  
Thanks!

@lmiq Okay, I think I am almost there.

So I added the struct definition `hypChan2020` in the module and exported it. This allows me to neatly call the function without any arguments. Here is my syntax

```julia
function Chan2020_LBA(YY;hyp=hypChan2020,p::Integer=4,nburn::Integer=1000,nsave::Integer=2000)
end

```

then the user can just do

```julia
using BayesianVAR
Y_20 = readdlm("data/FRED_Chan2019.txt", ',');
Chan2020_LBA(Y_4)
Chan2020_LBA(Y_4,p=1,nburn = 100, nsave = 5000)

```

these all work and I also see hypChan2020() in the global scope.

However, I am struggling with the syntax [from your referenced pos](https://discourse.julialang.org/t/how-to-allow-users-to-safely-change-package-constants/115173/6)t.

For example, this doesn’t work

```julia
using BayesianVAR
Y_20 = readdlm("data/FRED_Chan2019.txt", ',');
hyper=hypChan2020()
Chan2020_LBA(Y_4,hyp=hyper())

```

and throws  
`ERROR: MethodError: objects of type hypChan2020 are not callable The object of type hypChan2020 exists, but no method is defined for this combination of argument types when trying to treat it as a callable object.`  
Also hyp is an immutable struct so I cannot change anything, but that is an easy fix.

---

_[View the full topic](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095)._
