1
1
Fork
You've already forked hoc6
0
The hoc interpreter extracted from UNIX v10
C 61.2%
Yacc 28.8%
Roff 7.7%
Makefile 1.8%
Perl 0.5%
Find a file
2025年04月11日 13:44:07 +02:00
tests Extract the unit tests 2024年11月30日 20:14:58 +01:00
.gitignore Add gitignore 2024年11月28日 15:04:02 +01:00
code.c Always read() from stdin 2024年11月30日 19:43:45 +01:00
FIXES Initial import from Reasearch UNIX v10 sources 2024年10月03日 22:27:05 +02:00
hoc.1 Initial import from Reasearch UNIX v10 sources 2024年10月03日 22:27:05 +02:00
hoc.1.orig Initial import from Reasearch UNIX v10 sources 2024年10月03日 22:27:05 +02:00
hoc.h Convert sources to C89 2024年11月28日 15:04:02 +01:00
hoc.y Use the program's basename in error messages 2025年04月11日 13:44:07 +02:00
init.c Convert sources to C89 2024年11月28日 15:04:02 +01:00
makefile Extract the unit tests 2024年11月30日 20:14:58 +01:00
math.c Add missing include for strerror(3) 2025年04月11日 13:25:58 +02:00
permission Initial import from Reasearch UNIX v10 sources 2024年10月03日 22:27:05 +02:00
README Improve README 2024年11月28日 22:59:17 +01:00
symbol.c Convert sources to C89 2024年11月28日 15:04:02 +01:00
y.tab.h Fix int-to-pointer-cast warnings 2024年11月28日 22:59:17 +01:00

This is hoc, the High Order Calculator, first described in
"The UNIX Programming Environment" by Brian W. Kernighan & Rob Pike (1984).
If you are not familiar with hoc, take a look at its Wikipedia page:
https://en.wikipedia.org/wiki/Hoc_(programming_language)
This version has been extracted from Research UNIX v10, and slightly
modernized to compile with modern compilers.
Build requirements: a c89 compiler, yacc (or bison), make.
-- original readme below --
Changes since the book version:
1. The variable "_" contains the result of the last
top-level expression evaluation, so you can re-use
intermediate values without re-typing them.
2. for statement added, just like the one in C.
3. ++ and -- added.
4. Interrupts are caught; use cntrl-D to quit.
5. % operator added.
6. +=, -=, etc., added.
7. \ at end of line eats newline
8. results are 16 digits
9. tabs on output are no longer
Jun 1990:
10.	asin, acos, sinh, cosh, tanh, erf, erfc