home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp48 / 5587 < prev    next >
Encoding:
Internet Message Format  |  1992-11-06  |  2.3 KB

  1. Path: sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!sun-barr!olivea!sgigate!sgiblab!munnari.oz.au!bruce.cs.monash.edu.au!monu6!aurora.cc.monash.edu.au!ins534z
  2. From: ins534z@aurora.cc.monash.edu.au (Quetzal)
  3. Newsgroups: comp.sys.hp48
  4. Subject: Re: (up/dn)MATCH Q's...
  5. Message-ID: <ins534z.721012871@aurora.cc.monash.edu.au>
  6. Date: 6 Nov 92 01:21:11 GMT
  7. References: <Bx5Aoy.L7A@ireq.hydro.qc.ca> <STEVEV.92Nov3113953@miser.uoregon.edu> <1992Nov3.220518.9744@tamsun.tamu.edu>
  8. Sender: news@monu6.cc.monash.edu.au (Usenet system)
  9. Organization: Monash University, Melb., Australia.
  10. Lines: 40
  11.  
  12. apj6796@tamsun.tamu.edu (Albert Paul Jimenez III      ) writes:
  13.  
  14.  
  15. >1) documentation on the MATCH cmds is sadly lacking... there's what 1 & 1/2 pages and they do one simple example... 
  16.  
  17. I agree.  But there's really not much more that could be said.  (up)MATCH
  18. and (down)MATCH aren't really suited to that sort of thing, though they
  19. do work.
  20.  
  21. >2) undocumented feature: as well as using & as a single wildcard, &1, &2, etc can also be used... helps to do more comples pattern matching
  22.  
  23. Well, it's not undocumented in the old manual.  &U and &V keep popping up
  24. in the examples.
  25.  
  26. >3) anyone got any more documentation on this thing? 
  27. >   hopefully including a way to specify which occurance to substitute in for
  28. >   (# of possible subs is on lvl 1 after the MATCH cmd) so i can do simple communative swapping on say, just the 2nd _AND_ in '(A AND B) OR (C AND D)' instead of haveing to swap the whole thing with << { '&1 AND &2' '&2 AND &1' } ?MATCH DROP >>
  29.  
  30. The list can have two or three elements.  If it has two, you get exactly
  31. what you've been doing all along.  Every occurrence gets replaced (well,
  32. not *EVERY*, but you know what I mean).  If there are three elements in the
  33. list, then the third one is evaluated and the replacement ONLY goes ahead
  34. if that evaluation turns out to be nonzero.  To only replace the second in
  35. your example, do
  36. \<<
  37.     { '&1 AND &2' '&2 AND &1' '&1==C' }
  38.     (up)MATCH  @ (say)
  39.     DROP
  40. \>>
  41.  
  42. (come to think of it, that won't work due to the symbolic nature of 'C',
  43. but you get the idea.)
  44.  
  45. The RULES menu does this by operating on a string containing the algebraic,
  46. I'm led to believe.  It formats it for the EquationWriter, but all it
  47. is is a string.  Consult an expert on this.  I'm not.
  48.  
  49. This is all in the manual, isn't it?  Or isn't it in the new manual?
  50.  
  51. Tim Pickett.
  52.