home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / forth / 3009 < prev    next >
Encoding:
Internet Message Format  |  1992-08-22  |  4.8 KB

  1. Path: sparky!uunet!gatech!pitt!willett!ForthNet
  2. From: ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie)
  3. Newsgroups: comp.lang.forth
  4. Subject: Environmental Queries
  5. Message-ID: <4007.UUL1.3#5129@willett.pgh.pa.us>
  6. Date: 22 Aug 92 13:27:28 GMT
  7. Organization: EIEI-U
  8. Lines: 106
  9.  
  10. Category 10,  Topic 33
  11. Message 10        Fri Aug 21, 1992
  12. B.RODRIGUEZ2 [Brad]          at 22:49 EDT
  13.  
  14.                  ANSI X3J14 FORTH TECHNICAL PROPOSAL
  15.                      (X3J14 dpANS-3, March 1992)
  16.  
  17. TITLE:  S" should be interpretive in CORE
  18.  
  19. SECTION:  6.1.2165 S"
  20.           11.1.2165 S"
  21.           see also 6.1.1345 ENVIRONMENT?
  22.  
  23. SUMMARY:  An interpretive S" is needed to perform environmental
  24.      query, which is a Core function.
  25.  
  26. PROPOSAL:  Change the text of section 6.1.2165 to text of section
  27.      11.1.2165, and then delete section 11.1.2165.  (This is to
  28.      move the interpretive behavior of S" to the Core word set.)
  29.  
  30. RELATED PROPOSALS:  "ENVIRONMENT? should take text from input
  31.      stream"
  32.  
  33. DISCUSSION:  Another major weakness in the ENVIRONMENT? concept
  34.      is that there is only one portable means to query
  35.      ENVIRONMENT? in an ANS Forth core system, and this means is
  36.      clumsy, unobvious, and inapplicable to cross-compilers.
  37.  
  38.      This is because there is only one portable way in a core
  39.      system to obtain a text string interpretively: by executing
  40.      a newly-created definition that contains an S", e.g.,
  41.           : "MAX-N"   S" MAX-N" ;
  42.           "MAX-N" ENVIRONMENT? ...
  43.      which is clumsy, and not truly portable -- most Forth cross-
  44.      compilers, for instance, would be unable to execute this,
  45.      since the execution environment ("target") and the compila-
  46.      tion environment are separate and distinct.
  47.  
  48.      At present, the only way to use S" interpretively is to
  49.      declare an environmental dependency on the File-Access word
  50.      set.  This is contrary to the purpose of ENVIRONMENT?, which
  51.      is intended to allow all Forth systems to be portably
  52.      queried.
  53.  
  54.      This proposal would rectify the problem by allowing inter-
  55.      pretive use of S" in the Core word set.
  56.  
  57.      Note: if the related proposal, "ENVIRONMENT? should take
  58.      text from input stream" is adopted, then I withdraw this
  59.      proposal as no longer being necessary.
  60.  
  61.      Objections.
  62.  
  63.      It has been pointed out that most implementors will include
  64.      an interpretive behavior for S" anyway, and so it need not
  65.      be included in the standard.  This overlooks the fact that,
  66.      no matter what is provided by the vendors, no program can be
  67.      a "Standard Program" if it uses S" interpretively.  At best,
  68.      it can only be a Standard Program with an environmental
  69.      dependency on the File-Access word set.
  70.  
  71.      If all implementors will include interpretive S", there is
  72.      no harm in mandating this behavior in the standard.  If this
  73.      is how the Committee believes ENVIRONMENT? should be used,
  74.      interpretive S" should be mandated in the standard.
  75.  
  76.      It has been suggested (ref. Doc. No. X3J14/92-1PRC18R) that
  77.      other portable means exist.  This statement is incorrect.
  78.  
  79.           BL WORD COUNT  cannot be used interpretively; again, a
  80.           new definition must be created and executed.
  81.  
  82.           PAD 80 SOURCE-FILE READ-LINE also requires the File-
  83.           Access word set.  Also, it can only be used when load-
  84.           ing from files; a different construct is needed for
  85.           loading from blocks, and no analogous construct exists
  86.           for interpretive use from the keyboard.
  87.  
  88.      It has been suggested that new definitions can be created by
  89.      the user to rectify these shortcomings, e.g.,
  90.           : ENVIRONMENTAL   BL WORD COUNT ENVIRONMENT? ;
  91.           ENVIRONMENTAL MAX-N ...
  92.      There are three responses to this:
  93.  
  94.      a) it is not obvious to the programmer that this technique
  95.      is required to guarantee portability.  Most ANS Forth users
  96.      will doubtless employ the non-Standard
  97.      S" MAX-N" ENVIRONMENT?, especially if their implementations
  98.      allow this usage.
  99.  
  100.      b) as noted previously, techniques that require the execu-
  101.      tion of new definitions are inapplicable to cross-compilers.
  102.      While the dpANS does not now address the issue of cross-
  103.      compilers, it would be unconscionable to require a technique
  104.      that cannot later be extended to cross-compilers, especially
  105.      for so fundamental an operation as environmental queries.
  106.  
  107.      c) if this is the means by which the Committee feels that
  108.      ENVIRONMENT? should be used, then this should be the means
  109.      specified by the Standard!  (See related proposal.)
  110.  
  111. -----
  112. This message came from GEnie via willett.  You *cannot* reply to the author
  113. using e-mail.  Please post a follow-up article, or use any instructions
  114. the author may have included (USMail addresses, telephone #, etc.).
  115. Report problems to: dwp@willett.pgh.pa.us
  116.