ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Characters allowed in macro names
@ 2018-04-22 15:23 N. Raghavendra
  2018-04-22 16:04 ` Hans Hagen
  2018-04-22 18:08 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: N. Raghavendra @ 2018-04-22 15:23 UTC (permalink / raw)
  To: ntg-context

I was wondering if it is alright to use underscores in the names of
macros, e.g, as in the following file.  It looks like \startsetups, and
\def accept names with hyphens, underscores, and numerals, but
\starttexdefinition doesn't tolerate any of them.

1. In general, what characters are allowed in macro names?  Are Unicode
   characters admissible?

2. Apart from the fact that one can use whitespace freely in
   \starttexdefinition, is there any reason to prefer it over \def?

Thanks,
Raghu.

------------------------------------------------------------
\starttext

\startsetups [hello-world_1]
  Hello, world 1!
\stopsetups

\setups [hello-world_1]

\def\hello-world_2{Hello, world 2!}

\hello-world_2

\starttexdefinition helloWorld
  Hello, world!
\stoptexdefinition

\helloWorld

%% Doesn't work
%% \starttexdefinition fooBar1
%%   Foo, bar 1!
%% \stoptexdefinition
%%
%% \fooBar1

%% Doesn't work
%% \starttexdefinition foo_bar
%%   Foo, bar!
%% \stoptexdefinition
%%
%% \foo_bar

%% Doesn't work
%% \starttexdefinition foo-bar
%%   Foo, bar!
%% \stoptexdefinition
%%
%% \foo-bar

\stoptext
------------------------------------------------------------
--
N. Raghavendra <raghu@hri.res.in>, http://www.retrotexts.net/
Harish-Chandra Research Institute, http://www.hri.res.in/
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-04-22 18:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-22 15:23 Characters allowed in macro names N. Raghavendra
2018-04-22 16:04 ` Hans Hagen
2018-04-22 18:19   ` N. Raghavendra
2018-04-22 18:08 ` Wolfgang Schuster
2018-04-22 18:22   ` N. Raghavendra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).