home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / std_unix / volume.26 / text0008.txt < prev    next >
Encoding:
Text File  |  1992-02-21  |  2.6 KB  |  55 lines

  1. Submitted-by: rml@hpfcdc.fc.hp.com (Bob Lenk)
  2.  
  3. In article <1991Nov21.235529.9196@uunet.uu.net> gwyn@smoke.brl.mil (Doug Gwyn) writes:
  4.  
  5. >    cc -Dmacrostufff -Iheaderdir -c -O foo.c bar.o mylib.a -lX
  6. >
  7. > The requirement that this invocation (when -I etc. aren't being used)
  8. > obtain a C implementation that conforms to the C standard could be left
  9. > as a separate specification, not necessarily required for 1003.2 proper.
  10.  
  11. Then what use would the 1003.2 spec be?  An application (script/makefile)
  12. using it couldn't depend on it compiling standard C, or K&R C, or 6th
  13. edition C, or perhaps even Cobol.  The separate specification that binds
  14. 1003.2 to the C Standard would be required to write portable applications,
  15. and it would have to specify that existing practice be violated.
  16.  
  17. > >More than that, regexp's as usually implemented were hopelessly
  18. > >ethnocentric; changing languages was impossible.
  19. >
  20. > No, to the contrary the existing regexp implementation was acultural;
  21. > you're referring to the idea that "[a-z]" for example ought to mean
  22. > "match any lowercase character in the current locale", but that is
  23. > NOT what it meant.  It actually meant "match any byte having value
  24. > between the values I gave you around the dash-representation" (this
  25. > already was important to understand on machines that preferred
  26. > EBCDIC codesets, for example).
  27.  
  28. Now lets look at reality.  How are subranges in regular expressions
  29. really used?  How many scripts have you written that really want to find
  30. all characters with encodings between those of 'a' and 'z'?  How many
  31. scripts have you written that take advantage of the coincidence that
  32. "[a-z]" happens to match "any lowercase character" on an ASCII machine
  33. in an English-speaking country?  Now expand "you" in the previous two
  34. sentences to all users of regular expressions.  How many scripts using
  35. the existing definition work as intended except on an ASCII machine on
  36. English language data?  Do you think regular expressions would have been
  37. developed with this definition on EBCDIC machines or in Denmark or
  38. Japan?  Do you think anyone would have used them if they had been?
  39.  
  40. IMHO subranges in regular expressions are only interesting, worth
  41. standardizing, or even worth implementing because of the coincidence
  42. that they can be used for concepts like "any lowercase character".  The
  43. people who are happy with the traditional definition are happy because
  44. that coincidence applies with their language and codeset.  Basing an
  45. international standard on this would be not only ethnocentric, but (as
  46. Doug helps to point out) codeset-centric as well.
  47.  
  48.         Bob Lenk
  49.         rml@fc.hp.com
  50.         {uunet,hplabs}!fc.hp.com!rml
  51.  
  52.  
  53. Volume-Number: Volume 26, Number 9
  54.  
  55.