home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / jsage / znode3 / z80dos / arnznote.leh < prev    next >
Encoding:
Text File  |  1994-09-02  |  2.9 KB  |  57 lines

  1. Jay,
  2.  
  3. Here are my thoughts on the subject of spaces left by non-existent  tokens 
  4. in alias script expansions.  
  5.  
  6. Please excuse the fact that the names which I use for elements of the 
  7. command line and alias script are not the same as those which you very 
  8. nicely set forth in the ARUNZ09N.DOC file, however I wish to set forth a 
  9. concept which depends on a slightly different nomenclature.  I think my 
  10. meanings will be obvious.
  11.  
  12. First, let me make a couple of definitions.  
  13.  
  14. By a "string" I mean a set of characters defined by naming each element of 
  15. the set.  Thus the statement $1 = cat means that the string named $1 is a 
  16. set of the characters c-a-t.  A null string, in this case, is the same as 
  17. a non-existent string.  
  18.  
  19. By a "field", I mean a >delimited< field which exists in a relationship to 
  20. other fields.  A field consists of a string and a >field delimiter< which 
  21. separates it from other fields.  A null field is NOT the same as a 
  22. non-existent field.  The former consists of a field containing a null 
  23. string, while the latter has no existence by virtue of the fact that it 
  24. has no delimiter.  A command line and an alias script both consist of a 
  25. set of delimited fields, the delimiter being a space or a tab.
  26.  
  27. It seems to me that what we have at present with ARUNZ (and other similar 
  28. command line expanders) is a situation where one syntax is used to define 
  29. two different kinds of parameters, and perhaps we need a syntax for each 
  30. kind.  We may call one a "string substitution parameter" and the other a 
  31. "field substitution parameter".  Currently, $n functions in ARUNZ strictly 
  32. as a string substitution paramter.  If the command line field n contains 
  33. the string xxxx then $n in the alias script will be so expanded.  If the 
  34. field n does not exist in the command line, then a null string will be 
  35. substituted in place of $n.  This is fine for such expansions as 
  36. "FOO$1.COM" where FOO.COM is, for instance, the current version and 
  37. previous versions have numbers which may be substituted as indicated.  
  38. This is srictly a string substitution operation.  On the other hand, when 
  39. we use $n to indicate the contents of a >field< in an alias script, as in 
  40. FOO $1 $2, we are using it as a field substitution parameter.  Since we 
  41. are substituting one field for another, this works fine unless a command 
  42. line field is non-existent.  If this is the case, the corresponding field 
  43. in the expanded alias script must also not exist.  Using a string 
  44. substitution parameter for the job will simply produce a null field - not 
  45. the same.
  46.  
  47. I would suggest that you develope ARUNZ to differentiate these two kinds 
  48. of parameters - perhaps %n or $%n for string substitution and $n for field 
  49. substitution, or some such.  Let me know what you think.
  50.  
  51.  
  52. Best,
  53.  
  54.  
  55.  
  56. Lindsay Haisley
  57.