Subject: | |
From: | |
Reply To: | |
Date: | Thu, 6 Jan 2011 17:50:11 +0000 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
On 06/01/2011 17:37, Paul Thompson wrote:
> The optional argument thing could be better handled by using named arguments.
> So, for \parbox, which has optional and mandatory arguments, we currently have
>
>
> \parbox[pos][height][inner-pos]{width}{text}
>
> This is mindlessly confusing in many cases. Why not have
>
> \parbox{pos=t,height=something,innerpos=t,width=something}{text}
>
>
> The use of named arguments is vastly superior to positional arguments,
> especially when optional arguments can be specified.
Not directly relevant to the discussion about how one defines optional
arguments, but very true in any case. I hope you'll allow one optional
argument as 'reasonable', as this often makes sense:
\foo[<optional-keyval-list>]{<mandatory-argument>}
At this stage, user-level syntax for LaTeX3 is undecided but I suspect
that there is likely to be a greater use of key--value stuff where
appropriate.
> Don't even get me started on \newcommand.
\NewDocumentCommand has only mandatory arguments :-)
--
Joseph Wright
|
|
|