home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / amiga / programm / 15704 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.8 KB  |  61 lines

  1. Path: sparky!uunet!decwrl!netsys!agate!ames!think.com!sdd.hp.com!nobody
  2. From: denson@sdd.hp.com (Craig Denson)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: LISP - Don't use it.
  5. Date: 11 Nov 1992 12:33:25 -0800
  6. Organization: Hewlett Packard, San Diego Division
  7. Lines: 49
  8. Message-ID: <1drqmlINN4fb@hpsdln.sdd.hp.com>
  9. References: <1992Nov6.220216.2313@sth.frontec.se> <BxBn4w.7oM@fc.hp.com> <CASEY.92Nov9143047@anxiety.lexmark.lex.usa.na>
  10. NNTP-Posting-Host: hpsdln.sdd.hp.com
  11.  
  12. In article <CASEY.92Nov9143047@anxiety.lexmark.lex.usa.na> pacasey@lexmark.com writes:
  13.  
  14. >So, I'd like to know reasons why other people like ELisp, or Lisp!
  15.  
  16. ok,
  17. an example of some working elisp. it seems to me that, even if you
  18. have only the foggiest idea of what a regular expression is,
  19. - you can follow what's going on here fairly easily. i.e. simplicity
  20. - the built-in functions are powerful, when it's byte-compiled, it's
  21.   relatively fast,
  22. - when you use it in batches with gnuclient it's even faster.
  23. - it integrates well in the un*x environment and i assume that with
  24.   the arexx version of gnuclient it works well in the amiga
  25.   environment (i have a stock 1.3 A2000, so i don't use it at home.)
  26.  
  27. craig
  28.  
  29. ------------------------------
  30. (defun clean_clpa ()
  31.  
  32. ; get rid of sql junk
  33.  
  34. (beginning-of-buffer)
  35. (flush-lines "---+" )
  36. (flush-lines "affected" )
  37. (flush-lines "END OF QUERY" )
  38.  
  39. ; flush leading and trailing whitespace
  40.  
  41. (beginning-of-buffer)
  42. (replace-regexp "^[     ]+" "")
  43. (beginning-of-buffer)
  44. (replace-regexp "[     ]+$" "")
  45.  
  46. ; compress blanks in front of date into 1
  47.  
  48. (beginning-of-buffer)
  49. (replace-regexp " +\\([0-9]+ 199\\)" " \\1")
  50.  
  51. [... stuff deleted ...] 
  52.  
  53. )
  54.  
  55. ; do all of above and then write buffer to temporary file 
  56.  
  57. (clean_clpa)
  58. (write-region (point-min) (point-max) "/tmp/cp.txt" nil "NO MSG")
  59.  
  60.  
  61.