Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Conklin E.K.Forth programmer's handbook.2000.pdf
Скачиваний:
321
Добавлен:
23.08.2013
Размер:
2.04 Mб
Скачать

Forth Programmer’s Handbook

References CONSTANT, Section 4.2.3

LOAD and the return stack, Section 3.4.3.1

LIST, Section 3.4.3.3

3.4.3.3 Block-based Programmer Aids and Utilities

As a consequence of its standalone heritage, Forth has traditionally accompanied its block-based systems with a rich portfolio of programmer aids and utilities. These will vary depending upon the implementation, but a fully supported block system will normally include:

!An editor. Traditional Forth block editors format a block in 16 lines of 64 characters each, as this is a convenient size on most displays. By convention, the first line of each block includes a comment summarizing the contents of that block. The balance of the block should contain a few simple definitions related to its stated objective. Most block editors provide a command line and are string oriented. Some are quite powerful. All will include the basic command LIST to display a block, and the variable SCR which contains the number of the block most recently LISTed.

!Shadow-block, on-line documentation. Space within a block is limited, so comments are conventionally kept in a separate block, and the system pairs each source block with its shadow. From a keyboard, you should be able to toggle between a source block and its shadow counterpart. Shadow blocks are not compiled or executed.

!Program listing utilities. Typical systems include a utility to print indexes (the first, or comment, line from each of a range of blocks) and lists of blocks. Depending on the printer, it is normally possible to print source and shadow blocks side-by-side, with three such pairs on a page.

!Disk-management utilities. These include simple functions for moving groups of blocks and their associated shadows, initializing regions of disk, browsing disk (displaying the first-line comments), etc.

!Source-block comparison utilities. Comparison utilities that highlight any differences between ranges of similar blocks are extremely helpful on multiprogrammer projects when work has to be merged from several sources.

!Programmer aids. The programmer aids described in Section 1.4 (page 1–22) are normally available on block-based systems. LOCATE, for example, will show the block from which a word was compiled; with a single keystroke, you

System Functions 95

Соседние файлы в предмете Электротехника