summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@mozilla.com>2012-04-04 18:01:55 -0700
committerGraydon Hoare <graydon@mozilla.com>2012-04-04 18:08:55 -0700
commit2577e3eafca4bf8ba85c74240cc0ac832e5ae7d4 (patch)
tree4f08d41ae1a5367dcb9aab5ba2cdeae65450b09d /src/libcore
parent4baf2ceae1475933e9e871c8c56a7e8039c61bbc (diff)
downloadrust-2577e3eafca4bf8ba85c74240cc0ac832e5ae7d4.tar.gz
rust-2577e3eafca4bf8ba85c74240cc0ac832e5ae7d4.zip
Tidy up predicate names in libcore. Should close #1431.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/i16.rs10
-rw-r--r--src/libcore/i32.rs10
-rw-r--r--src/libcore/i64.rs10
-rw-r--r--src/libcore/i8.rs10
-rw-r--r--src/libcore/int.rs10
-rw-r--r--src/libcore/result.rs10
-rw-r--r--src/libcore/u16.rs8
7 files changed, 34 insertions, 34 deletions
diff --git a/src/libcore/i16.rs b/src/libcore/i16.rs
index 30116f92b0e..6ae13ae4442 100644
--- a/src/libcore/i16.rs
+++ b/src/libcore/i16.rs
@@ -19,10 +19,10 @@ pure fn ne(x: i16, y: i16) -> bool { x != y }
 pure fn ge(x: i16, y: i16) -> bool { x >= y }
 pure fn gt(x: i16, y: i16) -> bool { x > y }
 
-pure fn positive(x: i16) -> bool { x > 0i16 }
-pure fn negative(x: i16) -> bool { x < 0i16 }
-pure fn nonpositive(x: i16) -> bool { x <= 0i16 }
-pure fn nonnegative(x: i16) -> bool { x >= 0i16 }
+pure fn is_positive(x: i16) -> bool { x > 0i16 }
+pure fn is_negative(x: i16) -> bool { x < 0i16 }
+pure fn is_nonpositive(x: i16) -> bool { x <= 0i16 }
+pure fn is_nonnegative(x: i16) -> bool { x >= 0i16 }
 
 #[doc = "Iterate over the range [`lo`..`hi`)"]
 fn range(lo: i16, hi: i16, it: fn(i16)) {
@@ -37,5 +37,5 @@ pure fn compl(i: i16) -> i16 {
 
 #[doc = "Computes the absolute value"]
 pure fn abs(i: i16) -> i16 {
-    if negative(i) { -i } else { i }
+    if is_negative(i) { -i } else { i }
 }
diff --git a/src/libcore/i32.rs b/src/libcore/i32.rs
index faa2c71821a..9a6e4ff8a19 100644
--- a/src/libcore/i32.rs
+++ b/src/libcore/i32.rs
@@ -19,10 +19,10 @@ pure fn ne(x: i32, y: i32) -> bool { x != y }
 pure fn ge(x: i32, y: i32) -> bool { x >= y }
 pure fn gt(x: i32, y: i32) -> bool { x > y }
 
-pure fn positive(x: i32) -> bool { x > 0i32 }
-pure fn negative(x: i32) -> bool { x < 0i32 }
-pure fn nonpositive(x: i32) -> bool { x <= 0i32 }
-pure fn nonnegative(x: i32) -> bool { x >= 0i32 }
+pure fn is_positive(x: i32) -> bool { x > 0i32 }
+pure fn is_negative(x: i32) -> bool { x < 0i32 }
+pure fn is_nonpositive(x: i32) -> bool { x <= 0i32 }
+pure fn is_nonnegative(x: i32) -> bool { x >= 0i32 }
 
 #[doc = "Iterate over the range [`lo`..`hi`)"]
 fn range(lo: i32, hi: i32, it: fn(i32)) {
@@ -37,5 +37,5 @@ pure fn compl(i: i32) -> i32 {
 
 #[doc = "Computes the absolute value"]
 pure fn abs(i: i32) -> i32 {
-    if negative(i) { -i } else { i }
+    if is_negative(i) { -i } else { i }
 }
diff --git a/src/libcore/i64.rs b/src/libcore/i64.rs
index a2e39a4b679..a0f8bf3e1eb 100644
--- a/src/libcore/i64.rs
+++ b/src/libcore/i64.rs
@@ -19,10 +19,10 @@ pure fn ne(x: i64, y: i64) -> bool { x != y }
 pure fn ge(x: i64, y: i64) -> bool { x >= y }
 pure fn gt(x: i64, y: i64) -> bool { x > y }
 
-pure fn positive(x: i64) -> bool { x > 0i64 }
-pure fn negative(x: i64) -> bool { x < 0i64 }
-pure fn nonpositive(x: i64) -> bool { x <= 0i64 }
-pure fn nonnegative(x: i64) -> bool { x >= 0i64 }
+pure fn is_positive(x: i64) -> bool { x > 0i64 }
+pure fn is_negative(x: i64) -> bool { x < 0i64 }
+pure fn is_nonpositive(x: i64) -> bool { x <= 0i64 }
+pure fn is_nonnegative(x: i64) -> bool { x >= 0i64 }
 
 #[doc = "Iterate over the range [`lo`..`hi`)"]
 fn range(lo: i64, hi: i64, it: fn(i64)) {
@@ -37,5 +37,5 @@ pure fn compl(i: i64) -> i64 {
 
 #[doc = "Computes the absolute value"]
 pure fn abs(i: i64) -> i64 {
-    if negative(i) { -i } else { i }
+    if is_negative(i) { -i } else { i }
 }
diff --git a/src/libcore/i8.rs b/src/libcore/i8.rs
index 6f6e375d010..8d4e429ffc9 100644
--- a/src/libcore/i8.rs
+++ b/src/libcore/i8.rs
@@ -19,10 +19,10 @@ pure fn ne(x: i8, y: i8) -> bool { x != y }
 pure fn ge(x: i8, y: i8) -> bool { x >= y }
 pure fn gt(x: i8, y: i8) -> bool { x > y }
 
-pure fn positive(x: i8) -> bool { x > 0i8 }
-pure fn negative(x: i8) -> bool { x < 0i8 }
-pure fn nonpositive(x: i8) -> bool { x <= 0i8 }
-pure fn nonnegative(x: i8) -> bool { x >= 0i8 }
+pure fn is_positive(x: i8) -> bool { x > 0i8 }
+pure fn is_negative(x: i8) -> bool { x < 0i8 }
+pure fn is_nonpositive(x: i8) -> bool { x <= 0i8 }
+pure fn is_nonnegative(x: i8) -> bool { x >= 0i8 }
 
 #[doc = "Iterate over the range [`lo`..`hi`)"]
 fn range(lo: i8, hi: i8, it: fn(i8)) {
@@ -37,5 +37,5 @@ pure fn compl(i: i8) -> i8 {
 
 #[doc = "Computes the absolute value"]
 pure fn abs(i: i8) -> i8 {
-    if negative(i) { -i } else { i }
+    if is_negative(i) { -i } else { i }
 }
diff --git a/src/libcore/int.rs b/src/libcore/int.rs
index 5aed338bd6b..bc482039019 100644
--- a/src/libcore/int.rs
+++ b/src/libcore/int.rs
@@ -30,10 +30,10 @@ pure fn ne(x: int, y: int) -> bool { ret x != y; }
 pure fn ge(x: int, y: int) -> bool { ret x >= y; }
 pure fn gt(x: int, y: int) -> bool { ret x > y; }
 
-pure fn positive(x: int) -> bool { ret x > 0; }
-pure fn negative(x: int) -> bool { ret x < 0; }
-pure fn nonpositive(x: int) -> bool { ret x <= 0; }
-pure fn nonnegative(x: int) -> bool { ret x >= 0; }
+pure fn is_positive(x: int) -> bool { ret x > 0; }
+pure fn is_negative(x: int) -> bool { ret x < 0; }
+pure fn is_nonpositive(x: int) -> bool { ret x <= 0; }
+pure fn is_nonnegative(x: int) -> bool { ret x >= 0; }
 
 #[doc = "Produce a uint suitable for use in a hash table"]
 pure fn hash(x: int) -> uint { ret x as uint; }
@@ -112,7 +112,7 @@ pure fn compl(i: int) -> int {
 
 #[doc = "Computes the absolute value"]
 fn abs(i: int) -> int {
-    if negative(i) { -i } else { i }
+    if is_negative(i) { -i } else { i }
 }
 
 #[test]
diff --git a/src/libcore/result.rs b/src/libcore/result.rs
index 64385fca9bf..04dde5960db 100644
--- a/src/libcore/result.rs
+++ b/src/libcore/result.rs
@@ -44,7 +44,7 @@ pure fn get_err<T, U: copy>(res: result<T, U>) -> U {
 }
 
 #[doc = "Returns true if the result is `ok`"]
-pure fn success<T, U>(res: result<T, U>) -> bool {
+pure fn is_success<T, U>(res: result<T, U>) -> bool {
     alt res {
       ok(_) { true }
       err(_) { false }
@@ -52,8 +52,8 @@ pure fn success<T, U>(res: result<T, U>) -> bool {
 }
 
 #[doc = "Returns true if the result is `error`"]
-pure fn failure<T, U>(res: result<T, U>) -> bool {
-    !success(res)
+pure fn is_failure<T, U>(res: result<T, U>) -> bool {
+    !is_success(res)
 }
 
 #[doc = "
@@ -113,9 +113,9 @@ impl extensions<T:copy, E:copy> for result<T,E> {
 
     fn get_err() -> E { get_err(self) }
 
-    fn success() -> bool { success(self) }
+    fn is_success() -> bool { is_success(self) }
 
-    fn failure() -> bool { failure(self) }
+    fn is_failure() -> bool { is_failure(self) }
 
     fn chain<U:copy>(op: fn(T) -> result<U,E>) -> result<U,E> {
         chain(self, op)
diff --git a/src/libcore/u16.rs b/src/libcore/u16.rs
index eb0965057e7..16ca4800f81 100644
--- a/src/libcore/u16.rs
+++ b/src/libcore/u16.rs
@@ -19,10 +19,10 @@ pure fn ne(x: u16, y: u16) -> bool { x != y }
 pure fn ge(x: u16, y: u16) -> bool { x >= y }
 pure fn gt(x: u16, y: u16) -> bool { x > y }
 
-pure fn positive(x: u16) -> bool { x > 0u16 }
-pure fn negative(x: u16) -> bool { x < 0u16 }
-pure fn nonpositive(x: u16) -> bool { x <= 0u16 }
-pure fn nonnegative(x: u16) -> bool { x >= 0u16 }
+pure fn is_positive(x: u16) -> bool { x > 0u16 }
+pure fn is_negative(x: u16) -> bool { x < 0u16 }
+pure fn is_nonpositive(x: u16) -> bool { x <= 0u16 }
+pure fn is_nonnegative(x: u16) -> bool { x >= 0u16 }
 
 #[doc = "Iterate over the range [`lo`..`hi`)"]
 fn range(lo: u16, hi: u16, it: fn(u16)) {