Will Robertson writes:
> On 12/03/2009, at 11:47 PM, Joseph Wright wrote:
> > A "philosophical" question. To make various bits of code clearer, I'm
> > in the habit of splitting self-contained parts off. Sometimes, this
> > results in functions which take no arguments. Under the LaTeX3
> > scheme,
> > is it "acceptable" to have functions of no arguments rather than tlps
> > containing the data?
> To be hasty (and not particularly experienced :) ) I would say yes,
> this is a more than acceptable idea. I see no problem (quite the
> contrary) with functions that say "initialise the local variables
> we're going to use" or "detect the mode that we're currently in",
> which do not require any information (besides the current state of
> things) passed to them.
> I think of tlp's more as data containers, which could even contain
> functions to call in certain circumstances, but which wouldn't be used
> in general to store entire "subroutines" for repeated execution.
precisely. functions without arguments are not only acceptable but in my book
should be used whenever the focus is on execution rather than on storage
and/or manipulation. It is true that you can execute a tlp (after all we are
in a macro language) but the focus for tlp is the storage bin. for precisely
this reason we have \c_empty_tlp but also \prg_do_nothing: etc.
So yes, please use functions (ie ending in ":") whenever you a splitting
things apart in executable bits