help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: space vs semicolon - why syntax error with the former ? (octave-3.4.


From: Jordi Gutiérrez Hermoso
Subject: Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2)
Date: Tue, 16 Aug 2011 10:40:16 -0500

A newline is the end of a statement. If you want to end statements in
the same line, you use semicolons or commas. You always use semicolons
if you want to end a statement and not echo its result and commas if
you don't.

Octave is hardly the only language that works this way; bash comes to
mind as another language where you need to write, e.g.

     for i in *; do foo $i; done; echo "done"

and if you miss the semicolon after done, it's a syntax error in bash,
similar to Octave.

HTH,
- Jordi G. H.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]