# \#function-parameters

**URL:** https://discourse.julialang.org/tag/function-parameters/1114.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Good way to parametrize over type parameter?](https://discourse.julialang.org/t/good-way-to-parametrize-over-type-parameter/132533)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 4\
**Last updated:** [September 21, 2025, 12:27pm UTC](https://discourse.julialang.org/t/good-way-to-parametrize-over-type-parameter/132533 "2025-09-21T12:27:28Z")

</div>

Hi, I’m writing a numerical code that is parametrized by T, which is typically T=Float64 but could be one of the other number types. It’s a PDE solver so I’ve got a bunch of other types I call “geometries”, say A{T}, B{…

---

## [Yet another "how to pass multiple parameters to a function" post](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095)

<div class="topic-metadata">

**Author:** [@Boris](https://discourse.julialang.org/u/Boris)\
**Replies:** 7\
**Last updated:** [March 21, 2025, 5:33pm UTC](https://discourse.julialang.org/t/yet-another-how-to-pass-multiple-parameters-to-a-function-post/127095 "2025-03-21T17:33:05Z")

</div>

Apologies for the n-th post on this topic (#1, #2, #3, etc. etc).I simply don’t get it and feel overwhelmed by all choices of how to pass parameters to a function (positional arguments, optional keyword arguments, named …

---

## [Type Definition of Array Arguments to Functions](https://discourse.julialang.org/t/type-definition-of-array-arguments-to-functions/119372)

<div class="topic-metadata">

**Author:** [@freestatelabs](https://discourse.julialang.org/u/freestatelabs)\
**Replies:** 8\
**Last updated:** [September 13, 2024, 2:36pm UTC](https://discourse.julialang.org/t/type-definition-of-array-arguments-to-functions/119372 "2024-09-13T14:36:42Z")

</div>

Hi, for a project I’m working on, I defaulted to defining my functions with input arrays with data types as Float64, i.e. function foo(vec::Vector{Float64}) # do stuff end However, I realized later that this was a…

---

## [Choice of type parameters](https://discourse.julialang.org/t/choice-of-type-parameters/115147)

<div class="topic-metadata">

**Author:** [@freedomjin](https://discourse.julialang.org/u/freedomjin)\
**Replies:** 0\
**Last updated:** [June 4, 2024, 2:57am UTC](https://discourse.julialang.org/t/choice-of-type-parameters/115147 "2024-06-04T02:57:04Z")

</div>

Hi, I am a little confused about choice of type parameters either as data types or as literals, and would like to know their differences? More specifically, when defining a parametric type, which takes, say, some intege…

---

## [Passing \`Symbol\` variable allocates when literal does not?](https://discourse.julialang.org/t/passing-symbol-variable-allocates-when-literal-does-not/110518)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 4\
**Last updated:** [February 21, 2024, 4:04pm UTC](https://discourse.julialang.org/t/passing-symbol-variable-allocates-when-literal-does-not/110518 "2024-02-21T16:04:44Z")

</div>

I have the following snippet: function preparearrays!(arrays, N, L; mode = :all) for n in 0:(length(arrays)-1) if mode === :all for m in 0:(L-1) # run till length L to zero all bits …

---

## [Should the manual discuss type parameters of keyword arguments?](https://discourse.julialang.org/t/should-the-manual-discuss-type-parameters-of-keyword-arguments/105752)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [November 3, 2023, 12:34pm UTC](https://discourse.julialang.org/t/should-the-manual-discuss-type-parameters-of-keyword-arguments/105752 "2023-11-03T12:34:14Z")

</div>

Type parameters for keyword arguments are currently a convenience form, equivalent to saving the result of a typeof, perform a subtype check when that is specified. Eg foo(; a::C) where {C \<: Integer} = :C is more o…

---

## [Slurping in not final position](https://discourse.julialang.org/t/slurping-in-not-final-position/102784)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 11\
**Last updated:** [August 15, 2023, 12:45pm UTC](https://discourse.julialang.org/t/slurping-in-not-final-position/102784 "2023-08-15T12:45:10Z")

</div>

I was running the roames notebook exercises, in an attempt to fix this: Create a more generic reduce2 function that works recursively over a tuple For the operations + and \*, being associative, simulate the operatio…

---

## [MethodError: no matching method for Int64 despite specifying Real](https://discourse.julialang.org/t/methoderror-no-matching-method-for-int64-despite-specifying-real/98809)

<div class="topic-metadata">

**Author:** [@JoO0oss](https://discourse.julialang.org/u/JoO0oss)\
**Replies:** 4\
**Last updated:** [May 13, 2023, 8:56pm UTC](https://discourse.julialang.org/t/methoderror-no-matching-method-for-int64-despite-specifying-real/98809 "2023-05-13T20:56:03Z")

</div>

I’ve looked at this question on the Julia discourse and checked parametric types in the docs (which are fantastic docs, I’d like to add) and I’m not sure what to do next. I have a function which wants tuples of numbers,…

---

## [Saving arguments or wrap function?](https://discourse.julialang.org/t/saving-arguments-or-wrap-function/98688)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 4\
**Last updated:** [May 11, 2023, 5:42pm UTC](https://discourse.julialang.org/t/saving-arguments-or-wrap-function/98688 "2023-05-11T17:42:41Z")

</div>

Currently I have a structure where I save functions into something of the sort struct fooS x::Float64 A::Dict{Symbol, Function} fooS(x) = new(consfoo(x)...) end function consfoo(x) return x, Dict{Sym…

---

## [How can I see what parameters are making my code erroring when broadcasting a function call?](https://discourse.julialang.org/t/how-can-i-see-what-parameters-are-making-my-code-erroring-when-broadcasting-a-function-call/96130)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 3\
**Last updated:** [March 15, 2023, 8:59pm UTC](https://discourse.julialang.org/t/how-can-i-see-what-parameters-are-making-my-code-erroring-when-broadcasting-a-function-call/96130 "2023-03-15T20:59:04Z")

</div>

Hi all! I have a function that raises a MethodError when broadcasted to a large vector of Strings. The error simply says julia\> df\_model\_measure\_master\[!, dest\_source\_eq\_sym\] = has\_dest\_source\_eq.(df\_model\_measure\_mast…

---

## [Good coding practices: How to cluster many variables in function argument](https://discourse.julialang.org/t/good-coding-practices-how-to-cluster-many-variables-in-function-argument/92855)

<div class="topic-metadata">

**Author:** [@physh](https://discourse.julialang.org/u/physh)\
**Replies:** 7\
**Last updated:** [January 13, 2023, 2:46am UTC](https://discourse.julialang.org/t/good-coding-practices-how-to-cluster-many-variables-in-function-argument/92855 "2023-01-13T02:46:01Z")

</div>

Hello there, I’m still fairly new to julia, but I guess it is anyway a general programming question. In my code there are several physical parameters, e.g. mass,speed,height,… as well as numerical parameters for differ…

---

## [Specify the type of function when it is a parameter of another function](https://discourse.julialang.org/t/specify-the-type-of-function-when-it-is-a-parameter-of-another-function/85724)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 4\
**Last updated:** [August 14, 2022, 6:56pm UTC](https://discourse.julialang.org/t/specify-the-type-of-function-when-it-is-a-parameter-of-another-function/85724 "2022-08-14T18:56:12Z")

</div>

Perhaps the question doesn’t matter much in practice or even makes little sense in theory. In which case, please explain the reasons in a simple way. Playing with the splitarray function, I wondered if and how it was po…
