Skip to content

Commit d7f131b

Browse files
committed
---
yaml --- r: 34387 b: refs/heads/snap-stage3 c: 1330b1c h: refs/heads/master i: 34385: 6b18f4d 34383: c186c12 v: v3
1 parent 677e6a4 commit d7f131b

File tree

3 files changed

+60
-1
lines changed

3 files changed

+60
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 1bc51f172863bf9731f39b71e2e6a6db76707aa5
4+
refs/heads/snap-stage3: 1330b1cdf569f8ea5eaec74301125fde32884d62
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
struct HTMLImageData {
2+
mut image: Option<~str>
3+
}
4+
5+
struct ElementData {
6+
kind: ~ElementKind
7+
}
8+
9+
enum ElementKind {
10+
HTMLImageElement(HTMLImageData)
11+
}
12+
13+
enum NodeKind {
14+
Element(ElementData)
15+
}
16+
17+
enum NodeData = {
18+
kind: ~NodeKind
19+
};
20+
21+
fn main() {
22+
let id = HTMLImageData { image: None };
23+
let ed = ElementData { kind: ~HTMLImageElement(id) };
24+
let n = NodeData({kind : ~Element(ed)});
25+
match n.kind {
26+
~Element(ed) => match ed.kind {
27+
~HTMLImageElement(d) if d.image.is_some() => { true }
28+
},
29+
_ => fail ~"WAT" //~ ERROR wat
30+
};
31+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
extern mod std;
2+
3+
use pipes::Chan;
4+
5+
type RingBuffer = ~[float];
6+
type SamplesFn = fn~ (samples: &RingBuffer);
7+
8+
enum Msg
9+
{
10+
GetSamples(~str, SamplesFn), // sample set name, callback which receives samples
11+
}
12+
13+
fn foo(name: ~str, samples_chan: Chan<Msg>) {
14+
do task::spawn
15+
|copy name|
16+
{
17+
let callback: SamplesFn =
18+
|buffer|
19+
{
20+
for uint::range(0, buffer.len())
21+
|i| {error!("%?: %f", i, buffer[i])}
22+
};
23+
samples_chan.send(GetSamples(copy name, callback));
24+
};
25+
}
26+
27+
fn main() {}
28+

0 commit comments

Comments
 (0)