Mercurial > hg > octave-lyh
annotate doc/interpreter/contrib.txi @ 8202:cf59d542f33e
replace all TODOs and XXXs with FIXMEs
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Wed, 08 Oct 2008 20:00:25 +0200 |
parents | 837487bd3450 |
children | a9da991c77aa |
rev | line source |
---|---|
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
1 @c Copyright (C) 2008 Jaroslav Hajek <highegg@gmail.com> |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
2 @c |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
3 @c This file is part of Octave. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
4 @c |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
5 @c Octave is free software; you can redistribute it and/or modify it |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
6 @c under the terms of the GNU General Public License as published by the |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
7 @c Free Software Foundation; either version 3 of the License, or (at |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
8 @c your option) any later version. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
9 @c |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
10 @c Octave is distributed in the hope that it will be useful, but WITHOUT |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
11 @c ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
12 @c FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
13 @c for more details. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
14 @c |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
15 @c You should have received a copy of the GNU General Public License |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
16 @c along with Octave; see the file COPYING. If not, see |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
17 @c <http://www.gnu.org/licenses/>. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
18 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
19 @node Contributing Guidelines |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
20 @appendix Contributing Guidelines |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
21 @cindex coding standards |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
22 @cindex Octave development |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
23 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
24 This chapter is dedicated to those who wish to contribute code to Octave. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
25 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
26 @menu |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
27 * How to Contribute:: How you may start contributing code. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
28 * General Guidelines:: Advices applicable to any type of source. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
29 * Octave Sources (m-files):: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
30 * C++ Sources:: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
31 * Other Sources:: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
32 @end menu |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
33 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
34 @node How to Contribute |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
35 @section How to Contribute |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
36 The mailing list for Octave development discussion and sending contributions is |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
37 @email{maintainers@@octave.org}. This concerns the development of Octave core, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
38 i.e. code that goes to Octave directly. You may consider developing and |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
39 publishing a package instead; a great place for this is the allied Octave-Forge |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
40 project (@url{http://octave.sf.net}). Note that the Octave project is |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
41 inherently more conservative and follows narrower rules. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
42 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
43 The preferable form of contribution is creating a Mercurial changeset and |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
44 sending it via e-mail to the octave-maintainers mailing list. Mercurial is the |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
45 source code management system currently used to develop Octave. Other forms of |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
46 contributions (e.g. simple diff patches) are also acceptable, but they slow |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
47 down the review process. If you want to make more contributions, you should |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
48 really get familiar with Mercurial. A good place to start is |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
49 @url{http://www.selenic.com/mercurial/wiki/index.cgi/Tutorial}. There you will |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
50 also find help how to install Mercurial. |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
51 |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
52 A simple contribution sequence could look like this: |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
53 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
54 hg clone http://www.octave.org/hg/octave |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
55 # make a local copy of the octave |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
56 # source repository |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
57 cd octave |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
58 # change some sources... |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
59 hg commit -m "make Octave the coolest software ever" |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
60 # commit the changeset into your |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
61 # local repository |
8177
65c4ac814082
hg syntax bug in mercurial example
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8055
diff
changeset
|
62 hg export -o ../cool.diff tip |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
63 # export the changeset to a diff |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
64 # file |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
65 # send ../cool.diff via email |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
66 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
67 |
8200
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
68 You may want to get familiar with Mercurial queues to manage your changesets. |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
69 Here is a slightly less simple example using Mercurial queues, where you work |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
70 on two unrelated changesets in parallel and update one of the changesets after |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
71 discussion in the maintainers mailing list: |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
72 @example |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
73 hg qnew nasty_bug # create a new patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
74 # change sources... |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
75 hg qref # save the changes into the patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
76 # change even more... |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
77 hg qref -m "solution to nasty bug!" |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
78 # save again with commit message |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
79 hg export -o ../nasty.diff tip |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
80 # export the patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
81 # send ../nasty.diff via email |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
82 hg qpop # undo the application of the patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
83 # and remove the changes from the |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
84 # source tree |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
85 hg qnew doc_improvements # create an unrelated patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
86 # change doc sources... |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
87 hg qref -m "could not find myfav.m in the doc" |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
88 # save the changes into the patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
89 hg export -o ../doc.diff tip |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
90 # export the second patch |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
91 # send ../doc.diff tip via email |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
92 hg qpop |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
93 # discussion in the maintainers mailing list ... |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
94 hg gpush nasty_bug # apply the patch again |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
95 # change sources yet again ... |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
96 hg qref |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
97 hg export -o ../nasty2.diff tip |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
98 # send ../nasty2.diff via email |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
99 @end example |
837487bd3450
help new contributors with mercurial
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
8177
diff
changeset
|
100 |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
101 @node General Guidelines |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
102 @section General Guidelines |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
103 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
104 All Octave's sources are distributed under the General Public License (GPL). |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
105 Currently, Octave uses GPL version 3. For details about this license, see |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
106 @url{http://www.gnu.org/licenses/gpl.html}. Therefore, whenever you create a |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
107 new source file, it should have the following comment header (use appropriate |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
108 year, name and comment marks): |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
109 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
110 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
111 ## Copyright (C) 1996, 1997, 2007 John W. Eaton <jwe@@bevo.che.wisc.edu> |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
112 ## |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
113 ## This file is part of Octave. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
114 ## |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
115 ## Octave is free software; you can redistribute it and/or |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
116 ## modify it under the terms of the GNU General Public |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
117 ## License as published by the Free Software Foundation; |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
118 ## either version 3 of the License, or (at your option) any |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
119 ## later version. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
120 ## |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
121 ## Octave is distributed in the hope that it will be useful, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
122 ## but WITHOUT ANY WARRANTY; without even the implied |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
123 ## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
124 ## PURPOSE. See the GNU General Public License for more |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
125 ## details. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
126 ## |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
127 ## You should have received a copy of the GNU General Public |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
128 ## License along with Octave; see the file COPYING. If not, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
129 ## see <http://www.gnu.org/licenses/>. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
130 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
131 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
132 Always include ChangeLog entries in changesets. After making your source |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
133 changes, record and briefly describe the changes in the nearest ChangeLog file |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
134 upwards in the directory tree. Use the previous entries as a template. Your |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
135 entry should contain your name and email, and the path to the modified source |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
136 file relative to the parent directory of the ChangeLog file. If there are more |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
137 functions in the file, you should also include the name of the modified function |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
138 (in parentheses after file path). Example: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
139 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
140 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
141 2008-04-02 David Bateman <dbateman@@free.fr> |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
142 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
143 * graphics.cc (void gnuplot_backend::close_figure (const |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
144 octave_value&) const): Allow for an input and output stream. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
145 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
146 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
147 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
148 The ChangeLog entries should describe what is changed, not why. The reason of |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
149 the change should appear in the commit message. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
150 |
8202
cf59d542f33e
replace all TODOs and XXXs with FIXMEs
Jaroslav Hajek <highegg@gmail.com>
parents:
8200
diff
changeset
|
151 The preferred comment mark for places that may need further attention is FIXME. |
cf59d542f33e
replace all TODOs and XXXs with FIXMEs
Jaroslav Hajek <highegg@gmail.com>
parents:
8200
diff
changeset
|
152 |
8055
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
153 @node Octave Sources (m-files) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
154 @section Octave Sources (m-files) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
155 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
156 Don't use tabs. Tabs cause trouble. If you are used to them, set up your editor |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
157 so that it converts tabs to spaces. Indent the bodies of the statement blocks. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
158 Recommended indent is 2 spaces. When calling functions, put spaces after commas |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
159 and before the calling parentheses, like this: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
160 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
161 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
162 x = max (sin (y+3), 2); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
163 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
164 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
165 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
166 An exception are matrix and vector constructors: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
167 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
168 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
169 [sin(x), cos(x)] |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
170 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
171 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
172 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
173 Here, putting spaces after @code{sin}, @code{cos} would result in a parse error. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
174 In indexing expression, do not put a space after the identifier (this |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
175 differentiates indexing and function calls nicely). The space after comma is not |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
176 necessary if index expressions are simple, i.e. you may write |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
177 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
178 A(:,i,j) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
179 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
180 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
181 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
182 but |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
183 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
184 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
185 A([1:i-1;i+1:n], XI(:,2:n-1)) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
186 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
187 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
188 Use lowercase names if possible. Uppercase is acceptable for variable names |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
189 consisting of 1-2 letters. Do not use mixed case names. Function names must be |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
190 lowercase. Function names are global, so choose them wisely. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
191 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
192 Always use a specific end-of-block statement (like @code{endif}, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
193 @code{endswitch}) rather than generic @code{end}. Enclose the @code{if}, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
194 @code{while}, @code{until} and @code{switch} conditions in parentheses, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
195 like in C: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
196 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
197 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
198 if (isvector (a)) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
199 s = sum(a); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
200 endif |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
201 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
202 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
203 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
204 Do not do this, however, with @code{for}: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
205 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
206 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
207 for i = 1:n |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
208 b(i) = sum (a(:,i)); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
209 endfor |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
210 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
211 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
212 @node C++ Sources |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
213 @section C++ Sources |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
214 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
215 Don't use tabs. Tabs cause trouble. If you are used to them, set up your editor |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
216 so that it converts tabs to spaces. Format function headers like this: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
217 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
218 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
219 static bool |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
220 matches_patterns (const string_vector& patterns, int pat_idx, |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
221 int num_pat, const std::string& name) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
222 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
223 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
224 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
225 The function name should start in column 1, and multi-line argument lists should |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
226 be aligned on the first char after the open parenthesis. You should put a space |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
227 after the left open parenthesis and after commas, for both function definitions |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
228 and function calls. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
229 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
230 Recommended indent is 2 spaces. When indenting, indent the statement after |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
231 control structures (like @code{if}, @code{while} etc.). If there is a compound |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
232 statement, indent @i{both} the curly braces and the body of the statement (so |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
233 that the body gets indented by @i{two} indents). Example: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
234 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
235 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
236 if (have_args) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
237 @{ |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
238 idx.push_back (first_args); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
239 have_args = false; |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
240 @} |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
241 else |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
242 idx.push_back (make_value_list (*p_args, *p_arg_nm, &tmp)); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
243 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
244 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
245 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
246 If you have nested @code{if} statements, use extra braces for extra |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
247 clarification. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
248 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
249 Split long expressions in such a way that a continuation line starts with an |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
250 operator rather than identifier. If the split occurs inside braces, continuation |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
251 should be aligned with the first char after the innermost braces enclosing the |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
252 split. Example: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
253 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
254 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
255 SVD::type type = ((nargout == 0 || nargout == 1) |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
256 ? SVD::sigma_only |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
257 : (nargin == 2) ? SVD::economy : SVD::std); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
258 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
259 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
260 @noindent |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
261 Consider putting extra braces around a multiline expression to make it more |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
262 readable, even if they are not necessary. Also, do not hesitate to put extra |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
263 braces anywhere if it improves clarity. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
264 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
265 Try declaring variables just before they're needed. Use local variables of |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
266 blocks - it helps optimization. Don't write multi-line variable declaration |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
267 with a single type specification and multiple variables. If the variables don't |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
268 fit on single line, repeat the type specification. Example: |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
269 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
270 @example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
271 octave_value retval; |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
272 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
273 octave_idx_type nr = b.rows (); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
274 octave_idx_type nc = b.cols (); |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
275 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
276 double d1, d2; |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
277 @end example |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
278 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
279 Use lowercase names if possible. Uppercase is acceptable for variable names |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
280 consisting of 1-2 letters. Do not use mixed case names. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
281 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
282 Try to use Octave's types and classes if possible. Otherwise, try to use C++ |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
283 standard library. Use of STL containers and algorithms is encouraged. Use |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
284 templates wisely to reduce code duplication. Avoid comma expressions, labels |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
285 and gotos, and explicit typecasts. If you need to typecast, use the modern C++ |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
286 casting operators. In functions, try to reduce the number of @code{return} |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
287 statements - use nested @code{if} statements if possible. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
288 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
289 @node Other Sources |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
290 @section Other Sources |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
291 Apart from C++ and Octave language (m-files), Octave's sources include files |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
292 written in C, Fortran, M4, perl, unix shell, AWK, texinfo and TeX. There are |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
293 not many rules to follow when using these other languages; some of them are |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
294 summarized below. In any case, the golden rule is: if you modify a source |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
295 file, try to follow any conventions you can detect in the file or other similar |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
296 files. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
297 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
298 For C you should obviously follow all C++ rules that can apply. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
299 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
300 If you happen to modify a Fortran file, you should stay within Fortran 77 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
301 with common extensions like @code{END DO}. Currently, we want all sources |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
302 to be compilable with the f2c and g77 compilers, without special flags if |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
303 possible. This usually means that non-legacy compilers also accept the sources. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
304 |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
305 The M4 macro language is mainly used for autoconf configuration files. You should |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
306 follow normal M4 rules when contributing to these files. Some M4 files come |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
307 from external source, namely the Autoconf archive @url{http://autoconf-archive.cryp.to}. |
d51c3541be28
contrib.txi: new documentation for contributors
Jaroslav Hajek <highegg@gmail.com>
parents:
diff
changeset
|
308 |