My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
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
47
48
49
50
51
52
53
54
55
56
57
module TestDuckTyping
{
methods
{
DoWhatDucksDo(d : IDuck)
{
Console.WriteLine(d.Quack());
}

Main()
{
var m = new Man();
var d = new Duck();
DoWhatDucksDo(d);
DoWhatDucksDo(m);
}
}
}

interface IDuck
{
methods
{
Quack() : String;
}
}

class Man
{
methods
{
Quack() : String
{
return "quack " + Shoot();
}
Shoot() : String
{
return "bang";
}
}
}

class Duck
{
implements
{
IDuck;
}
methods
{
Quack() : String
{
return "quack";
}
}
}

Change log

r222 by cdiggins on Apr 17, 2010   Diff
I now have a compile-time code generation
example. All tests work now. Changed all
tabs to "    ". Fixed some bugs with
marsahaling of Lists. Renamed HeronTests
to UnitTests. I'm probably going to make a
release from this.
Go to: 
Project members, sign in to write a code review

Older revisions

r218 by cdiggins on Apr 10, 2010   Diff
The big deal is that "as" is no longer
necessary for duck-typing. In this set
there are a set of negative tests that
check that things fail that should
fails. Specifically in regards to null
...
r149 by cdiggins on Dec 31, 2009   Diff
Renamed HeronCodeModel.cs to
HeronCodeModelBuilder.cs. Made the
HeronCodeModelBuilder into a non-
static class. Changing how type
resolution works: the module is used
...
r144 by cdiggins on Dec 19, 2009   Diff
Renamed test files. Module names and
file names must match.
Got static method calls to work.
All revisions of this file

File info

Size: 792 bytes, 57 lines
Powered by Google Project Hosting