Hello,
For a project i declared a custom function like this :
#let formatable_song(
title,
body_list,
body_list_format,
header : (
tune : none,
author : none,
lyrics : none,
pseudo : none,
comments : none),
) = {...}
I want to be able to “instantiate” formatable_song with header dictionary that have not all the keys like this instead of manually setting blank value to none
:
#let Gaudeamus = formatable_song(
"Gaudeamus",
(couplet1, couplet2, couplet3, couplet4, couplet5, couplet6, couplet7),
("c","c","c","c","c","c","c"),
header : (
comments : "Les couplets marqué en gras sont ceux faits en cantus"
)
)
// instead of this :
#let Gaudeamus = formatable_song(
"Gaudeamus",
(couplet1, couplet2, couplet3, couplet4, couplet5, couplet6, couplet7),
("c","c","c","c","c","c","c"),
header : (
tune : none,
author : none,
lyrics : none,
pseudo : none,
comments : "Les couplets marqué en gras sont ceux faits en cantus"
)
)
Before using dict i was using default value parameter but i find this solution “less” elegant.
Is there a proper way to do this ?
Thank you in advance for your responses