# \#bool

**URL:** https://forums.swift.org/tag/bool/714.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Problematic \`== true/false\` boolean comparisons](https://forums.swift.org/t/problematic-true-false-boolean-comparisons/77314)

<div class="topic-metadata">

**Author:** [@alexhunsley](https://forums.swift.org/u/alexhunsley)\
**Replies:** 31\
**Last updated:** [January 25, 2025, 10:33pm UTC](https://forums.swift.org/t/problematic-true-false-boolean-comparisons/77314 "2025-01-25T22:33:43Z")

</div>

Intro This isn't an evolution proposal; it's my research on what feels like a weird snaggy bit around bool comparisons in Swift involving three-value logic. The snag makes it too easy to write fragile or incorrect code. …

---

## [How would you test an arbitrary value for “boolness”?](https://forums.swift.org/t/how-would-you-test-an-arbitrary-value-for-boolness/75045)

<div class="topic-metadata">

**Author:** [@JaanusK](https://forums.swift.org/u/JaanusK)\
**Replies:** 6\
**Last updated:** [October 1, 2024, 11:56am UTC](https://forums.swift.org/t/how-would-you-test-an-arbitrary-value-for-boolness/75045 "2024-10-01T11:56:19Z")

</div>

How would you write this? SomeValueProtocol is a protocol that covers Bool, all Swift integer types, as well as non-related types. I would like to do something like this, but I am having trouble with the integer part. f…

---

## [||= and &&= for Bool](https://forums.swift.org/t/and-for-bool/69998)

<div class="topic-metadata">

**Author:** [@wadetregaskis](https://forums.swift.org/u/wadetregaskis)\
**Replies:** 10\
**Last updated:** [February 15, 2024, 2:32pm UTC](https://forums.swift.org/t/and-for-bool/69998 "2024-02-15T14:32:09Z")

</div>

It appears there's no ||= nor &&= operators for Bool… is there a reason for that? Is there a near equivalent (that's better than the longhand \<expression\> = \<expression\> || \<bool\>?)

---

## [How and where does the true/false reserved keywords define in Swift?](https://forums.swift.org/t/how-and-where-does-the-true-false-reserved-keywords-define-in-swift/66837)

<div class="topic-metadata">

**Author:** [@HuangRunHua](https://forums.swift.org/u/HuangRunHua)\
**Replies:** 3\
**Last updated:** [August 19, 2023, 2:49pm UTC](https://forums.swift.org/t/how-and-where-does-the-true-false-reserved-keywords-define-in-swift/66837 "2023-08-19T14:49:47Z")

</div>

I am recently learning the source code of the Bool type in Swift. I have defined a Coin structure (shows below) imitating the source code. Similar to Bool, there are two values of true and false. I want to assign two val…

---

## [String interpolation of Bool](https://forums.swift.org/t/string-interpolation-of-bool/58864)

<div class="topic-metadata">

**Author:** [@mvolkmann](https://forums.swift.org/u/mvolkmann)\
**Replies:** 3\
**Last updated:** [July 12, 2022, 1:23am UTC](https://forums.swift.org/t/string-interpolation-of-bool/58864 "2022-07-12T01:23:20Z")

</div>

Often when debugging a SwiftUI app I want to do something like this: Text("myBool = \\(myBool)") But the compiler doesn't like that, so I have to do this instead which is tedious: Text("myBool = \\(String(describing: my…
