From: Sietse Brouwer <sbbrouwer@gmail.com>
To: Hans Hagen <pragma@wxs.nl>
Cc: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: ConTeXt: Page numbering in words for spanish
Date: Wed, 21 Nov 2012 13:28:40 +0100 [thread overview]
Message-ID: <CAF=dkzwqyMpmg8ys=nLWxJ2xVDnC4UZ-FyrcXVxO28=6p0LVfg@mail.gmail.com> (raw)
In-Reply-To: <50ACC099.3000206@wxs.nl>
> they are local tables ... so invisible to users
Fair point. I was concerned more with changeabiltity: this way someone
who writes a new function has an obvious name (numberwords.french) for
her new wordlist, and an obvious single point of alteration for her
copy of verbose.english, namely to change `local words =
numberwords.english` to `...numberwords.french`. (Algorithm tweaks
will still come after that, of course.) The code needs very little
changing. This is a minor point only, of course.
--Sietse
+ local numberwords = { }
- words = {
+ numberwords.english = {
[1] = "one",
...
}
-spanishwords = {
+ numberwords.spanish = {
[1] = "uno",
...
}
function verbose.english(n)
+ local words = allwords.english
... `words` already used throughout ...
end
function verbose.spanish(n)
+ local words = allwords.spanish
-- to use a different table, no need to
-- replace `spanishwords` throughout
-- the function; just change the line above.
... no more `spanishwords`, just `words` ...
end
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2012-11-21 12:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-21 9:08 Acidrums4
2012-11-21 10:26 ` Hans Hagen
2012-11-21 11:25 ` Sietse Brouwer
2012-11-21 11:52 ` Hans Hagen
2012-11-21 12:28 ` Sietse Brouwer [this message]
2012-11-21 21:05 ` Acidrums4
2012-11-21 23:47 ` Sietse Brouwer
2012-11-22 0:03 ` Acidrums4
2012-11-22 10:55 ` Mojca Miklavec
2012-11-22 12:11 ` Sietse Brouwer
2012-11-23 20:50 ` Marcin Borkowski
2012-11-23 22:46 ` Hans Hagen
2012-11-23 23:09 ` Alan BRASLAU
2012-11-22 10:04 ` Hans Hagen
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='CAF=dkzwqyMpmg8ys=nLWxJ2xVDnC4UZ-FyrcXVxO28=6p0LVfg@mail.gmail.com' \
--to=sbbrouwer@gmail.com \
--cc=ntg-context@ntg.nl \
--cc=pragma@wxs.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).