Permalink
Browse files

Camel case various core constructors

  • Loading branch information...
1 parent 4ba9fdd commit 161a82e433fbfbc0bd57a4d951ac37656a8a30f6 @brson brson committed Aug 27, 2012
Showing with 530 additions and 545 deletions.
  1. +7 −7 doc/rust.md
  2. +2 −2 doc/tutorial.md
  3. +41 −41 src/libcore/comm.rs
  4. +41 −39 src/libcore/dlist.rs
  5. +1 −2 src/libcore/dvec.rs
  6. +2 −2 src/libcore/io.rs
  7. +7 −7 src/libcore/os.rs
  8. +13 −13 src/libcore/priv.rs
  9. +16 −16 src/libcore/rand.rs
  10. +2 −2 src/libcore/run.rs
  11. +3 −3 src/libcore/send_map.rs
  12. +50 −50 src/libcore/task.rs
  13. +1 −1 src/libstd/deque.rs
  14. +30 −30 src/libstd/net_tcp.rs
  15. +5 −5 src/libstd/net_url.rs
  16. +2 −2 src/libstd/smallintmap.rs
  17. +1 −1 src/libstd/tempfile.rs
  18. +10 −10 src/libstd/test.rs
  19. +12 −12 src/libstd/timer.rs
  20. +7 −7 src/libstd/uv_global_loop.rs
  21. +10 −10 src/libstd/uv_iotask.rs
  22. +6 −6 src/libstd/uv_ll.rs
  23. +2 −2 src/libsyntax/codemap.rs
  24. +1 −1 src/libsyntax/ext/pipes/pipec.rs
  25. +3 −3 src/libsyntax/ext/pipes/proto.rs
  26. +2 −2 src/libsyntax/ext/qquote.rs
  27. +2 −2 src/libsyntax/ext/simplext.rs
  28. +3 −3 src/libsyntax/ext/tt/macro_parser.rs
  29. +2 −2 src/libsyntax/parse/parser.rs
  30. +2 −2 src/libsyntax/print/pp.rs
  31. +3 −3 src/libsyntax/print/pprust.rs
  32. +2 −2 src/libsyntax/util/interner.rs
  33. +2 −2 src/rustc/driver/rustc.rs
  34. +2 −2 src/rustc/front/test.rs
  35. +2 −2 src/rustc/metadata/creader.rs
  36. +1 −1 src/rustc/metadata/csearch.rs
  37. +2 −2 src/rustc/metadata/decoder.rs
  38. +1 −1 src/rustc/middle/borrowck.rs
  39. +1 −1 src/rustc/middle/borrowck/check_loans.rs
  40. +1 −1 src/rustc/middle/borrowck/loan.rs
  41. +2 −2 src/rustc/middle/check_const.rs
  42. +2 −2 src/rustc/middle/liveness.rs
  43. +3 −3 src/rustc/middle/region.rs
  44. +11 −11 src/rustc/middle/resolve3.rs
  45. +2 −2 src/rustc/middle/trans/alt.rs
  46. +2 −2 src/rustc/middle/trans/shape.rs
  47. +2 −2 src/rustc/middle/typeck/check/method.rs
  48. +4 −4 src/rustc/middle/typeck/coherence.rs
  49. +2 −2 src/rustc/middle/typeck/infer.rs
  50. +3 −3 src/rustc/middle/typeck/infer/region_var_bindings.rs
  51. +2 −2 src/rustdoc/astsrv.rs
  52. +10 −10 src/rustdoc/markdown_writer.rs
  53. +2 −2 src/test/auxiliary/cci_capture_clause.rs
  54. +3 −3 src/test/auxiliary/cci_nested_lib.rs
  55. +2 −2 src/test/bench/core-map.rs
  56. +4 −4 src/test/bench/core-std.rs
  57. +2 −2 src/test/bench/core-vec-append.rs
  58. +1 −1 src/test/bench/graph500-bfs.rs
  59. +6 −6 src/test/bench/msgsend-ring.rs
  60. +4 −4 src/test/bench/shootout-chameneos-redux.rs
  61. +1 −1 src/test/bench/shootout-fasta.rs
  62. +2 −2 src/test/bench/shootout-k-nucleotide.rs
  63. +4 −4 src/test/bench/shootout-mandelbrot.rs
  64. +2 −2 src/test/bench/shootout-threadring.rs
  65. +3 −3 src/test/bench/task-perf-linked-failure.rs
  66. +4 −4 src/test/bench/task-perf-one-million.rs
  67. +7 −9 src/test/bench/task-perf-word-count-generic.rs
  68. +1 −1 src/test/compile-fail/no-send-res-ports.rs
  69. +2 −2 src/test/compile-fail/unsendable-class.rs
  70. +2 −2 src/test/run-fail/linked-failure.rs
  71. +3 −3 src/test/run-fail/linked-failure2.rs
  72. +3 −3 src/test/run-fail/linked-failure3.rs
  73. +4 −4 src/test/run-fail/linked-failure4.rs
  74. +3 −4 src/test/run-fail/port-type.rs
  75. +1 −1 src/test/run-fail/task-comm-recv-block.rs
  76. +3 −4 src/test/run-pass/basic-1.rs
  77. +3 −4 src/test/run-pass/basic-2.rs
  78. +2 −3 src/test/run-pass/basic.rs
  79. +5 −5 src/test/run-pass/binops.rs
  80. +7 −8 src/test/run-pass/chan-leak.rs
  81. +2 −3 src/test/run-pass/comm.rs
  82. +4 −4 src/test/run-pass/decl-with-recv.rs
  83. +1 −1 src/test/run-pass/dvec-index-op.rs
  84. +2 −2 src/test/run-pass/dvec-test.rs
  85. +5 −6 src/test/run-pass/hashmap-memory.rs
  86. +3 −4 src/test/run-pass/issue-507.rs
  87. +6 −8 src/test/run-pass/issue-687.rs
  88. +4 −4 src/test/run-pass/issue-783.rs
  89. +2 −4 src/test/run-pass/ivec-tag.rs
  90. +2 −2 src/test/run-pass/lazychan.rs
  91. +4 −4 src/test/run-pass/many.rs
  92. +1 −1 src/test/run-pass/morestack6.rs
  93. +14 −14 src/test/run-pass/rt-circular-buffer.rs
  94. +2 −2 src/test/run-pass/rt-sched-1.rs
  95. +2 −2 src/test/run-pass/send-iloop.rs
  96. +4 −4 src/test/run-pass/send-resource.rs
  97. +3 −4 src/test/run-pass/send-type-inference.rs
  98. +2 −2 src/test/run-pass/sendable-class.rs
  99. +1 −1 src/test/run-pass/sendfn-deep-copy.rs
  100. +1 −1 src/test/run-pass/sendfn-generic-fn.rs
  101. +1 −1 src/test/run-pass/sendfn-spawn-with-fn-arg.rs
  102. +2 −2 src/test/run-pass/spawn-types.rs
  103. +2 −2 src/test/run-pass/task-comm-chan-cleanup.rs
  104. +2 −2 src/test/run-pass/task-comm-chan-cleanup2.rs
  105. +2 −2 src/test/run-pass/task-comm-chan-cleanup3.rs
  106. +2 −2 src/test/run-pass/task-comm-chan-cleanup4.rs
  107. +2 −2 src/test/run-pass/task-comm-chan-nil.rs
  108. +8 −9 src/test/run-pass/task-comm.rs
  109. +2 −2 src/test/run-pass/task-killjoin-rsrc.rs
  110. +2 −2 src/test/run-pass/task-spawn-move-and-copy.rs
  111. +2 −2 src/test/run-pass/unique-send-2.rs
  112. +2 −2 src/test/run-pass/unique-send.rs
  113. +2 −2 src/test/run-pass/unwind-resource.rs
View
@@ -3030,8 +3030,8 @@ The result of a `spawn` call is a `core::task::task` value.
An example of a `spawn` call:
~~~~
-let po = comm::port();
-let ch = comm::chan(po);
+let po = comm::Port();
+let ch = comm::Chan(po);
do task::spawn {
// let task run, do other things
@@ -3052,24 +3052,24 @@ channel's outgoing buffer.
An example of a send:
~~~~
-let po = comm::port();
-let ch = comm::chan(po);
+let po = comm::Port();
+let ch = comm::Chan(po);
comm::send(ch, ~"hello, world");
~~~~
### Receiving values from ports
Receiving a value is done by a call to the `recv` method on a value of type
-`core::comm::port`. This call causes the receiving task to enter the *blocked
+`core::comm::Port`. This call causes the receiving task to enter the *blocked
reading* state until a value arrives in the port's receive queue, at which
time the port deques a value to return, and un-blocks the receiving task.
An example of a *receive*:
~~~~~~~~
-# let po = comm::port();
-# let ch = comm::chan(po);
+# let po = comm::Port();
+# let ch = comm::Chan(po);
# comm::send(ch, ~"");
let s = comm::recv(po);
~~~~~~~~
View
@@ -2996,9 +2996,9 @@ message to the port. The next statement actually spawns the child:
~~~~
# import task::{spawn};
-# import comm::{port, chan};
+# import comm::{Port, Chan};
# fn some_expensive_computation() -> int { 42 }
-# let port = port();
+# let port = Port();
# let chan = port.chan();
do spawn {
let result = some_expensive_computation();
View
@@ -30,8 +30,8 @@
import either::Either;
import libc::size_t;
-export Port, port;
-export Chan, chan;
+export Port;
+export Chan;
export send;
export recv;
export peek;
@@ -69,13 +69,13 @@ enum Chan<T: send> {
}
/// Constructs a port
-fn port<T: send>() -> Port<T> {
+fn Port<T: send>() -> Port<T> {
Port_(@PortPtr(rustrt::new_port(sys::size_of::<T>() as size_t)))
}
impl<T: send> Port<T> {
- fn chan() -> Chan<T> { chan(self) }
+ fn chan() -> Chan<T> { Chan(self) }
fn send(+v: T) { self.chan().send(v) }
fn recv() -> T { recv(self) }
fn peek() -> bool { peek(self) }
@@ -93,7 +93,7 @@ impl<T: send> Chan<T> {
/// Open a new receiving channel for the duration of a function
fn listen<T: send, U>(f: fn(Chan<T>) -> U) -> U {
- let po = port();
+ let po = Port();
f(po.chan())
}
@@ -157,7 +157,7 @@ fn as_raw_port<T: send, U>(ch: comm::Chan<T>, f: fn(*rust_port) -> U) -> U {
* Constructs a channel. The channel is bound to the port used to
* construct it.
*/
-fn chan<T: send>(p: Port<T>) -> Chan<T> {
+fn Chan<T: send>(p: Port<T>) -> Chan<T> {
Chan_(rustrt::get_port_id((**p).po))
}
@@ -295,51 +295,51 @@ extern mod rusti {
#[test]
-fn create_port_and_chan() { let p = port::<int>(); chan(p); }
+fn create_port_and_chan() { let p = Port::<int>(); Chan(p); }
#[test]
fn send_int() {
- let p = port::<int>();
- let c = chan(p);
+ let p = Port::<int>();
+ let c = Chan(p);
send(c, 22);
}
#[test]
fn send_recv_fn() {
- let p = port::<int>();
- let c = chan::<int>(p);
+ let p = Port::<int>();
+ let c = Chan::<int>(p);
send(c, 42);
assert (recv(p) == 42);
}
#[test]
fn send_recv_fn_infer() {
- let p = port();
- let c = chan(p);
+ let p = Port();
+ let c = Chan(p);
send(c, 42);
assert (recv(p) == 42);
}
#[test]
fn chan_chan_infer() {
- let p = port(), p2 = port::<int>();
- let c = chan(p);
- send(c, chan(p2));
+ let p = Port(), p2 = Port::<int>();
+ let c = Chan(p);
+ send(c, Chan(p2));
recv(p);
}
#[test]
fn chan_chan() {
- let p = port::<Chan<int>>(), p2 = port::<int>();
- let c = chan(p);
- send(c, chan(p2));
+ let p = Port::<Chan<int>>(), p2 = Port::<int>();
+ let c = Chan(p);
+ send(c, Chan(p2));
recv(p);
}
#[test]
fn test_peek() {
- let po = port();
- let ch = chan(po);
+ let po = Port();
+ let ch = Chan(po);
assert !peek(po);
send(ch, ());
assert peek(po);
@@ -349,10 +349,10 @@ fn test_peek() {
#[test]
fn test_select2_available() {
- let po_a = port();
- let po_b = port();
- let ch_a = chan(po_a);
- let ch_b = chan(po_b);
+ let po_a = Port();
+ let po_b = Port();
+ let ch_a = Chan(po_a);
+ let ch_b = Chan(po_b);
send(ch_a, ~"a");
@@ -365,10 +365,10 @@ fn test_select2_available() {
#[test]
fn test_select2_rendezvous() {
- let po_a = port();
- let po_b = port();
- let ch_a = chan(po_a);
- let ch_b = chan(po_b);
+ let po_a = Port();
+ let po_b = Port();
+ let ch_a = Chan(po_a);
+ let ch_b = Chan(po_b);
for iter::repeat(10u) {
do task::spawn {
@@ -389,10 +389,10 @@ fn test_select2_rendezvous() {
#[test]
fn test_select2_stress() {
- let po_a = port();
- let po_b = port();
- let ch_a = chan(po_a);
- let ch_b = chan(po_b);
+ let po_a = Port();
+ let po_b = Port();
+ let ch_a = Chan(po_a);
+ let ch_b = Chan(po_b);
let msgs = 100u;
let times = 4u;
@@ -426,8 +426,8 @@ fn test_select2_stress() {
#[test]
fn test_recv_chan() {
- let po = port();
- let ch = chan(po);
+ let po = Port();
+ let ch = Chan(po);
send(ch, ~"flower");
assert recv_chan(ch) == ~"flower";
}
@@ -436,16 +436,16 @@ fn test_recv_chan() {
#[should_fail]
#[ignore(cfg(windows))]
fn test_recv_chan_dead() {
- let ch = chan(port());
+ let ch = Chan(Port());
send(ch, ~"flower");
recv_chan(ch);
}
#[test]
#[ignore(cfg(windows))]
fn test_recv_chan_wrong_task() {
- let po = port();
- let ch = chan(po);
+ let po = Port();
+ let ch = Chan(po);
send(ch, ~"flower");
assert result::is_err(task::try(||
recv_chan(ch)
@@ -454,14 +454,14 @@ fn test_recv_chan_wrong_task() {
#[test]
fn test_port_send() {
- let po = port();
+ let po = Port();
po.send(());
po.recv();
}
#[test]
fn test_chan_peek() {
- let po = port();
+ let po = Port();
let ch = po.chan();
ch.send(());
assert ch.peek();
@@ -482,7 +482,7 @@ fn test_listen() {
fn test_port_detach_fail() {
for iter::repeat(100u) {
do task::spawn_unlinked {
- let po = port();
+ let po = Port();
let ch = po.chan();
do task::spawn {
Oops, something went wrong.

0 comments on commit 161a82e

Please sign in to comment.