On 01/09/2011 11:57, Ulrike Fischer wrote:
> Is there an expl3 equivalent for a \providecommand?
> 
> I could do 
> 
> \cs_if_free:NT \mycommand {\cs_set:Npn \mycommand {...}}
> 
> but I don't find it very elegant to have to type \mycommand twice. 

At the code level, the answer is 'no'. Within a module, we'd expect all
functions to be well-defined: if they 'might' be needed, they should
exist. (See for example the fact that a lot of internal aux functions
are created simply to mark the name as taken.)

At the document level, there is \ProvideDocumentCommand, but even there
I'd hope that this will not be used very often. Well-designed interfaces
should provide a precise set of functions.

Now, there is the reality that LaTeX2e stuff is often not so
well-designed and does sometime rely on 'might exist' functions. There,
I'm afraid the construct you've pointed to is the way to go.
-- 
Joseph Wright