Mercurial > octave-nkf
annotate test/ctor-vs-method/__trace__.m @ 20595:c1a6c31ac29a
eliminate more simple uses of error_state
* ov-classdef.cc: Eliminate simple uses of error_state.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 06 Oct 2015 00:20:02 -0400 |
parents | b1283d4c06c2 |
children |
rev | line source |
---|---|
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
1 function r = __trace__ (t) |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
2 persistent history |
16213
b1283d4c06c2
test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents:
13147
diff
changeset
|
3 |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
4 if (isempty (history)) |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
5 history = {}; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
6 end |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
7 if (nargin == 0) |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
8 if (nargout == 0) |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
9 history = {}; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
10 else |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
11 r = history; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
12 end |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
13 elseif (nargin == 1); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
14 history = [history; t]; |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
15 else |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
16 error ('incorrect call to __trace__'); |
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
17 end |
16213
b1283d4c06c2
test: Use Octave coding standards for scripts in test/ directory.
Rik <rik@octave.org>
parents:
13147
diff
changeset
|
18 |
13147
6c952376482d
look for methods before constructors
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
19 end |