home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!lunic!sunic!fuw.edu.pl!cocos!jt
- From: jt@fuw.edu.pl (Jerzy Tarasiuk)
- Newsgroups: comp.lang.rexx
- Subject: Re: Lower-case alphabetic set
- Message-ID: <JT.93Jan21151108@fizyk1.fuw.edu.pl>
- Date: 21 Jan 93 14:11:08 GMT
- References: <REXXLIST%93010320580660@OHSTVMA.ACS.OHIO-STATE.EDU>
- <C0CDCz.Co3@csfb1.fir.fbc.com> <C0E55F.IK5@csfb1.fir.fbc.com>
- <16B4E7C5F.MCMASTER@LSTC2VM.stortek.com>
- Sender: news@fuw.edu.pl
- Organization: Warsaw University Physics Dept.
- Lines: 35
- In-Reply-To: MCMASTER@LSTC2VM.stortek.com's message of Wed, 6 Jan 1993 15:50:37 GMT
- Nntp-Posting-Host: fizyk1
-
- >>>>> On Wed, 6 Jan 1993 15:50:37 GMT, MCMASTER@LSTC2VM.stortek.com (Jim McMaster) said:
- Jim> Nntp-Posting-Host: lstc2vm.stortek.com
- Jim> In article <C0E55F.IK5@csfb1.fir.fbc.com>
- Jim> jbrock@csfb1.fir.fbc.com (John Brock) writes:
- >In article <C0CDCz.Co3@csfb1.fir.fbc.com>, jbrock@csfb1.fir.fbc.com (John Brock) writes:
- >|> How about:
- >|> lowercase: procedure
- >|> return translate(arg(1), xrange(), translate(xrange()))
- >|>
- >|> I like this because it is consise and generic. It should work as it
- >|> stands for any language, and it lets me avoid typing out all the upper
- >|> and lower case letters by hand (which I think looks ugly, even though
- >|> it's clearly more efficient to do it that way).
-
- I am afraid it is character-set-dependent and implementation-dependent:
- note every uppercase alpha occurs in input table TWICE, since it isn't
- determinable from language doc which occurrence is taken as matching.
- Probably on some systems it will leave all unchanged.
- But use xrange('a','z') instead xrange() should help (assuming upper
- and lower case alpha are in separate areas, i.e. xrange('a','z')
- doesn't contain any uppercase alpha. Since, use:
- translate(arg(1), xrange('a','z'), translate(xrange('a','z')))
-
- >It even makes a certain kind of sense if translate is generalized
- >(e.g., mapping a ==> b, b ==> c, and c ==> a), an long as it never maps
- >two distinct characters to the same character.
-
- In the version with xrange('a','z') translate with specified tables
- must not change characters not found in input table and either map
- 'a' to 'A' with default tables and translate according given tables
- when they are given, or make shift (the a=>b, b=>c, c=>a) in both
- cases (I am not sure: should the shift be made before or after normal
- translation? I am afraid once after and once before for all to work).
-
- Jerzy Tarasiuk <jt@zfja-gate.fuw.edu.pl>
-