Table of Contents


美國國家資訊系統標準(American National Standard for Information Systems)

程式設計語言(Programming Languages)

符式(Forth)

事務局(Secretariat)
電腦和商業設備生產協會(Computer and Business Equipment Manufacturers Association)
標準通過日期(Approved): March 24, 1994
美國國家標準學會組織(American National Standards Institute, Inc.)

版權由 X3J14 技術委員會所有. 保留所有權利.

Copyright (c) 1994 by Technical Committee X3J14. All rights reserved.

這是一份由 X3J14 技術委員會提出, 用來印出 ANS Forth 標準的最後一版草稿 的工作文件. 這份文件的授權許可不加以修改的完全複製, 或是在下列情況下 的修改: (1) 清楚地標示所插入的文字. (2) 將已存在的文字陰影化或變成高亮度. (3) 或是將範例刪除.

This is a working document of Technical Committee X3J14 which represents the last draft of ANS Forth submitted to ANSI for publication. Permission is hereby granted to copy this document provided that it is copied in its entirety without alteration or as altered by (1) adding text that is clearly marked as an insertion; (2) shading or highlighting existing text; and/or (3) deleting examples.

換句話說, 如果能達成以上的需求, 授權許可使用這份工作文件做為教科書、 系統手冊、和線上文件的基礎. 並且做出的產物應能處理正式的 ANS 所不能實際 解決的一項專門性的需求.

Specifically, permission is granted to use this working document as the foundation for textbooks, system manuals, and online documentation so long as the requirements in the preceding paragraph are met and the resulting product addresses a technical need that is not practically met by the official ANS.

注意: 這份文件只由技術委員會依上述說明, 提供作為一份公眾審閱和評論的工作文件, 它並不是要做為一份由 ANSI 印出的正式的 ANS Forth 標準文件的替代品. 如果有衝突的情形出現, 只有 X3.215-1994 的印刷文件能作為正式的 ANS Forth 標準.

NOTE: This file is provided as a working document of the TC for public review and comment as well as documentation uses described above. It is not intended as a substitute for the official ANS Forth document published by ANSI. In the event of conflict, only the printed document X3.215-1994 represents the official ANS Forth.

要獲得正式的標準文件, 請連絡美國國家標準學會販售部門, 電話是 (212) 642-4900, 傳真 (212) 302-1286; 或是世界工程文件部門, 電話是 (800) 854-7179, 或傳真 (303) 843-9880, 並且要求取得文件 X3.215-1994. 感謝您對這份文件有興趣.

To obtain the official standard, please contact the American National Standards Institute Sales Department, at (212) 642-4900 or FAX (212) 302-1286, or Global Engineering Documents, at (800) 854-7179 or FAX (303) 843-9880, and request Document X3.215-1994. Thank you very much for your interest.

譯註: 依據上述的授權, 我將這份文件全部翻譯加入中文, 不曾刪除任何一段原始 文字. 而加入的格式如下: 中文(英文)、中文 ... (換行) 英文...
並且作成線上的參考文件型式.
版本: 0.0.01

Note from Chinese Translator: According the permission described above, I translate all the documentation into Chinese, and don't delete any origin text. The format of the insertional Chinese text is Chinese(English), Chinese (newline) English.
And I make it as the online documentation for reference.
version: 0.0.01


前言(Foreword)

(這個前言並不是美國國家標準 X3.215-1994 的一部分)

(This foreword is not a part of American National Standard X3.215-1994)

Forth 是一個直接在人類和機器之間通訊的語言. 用自然語言的發音和機器 導向的字句排列法, Forth 提供了一個合乎經濟效益的、有生產力的環境來 進行交談式編譯和執行程式. Forth 也提供了低階取用電腦控制硬體的能力, 並且能夠延申語言本身. 這個延申性允許這個語言很快地擴展並且適應於特別 的需求以及不同的硬體系統.

Forth is a language for direct communication between human beings and machines. Using natural-language diction and machine-oriented syntax, Forth provides an economical, productive environment for interactive compilation and execution of programs. Forth also provides low-level access to computer-controlled hardware, and the ability to extend the language itself. This extensibility allows the language to be quickly expanded and adapted to special needs and different hardware systems.

Forth 是由 Charles Moore 發明用來提升程式設計師的生產力, 同時也不犧牲 機器的效率之用. Forth 是一個分層的環境, 包含了一個電腦語言的元素、同時 也有一個作業系統和一個機器的監視器. 它的延申性及分層的環境架構提供了 一個高度的交談式程式發展和測試環境.

Forth was invented by Mr. Charles Moore to increase programmer productivity without sacrificing machine efficiency. Forth is a layered environment containing the elements of a computer language as well as those of an operating system and a machine monitor. This extensible, layered environment provides for highly interactive program development and testing.

由於對於用 Forth 寫的應用軟體程式的可移轉性有興趣, 標準化的努力從 1970 年代中期開始, 由一個國際的使用者組織和系統發展者們組成了 Forth 標準化團體. 這項努力的成果是 Forth-77 標準. 由於這個語言的發展, 臨時的的 Forth-78 標準也由 Forth 標準化團體發表. 隨著 1979 年的 Forth 標準化團體會議, Forth-79 標準在 1980 年發表. 主要的修改是由 Forth 標準化團體 在 1983 年發表的 Forth-83 標準.

In the interests of transportability of application software written in Forth, standardization efforts began in the mid-1970s by an international group of users and implementors who adopted the name Forth Standards Team. This effort resulted in the Forth-77 Standard. As the language continued to evolve, an interim Forth-78 Standard was published by the Forth Standards Team. Following Forth Standards Team meetings in 1979, the Forth-79 Standard was published in 1980. Major changes were made by the Forth Standards Team in the Forth-83 Standard, which was published in 1983.

第一次在 Forth 程式設計系統上的技術委員會會議是由 X3J14 Forth 技術委員會 的組織委員會在 1987 年 8 月 3 日所聚集的. 後來聚會於 1987 年 11 月 11 到 12 日, 1988 年 2 月 10 到 12 日, 1988 年 5 月 25 到 28 日, 1988 年 8 月 10 到 13 日, 1988 年 10 月 26 到 29 日, 1989 年 1 月 25 到 28 日, 1989 年 5 月 3 到 6 日. 1989 年 7 月 26 到 29 日, 1989 年 10 月 25 到 28 日, 1990 年 1 月 24 到 27 日, 1990 年 5 月 22 到 26 日, 1990 年 8 月 21 到 25, 1990 年 11 月 6 到 10 日, 1991 年 1 月 29 日到 2 月 2 日, 1991 年 5 月 3 到 4 日, 1991 年 6 月 16 到 19 日, 1991 年 7 月 30 日到 8 月 3 日. 1992 年 3 月 17 到 21 日, 1992 年 10 月 13 到 17 日, 1993 年 1 月 26 到 30 日, 1993 年 6 月 28 到 30 日, 和 1994 年 6 月 21 日.

The first meeting of the Technical Committee on Forth Programming Systems was convened by the Organizing Committee of the X3J14 Forth Technical Committee on August 3, 1987, and has met subsequently on November 11-12, 1987, February 10-12, 1988, May 25-28, 1988, August 10-13, 1988, October 26-29, 1988, January 25-28, 1989, May 3-6, 1989, July 26-29, 1989, October 25-28, 1989, January 24-27, 1990, May 22-26, 1990, August 21-25, 1990, November 6-10,1990, January 29-February 2, 1991, May 3-4, 1991, June 16-19, 1991, July 30-August 3, 1991, March 17-21, 1992, October 13-17, 1992, January 26-30, 1993, June 28-30, 1993, and June 21, 1994.

我們歡迎解釋的需求, 改進的建議或是 addenda (譯註: 查不到這個單字), 以及缺點的報告. 它們應該被送往 X3 事務局, 電腦和商業設備生產協會, 1250 Eye Street, NW, Suite 200, Washington, DC 20005.

Requests for interpretation, suggestions for improvement or addenda, or defect reports are welcome. They should be sent to the X3 Secretariat, Computer and Business Equipment Manufacturers Association, 1250 Eye Street, NW, Suite 200, Washington, DC 20005.


X3 會員資格(X3 Membership)

這個標準是由合格的的資訊處理系統標準委員會 X3 處理並且通過, 用來提出作為 ANSI 標準. 委員會的認可並不表示所有的委員會成員投票贊成. 在目前通過的這 個標準, X3 委員會有下列的成員:

This standard was processed and approved for submittal to ANSI by the Accredited Standards Committee on Information Processing Systems, X3. Committee approval of this standard does not necessarily imply that all committee members voted for its approval. At the time it approved this standard, the X3 Committee had the following members:

James D. Converse, Chair (主席)
Donald C. Loughry, Vice-Chair (副主席)
Joanne Flanagan, Secretary (書記)

生產的團體(Producer Group)              代表人名字(Name of Representative)
--------------                          ----------------------
AMP Incorporated                        Edward Kelly
                                        Charles Brill (Alt.)

AT&T/NCR Corporation                    Thomas W. Kern
                                        Thomas F. Frost (Alt.)

Apple Computer, Inc.                    Karen Higginbottom

Compaq Computers                        James Barnes

Digital Equipment Corporation           Delbert Shoemaker
                                        Kevin Lewis

Hitachi America Ltd.                    John Neumann
                                        Kei Yamashita (Alt.)

Hewlett Packard                         Donald C. Loughry

Bull HN Information Systems Inc.        William George

IBM Corporation                         Joel Urman
                                        Mary Anne Lawler (Alt.)

Unisys Corporation                      John Hill
                                        Stephen P. Oksala (Alt.)

Sony Corporation of America             Michael Deese

Storage Technology Corporation          Joseph S. Zajaczkowski
                                        Samuel D. Cheatham (Alt.)

Sun Microsystems, Inc.                  Scott Jameson
                                        Gary S. Robinson (Alt.)

* Xerox Corporation                     Dwight McBain
                                        Roy Pierce (Alt.)

3M Company                              Edie T. Morioka
                                        Paul D. Jahnke (Alt.

顧客團體(Consumers Group)
---------------

Boeing Company                          Catherine Howells
                                        Andrea Vanosdoll (Alt.)

Eastman Kodak Company                   James Converse
                                        Michael Nier (Alt.)

General Services Administration         Douglas Arai
                                        Larry L. Jackson (Alt.)

Guide International Inc.                Frank Kirshenbaum
                                        Harold Kuneke (Alt.)

** Hughes Aircraft Company              Harold Zebrack

National Communications Systems         Dennis Bodson

Northern Telecom Inc.                   Mel Woinsky
                                        Subhash Patel (Alt.)

** Recognition Tech Users Association   Herbert P. Schantz
                                        Edwin Hale (Alt.)

Share Inc.                              Gary AinsworthDavid Thewis (Alt.)

U. S. Department of Defense             William Rinehuls
                                        J. Pasquariello (Alt.)

U. S. Department of Energy              Alton Cox
                                        Lawrence A. Wasson (Alt.)

Wintergreen Information Services        John Wheeler

一般有興趣的團體(General Interest Group)
----------------------

American Nuclear Society                Geraldine C. Main
                                        Sally Hartzell (Alt.)

Assn. of the Institute for Certification of Computer Professionals
                                        Kenneth Zemrowski

Nat'l Institute of Standards and Technology     
                                        Robert E. Rountree
                                        Micharl Hogan (Alt.)

Neville & Associates                    Carlton Neville
________________________

* Abstain      ** Non-Response


X3J14 成員(X3J14 Membership)

在草案通過成為美國國家標準時, 程式設計語言 Forth X3J14 技術委員會有下列 的成員:

At the time it approved this draft of the proposed American National Standard, the Technical Committee X3J14 on the Forth Programming Language had the following members:

Elizabeth Rather, Chair (主席)
Mitch Bradley, acting Vice-Chair (副主席)
Don Colburn, Secretary (書記)
John Rible, Technical Editor (技術編輯)
Len Zettel, Vocabulary Representative (詞彙表代理人)
Greg Bailey, Technical Subcommittee Chair (技術附屬委員會主席)

代表的組織(Organization Represented)    代表人名字(Name of Representative)
------------------------                ----------------------
ATHENA Programming, Inc.                Greg Bailey
                                        Howe Fong (Alt.)

Bradley Forthware                       Mitch Bradley

Creative Solutions, Inc.                Don Colburn

Ford Motor Company                      Leonard F. Zettel, Jr.

FORTH, Inc.                             Elizabeth Rather
                                        Dennis Ruffer (Alt.)

Institute for Applied Forth Research    Lawrence Forsley
                                        Horace Simmons (Alt.)

Johns Hopkins University, Applied Physics Lab.  
                                        John Hayes

Mephistopheles Systems                  Dave Harralson

NASA/Goddard Space Flight Center        James Rash

Nomadic Software                        John K. Stevenson

Unisyn, Inc.                            Gary Betts
                                        Stephen Egbert (Alt.)

Up and Running                          Martin Tracy

Vesta Technology                        Jack Woehr

Individual Members                      Loring Craymer
                                        John Rible
                                        E. (Jet) Thomas

X3 Liasons                              Clyde R. Camp
                                        Kathleen McMillan

下列的組織和個人也像是技術委員會成員一樣參與了這個計劃, 輪流地或是旁觀地. 技術委員會了解並敬重他們的貢獻.

The following organizations and individuals have also participated in this project as Technical Committee members, alternates, or observers. The Technical Committee recognizes and respects their contributions:

組織(Organizations)
-------------

British Columbia Inst. of Tech.  MCI Telecommunications Corp.
Computer Cowboys                 Micromotion
Computer Sciences Corp.          MicroProcessor Engineering Ltd.
Computer Strategies, Inc.        National Institute of Standards & Technology
Digalog Corp.                    NCR Medical Systems Group
Embedded Sys. Programming Mag.   Performance Packages, Inc.
Forth Interest Group (FIG)       Purdue University
H.B. Pascal & Co., Inc.          Robert Berkey Services
Harris Semiconductor             Shaw Laboratories
IBM Corporation                  Social Security Administration
IEEE                             Software Engineering
Kelly Enterprises                Texas Instruments
Laboratory Microsystems, Inc.    The Dickens Company
Maxtor Corp.

個人(Individuals)
-----------

David J. Angel  Ray Duncan      Charles Moore   Dean Sanderson
Wil Baden       Douglas Fishman Mike Nemeth     George Shaw
Robert Berkey   Tom Hand        Harry Pascal    Gerald Shifrin
Ron Braithwaite Gregory Ilg     Stephen Pelc    Robert Smith
Jack Brown      Charles Keane   Dean Perrine    Tyler Sperry
Chris Colburn   Guy M. Kelly    David C. Petty  Tom Zimmer
Ted Dickens     Andrew Kobziar  Bill Ragsdale   James Ryland
John Dorband    Martin Lascelles


美國國家資訊系統標準 X3.215-1994 (AMERICAN NATIONAL STANDARD ANSI X3.215-1994 American National Standard for Information Systems)

程式設計語言(Programming Language)

符式(Forth)


1. 簡介(Introduction)


1.1 目標(Purpose)

這個標準的目標是提升 Forth 程式的可移植性, 以便能使用於廣泛的多種電腦系統中, 使程式、程式設計技巧、程式中的創意更容易在 Forth 程式設計師中交換. 並且作為 Forth 語言未來發展的基礎.

The purpose of this Standard is to promote the portability of Forth programs for use on a wide variety of computing systems, to facilitate the communication of programs, programming techniques, and ideas among Forth programmers, and to serve as a basis for the future evolution of the Forth language.


1.2 範圍(Scope)

這個標準利用一個標準系統的定義詞來指定一個 Forth 系統和一個 Forth 程式之間 的介面.

This Standard specifies an interface between a Forth System and a Forth Program by defining the words provided by a Standard System.

參閱(See): A.1.2 範圍(Scope)


1.2.1 包含部分(Inclusions)

這個標準指定了(This Standard specifies):


1.2.2 排除部分(Exclusions)

標準並未指定(This Standard does not specify):


1.3 文件結構(Document organization)


1.3.1 詞集(Word sets)

這個標準將 Forth 詞和性能分類成詞集, 用一個名字來代表一些共用的外觀, 通常是它們的共用作用區域. 每個詞集可以有一個延申集, 包含了一些提供額外 功能的詞. 這些詞並不需要在詞集中實作.

This Standard groups Forth words and capabilities into word sets under a name indicating some shared aspect, typically their common functional area. Each word set may have an extension, containing words that offer additional functionality. These words are not required in an implementation of the word set.

定義於一到六節的核心 詞集, 包含了一個標準系統所需的詞和能力. 定義於七至十七節其他的詞集是選用的, 讓標準可以提供不同層次的功能.

The Core word set, defined in sections 1 through 6, contains the required words and capabilities of a Standard System. The other word sets, defined in sections 7 through 17, are optional, making it possible to provide Standard Systems with tailored levels of functionality.

參閱(See): A.1.3.1 詞集(Word sets)


1.3.1.1 正文區(Text sections)

在每一個詞集中, 第一節包含了介紹和解釋的資料, 第二節介紹標準中到處使用的 專有名詞和標記法. 在這幾節中沒有需求.

Within each word set, section 1 contains introductory and explanatory material and section 2 introduces terms and notation used throughout the Standard. There are no requirements in these sections.

第三和第四節包含了標準系統和程式個別地需要的文件, 而第五節指定了它們的命令.

Sections 3 and 4 contain the usage and documentation requirements, respectively, for Standard Systems and Programs, while section 5 specifies their labeling.


1.3.1.2 詞彙表區(Glossary sections)

每一個詞集的第六節指定了詞集和延申詞集中定義詞的行為需求.

Section 6 of each word set specifies the required behavior of the definitions in the word set and the extensions word set.


1.3.2 附件(Annexes)

這個附件並不包含任何必須的資料.

The annexes do not contain any required material.

附件 A 提供了一些委員會決定創造這個標準的決定的理論基礎, 就像是實作的例子. 它有跟標準內容的相同節區編號, 以便容易連結每一個需求節區和它的解釋節區.

Annex A provides some of the rationale behind the committee's decisions in creating this Standard, as well as implementation examples. It has the same section numbering as the body of the Standard to make it easy to relate each requirements section to its rationale section.

附件 B 是一份簡短的 Forth 參考文獻.

Annex B is a short bibliography on Forth.

附件 C 提供了 Forth 的一份簡介.

Annex C provides an introduction to Forth.

附件 D 討論了 ANS Forth 跟早期 Forth 的相容性, 強調跟 Forth-83 標準的不同.

Annex D discusses the compatibility of ANS Forth with earlier Forths, emphasizing the differences from Forth-83.

附件 E 展現了在 ANS Forth 中寫可移植程式的技巧.

Annex E presents some techniques for writing portable programs in ANS Forth.

附件 F 包含了所有詞集的詞列表, 並且作為一份 ANS Forth 詞的索引.

Annex F includes the words from all word sets in a single list, and serves as an index of ANS Forth words.


1.4 未來的方向(Future directions)


1.4.1 新的技術(New technology)

這個標準採用了一般常用的詞和不斷增加的習慣, 新的詞也會被採用以便容易 地創造可移植的程式.

This Standard adopts certain words and practices that are increasingly found in common practice. New words have also been adopted to ease creation of portable programs.


1.4.2 過時的特色(Obsolescent features)

這個標準將一些詞和一些過去常用的方法變成過時的. 雖然為了它們的廣泛使用, 所以仍然將它們保留在這個標準中, 在新的系統實作及新的程式中使用它們是不被 鼓勵的, 因為它們可能會在未來的標準修訂版中放棄.

This Standard adopts certain words and practices that cause some previously used words to become obsolescent. Although retained here because of their widespread use, their use in new implementations or new programs is discouraged, because they may be withdrawn from future revisions of the Standard.

標準指出下列詞是過時的:

This Standard designates the following words as obsolescent:

6.2.0060        #TIB
15.6.2.1580     FORGET
6.2.2240        SPAN
6.2.0970        CONVERT
6.2.2040        QUERY
6.2.2290        TIB
6.2.1390        EXPECT


內容列表(Table of Contents)
下一節(Next Section)