home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / rexx / 1495 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  2.5 KB

  1. 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
  2. From: jt@fuw.edu.pl (Jerzy Tarasiuk)
  3. Newsgroups: comp.lang.rexx
  4. Subject: Re: Lower-case alphabetic set
  5. Message-ID: <JT.93Jan21151108@fizyk1.fuw.edu.pl>
  6. Date: 21 Jan 93 14:11:08 GMT
  7. References: <REXXLIST%93010320580660@OHSTVMA.ACS.OHIO-STATE.EDU>
  8.     <C0CDCz.Co3@csfb1.fir.fbc.com> <C0E55F.IK5@csfb1.fir.fbc.com>
  9.     <16B4E7C5F.MCMASTER@LSTC2VM.stortek.com>
  10. Sender: news@fuw.edu.pl
  11. Organization: Warsaw University Physics Dept.
  12. Lines: 35
  13. In-Reply-To: MCMASTER@LSTC2VM.stortek.com's message of Wed, 6 Jan 1993 15:50:37 GMT
  14. Nntp-Posting-Host: fizyk1
  15.  
  16. >>>>> On Wed, 6 Jan 1993 15:50:37 GMT, MCMASTER@LSTC2VM.stortek.com (Jim McMaster) said:
  17. Jim> Nntp-Posting-Host: lstc2vm.stortek.com
  18. Jim> In article <C0E55F.IK5@csfb1.fir.fbc.com>
  19. Jim> jbrock@csfb1.fir.fbc.com (John Brock) writes:
  20.  >In article <C0CDCz.Co3@csfb1.fir.fbc.com>, jbrock@csfb1.fir.fbc.com (John Brock) writes:
  21. >|> How about:
  22. >|>   lowercase: procedure
  23. >|>   return translate(arg(1), xrange(), translate(xrange()))
  24. >|>
  25. >|> I like this because it is consise and generic.  It should work as it
  26. >|> stands for any language, and it lets me avoid typing out all the upper
  27. >|> and lower case letters by hand (which I think looks ugly, even though
  28. >|> it's clearly more efficient to do it that way).
  29.  
  30. I am afraid it is character-set-dependent and implementation-dependent:
  31. note every uppercase alpha occurs in input table TWICE, since it isn't
  32. determinable from language doc which occurrence is taken as matching.
  33. Probably on some systems it will leave all unchanged.
  34. But use xrange('a','z') instead xrange() should help (assuming upper
  35. and lower case alpha are in separate areas, i.e. xrange('a','z')
  36. doesn't contain any uppercase alpha. Since, use:
  37. translate(arg(1), xrange('a','z'), translate(xrange('a','z')))
  38.  
  39. >It even makes a certain kind of sense if translate is generalized
  40. >(e.g., mapping a ==> b, b ==> c, and c ==> a), an long as it never maps
  41. >two distinct characters to the same character.
  42.  
  43. In the version with xrange('a','z') translate with specified tables
  44. must not change characters not found in input table and either map
  45. 'a' to 'A' with default tables and translate according given tables
  46. when they are given, or make shift (the a=>b, b=>c, c=>a) in both
  47. cases (I am not sure: should the shift be made before or after normal
  48. translation? I am afraid once after and once before for all to work).
  49.  
  50. Jerzy Tarasiuk <jt@zfja-gate.fuw.edu.pl>
  51.