3 hoc \- interactive floating point language
15 interprets a simple language for floating point arithmetic,
16 at about the level of BASIC, with C-like syntax and
21 are read and interpreted in order.
29 interprets the standard input.
32 option allows input to
34 to be specified on the command line, to be treated as if it appeared in a file.
41 Expressions are evaluated and their results printed.
42 Statements, typically assignments and function or procedure
43 definitions, produce no output unless they explicitly call
46 Variable names have the usual syntax, including
50 by itself contains the value of the last expression evaluated.
58 are predefined; the last is 59.25..., degrees per radian.
60 Expressions are formed with these C-like operators, listed by
61 decreasing precedence.
80 Built in functions are
100 reads a value into the variable
102 and returns 0 at EOF;
105 prints a list of expressions that may include
106 string constants such as
109 Control flow statements are
114 with braces for grouping.
115 Newline ends a statement.
116 Backslash-newline is equivalent to a space.
118 Functions and procedures are introduced by the words
123 is used to return with a value from a function.
127 temp = abs(a) % abs(b)
128 if(temp == 0) return abs(b)
131 for(i=1; i<12; i++) print gcd(i,12)
139 B. W. Kernighan and R. Pike,
141 The Unix Programming Environment,
144 Error recovery is imperfect within function and procedure definitions.