1*43693Scael.\" Copyright (c) 1983, 1990 The Regents of the University of California. 236830Sbostic.\" All rights reserved. 319755Smckusick.\" 4*43693Scael.\" %sccs.include.redist.man% 519755Smckusick.\" 6*43693Scael.\" @(#)fp.1 6.3 (Berkeley) 06/24/90 736830Sbostic.\" 8*43693Scael.Dd 9*43693Scael.Dt FP 1 10*43693Scael.Os BSD 4.2 1119755Smckusick.ds s 1 12*43693Scael.Sh NAME 13*43693Scael.Nm fp 14*43693Scael.Nd Functional Programming language compiler/interpreter 15*43693Scael.Sh SYNOPSIS 16*43693Scael.Nm fp 17*43693Scael.Sh DESCRIPTION 18*43693Scael.Nm Fp 1919755Smckusickis an 2019755Smckusickinterpreter/compiler that implements the applicative language proposed 2119755Smckusickby John Backus. It is written in 22*43693Scael.Em FRANZ LISP . 23*43693Scael.Pp 2419755SmckusickIn a functional programming language 2519755Smckusickintent is expressed 2619755Smckusickin a mathematical style devoid of assignment statements 2719755Smckusickand variables. 2819755SmckusickFunctions compute by value only; there are no side-effects 2919755Smckusicksince the result of a computation depends solely on the inputs. 30*43693Scael.Pp 31*43693Scael.Nm Fp 32*43693Scael.Em programs 33*43693Scaelconsist of 34*43693Scael.Em functional expressions 35*43693Scael\- 36*43693Scaelprimitive and user-defined 37*43693Scael.Nm fp 3819755Smckusickfunctions 39*43693Scaelcombined by 40*43693Scael.Em functional forms . 4119755SmckusickThese forms take functional arguments 4219755Smckusickand return functional results. 4319755SmckusickFor example, the composition 44*43693Scaeloperator 45*43693Scael.Sq Ic @ 4619755Smckusicktakes two functional arguments and returns a function 4719755Smckusickwhich represents their composition. 48*43693Scael.Pp 49*43693ScaelThere exists a single operation in 50*43693Scael.Nm fp 5119755Smckusick\&\- 52*43693Scael.Em application . 5319755SmckusickThis operation causes the system to evaluate the indicated function using 54*43693Scaelthe single argument 5519755Smckusickas input 5619755Smckusick(all functions are monadic). 57*43693Scael.Sh GETTING STARTED 58*43693Scael.Pp 59*43693Scael.Nm Fp 60*43693Scaelinvokes the system. 61*43693Scael.Nm Fp 6219755Smckusickcompiles functions into 63*43693Scael.Xr lisp 1 6419755Smckusicksource code; 65*43693Scael.Xr lisp 1 6619755Smckusickinterprets this code 6719755Smckusick(the user may compile this code using the 68*43693Scael.Xr liszt 1 69*43693Scaelcompiler to gain a factor of 10 in performance). 70*43693Scael.Ic Control D 7119755Smckusickexits back to the shell. 72*43693Scael.Ic Break 7319755Smckusickterminates any computation in progress and resets any open file units. 74*43693Scael.Ic )help 7519755Smckusickprovides a short summary of all user commands. 76*43693Scael.Sh FILES 77*43693Scael.Dw liszt 78*43693Scael.Di L 79*43693Scael.Dp Pa lisp 80*43693Scaelthe FRANZ LISP interpreter 81*43693Scael.Dp Pa liszt 82*43693Scaelthe liszt compiler 83*43693Scael.\" .Dp Pa /usr/doc/fp 84*43693Scael.\" the User's Guide 85*43693Scael.Dp 86*43693Scael.Sh SEE ALSO 87*43693Scael.Xr lisp 1 , 88*43693Scael.Xr liszt 1 , 8919755Smckusick.br 90*43693Scael.Em The Berkeley FP user's manual , 9119755Smckusickavailable on-line. 92*43693ScaelThe language is described in the August 1978 issue of 93*43693Scael.Em CACM 9419755Smckusick(Turing award lecture by John Backus). 95*43693Scael.Sh BUGS 9619755SmckusickIf a non-terminating function is applied as the result of loading a file, 9719755Smckusickthen control is returned to the user immediately, everything 9819755Smckusickafter that position in the file is ignored. 99*43693Scael.Pp 100*43693Scael.Nm Fp 101*43693Scaelincorrectly marks the location of a syntax error on 10219755Smckusicklarge, multi-line function definitions or applications. 103*43693Scael.Sh HISTORY 104*43693Scael.Nm Fp 105*43693Scaelappeared in 4.2 BSD. 106*43693Scael.Sh AUTHOR 10719755SmckusickScott B. Baden 108