0README hoc6 |-- 0NOTE obvious |-- 0README obvious |-- Makefile makefile (mods) |-- hoc executable for mac os x 10.3 |-- hoc.1 man page paolucci |-- hoc.1.txt man page paolucci |-- hoc.ms documentation (mods) |-- hoc.ms.ps documentation groff |-- hoc.ms.txt documentation groffer |-- makeapp format code files for troff |-- code.c source file (mods) |-- hoc.h source file (mods) |-- hoc.y source file (mods) |-- init.c source file |-- math.c source file |-- symbol.c source file |-- ack test function/proc |-- ack1 test function/proc |-- double test function/proc |-- fac test function/proc |-- fac1 test function/proc |-- fac2 test function/proc |-- fib test function/proc |-- fib2 test function/proc |-- fibsum test function/proc |-- fibtest test function/proc `-- mbox email left in directory by bwk NAME hoc - interactive floating point language SYNOPSIS hoc [ file ... ] DESCRIPTION Hoc interprets a simple language for floating point arithmetic, at about the level of BASIC, with C-like syntax and functions and proce- dures with arguments and recursion. The named files are read and interpreted in order. If no file is given or if file is `-' hoc interprets the standard input. Hoc input consists of expressions and statements. Expressions are evaluated and their results printed. Statements, typically assignments and function or procedure definitions, produce no output unless they explicitly call print. SEE ALSO bc(1) and dc(1). Hoc was published by Kernighan and Pike, during the AT&T-BSD years of C and Unix. It is a primer for use of yacc (now bison) and a grammar. Given progs such as R (nee S), hoc is no longer useful (it never was widely used, AFAIK). But as a tutorial, and as part of C-Unix history, hoc lives! The sources are from Brian Kernighan's website: http://www.cs.bell-labs.com/who/bwk/index.html Others have typed in the code. The man pages hoc.1.txt and hoc.1 are from a posting by: Dr. Samuel Paolucci The changes to adapt code to irix and to macosx are detailed in 0NOTE. The code is old k&r - obviously... ==> lots of warnings on decl, etc. Tests: Ackermann's function: hoc ack prints result and number of (recursive) calls to ack(), for ack(3,3) hoc ack1 - waits for user input of two integers, x and y prints result and number of (recursive) calls to ack(), for ack(x,y) Factorial function; hoc fac2 prints factorial for integers 0 through 20 Fibonacci series: hoc fib - waits for user input: "fib(yinput)", with integer yinput prints Fibonacci series for starting values (0,1) up to (x,y), y