From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79400 Path: news.gmane.org!not-for-mail From: Sietse Brouwer Newsgroups: gmane.comp.tex.context Subject: Re: ConTeXt: Page numbering in words for spanish Date: Wed, 21 Nov 2012 13:28:40 +0100 Message-ID: References: <1410329.t7YnaHOuHa@localhost> <50ACAC69.9060603@wxs.nl> <50ACC099.3000206@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1353500965 3986 80.91.229.3 (21 Nov 2012 12:29:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2012 12:29:25 +0000 (UTC) Cc: mailing list for ConTeXt users To: Hans Hagen Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 21 13:29:36 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Tb9Qt-0001Me-9h for gctc-ntg-context-518@m.gmane.org; Wed, 21 Nov 2012 13:29:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AA491103B0; Wed, 21 Nov 2012 13:29:24 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IYe8RKUvO3qN; Wed, 21 Nov 2012 13:29:19 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 429DC10356; Wed, 21 Nov 2012 13:29:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id EBA0010356 for ; Wed, 21 Nov 2012 13:29:17 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id TpsotQa-bxxE for ; Wed, 21 Nov 2012 13:29:17 +0100 (CET) Original-Received: from filter3-utr.mf.surf.net (filter3-utr.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 3C03510352 for ; Wed, 21 Nov 2012 13:29:17 +0100 (CET) Original-Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by filter3-utr.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qALCTBg3031263 for ; Wed, 21 Nov 2012 13:29:16 +0100 Original-Received: by mail-ie0-f169.google.com with SMTP id 10so12597315ied.14 for ; Wed, 21 Nov 2012 04:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=B+DsBc1d+xV+jlcqs0NiPZsjDKZCi9/BepJXnQLJnno=; b=uFKljYWBeQM9GfFbbQ0eJydqHu54eo47mI3yZVHEGBVk8FZE2ZB/GZLW52bSaBtxE7 Bs9eqng3zx6YhkMSRKd4/hbMdxGOJ2btWL1u9HbJhk8jY0EK/B7GYyMKCTMQhvtTImDs NY6J3ovoOu2gi8EWcUE4rw+wfwXR+XD8R1+nQjPX8U/kUbLwdvx2QKcSrAhdQGXNVUT7 Kdrhr6zNPPPKtYx+PndxAewLO4ai7Tjeb//vvayW6Dc1Ibq6VsasKrW+qjRJiIklsBik E7mnq/Qg7cfMWNoUtRyT/aWboc9YcS+51zH0t/o8uvpNUkb8oTakZtQMID8ByFro0N1+ pNpQ== Original-Received: by 10.42.72.130 with SMTP id o2mr17119849icj.7.1353500950399; Wed, 21 Nov 2012 04:29:10 -0800 (PST) Original-Received: by 10.64.5.138 with HTTP; Wed, 21 Nov 2012 04:28:40 -0800 (PST) In-Reply-To: <50ACC099.3000206@wxs.nl> X-Bayes-Prob: 0.0029 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.223.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08IqctbTN - 2576bdad22e0 - 20121121 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79400 Archived-At: > 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 ___________________________________________________________________________________