Commit | Line | Data |
---|---|---|
362b077f C |
1 | |
2 | ||
3 | ||
4 | FP(1) UNIX Programmer's Manual FP(1) | |
5 | ||
6 | ||
7 | ||
8 | N\bNA\bAM\bME\bE | |
9 | fp - Functional Programming language compiler/interpreter | |
10 | ||
11 | S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS | |
12 | f\bfp\bp | |
13 | ||
14 | D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN | |
15 | _\bF_\bp is an interpreter/compiler that implements the applica- | |
16 | tive language proposed by John Backus. It is written in | |
17 | F\bFR\bRA\bAN\bNZ\bZ L\bLI\bIS\bSP\bP. | |
18 | ||
19 | In a functional programming language intent is expressed in | |
20 | a mathematical style devoid of assignment statements and | |
21 | variables. Functions compute by value only; there are no | |
22 | side-effects since the result of a computation depends | |
23 | solely on the inputs. | |
24 | ||
25 | _\bF_\bp "programs" consist of _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\ba_\bl _\be_\bx_\bp_\br_\be_\bs_\bs_\bi_\bo_\bn_\bs - primitive | |
26 | and user-defined _\bf_\bp functions combined by _\bf_\bu_\bn_\bc_\bt_\bi_\bo_\bn_\ba_\bl _\bf_\bo_\br_\bm_\bs. | |
27 | These forms take functional arguments and return functional | |
28 | results. For example, the composition operator '@' takes | |
29 | two functional arguments and returns a function which | |
30 | represents their composition. | |
31 | ||
32 | There exists a single operation in _\bf_\bp - _\ba_\bp_\bp_\bl_\bi_\bc_\ba_\bt_\bi_\bo_\bn. This | |
33 | operation causes the system to evaluate the indicated func- | |
34 | tion using the single argument as input (all functions are | |
35 | monadic). | |
36 | ||
37 | G\bGE\bET\bTT\bTI\bIN\bNG\bG S\bST\bTA\bAR\bRT\bTE\bED\bD | |
38 | _\bF_\bp invokes the system. _\bF_\bp compiles functions into _\bl_\bi_\bs_\bp(1) | |
39 | source code; _\bl_\bi_\bs_\bp(1) interprets this code (the user may com- | |
40 | pile this code using the liszt (1) compiler to gain a factor | |
41 | of 10 in performance). _\bC_\bo_\bn_\bt_\br_\bo_\bl _\bD exits back to the shell. | |
42 | _\bB_\br_\be_\ba_\bk terminates any computation in progress and resets any | |
43 | open file units. )_\bh_\be_\bl_\bp provides a short summary of all user | |
44 | commands. | |
45 | ||
46 | F\bFI\bIL\bLE\bES\bS | |
47 | /usr/ucb/lisp the FRANZ LISP interpreter | |
48 | /usr/ucb/liszt the liszt compiler | |
49 | /usr/doc/fp the User's Guide | |
50 | ||
51 | S\bSE\bEE\bE A\bAL\bLS\bSO\bO | |
52 | lisp(1), liszt(1). | |
53 | ||
54 | _\bT_\bh_\be _\bB_\be_\br_\bk_\be_\bl_\be_\by _\bF_\bP _\bu_\bs_\be_\br'_\bs _\bm_\ba_\bn_\bu_\ba_\bl, available on-line. The | |
55 | language is described in the August 1978 issue of _\bC_\bA_\bC_\bM | |
56 | (Turing award lecture by John Backus). | |
57 | ||
58 | B\bBU\bUG\bGS\bS | |
59 | ||
60 | ||
61 | ||
62 | ||
63 | Printed 7/9/88 April 29, 1985 1 | |
64 | ||
65 | ||
66 | ||
67 | ||
68 | ||
69 | ||
70 | FP(1) UNIX Programmer's Manual FP(1) | |
71 | ||
72 | ||
73 | ||
74 | If a non-terminating function is applied as the result of | |
75 | loading a file, then control is returned to the user immedi- | |
76 | ately, everything after that position in the file is | |
77 | ignored. | |
78 | ||
79 | FP incorrectly marks the location of a syntax error on | |
80 | large, multi-line function definitions or applications. | |
81 | ||
82 | A\bAU\bUT\bTH\bHO\bOR\bR | |
83 | Scott B. Baden | |
84 | ||
85 | ||
86 | ||
87 | ||
88 | ||
89 | ||
90 | ||
91 | ||
92 | ||
93 | ||
94 | ||
95 | ||
96 | ||
97 | ||
98 | ||
99 | ||
100 | ||
101 | ||
102 | ||
103 | ||
104 | ||
105 | ||
106 | ||
107 | ||
108 | ||
109 | ||
110 | ||
111 | ||
112 | ||
113 | ||
114 | ||
115 | ||
116 | ||
117 | ||
118 | ||
119 | ||
120 | ||
121 | ||
122 | ||
123 | ||
124 | ||
125 | ||
126 | ||
127 | ||
128 | ||
129 | Printed 7/9/88 April 29, 1985 2 | |
130 | ||
131 | ||
132 |