LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Lars Hellström <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 14 Apr 2014 15:30:29 +0200
Content-Type:
text/plain
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