diff options
| author | Patrick Walton <[email protected]> | 2011-04-07 10:14:25 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-04-07 10:14:25 -0700 |
| commit | 2a894cabc237f32484dd9fb4265790c60eefd661 (patch) | |
| tree | 3d3b128ae9670f7b425d6cd68936482f603ca656 /src/lib/util.rs | |
| parent | Merge branch 'master' of github.com:graydon/rust (diff) | |
| parent | Run optimizations. (diff) | |
| download | rust-2a894cabc237f32484dd9fb4265790c60eefd661.tar.xz rust-2a894cabc237f32484dd9fb4265790c60eefd661.zip | |
Merge branch 'master' of github.com:graydon/rust
Diffstat (limited to 'src/lib/util.rs')
| -rw-r--r-- | src/lib/util.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/util.rs b/src/lib/util.rs index 72844d5f..2f797f69 100644 --- a/src/lib/util.rs +++ b/src/lib/util.rs @@ -11,6 +11,18 @@ fn rational_leq(&rational x, &rational y) -> bool { ret x.num * y.den <= y.num * x.den; } +fn fst[T, U](&tup(T, U) x) -> T { + ret x._0; +} + +fn snd[T, U](&tup(T, U) x) -> U { + ret x._1; +} + +fn orb(&bool a, &bool b) -> bool { + ret a || b; +} + // Local Variables: // mode: rust; // fill-column: 78; |