annotate test/bug-52851/script2.m @ 33658:b1d6e40ac737 stable tip

NEWS.9.md: Fix typo and minor formatting changes. * etc/NEWS.9.md: Fix typo. Adjust whitespace. Use markdown syntax for code snippets.
author Markus Mützel <markus.muetzel@gmx.de>
date Wed, 05 Jun 2024 11:27:35 +0200
parents d45d1b4bb919
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28698
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 1; %script identifier
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 function r = caller (fun)
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 r = fun ();
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 endfunction
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 function r = computation ()
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 r = 1;
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 endfunction
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 r1 = caller (@computation);
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 function r = computation ()
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 r = 2;
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 endfunction
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
d45d1b4bb919 allow functions to be redefined in scripts (bug #52851)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 r2 = caller (@computation);