Welcome to the Dictionary of Programming Languages, a compendium
of computer coding methods assembled to provide information and
aid your appreciation for computer science history.
Browse the dictionary by clicking on a section:
A
B
C
D
E
F
G
H
I
JK
L
M
N
O
P
QR
S
T
UV
WXYZ+
Get a full dump of the dictionary:
List of Names
Short Form
Full Form
HOW TO RETURN index doc: PUT {} IN where FOR line.no IN keys doc: TREAT LINE RETURN where TREAT LINE: FOR word IN split doc[line.no]: IF word not.in keys where: PUT {} IN where[word] INSERT line.no IN where[word]
PROGRAM ONE WHEEL " Simple model of a dynamical system " written in ACSL 1, circa 1982. INITIAL CINTERVAL CINT = 0.05 ALGORITHM IALG = 4 $ "RK3" CONSTANT X1IO = 0.0, X2IO=0.0, X1DIC=0.0, X2DIC = 0.0 CONSTANT M1 = 25.0, M2=2.0, DF=100.0, K2=5000 CONSTANT TDONE = 15.0 K1 = 1000.0 END $ "OF INITIALIZATION" DYNAMIC DERIVATIVE X3= STEP(0.0) X1D = INTEG((-DF/M1)*(X1D-X2D) - (K1/M1)*(X1-X2), X1DIC) X2D = INTEG((-DF/M1)*(X1D-X2D) - (K1/M1)*(X1-X2), ... (K2/M2)*(X2-X3*5.0), X2DIC) X1 = INTEG(X1D,X1IO) X2 = INTEG(X2D,X2IO) END "OF DERIVATIVE SECTION" TERMT(T .GE. TDONE) END "OF DYNAMIC SECTION" END "OF PROGRAM"
-- simple programming with floating-point #s with Ada.Float_Text_IO; use Ada.Float_Text_IO; procedure Think is A, B : Float := 0.0; -- A and B initially zero; note the period. I, J : Integer := 1; begin A := B * 7.0; I := J * 3; B := Float(I) / A; Put(B); end Think;
/* An Alef program to parse numbers out of * the string returned from /dev/time, and * print them from a separate proc. This is * a rather lame conglomeration of several * examples from Bob Flandrea's Alef * User's Guide */ tuple(int, uint, byte*) strtoui(byte* str, int base) { int val; while(*str != 0 && whitespace(*str)) str ; if(str == nil || *str == 0) return(0, 0, str); while(*str && !whitespace(*str)) { if(!validdigit(*str, base)) return (-1, val, str 1); /* extract digit into val */ str ; } return(1, val, str); } void receive(chan(uint) c) { int s; s = <-c; print("%d\n", s); if (s == 0) terminate(nil); } void main(void) { chan(uint) c; alloc c; proc receive(c); int ret; uint val; int fd; byte *p, buf[128], *newp; fd = open("/dev/time", OREAD|OCEXEC); if (fd >= 0) { read(fd, buf, sizeof(buf)); for(p = buf; *p; p = newp) { (ret, val, newp) = strtoui(p, 10); if(ret >= 0) c <-= val; if(ret == 0) break; } } }
// the main program, calculate the mean of // some numbers begin integer N; Read Int(N); begin real array Data[1:N]; real sum, avg; integer i; sum:=0; for i:=1 step 1 until N do begin real val; Read Real(val); Data[i]:=if val<0 then -val else val end; for i:=1 step 1 until N do sum:=sum Data[i]; avg:=sum/N; Print Real(avg) end end
Here is a better example, written in the
Algol60 publication language, from
Jean Sammet courtesy of
Glyn Webster.
procedure problem (a, b); value a, b; integer a, b; begin integer k; real e; for k := 2 × (a ÷ 2) 1 step 2 until b do begin e := if prime(k) then sqrt(3 × k sin(k)) else sqrt(4 × k cos(k)); if prime(k) then putlist(k, e, 'prime') else putlist(k, e, 'nonprime') end end problem;
-- Use the Finder to close all applications -- (by Joshua D. Baer) property specialApps : {"Finder"} tell application "Finder" set allApps to name of processes end tell repeat with someParticularApp in allApps if specialApps does not contain someParticularApp then tell application someParticularApp activate quit end tell end if end repeat
;; Very simple example of interactive extension ;; for AutoCAD (Defun c:SF2ACRE () (setq SF (getreal "Enter area in square feet: ")) (setq AGREAGE (/ SF 43560.0)) (alert (strcat "\nThe area in acres is " (rtos ARGEAGE 2 2))) )
BEGIN { if ("'$#argv'"==1) Col="'$1'"; else Col=1 } {Total = $Col; }; END { printf "Total for column %d with %d items: %d\n", Col,NR,Total }
Descriptions in this dictionary are ©1997-99 Neal Ziring. Some examples copyright of their respective authors. Some technologies and languages are trademarked. Permission to copy descriptions is granted as long as authorship credit is preserved.
Comments on this dictionary, corrections and suggestions, are all welcome. Please use email, the address is ziring@home.com
[Ziring MicroWeb Home] [Dictionary Start] [Sign Guestbook]
Dictionary and script maintained by Neal Ziring, last major modifications 3/18/98. Most recent additions to dictionary and master list, 1/00.