143693Scael.\" Copyright (c) 1983, 1990 The Regents of the University of California. 236830Sbostic.\" All rights reserved. 319755Smckusick.\" 4*50654Scael.\" %sccs.include.redist.roff% 519755Smckusick.\" 6*50654Scael.\" @(#)fp.1 6.6 (Berkeley) 07/29/91 736830Sbostic.\" 843693Scael.Dd 943693Scael.Dt FP 1 1043693Scael.Os BSD 4.2 1143693Scael.Sh NAME 1243693Scael.Nm fp 1343693Scael.Nd Functional Programming language compiler/interpreter 1443693Scael.Sh SYNOPSIS 1543693Scael.Nm fp 1643693Scael.Sh DESCRIPTION 1743693Scael.Nm Fp 1819755Smckusickis an 1919755Smckusickinterpreter/compiler that implements the applicative language proposed 2019755Smckusickby John Backus. It is written in 21*50654Scael.Tn FRANZ LISP . 2243693Scael.Pp 2319755SmckusickIn a functional programming language 2419755Smckusickintent is expressed 2519755Smckusickin a mathematical style devoid of assignment statements 2619755Smckusickand variables. 2719755SmckusickFunctions compute by value only; there are no side-effects 2819755Smckusicksince the result of a computation depends solely on the inputs. 2943693Scael.Pp 3043693Scael.Nm Fp 31*50654Scaelprograms consist of 3243693Scael.Em functional expressions 3343693Scael\- 3443693Scaelprimitive and user-defined 3543693Scael.Nm fp 3619755Smckusickfunctions 3743693Scaelcombined by 3843693Scael.Em functional forms . 3919755SmckusickThese forms take functional arguments 4019755Smckusickand return functional results. 4119755SmckusickFor example, the composition 4243693Scaeloperator 4343693Scael.Sq Ic @ 4419755Smckusicktakes two functional arguments and returns a function 4519755Smckusickwhich represents their composition. 4643693Scael.Pp 4743693ScaelThere exists a single operation in 4843693Scael.Nm fp 4919755Smckusick\&\- 5043693Scael.Em application . 5119755SmckusickThis operation causes the system to evaluate the indicated function using 5243693Scaelthe single argument 5319755Smckusickas input 5419755Smckusick(all functions are monadic). 5543693Scael.Sh GETTING STARTED 5643693Scael.Pp 5743693Scael.Nm Fp 5843693Scaelinvokes the system. 5943693Scael.Nm Fp 6019755Smckusickcompiles functions into 6143693Scael.Xr lisp 1 6219755Smckusicksource code; 6343693Scael.Xr lisp 1 6419755Smckusickinterprets this code 6519755Smckusick(the user may compile this code using the 6643693Scael.Xr liszt 1 6743693Scaelcompiler to gain a factor of 10 in performance). 6843693Scael.Ic Control D 6919755Smckusickexits back to the shell. 7043693Scael.Ic Break 7119755Smckusickterminates any computation in progress and resets any open file units. 7243693Scael.Ic )help 7319755Smckusickprovides a short summary of all user commands. 7443693Scael.Sh FILES 75*50654Scael.Bl -tag -width liszt -compact 76*50654Scael.It Pa lisp 77*50654ScaelThe 78*50654Scael.Dv FRANZ LISP 79*50654Scaelinterpreter. 80*50654Scael.It Pa liszt 81*50654ScaelThe liszt compiler. 82*50654Scael.El 8343693Scael.Sh SEE ALSO 8443693Scael.Xr lisp 1 , 8543693Scael.Xr liszt 1 , 86*50654Scael.Rs 87*50654Scael.%T "The Berkeley FP user's manual" 88*50654Scael.Re 89*50654Scael.Pp 9043693ScaelThe language is described in the August 1978 issue of 9143693Scael.Em CACM 9219755Smckusick(Turing award lecture by John Backus). 9343693Scael.Sh BUGS 9419755SmckusickIf a non-terminating function is applied as the result of loading a file, 9519755Smckusickthen control is returned to the user immediately, everything 9619755Smckusickafter that position in the file is ignored. 9743693Scael.Pp 9843693Scael.Nm Fp 9943693Scaelincorrectly marks the location of a syntax error on 10019755Smckusicklarge, multi-line function definitions or applications. 10143693Scael.Sh HISTORY 102*50654ScaelThe 103*50654Scael.Nm fp 104*50654Scaelprogram appeared in 105*50654Scael.Bx 4.2 . 106