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

« back to all changes in this revision

Viewing changes to tads/tads3/test/data/mod_obj.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
#include "tads.h"
 
2
 
 
3
corePrint(val, obj)
 
4
{
 
5
    tadsSay('core: val=<');
 
6
    tadsSay(val);
 
7
    tadsSay('>\n');
 
8
}
 
9
 
 
10
modify Object
 
11
    print(x)
 
12
    {
 
13
        corePrint(x, self);
 
14
    }
 
15
;
 
16
 
 
17
modify Collection
 
18
    print(x)
 
19
    {
 
20
        tadsSay('collection: val=<');
 
21
        tadsSay(x);
 
22
        tadsSay('>self=[');
 
23
        local first = true;
 
24
        foreach (local obj in self)
 
25
        {
 
26
            if (!first) tadsSay(',');
 
27
            first = nil;
 
28
            tadsSay(obj);
 
29
        }
 
30
        tadsSay(']\n');
 
31
    }
 
32
;
 
33
 
 
34
myObj: object
 
35
    foo = nil
 
36
;
 
37
 
 
38
main(args)
 
39
{
 
40
    myObj.print('hello');
 
41
    [1, 2, 3].print('bye');
 
42
}
 
43