var A : array [0..9] of integer; (* Pascal *) int A[10]; /* C */(C itself also has much in common with macro-assemblers, but counts in the taxonomy of computer languages as a member of the "Algol family". See e.g. [1].)Pascal descendants include: Delphi Pascal, Modula 2, Modula 3 [2], Oberon, Oberon/2 [3], Component Pascal [4] and Free Pascal.See http://www.xploiter.com/mirrors/pascal/default.htm for a self-paced learning module on Pascal programming.

*pascal*on the Tcl'ers Chat is Pascal Scheffers

The language was named in honor to the French philosopher and mathematician Blaise Pascal, who is also known for the Pascal Triangle. Here's Tcl code that produces the next row of the triangle, given any row:

proc pascal {{lastrow ""}} { set res 1 foreach a [lrange $lastrow 1 end] b $lastrow { lappend res [expr $a+$b] } set res } ;# RS % pascal 1 %pascal 1 1 1 % pascal {1 1} 1 2 1 % pascal {1 2 1} 1 3 3 1 % pascal {1 3 3 1} 1 4 6 4 1Note that in the last foreach step, a is "" (because the shorter list has ended). expr evaluates the string +1, which returns the final 1. But the expression must not be braced, otherwise it would raise an error by expr's parser, which would not take "" for a summand...KBK: The numbers in Pascal's triangle are, of course, the binomial coefficients. Tcllib has a robust

*::math::combinatorics::choose*procedure for computing them, even for large and fractional arguments.AM See also: Pascal's triangle - as it deserves its own page :)

Pascal>TCL

Category Language