260 likes | 876 Views
ALGOL 60. ALGOL 68. INT i, j, k, m, n; REAL a, b, x, y; BOOL p, q, overflow; CHAR c; FORMAT f; BYTES r; STRING s; BITS t; COMPL w, z; REF REAL xx, yy; UNION(INT, REAL) uir; PROC VOID task1, task2; [ 1: n] REAL x1, y1; FLEX [1:n] REAL a1; [1: m, 1: n] REAL x2;
E N D
ALGOL 68 INT i, j, k, m, n; REAL a, b, x, y; BOOL p, q, overflow; CHAR c; FORMAT f; BYTES r; STRING s; BITS t; COMPL w, z; REF REAL xx, yy; UNION(INT, REAL) uir; PROC VOID task1, task2; [ 1: n] REAL x1, y1; FLEX [1:n] REAL a1; [1: m, 1: n] REAL x2; [1: n, 1: n] REAL y2; [1: n] INT i1; [1: m, 1: n ] INT i2; [1: n] COMPL z1; PROC x or y = REF REAL: IF random < .5 THEN x ELSE y FI; PROC ncos = (INT i)REAL: cos(2 * pi * i / n); PROC nsin = (INT i)REAL: sin(2 * pi * i / n); PROC finish = VOID: GO TO stop; MODE BOOK = STRUCT(STRING text, REF BOOK next); BOOK draft; princeton: grenoble: st pierre de chartreuse: kootwijk: warsaw: zandvoort: amsterdam: tirrenia: north berwick: munich: finish
SNOBOL &TRIM = 1 WORDPAT = BREAK(&LCASE &UCASE) SPAN(&LCASE &UCASE "'-") . WORD COUNT = ARRAY('3:9',0) READ LINE = INPUT :F(DONE) NEXTW LINE WORDPAT = :F(READ) COUNT<SIZE(WORD)> = COUNT<SIZE(WORD)>+ 1 :(NEXTW) DONE OUTPUT = "WORD LENGTH NUMBER OF OCCURRENCES" I = 2 PRINT I = I + 1 OUTPUT = LPAD(I,5) LPAD(COUNT<I>,20) :S(PRINT) END
SIMULA BEGIN INTEGER X, N, SUM, MAX; IF LASTITEM THEN OUTTEXT ("NULL LIST") ELSE BEGIN SUM:=MAX:=ININT; N:=1; WHILE LASTITEM DC BEGIN X:=ININT; N:=N+1; IF X > MAX THEN MAX:=X; SUM:=SUM+X; END; OUTTEXT("LIST LENGTH = "); OUTINT (N, 6); OUTTEXT(", HIGHEST = "); OUTINT (MAX, 6); OUTTEXT(", AVERAGE = "); OUTFIX (SUM/N, 2,, 8); END; OUTIMAGE; END
SHELL: PROCEDURE OPTIONS (MAIN); DECLARE ARRAY(50) FIXED BIN(15), (K,N) FIXED BIN(15); GET LIST(N); GET EDIT((ARRAY(K) DO K = 1 TO N)); PUT EDIT((ARRAY(K) DO K = 1 TO N)); CALL BUBBLE(ARRAY,N); END BUBBLE; BUBBLE: PROCEDURE(ARRAY,N); /* BUBBLE SORT*/ DECLARE (I,J) FIXED BIN(15); DECLARE S BIT(1); /* SWITCH */ DECLARE Y FIXED BIN(15); /* TEMPO */ DO I = N-1 BY -1 TO 1; S = '1'B; DO J = 1 TO I; IF X(J)>X(J+1) THEN DO; S = '0'B; Y = X(J); X(J) = X(J+1); X(J+1) = Y; END; END; IF S THEN RETURN; END; RETURN; END SRT; PL/1
ADA: Estructura de un programa ADA: Ejemplo simple
ML fun trap( a, b, n, F ) = if n <= 0 orelse b-a <= 0.0 then 0.0 else let val delta = (b-a)/real(n) in delta*(F(a)+F(a+delta))/2.0 + trap(a+delta,b,n-1,F) end;
REFERENCIAS: PETER wegner, Programing with ADA: an introduction by means of graduates examples, Prentice hall 1980, Englewood Cliffs N.Y. Vowels Robin A., Algol 60 and Fortran IV, JW & SA 1974.http://www.herts.docs/tutorialsbasic:http://www.jegsworks.com/Lessons-sp/lesson9/lesson9-2.htmC++http://www.jegsworks.com/Lessons-sp/lesson9/lesson9-2.htmCOBOLhttp://www.jegsworks.com/Lessons-sp/lesson9/lesson9-2.htmFORTRANhttp://www.geocities.com/SiliconValley/Horizon/7536/ejemplos.htm JAVA http://www.jegsworks.com/Lessons-sp/lesson9/lesson9-2.htm PASCAL http://members.tripod.com.ar/pascal/estructura_de_un_programa_en_pas.htm
REFERENCIAS: PROLOG http://www.uam.edu.ni/uam99/ingieneria/prolog/ Smalltalk http://www.dc.uba.ar/people/materias/plp/Smalltalk.html APL (A Programming Language) http://www.engin.umd.umich.edu/CIS/course.des/cis400/index.html XML (EXTENDED MARKUP LANGUAGE) http://www.programacion.net/html/xml/htmdsssl/capitulo3/capitulo3.htm PERL (Practical Extraction and Report Languaje) http://132.248.71.81/lacertus/tutorial_perl.html LENGUAJE C http://habitantes.elsitio.com/cafcocar/Lista_programas.html SNOBOL http://www.engin.umd.umich.edu/CIS/course.des/cis400/snobol/word.html ML http://cs.wwc.edu/Environment/SML-Tutorial.html PL/1 http://www.engin.umd.umich.edu/CIS/course.des/cis400/pl1/pl1bubble.html