Is there a reason why in Typst, named parameters == parameters with default values? This seems quite impractical.
Perhaps I would like to be able to have a positional parameter with a default value. For example, I can write:
#let example(arg) = [Example: #arg]
#example[
very long text
]
But I cannot write:
#let example(arg: "Default") = [Example: #arg]
#example[
very long text
]
Instead I have to write more verbosely:
#let example(arg: "Default") = [Example: #arg]
#example(arg: [
very long text
])
This can become quite ugly If I have several arguments.
The other way around, perhaps I would also like to be able to have a named argument without a default value - this would allow me to specify the name when passing my argument, making my code clearer, but also making the argument mandatory (no default value). For example, I can write:
#let example(setting) = [Using a specific #setting]
#example("value")
But not the slightly clearer:
#let example(setting) = [Using a specific #setting]
#example(setting: "value")
Essentially, I don’t understand why default values and named parameters are being bound together as a single thing, when I feel like their use and advantages are relevant separately. Feel free to point me to any prior discussion about this, I didn’t find any :)