home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / rexx / 1506 < prev    next >
Encoding:
Text File  |  1993-01-22  |  2.1 KB  |  48 lines

  1. Newsgroups: comp.lang.rexx
  2. Path: sparky!uunet!csfb1!jbrock
  3. From: jbrock@csfb1.fir.fbc.com (John Brock)
  4. Subject: Re: Lower-case alphabetic set
  5. Message-ID: <C19pLn.Bou@csfb1.fir.fbc.com>
  6. Sender: news@csfb1.fir.fbc.com (Usenet News Account)
  7. Reply-To: uunet!csfb1!jbrock
  8. Organization: First Boston Corporation
  9. References: <REXXLIST%93010320580660@OHSTVMA.ACS.OHIO-STATE.EDU> <JT.93Jan21151108@fizyk1.fuw.edu.pl>
  10. Date: Fri, 22 Jan 1993 18:20:10 GMT
  11. Lines: 35
  12.  
  13. In article <JT.93Jan21151108@fizyk1.fuw.edu.pl>, jt@fuw.edu.pl (Jerzy Tarasiuk) writes:
  14. |> >>>>> On Wed, 6 Jan 1993 15:50:37 GMT, MCMASTER@LSTC2VM.stortek.com (Jim McMaster) said:
  15. |> Jim> Nntp-Posting-Host: lstc2vm.stortek.com
  16. |> Jim> In article <C0E55F.IK5@csfb1.fir.fbc.com>
  17. |> Jim> jbrock@csfb1.fir.fbc.com (John Brock) writes:
  18. |>  >In article <C0CDCz.Co3@csfb1.fir.fbc.com>, jbrock@csfb1.fir.fbc.com (John Brock) writes:
  19. |> >|> How about:
  20. |> >|>   lowercase: procedure
  21. |> >|>   return translate(arg(1), xrange(), translate(xrange()))
  22. |> >|>
  23. |> >|> I like this because it is consise and generic.  It should work as it
  24. |> >|> stands for any language, and it lets me avoid typing out all the upper
  25. |> >|> and lower case letters by hand (which I think looks ugly, even though
  26. |> >|> it's clearly more efficient to do it that way).
  27. |> 
  28. |> I am afraid it is character-set-dependent and implementation-dependent:
  29. |> note every uppercase alpha occurs in input table TWICE, since it isn't
  30. |>  [...deleted...]
  31.  
  32. You're right!  My procedure depends on the fact that in both ASCII and
  33. EBCDIC the lower case letters occur before the upper case letters.  In
  34. fact it would be possible to devise an 8 bit character set in which all
  35. of the letters were scattered about at random, and even xrange('a','z')
  36. would be meaningless.  To write a lowercase() function that is
  37. completely generic and which reverses the translate() function you
  38. would have to go through the entire character set, test which
  39. characters were affected by translate(), and use only those characters
  40. to build your translate tables.
  41.  
  42. Maybe REXX should just be given an untranslate() function.
  43.  
  44. -- 
  45. John Brock
  46. uunet!csfb1!jbrock
  47. jbrock@csfb1.fir.fbc.com
  48.