Mercurial > octave
comparison libinterp/parse-tree/pt-eval.cc @ 32906:3904d7116c8c bytecode-interpreter
maint: Merge default to byte-codeinterpreter.
author | Nicholas R. Jankowski <jankowski.nicholas@gmail.com> |
---|---|
date | Thu, 01 Feb 2024 23:34:35 -0500 |
parents | dc3ff08bfd3f 81d1512a47cb |
children | e6814a319d4e |
comparison
equal
deleted
inserted
replaced
32901:f4d7e6efb2e9 | 32906:3904d7116c8c |
---|---|
2286 @result{} 4 | 2286 @result{} 4 |
2287 @var{x}(end,end) | 2287 @var{x}(end,end) |
2288 @result{} 6 | 2288 @result{} 6 |
2289 @end group | 2289 @end group |
2290 @end example | 2290 @end example |
2291 | |
2292 Programming notes: | |
2293 @enumerate | |
2294 @item | |
2295 The @code{end} keyword cannot be used within @code{subsref}, | |
2296 @code{subsasgn}, or @code{substruct} for manual indexing operations. | |
2297 | |
2298 @item | |
2299 For custom classes, to enable use of @code{end} in indexing expressions it | |
2300 must be overloaded with a function definition such as: | |
2301 @example | |
2302 @group | |
2303 function last_index = end (obj, end_dim, ndim_obj) | |
2304 if (end_dim == ndim_obj) | |
2305 last_index = prod (size (obj)(end_dim:ndim_obj)); | |
2306 else | |
2307 last_index = size (obj, end_dim); | |
2308 endif | |
2309 endfunction | |
2310 @end group | |
2311 @end example | |
2312 For more information see | |
2313 @ref{Object Oriented Programming, , Object Oriented Programming}. | |
2314 @end enumerate | |
2315 | |
2291 @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect} | 2316 @seealso{for, parfor, if, do, while, function, switch, try, unwind_protect} |
2292 @end deftypefn */) | 2317 @end deftypefn */) |
2293 { | 2318 { |
2294 tree_evaluator& tw = interp.get_evaluator (); | 2319 tree_evaluator& tw = interp.get_evaluator (); |
2295 | 2320 |