PageRenderTime 121ms CodeModel.GetById 40ms app.highlight 0ms RepoModel.GetById 60ms app.codeStats 0ms

/samples/oop/linkedlist.ooc

http://github.com/nddrylliog/oc
Unknown | 37 lines | 28 code | 9 blank | 0 comment | 0 complexity | b993d916a85cfb47387a88cb9f388ad8 MD5 | raw file
 1
 2
 3// : vs :=
 4
 5addConverter("ClassDecl", |comp, _class|
 6    _cover: comp createNode("CoverDecl")
 7    _metaclass: comp createNode("CoverDecl")
 8    _cover fields add("class", _metaclass)
 9    _cover fields each(|field|
10	field static? ifTrue(
11	    _cover, _metaclass
12	) add(field)
13    )
14    _cover
15)
16
17// ------------------------------------------
18
19ServerSocket: class {
20    accept: static func (port: Int) -> Socket { /* ... */ }
21}
22
23Socket: class {
24    close: func { /* ... */ }
25}
26
27// ------------------------------------------
28
29ServerSocket: cover {
30    accept: func (port: Int) -> Socket { /* ... */ }
31}
32
33Socket: cover {
34    class: cover {
35	close: func { /* ... */ }
36    }
37}