[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Whitespace question, [zeros (1, 2), ones (1, 2)]
From: |
Steve C. Thompson |
Subject: |
Whitespace question, [zeros (1, 2), ones (1, 2)] |
Date: |
Sat, 5 Nov 2005 16:09:27 -0800 |
User-agent: |
Mutt/1.5.9i |
Hi,
In my continuing pursuit in figuring out how to write programs
that don't suck, and are readable and consistent, I've ran into a
whitespace problem. A toy example:
octave:1> ones (1, 2)
ans =
1 1
octave:2> zeros (1, 2)
ans =
0 0
octave:3> [ones (1, 2), zeros (1, 2)]
parse error:
syntax error
>>> [ones (1, 2), zeros (1, 2)]
^
octave:3> [ones(1, 2), zeros(1, 2)]
ans =
1 1 0 0
So, the whitespace in `[ones (1, 2), zeros (1, 2)]' causes
problem. Should I just forget about whitespace between functions
and ()s? I personally like the whitespace; I think that it aids
in readability. However, I want to stick to a rule that will
work unconditionally. (And, for my current collaboration
efforts, I require strict MATLAB compatibility [sigh].)
Thanks for any advice and suggestions you might have.
Steve
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Whitespace question, [zeros (1, 2), ones (1, 2)],
Steve C. Thompson <=