LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Date: Mon, 14 Apr 2014 15:30:29 +0200
Reply-To: Mailing list for the LaTeX3 project <[log in to unmask]>
MIME-Version: 1.0
Message-ID: <[log in to unmask]>
Content-Transfer-Encoding: 8bit
Sender: Mailing list for the LaTeX3 project <[log in to unmask]>
From: Lars Hellström <[log in to unmask]>
Parts/Attachments: text/plain (26 lines)
I just noticed another point where the expl3 naming rules doesn't say what 
to do: what if I have a variable that is also a function? In traditional 
imperative languages those may seem like exclusive categories, but in 
(La)TeX programming it is sometimes perfectly natural, and quite 
straightforward.

The typical example of this would be a callback function: something that a 
module calls at specified points, but which the user of that module is 
expected to define. Treating this as just a function loses the specification 
of the scope for that variable. Treating it as a variable of type tl loses 
the specification that it takes arguments. What I found natural is to use a 
name of the form

   \<SCOPE>_<MODULE>_<DESCRIPTION>:<ARG-SPEC>

e.g.

   \l_harmless_callback:nn

This could be interpreted both as adding a SCOPE part to function names (the 
vast majority of functions without a SCOPE are implicity considered to be c_ 
constant), or alternatively as proclaiming any :<ARG-SPEC> to be a valid 
_<TYPE> for a variable.

Lars Hellström

ATOM RSS1 RSS2