Re: Function naming: Problems and proposed solution

I see more and more functions taking an options map as the final argument...

_________________
Tomos Hillman
eXpertML Ltd
+44 7793 242058
On 29 Nov 2020, 08:35 +0000, Dave Pawson <dave.pawson@gmail.com>, wrote:
> On Sun, 29 Nov 2020 at 00:05, Dimitre Novatchev <dnovatchev@gmail.com> wrote:
>
> > This could work, but we can soon end up with:
> >
> > my:myFn(arg1,,,,,,,,,,arg10)
> >
> > or even worse:
> >
> > my:myFn(arg1,,,,, arg5 ,,,,,arg10)
>
> Python gets round this by only allowing defaulted arguments as the
> last n arguments, giving
> my:myFn(arg1,arg2 ,arg3)
>
> Or specifically naming params
>
> my:myFn(arg1,,,,, p5=arg5 ,,,,,p10=arg10)
>
> regards
>
>
> --
> Dave Pawson
> XSLT XSL-FO FAQ.
> Docbook FAQ.
>

Received on Wednesday, 2 December 2020 09:58:43 UTC