Mercurial > hg > octave-nkf
comparison src/ov-list.cc @ 3447:5c76d8f267f7
[project @ 2000-01-17 20:12:43 by jwe]
author | jwe |
---|---|
date | Mon, 17 Jan 2000 20:12:43 +0000 |
parents | 30770ba4457a |
children | 0fb75d95b14f |
comparison
equal
deleted
inserted
replaced
3446:5ee5afb3981a | 3447:5c76d8f267f7 |
---|---|
142 } | 142 } |
143 return false; | 143 return false; |
144 } | 144 } |
145 | 145 |
146 DEFUN (list, args, , | 146 DEFUN (list, args, , |
147 "list (ARGS)\n\ | 147 "-*- texinfo -*-\n\ |
148 \n\ | 148 @deftypefn {Built-in Function} {} list (@var{a1}, @var{a2}, @dots{}})\n\ |
149 Create a new list from ARGS.") | 149 Create a new list with elements given by the arguments @var{a1},\n\ |
150 @var{a2}, @dots{}.\n\ | |
151 @end deftypefn") | |
150 { | 152 { |
151 return octave_value (args); | 153 return octave_value (args); |
152 } | 154 } |
153 | 155 |
154 DEFUN (nth, args, , | 156 DEFUN (nth, args, , |
155 "nth (LIST, N)\n\ | 157 "-*- texinfo -*-\n\ |
156 \n\ | 158 @deftypefn {Built-in Function} {} nth (@var{list}, @var{n})\n\ |
157 Return the N-th element of LIST.") | 159 Return the @var{n}-th element of @var{list}.\n\ |
160 @end deftypefn") | |
158 { | 161 { |
159 octave_value retval; | 162 octave_value retval; |
160 | 163 |
161 if (args.length () == 2) | 164 if (args.length () == 2) |
162 { | 165 { |
184 | 187 |
185 return retval; | 188 return retval; |
186 } | 189 } |
187 | 190 |
188 DEFUN (append, args, , | 191 DEFUN (append, args, , |
189 "append (LIST, ARG, ...)\n\ | 192 "-*- texinfo -*-\n\ |
193 @deftypefn {Built-in Function} {} append (@var{list}, @var{a1}, @var{a2}, @dots{})\n\ | |
194 Return a new list created by appending @var{a1}, @var{a1}, @dots{}, to\n\ | |
195 @var{list}. If any of the arguments to be appended is a list, its\n\ | |
196 elements are appended individually. For example,\n\ | |
190 \n\ | 197 \n\ |
191 Return a new list created by appending each ARG to LIST. If any of\n\ | 198 @example\n\ |
192 the arguments to be appended is a list, its elements are appended\n\ | 199 x = list (1, 2);\n\ |
193 individually. For example,\n\ | 200 y = list (3, 4);\n\ |
201 append (x, y);\n\ | |
202 @end example\n\ | |
194 \n\ | 203 \n\ |
195 x = list (1, 2);\n\ | 204 @noindent\n\ |
196 y = list (3, 4);\n\ | 205 results in the list containing the four elements @samp{(1 2 3 4)}, not\n\ |
197 append (x, y);\n\ | 206 a list containing the three elements @samp{(1 2 (3 4))}.\n\ |
198 \n\ | 207 @end deftypefn") |
199 results in the list containing the four elements (1 2 3 4), not a list\n\ | |
200 containing the three elements (1 2 (3 4))") | |
201 { | 208 { |
202 octave_value retval; | 209 octave_value retval; |
203 | 210 |
204 int nargin = args.length (); | 211 int nargin = args.length (); |
205 | 212 |
227 | 234 |
228 return retval; | 235 return retval; |
229 } | 236 } |
230 | 237 |
231 DEFUN (reverse, args, , | 238 DEFUN (reverse, args, , |
232 "reverse (LIST)\n\ | 239 "-*- texinfo -*-\n\ |
233 \n\ | 240 @deftypefn {Built-in Function} {} reverse (@var{list})\n\ |
234 Return a new list created by reversing the elements of LIST") | 241 Return a new list created by reversing the elements of @var{list}.\n\ |
242 @end deftypefn") | |
235 { | 243 { |
236 octave_value retval; | 244 octave_value retval; |
237 | 245 |
238 int nargin = args.length (); | 246 int nargin = args.length (); |
239 | 247 |
249 | 257 |
250 return retval; | 258 return retval; |
251 } | 259 } |
252 | 260 |
253 DEFUN (splice, args, , | 261 DEFUN (splice, args, , |
254 "splice (LIST_1, OFFSET, LENGTH, LIST_2)\n\ | 262 "-*- texinfo -*-\n\ |
255 splice (LIST_1, OFFSET, LENGTH, LIST_2)\n\ | 263 @deftypefn {Built-in Function} {} splice (@var{list_1}, @var{offset}, @var{length}, @var{list_2})\n\ |
256 splice (LIST_1, OFFSET, LENGTH)\n\ | 264 Replace @var{length} elements of @var{list_1} beginning at\n\ |
257 splice (LIST_1, OFFSET)\n\ | 265 @var{offset} with the contents of @var{list_2} (if any). If\n\ |
258 \n\ | 266 @var{length} is omitted, all elements from @var{offset} to the end of\n\ |
259 Replace LENGTH elements of LIST_1 beginning at OFFSET with the\n\ | 267 @var{list_1} are replaced. As a special case, if @var{offset} is one\n\ |
260 contents of LIST_2 (if any). If LENGTH is omitted, all elements\n\ | 268 greater than the length of @var{list_1} and @var{length} is 0, splice\n\ |
261 from OFFSET to the end of LIST_1 are replaced. As a special case, if\n\ | 269 is equivalent to @code{append (@var{list_1}, @var{list_2}).\n\ |
262 OFFSET is one greater than the length of LIST_1 and LENGTH is 0,\n\ | 270 @end deftypefn") |
263 splice is equivalent to append (LIST_1, LIST_2)") | |
264 { | 271 { |
265 octave_value retval; | 272 octave_value retval; |
266 | 273 |
267 int nargin = args.length (); | 274 int nargin = args.length (); |
268 | 275 |