Woud there be an elegant way to use a held option ?
For example if I need to pass by reference several variables but I don't always need all of them, it can be useful. For example if I want to append an element to a List/Association/Dataset.
I've managed to make something work but it's not very usable.
l = {};
ClearAll@ffff;
Options[ffff] = {"a" -> Hold[l]};
ffff[x_, OptionsPattern[]] := Function[Null, AppendTo[#, x], HoldFirst] @@ OptionValue["a"];
ffff[2]
l