ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: One-off theorem titles
Date: Thu, 3 Mar 2011 18:55:45 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.01.1103031843040.4196@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <8473E733-9BB1-48E7-821D-1260EBEC79E7@gmail.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 2034 bytes --]

On Thu, 3 Mar 2011, Wolfgang Schuster wrote:

>
>> I am a bit surprised by the naming of the internal macros:
>>
>> annotation_cmd
>> annotation__cmd
>> annotation___cmd
>
> I liked the LaTeX3 system to have names in the form \<module>_<command>,
> with this you have a easy way to protect internal commands and to avoid
> command clashes,

I also like \<module>_<command>. That is better than \<module><command> 
that I have been using. Of course, this means that _ should not have its 
usual meaning. I haven't checked on how \unprotect works in MkII. If it 
makes _ a letter, then I'll switch to \<module>_<command>.

Another option might be to use \<module>.<command> with . having the right 
catcode. That will give macro names a more OOP feel.

> e.g. you define the command \getfirstcharacter in your
> filter module but this name is already used in the core (syst-aux.mkiv)
> and with the name \filter_getfirstcharacter you can avoid this without
> thinking too much about a good name.

I didn't know that. I'll change that name.

So far, I have been using \externafillter<command> for 
most commands, and sometimes it gets unreadable.

>> I know that \do \dodo \dododo is not the best notation, but I don't find _ __ ___ better.
>
> I don’t like the __ and ___ either but do you know a better way for good
> names without using do, dodo, nodo, yes or nop?

I find that \module__command and \module___command are hard to 
distinguish. For helper macros, a better idea might be:

\module_command
\module_command!
\module_command!!

These commands are easy to distinguish visually. But this will not work 
for too well for three or four levels. I think that none of the schemes 
look good for three or four levels. Perhaps we could mix both existing 
schemes to get something reasonable:

\module_command
\module_command!
\module_command!do
\module_command!redo

or maybe

\module_command
\module_command_one
\module_command_two
\module_command_three

etc.

Aditya

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2011-03-03 23:55 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1142.1298911160.4223.ntg-context@ntg.nl>
2011-03-03  8:05 ` S Barmeier
2011-03-03  8:43   ` Otared Kavian
2011-03-03 14:18   ` Wolfgang Schuster
2011-03-03 18:18     ` Aditya Mahajan
2011-03-03 18:31       ` Wolfgang Schuster
2011-03-03 23:55         ` Aditya Mahajan [this message]
2011-03-04 10:33           ` Hans Hagen
2011-03-04 10:36             ` luigi scarso
2011-03-05 22:15               ` Aditya Mahajan
2011-03-04 18:05             ` Wolfgang Schuster
2011-03-04 18:56               ` Hans Hagen
2011-03-05 23:03                 ` Aditya Mahajan
2011-03-06  5:39                   ` Underscore catcode in MkII (was Re: One-off theorem titles) Aditya Mahajan
2011-03-06 11:07                     ` Hans Hagen
2011-03-06 16:59                       ` Aditya Mahajan
2011-03-06  8:44                   ` One-off theorem titles Wolfgang Schuster
2011-03-06  8:17                 ` Wolfgang Schuster
2011-03-04 10:36           ` Hans Hagen
2011-03-03 18:07   ` Aditya Mahajan
     [not found] <mailman.1223.1299163042.4223.ntg-context@ntg.nl>
2011-03-03 15:00 ` S Barmeier
2011-03-03 15:24   ` Wolfgang Schuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.01.1103031843040.4196@ybpnyubfg.ybpnyqbznva \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).