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
a = { 'name' : 'Test' }
b = a->name;
a->name = 'New';
io.writeln( b, a, std.about(a) );

a->meth = routine( self : map<string,string> )
{
for( it in self ) io.writeln( it )
}
a->meth();

c = { 'index' : 123 }
c->__proto__ = a;
io.writeln( c->name, c );

class Test{}
t = Test();

t->value = 123;
io.writeln( t->value );

t->__proto__ = c;

io.writeln( t->name, t->index );

Change log

ecb38678abf4 by Limin Fu <phoolimin> on Jun 3, 2010   Diff
Add: meta fields to support prototype-
based programming;
Add: meta field operator ->, VM
instructions GETMF, SETMF.
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 375 bytes, 24 lines
Powered by Google Project Hosting