[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: savevtk
From: |
Levente Torok |
Subject: |
Re: savevtk |
Date: |
Wed, 17 Nov 2010 19:22:59 +0100 |
Dear Philip, Carlo and octave-dev,
I had a chance to polish things according to your commands.
However I have a few questions.
Many of the codes do not fit into this scheme but I can accept that
this is guideline for the future.
> - 2 spaces rather than tabs (but I still use tabs in my own scripts so I
> don't mind this particular one)
>
> - spaces between internal function name and left paren; no space between
> array name and left paren or bracket
>
> - functions end with "endfunction" rather than "return"
>
> - appropriate end statements: if- elseif -else - endif / for - endfor /
> while - endwhile / etc.
>
Why dont want we write code that maybe used with matlab too?
This would be a benefit for all I believe.
> - spaces after commas in argument lists (e.g., "(a, b, c)" instead of
> "(a,b,c)")
>
> - are you sure your function shouldn't return some value, for successful
> writing or not? I see no write error catching structures at all
>
> - I think you should check for the return value of fopen and perhaps also
> fprintf to see if the calls succeeded (hint: fprintf returns the number of
> characters written).
> A try-catch or unwind_protect construct could be around the fprintf
> statements to maybe avoid dangling file pointers. Upon errors and ensuing
> break out of savevtk....() the output file will probably be closed anyway
> but personally I like more graceful solutions.
>
> - comments start with # rather than %
Why is this if we support multiple type of commenting styles?
> - in the Updates: section in the headers, please add some short description
> of what the update was all about
>
> - The copyright sections in the headers seem incomplete
>
> - in savevtk.m an empty line is needed between the copyright statement and
> the texinfo header
>
> - the texinfo headers seem a bit odd to me. Have a look at e.g. the Excel or
> OpenOffice.org scripts for examples
Where are these?
>
> - would a test case or some test section be useful?
I don't know the syntax of the example however it could be something like:
n=30;
X=zeros(n,n,n);
for x=1:n
for y=1:n
for z=1:n
X(x,y,z)=1/sqrt( x*x + y*y + z*z );
endfor
endfor
endfor
Maybe someone can write the same code with matrix arithmetic I did
tackle with this.
>
> But OK, maybe I am just too picky....
>
>
> Please try to incorporate these style thingies as much as possible and
> resend them to me, OK?
Thanks,
Lev
savevtk.m
Description: Text Data
savevtkvector.m
Description: Text Data
- Re: savevtk,
Levente Torok <=