home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / question / 10280 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  1.5 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!europa.asd.contel.com!emory!gwinnett!gwinnett!wafbox!bill
  2. From: bill@wafbox.UUCP (Bill Fulton)
  3. Newsgroups: comp.unix.questions
  4. Subject: Re: Associative arrays in [gn]awk --whynot! (long but interesting)
  5. Message-ID: <269@wafbox.UUCP>
  6. Date: 16 Aug 92 05:29:35 GMT
  7. References: <1992Aug13.063348.11691@news.acns.nwu.edu> <1992Aug14.173952.12112@mccc.edu> <1992Aug15.021954.27159@news.acns.nwu.edu>
  8. Reply-To: bill@wafbox.UUCP (Bill Fulton)
  9. Organization: Home
  10. Lines: 23
  11.  
  12. In article <1992Aug15.021954.27159@news.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
  13. >In article <1992Aug14.173952.12112@mccc.edu> pjh@mccc.edu (Pete Holsberg) writes
  14. >>In article <1992Aug13.063348.11691@news.acns.nwu.edu> navarra@casbah.acns.nwu.edu (John Navarra) writes:
  15. >>=======================
  16. >>=Basically, associative arrays in gn[awk] are 
  17. >>=unreliable (especially for a multi-field file).
  18. >>
  19. >>Unreliable? In what way?
  20. >
  21. >    With respect to order being read in. Obviously, many of you know
  22. >that this is a well-known bug. Some do not.
  23.  
  24. I thought that this was defined behaviour - from AWK book, page 51:
  25.     "The order in which the subscripts are considered is implementation
  26.     dependent."
  27.  
  28. This would seem to allow the implementation latitude to arrange the elements
  29. in the most efficient method, e.g. for look-up (hashed lists, etc).
  30.  
  31. -- 
  32. Bill Fulton            (Home Alone) |    Grab .. 
  33.     bill@wafbox.gwinnett.com        |            The ..
  34. OR  ..!gatech!dcatla!wafbox!bill    |                   Reins
  35.