Skip to content

Commit

Permalink
Replace True/False with true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
uasi authored and yorickpeterse committed Oct 29, 2023
1 parent d2316cb commit 772d224
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 45 deletions.
8 changes: 4 additions & 4 deletions std/src/std/byte_array.inko
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class builtin ByteArray {
# let bytes = ByteArray.from_array([105, 110, 107, 111])
#
# bytes.drain_to_string # => 'inko'
# bytes.empty? # => True
# bytes.empty? # => true
fn pub mut drain_to_string -> String {
inko_byte_array_drain_to_string(_INKO.state, self)
}
Expand Down Expand Up @@ -502,7 +502,7 @@ impl IntoString for ByteArray {
}

impl Equal[ByteArray] for ByteArray {
# Returns `True` if two `ByteArray` objects are equal to each other.
# Returns `true` if two `ByteArray` objects are equal to each other.
#
# Two `ByteArray` objects are considered equal if they have the exact same
# values in the exact same order.
Expand All @@ -511,8 +511,8 @@ impl Equal[ByteArray] for ByteArray {
#
# Comparing two `ByteArray` objects:
#
# ByteArray.from_array([10]) == ByteArray.from_array([10]) # => True
# ByteArray.from_array([10]) == ByteArray.from_array([20]) # => False
# ByteArray.from_array([10]) == ByteArray.from_array([10]) # => true
# ByteArray.from_array([10]) == ByteArray.from_array([20]) # => false
fn pub ==(other: ref ByteArray) -> Bool {
inko_byte_array_eq(self, other)
}
Expand Down
4 changes: 2 additions & 2 deletions std/src/std/cmp.inko
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ trait pub Compare[T] {

# A type that can be compared for equality.
trait pub Equal[T] {
# Returns `True` if `self` and the given object are equal to each other.
# Returns `true` if `self` and the given object are equal to each other.
#
# This operator is used to perform structural equality. This means two objects
# residing in different memory locations may be considered equal, provided
Expand All @@ -97,7 +97,7 @@ trait pub Equal[T] {
# values.
fn pub ==(other: ref T) -> Bool

# Returns `True` if `self` and the given object are not equal to each other.
# Returns `true` if `self` and the given object are not equal to each other.
fn pub !=(other: ref T) -> Bool {
(self == other).false?
}
Expand Down
28 changes: 14 additions & 14 deletions std/src/std/fs/path.inko
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn extern inko_time_system_offset -> Int64
# The character used to separate components in a file path.
let pub SEPARATOR = '/'

# Returns `True` if the byte is a valid path separator byte.
# Returns `true` if the byte is a valid path separator byte.
fn path_separator?(byte: Int) -> Bool {
byte == 47
}
Expand Down Expand Up @@ -125,7 +125,7 @@ fn bytes_before_last_separator(path: String) -> Int {
if in_separator { 1 } else { -1 }
}

# Returns `True` if the given file path is an absolute path.
# Returns `true` if the given file path is an absolute path.
fn absolute_path?(path: String) -> Bool {
path_separator?(path.byte(0))
}
Expand Down Expand Up @@ -191,17 +191,17 @@ class pub Path {
Path { @path = path }
}

# Returns `True` if the path points to a file.
# Returns `true` if the path points to a file.
fn pub file? -> Bool {
inko_path_is_file(_INKO.process, @path)
}

# Returns `True` if the path points to a directory.
# Returns `true` if the path points to a directory.
fn pub directory? -> Bool {
inko_path_is_directory(_INKO.process, @path)
}

# Returns `True` if the path points to an existing file or directory.
# Returns `true` if the path points to an existing file or directory.
fn pub exists? -> Bool {
inko_path_exists(_INKO.process, @path)
}
Expand Down Expand Up @@ -272,31 +272,31 @@ class pub Path {
}
}

# Returns `True` if this `Path` is an absolute path.
# Returns `true` if this `Path` is an absolute path.
#
# # Examples
#
# Checking if a `Path` is absolute:
#
# import std.fs.path.Path
#
# Path.new('foo').absolute? # => False
# Path.new('/foo').absolute? # => True
# Path.new('foo').absolute? # => false
# Path.new('/foo').absolute? # => true
fn pub absolute? -> Bool {
absolute_path?(@path)
}

# Returns `True` if this `Path` is a relative path.
# Returns `true` if this `Path` is a relative path.
#
# # Examples
#
# Checking if a `Path` is relative:
#
# import std.fs.path.Path
#
# Path.new('foo').relative? # => True
# Path.new('../').relative? # => True
# Path.new('/foo').relative? # => False
# Path.new('foo').relative? # => true
# Path.new('../').relative? # => true
# Path.new('/foo').relative? # => false
fn pub relative? -> Bool {
absolute?.false?
}
Expand Down Expand Up @@ -585,7 +585,7 @@ trait pub IntoPath {
}

impl Equal[Path] for Path {
# Returns `True` if `self` is equal to the given `Path`.
# Returns `true` if `self` is equal to the given `Path`.
#
# # Examples
#
Expand All @@ -596,7 +596,7 @@ impl Equal[Path] for Path {
# let path1 = Path.new('foo')
# let path2 = Path.new('foo')
#
# path1 == path2 # => True
# path1 == path2 # => true
fn pub ==(other: ref Path) -> Bool {
@path == other.to_string
}
Expand Down
22 changes: 11 additions & 11 deletions std/src/std/iter.inko
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ trait pub Iter[T] {
}
}

# Returns the first value for which the supplied `Block` returns `True`.
# Returns the first value for which the supplied `Block` returns `true`.
#
# This method will advance the `Iter` until either a value is found or we
# run out of values.
Expand Down Expand Up @@ -146,16 +146,16 @@ trait pub Iter[T] {
}
}

# Returns `True` if `self` contains any value for which the `func` argument
# returned `True`.
# Returns `true` if `self` contains any value for which the `func` argument
# returned `true`.
#
# This method stops iterating over the values after the first matching value.
#
# # Examples
#
# Checking if an `Iter` contains a value:
#
# [10, 20, 30].iter.any? fn (value) { value >= 20 } # => True
# [10, 20, 30].iter.any? fn (value) { value >= 20 } # => true
fn pub mut any?(func: fn (T) -> Bool) -> Bool {
loop {
match self.next {
Expand All @@ -166,7 +166,7 @@ trait pub Iter[T] {
}

# Returns an `Iter` that only produces values for which the supplied func
# returned `True`.
# returned `true`.
#
# # Examples
#
Expand Down Expand Up @@ -217,8 +217,8 @@ trait pub Iter[T] {
# Partitions the `Iter` into a tuple of two `Array` objects.
#
# The first value of the tuple contains all values for which the supplied
# func returned `True`. The second value contains all values for which the
# func returned `False`.
# func returned `true`. The second value contains all values for which the
# func returned `false`.
#
# # Examples
#
Expand All @@ -237,18 +237,18 @@ trait pub Iter[T] {
}
}

# Returns `True` if the supplied func returns `True` for _all_ values in
# Returns `true` if the supplied func returns `true` for _all_ values in
# `self`.
#
# This method stops iterating over the values after the first value for which
# the closure returns `False`.
# the closure returns `false`.
#
# # Examples
#
# Checking if all values in an `Iter` match a condition:
#
# [10, 20].iter.all? fn (value) { value.positive? } # => True
# [-1, 20].iter.all? fn (value) { value.positive? } # => False
# [10, 20].iter.all? fn (value) { value.positive? } # => true
# [-1, 20].iter.all? fn (value) { value.positive? } # => false
fn pub mut all?(func: fn (T) -> Bool) -> Bool {
loop {
match self.next {
Expand Down
22 changes: 11 additions & 11 deletions std/src/std/set.inko
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class pub Set[V: Hash + Equal[V]] {
# The Map used for storing values.
#
# The keys are the values inserted in this `Set`, the values are always set to
# `True`.
# `true`.
let @map: Map[V, Bool]

fn pub static new -> Set[V] {
Expand All @@ -21,7 +21,7 @@ class pub Set[V: Hash + Equal[V]] {

# Inserts a new value into the `Set`.
#
# The returned value is `True` if the value was inserted, `False` otherwise.
# The returned value is `true` if the value was inserted, `false` otherwise.
#
# # Examples
#
Expand All @@ -38,7 +38,7 @@ class pub Set[V: Hash + Equal[V]] {

# Removes a value from this `Set`.
#
# If the value was removed `True` is returned, otherwise `False` is returned.
# If the value was removed `true` is returned, otherwise `false` is returned.
#
# # Examples
#
Expand All @@ -49,16 +49,16 @@ class pub Set[V: Hash + Equal[V]] {
# let set = Set.new
#
# set.insert(10)
# set.remove(10) # => True
# set.remove(10) # => False
# set.remove(10) # => true
# set.remove(10) # => false
#
# Removing a non-existing value from a `Set`:
#
# import std.set.Set
#
# let set = Set.new
#
# set.remove(10) # => False
# set.remove(10) # => false
fn pub mut remove(value: ref V) -> Bool {
@map.remove(value).some?
}
Expand Down Expand Up @@ -104,7 +104,7 @@ class pub Set[V: Hash + Equal[V]] {
}

impl Equal[Set[V]] for Set {
# Returns `True` if `self` and the given `Set` are identical to each
# Returns `true` if `self` and the given `Set` are identical to each
# other.
#
# # Examples
Expand All @@ -119,7 +119,7 @@ impl Equal[Set[V]] for Set {
# set1.insert(10)
# set2.insert(10)
#
# set1 == set2 # => True
# set1 == set2 # => true
fn pub ==(other: ref Set[V]) -> Bool {
if size != other.size { return false }

Expand All @@ -128,7 +128,7 @@ impl Equal[Set[V]] for Set {
}

impl Contains[V] for Set {
# Returns `True` if this `Set` contains the given value.
# Returns `true` if this `Set` contains the given value.
#
# # Examples
#
Expand All @@ -138,9 +138,9 @@ impl Contains[V] for Set {
#
# let set = Set.new
#
# set.contains?(10) # => False
# set.contains?(10) # => false
# set.insert(10)
# set.contains?(10) # => True
# set.contains?(10) # => true
fn pub contains?(value: ref V) -> Bool {
@map.contains?(value)
}
Expand Down
6 changes: 3 additions & 3 deletions std/src/std/sys.inko
Original file line number Diff line number Diff line change
Expand Up @@ -372,14 +372,14 @@ class pub ExitStatus {
ExitStatus { @code = code }
}

# Returns `True` if the status signals success.
# Returns `true` if the status signals success.
#
# # Examples
#
# import std.sys.ExitStatus
#
# ExitStatus.new(0).success? # => True
# ExitStatus.new(1).success? # => False
# ExitStatus.new(0).success? # => true
# ExitStatus.new(1).success? # => false
fn pub success? -> Bool {
@code == 0
}
Expand Down

0 comments on commit 772d224

Please sign in to comment.