On 24.10.2012 04:15, Tollef Fog Heen wrote:
The subject says it: can functions provided by a loaded module have
optional arguments?
No, they can't.  You could have it take a magic value like -1 or similar
to signify "unset", though.
Thanks for the reply, Tollef. My goal was to make the vcl_recv be smaller and easier to read, so, instead of using a magic value, I renamed the actual function (which takes full set of arguments) into foo_ex() and created a separate foo() -- which passes all the mandatory arguments plus the default values for optional ones to foo_ex().

Still, I'd say, module-creation framework should some day support optional arguments (supplying default values)...

   -mi

_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to