Multi-programming-language "cookbook", control/paradigms (Chapter 4)
Table of contents:
- flow of control, decisions, loops
- [mapping across collections] -- Stub: mapping down a sequence (vector or linked-list) or across all elements of other types of collections
- [enumerations/iterators, continuations/streams, pipes, filters]
- [generic functions, operator/function overloading]
- [instance methods]
- [classes, interfaces, inheritance]
- [multi-processing, threads]
- [RPC (remote procedure call), RMI (remote method invocation)]
(Link back to main file with table of contents)
Flow of control, decisions, loops
Ordinary blocks of statements that don't return values were already
discussed earlier, and if-then statements
and expressions, loops, were all discussed
earlier. Here I'll just
include one more item not mentionned before:
Execute a sequence of statements/expressions in sequence, passing the
value of the last expression up to be the value of the overall expression:
- c, c++ -- stmt1, stmt2, ... stmty, expressionz (typically used inside the keepGoing test within if statements and while statements)
- lisp -- (progn stmt1 stmt2 ... stmty expressionz) (used all over the place, and implicit in many other constructs such as defun, let, cond, when, unless, etc.
Stub: more complete discussion of if/then/else and COND (lisp only)
Stub: more complete discussion of PROG and its component parts
Stub: case/switch/select statements
Stub: using ASSOC to emulate case/switch/select statement (lisp only)
Stub: new LOOP macro (Common Lisp only)
how to contact me
Copyright 2007 by Robert Elton Maas, all rights reserved