annotate test/eval-command.tst @ 27918:b442ec6dda5c

use centralized file for copyright info for individual contributors * COPYRIGHT.md: New file. * In most other files, use "Copyright (C) YYYY-YYYY The Octave Project Developers" instead of tracking individual names in separate source files. The motivation is to reduce the effort required to update the notices each year. Until now, the Octave source files contained copyright notices that list individual contributors. I adopted these file-scope copyright notices because that is what everyone was doing 30 years ago in the days before distributed version control systems. But now, with many contributors and modern version control systems, having these file-scope copyright notices causes trouble when we update copyright years or refactor code. Over time, the file-scope copyright notices may become outdated as new contributions are made or code is moved from one file to another. Sometimes people contribute significant patches but do not add a line claiming copyright. Other times, people add a copyright notice for their contribution but then a later refactoring moves part or all of their contribution to another file and the notice is not moved with the code. As a practical matter, moving such notices is difficult -- determining what parts are due to a particular contributor requires a time-consuming search through the project history. Even managing the yearly update of copyright years is problematic. We have some contributors who are no longer living. Should we update the copyright dates for their contributions when we release new versions? Probably not, but we do still want to claim copyright for the project as a whole. To minimize the difficulty of maintaining the copyright notices, I would like to change Octave's sources to use what is described here: https://softwarefreedom.org/resources/2012/ManagingCopyrightInformation.html in the section "Maintaining centralized copyright notices": The centralized notice approach consolidates all copyright notices in a single location, usually a top-level file. This file should contain all of the copyright notices provided project contributors, unless the contribution was clearly insignificant. It may also credit -- without a copyright notice -- anyone who helped with the project but did not contribute code or other copyrighted material. This approach captures less information about contributions within individual files, recognizing that the DVCS is better equipped to record those details. As we mentioned before, it does have one disadvantage as compared to the file-scope approach: if a single file is separated from the distribution, the recipient won't see the contributors' copyright notices. But this can be easily remedied by including a single copyright notice in each file's header, pointing to the top-level file: Copyright YYYY-YYYY The Octave Project Developers See the COPYRIGHT file at the top-level directory of this distribution or at https://octave.org/COPYRIGHT.html. followed by the usual GPL copyright statement. For more background, see the discussion here: https://lists.gnu.org/archive/html/octave-maintainers/2020-01/msg00009.html Most files in the following directories have been skipped intentinally in this changeset: doc libgui/qterminal liboctave/external m4
author John W. Eaton <jwe@octave.org>
date Mon, 06 Jan 2020 15:38:17 -0500
parents 05fc703b419a
children 1891570abac8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26662
diff changeset
1 ## Copyright (C) 2013-2019 The Octave Project Developers
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26662
diff changeset
2 ##
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26662
diff changeset
3 ## See the file COPYRIGHT.md in the top-level directory of this distribution
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26662
diff changeset
4 ## or <https://octave.org/COPYRIGHT.html/>.
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26662
diff changeset
5 ##
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
6 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
7 ## This file is part of Octave.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
8 ##
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23221
diff changeset
9 ## Octave is free software: you can redistribute it and/or modify it
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
10 ## under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23221
diff changeset
11 ## the Free Software Foundation, either version 3 of the License, or
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
12 ## (at your option) any later version.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
13 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
14 ## Octave is distributed in the hope that it will be useful, but
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
15 ## WITHOUT ANY WARRANTY; without even the implied warranty of
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
17 ## GNU General Public License for more details.
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
18 ##
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
19 ## You should have received a copy of the GNU General Public License
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
20 ## along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23221
diff changeset
21 ## <https://www.gnu.org/licenses/>.
22799
592fa741e0aa add missing copyright notices (bug #49624)
John W. Eaton <jwe@octave.org>
parents: 17913
diff changeset
22
26662
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
23 %!function r = sigma (opt)
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
24 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
25 %! if (nargin == 0)
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
26 %! sigma_call = "function";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
27 %! r = 1;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
28 %! elseif (ischar (opt))
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
29 %! sigma_call = "command";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
30 %! r = 1;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
31 %! else
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
32 %! sigma_call = "unexpected";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
33 %! endif
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
34 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
35 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
36 %!function f1 ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
37 %! ## ERROR; sigma used as variable and later parsed as command
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
38 %! sigma = svd (1);
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
39 %! eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
40 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
41 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
42 %!function f1a ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
43 %! ## Assignment of eval result means eval code is not parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
44 %! sigma = svd (1);
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
45 %! val = eval ("sigma -1;");
16360
11115c237231 recognize variables when parsing (bug #38576)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 %!endfunction
26662
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
47 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
48 %!function f2 ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
49 %! ## ERROR; sigma used as variable and later parsed as command
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
50 %! [u, sigma, v] = svd (1);
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
51 %! eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
52 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
53 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
54 %!function f2a ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
55 %! ## Assignment of eval result means eval code is not parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
56 %! [u, sigma, v] = svd (1);
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
57 %! val = eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
58 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
59 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
60 %!function f3 (sigma)
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
61 %! ## No assignment of eval result means eval code is parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
62 %! ## If f3 is called with a value for sigma, it will be used. Otherwise,
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
63 %! ## search for the function sigma and call with no arguments.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
64 %! eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
65 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
66 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
67 %!function f3a (sigma)
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
68 %! ## Assignment of eval result means eval code is not parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
69 %! val = eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
70 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
71 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
72 %!function f4 ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
73 %! ## No assignment of eval result means eval code is parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
74 %! eval ("sigma -1;");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
75 %!endfunction
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
76 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
77 %!function f4a ()
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
78 %! ## Assignment of eval result means eval code is not parsed as command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
79 %! val = eval ("sigma -1;");
16360
11115c237231 recognize variables when parsing (bug #38576)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 %!endfunction
26662
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
81 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
82 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
83 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
84 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
85 %! ## Matlab complains about sigma previously being used as a variable
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
86 %! ## before being used as a command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
87 %! fail ("f1 ()", "used as variable and later as function");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
88 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
89 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
90 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
91 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
92 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
93 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
94 %! f1a ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
95 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
96 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
97 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
98 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
99 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
100 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
101 %! ## Matlab complains about sigma previously being used as a variable
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
102 %! ## before being used as a command.
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
103 %! fail ("f2 ()", "used as variable and later as function");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
104 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
105 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
106 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
107 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
108 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
109 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
110 %! f2a ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
111 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
112 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
113 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
114 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
115 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
116 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
117 %! f3 ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
118 %! assert (sigma_call, "command");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
119 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
120 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
121 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
122 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
123 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
124 %! f3a ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
125 %! assert (sigma_call, "function");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
126 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
127 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
128 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
129 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
130 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
131 %! ## NOTE: this result disagrees with Matlab, which evaluates sigma
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
132 %! ## as a command-style function even though there is a variable named
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
133 %! ## sigma defined in the workspace prior to evaluating the function
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
134 %! ## call (compare with f1() and f2() above).
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
135 %! fail ("f3 (1)", "used as variable and later as function");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
136 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
137 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
138 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
139 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
140 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
141 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
142 %! f3a (1);
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
143 %! assert (sigma_call, "none");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
144 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
145 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
146 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
147 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
148 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
149 %! f4 ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
150 %! assert (sigma_call, "command");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
151 %! clear -global sigma_call
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
152 %!
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
153 %!test <55610>
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
154 %! global sigma_call;
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
155 %! sigma_call = "none";
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
156 %! f4a ();
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
157 %! assert (sigma_call, "function");
05fc703b419a update handling of command-style function call syntax in eval
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
158 %! clear -global sigma_call