<div dir="ltr"><div dir="ltr">On Sat, Sep 5, 2020 at 6:38 PM Nicola Tuveri <<a href="mailto:nic.tuv@gmail.com">nic.tuv@gmail.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div dir="auto">In most (if not all) cases in our functions, both libctx and propquery are optional arguments, as we have global defaults for them based on the loaded config file.<br></div><div dir="auto">As such, explicitly passing non-NULL libctx and propquery, is likely to be an exceptional occurrence rather than the norm.</div></div></blockquote><div><br></div><div>And that is where we have a conceptual difference, the libctx is <b>always</b> used. If it is provided as a NULL parameter then it is a shortcut to make the call to get the default or to get the already set one.</div><div>Conceptually it is always required for the function to operate.</div><div><br></div><div>And the conceptual issue is actually important here - all of these functions require the libctx to do their work - if it is not available then they are unable to do their work.</div><div>We just happen to have a default-if-NULL.</div><div><br></div><div>If C offered the ability to default a parameter if not provided (and many languages offer that) I would expect we would be using it. </div><div>But it doesn't - we are coding in C.</div><div><br></div><div>So it is really where-is-what-this-function-needs-coming-from that actually is the important thing - the source of the information the function needs to make its choice.</div><div>It isn't which algorithm is being selected - the critical thing is from which pool of algorithm implementations are we operating. The pool must be specified (this is C code), but we have a default value.</div><div><br></div><div>And that is why I think the conceptual approach here is getting confused by the arguments appearing to be optional - conceptually they are not - we just have a defaulting mechanism and that isn't the same conceptually as the arguments actually being optional.</div><div><br></div><div>Clearer?</div><div><br></div><div>Tim.</div><div><br></div><div><br></div><div> </div></div></div>