home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.rexx
- Path: sparky!uunet!csfb1!jbrock
- From: jbrock@csfb1.fir.fbc.com (John Brock)
- Subject: Re: Lower-case alphabetic set
- Message-ID: <C19pLn.Bou@csfb1.fir.fbc.com>
- Sender: news@csfb1.fir.fbc.com (Usenet News Account)
- Reply-To: uunet!csfb1!jbrock
- Organization: First Boston Corporation
- References: <REXXLIST%93010320580660@OHSTVMA.ACS.OHIO-STATE.EDU> <JT.93Jan21151108@fizyk1.fuw.edu.pl>
- Date: Fri, 22 Jan 1993 18:20:10 GMT
- Lines: 35
-
- In article <JT.93Jan21151108@fizyk1.fuw.edu.pl>, jt@fuw.edu.pl (Jerzy Tarasiuk) writes:
- |> >>>>> 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
- |> [...deleted...]
-
- You're right! My procedure depends on the fact that in both ASCII and
- EBCDIC the lower case letters occur before the upper case letters. In
- fact it would be possible to devise an 8 bit character set in which all
- of the letters were scattered about at random, and even xrange('a','z')
- would be meaningless. To write a lowercase() function that is
- completely generic and which reverses the translate() function you
- would have to go through the entire character set, test which
- characters were affected by translate(), and use only those characters
- to build your translate tables.
-
- Maybe REXX should just be given an untranslate() function.
-
- --
- John Brock
- uunet!csfb1!jbrock
- jbrock@csfb1.fir.fbc.com
-