[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.
- space vs semicolon - why syntax error with the former ? (octave-3.4.2), Sergei Steshenko, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Ben Abbott, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Sergei Steshenko, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Ben Abbott, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Sergei Steshenko, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), CdeMills, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Sergei Steshenko, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Przemek Klosowski, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Sergei Steshenko, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), Jordi Gutiérrez Hermoso, 2011/08/16
- Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2),
Jordi Gutiérrez Hermoso <=
Re: space vs semicolon - why syntax error with the former ? (octave-3.4.2), CdeMills, 2011/08/17