PM adopts a clean approach to statement separation. PM
statements are formally separated by semicolons. However, these may be omitted
if the next statement starts on a new line. This is the only syntactic role for
line breaks – statements and expressions may sprawl across as many lines as you
wish. For die-hard C/C++/Java programmers, it is also possible to add a
semicolon at the end of a statement list.
a=1; b=2; c=1
x = -b + sqrt( b**2 - 4 * a * c) /
2*a
print("x="//x)
Semicolons are also used in constructors for two-dimensional
data structures: arrays and matrices.
Line breaks can be substituted for semicolons here too, enabling you to
write something like:
id_matrix = ( 1,0,0
0,1,0
0,0,1 )
Comments
Post a Comment