~ubuntu-branches/ubuntu/wily/gargoyle-free/wily-proposed

« back to all changes in this revision

Viewing changes to tads/tads3/test/data/replaced_in_anonfn.t

  • Committer: Bazaar Package Importer
  • Author(s): Sylvain Beucler
  • Date: 2009-09-11 20:09:43 UTC
  • Revision ID: james.westby@ubuntu.com-20090911200943-idgzoyupq6650zpn
Tags: upstream-2009-08-25
ImportĀ upstreamĀ versionĀ 2009-08-25

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *   This tests using 'replaced()' (i.e., a call to the original version of
 
3
 *   a function that was replaced with 'modify') from within an anonymous
 
4
 *   function within the modifier function. 
 
5
 */
 
6
 
 
7
main(args)
 
8
{
 
9
    myfunc();
 
10
}
 
11
 
 
12
myfunc()
 
13
{
 
14
    "This is the original myfunc().\n";
 
15
}
 
16
 
 
17
modify myfunc()
 
18
{
 
19
    "This is the replaced myfunc().\n";
 
20
    "Calling replaced()...[\n";
 
21
    replaced();
 
22
    "]... back from replaced()\n";
 
23
 
 
24
    local f = new function()
 
25
    {
 
26
        "In anon - calling replaced...[\n";
 
27
        replaced();
 
28
        "]...back in anon\n";
 
29
    };
 
30
 
 
31
    "Again, using an anonymous function...[\n";
 
32
    f();
 
33
    "]...back from anon\n";
 
34
}
 
35