# 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:** 2

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [March 18, 2025, 3:45pm UTC](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095/2 "2025-03-18T15:45:56Z")

</div>

> [@Boris](#):
>
> ```julia
> @with_kw struct hypChan2020
> c1::Float64 = 0.04; # hyperparameter on own lags
> c2::Float64 = 0.01; # hyperparameter on other lags
> c3::Float64 = 100; # hyperparameter on the constant
> end
> 
> ```

This should be inside your module, and the name of the struct should be public, probably exported. The user must create **one instance** of that struct, and pass it to the function.

In the example you are passing _the type_.

The function can or cannot set a default value for the parameters, with `options::hypChan2020=hypChan2020()` as a keyword or optional positional argument.

(This alternative is what I described here: [How to allow users to safely change package "constants"? - #6 by lmiq](https://discourse.julialang.org/t/how-to-allow-users-to-safely-change-package-constants/115173/6))

---

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