My favorites | Sign in
dao
Project Home Downloads Wiki Issues Source
Repository:
Checkout   Browse   Changes   Clones    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

interface AA
{
routine Meth( a = 0 );
operator[]( index : int )=>int;
operator.name()=>string;

routine __for_iterator__( iter : for_iterator );
operator[]( iter : for_iterator )=>int;
}
routine Test( o : AA )
{
io.writeln( 'Test( o : AA )', std.about(o) );
o.Meth( 123 );
io.writeln( o[1] );
io.writeln( o.name );
for( i in o ) io.writeln(i)
}

class BB
{
routine Meth( a = 0 ){ io.writeln( a ) }
operator[]( index : int ){ return index }
operator.name(){ return 'BB' }

routine __for_iterator__( iter : for_iterator ){
iter.valid = 1;
iter.iterator = 0;
}
operator[]( iter : for_iterator ){
id = (int)iter.iterator;
iter.valid = id + 1 < 5;
iter.iterator = id + 1;
return id;
}
}
class CC : BB
{
}

bind AA to BB;

Test( BB() );
Test( CC() );

for( i in BB() ) io.writeln(i)

Change log

007cd68e13b8 by Limin Fu <phoolimin> on Dec 29, 2011   Diff
Add: runtime Dao routine specialization.
Go to: 
Project members, sign in to write a code review

Older revisions

74d33085cb37 by Limin Fu <phoolimin> on Feb 6, 2011   Diff
Remove: DaoNameSpace_SetupType() and
DaoNameSpace_SetupTypes() from dao.h;
Fix: handling of default class
instance for template classes;
Fix: a few new compiling bugs.
4bddef252abb by Limin Fu <phoolimin> on Nov 6, 2010   Diff
Change: DVM_GETC and DVM_GETV (to
prepare for better namespace and class
support);
Minor Fix: a bug in raising warning
exception.
3b132ebd6aff by Limin Fu <phoolimin> on Nov 6, 2010   Diff
Minor Fix: constant folding for
symbols;
Minor Change: compiling error
reporting for interface;
All revisions of this file

File info

Size: 807 bytes, 46 lines
Powered by Google Project Hosting