The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,861 other subscribers

Reminder: see if I can implement megabool in Delphi (or at least trilean)

Posted by jpluimers on 2025/05/06

Now that I re-wrote my 2012 talk on Class Operators and Helpers and presented it in Delphi at the ITDevCon2024 ([Wayback/Archive] ITDevCon | Home – Rome, 2024), see [Wayback/Archive] GitHub – jpluimers/ITDevCon2024: Temporary ITDevCon2024 repository until I fixed the «git checkout “Illegal byte sequence”» of my Conferences repository, here is an idea to check out if I can implement it in Delphi:

[WaybackSave/Archive] goosewin on X: “you should add megabool to your projects …”

[Wayback/Archive] Gb4v6EPX0AA8JiJ.jpg (303×318)

This was a wildly popular screenshot in November 2024 on social media (not just Twitter or [Wayback/Archive] John Vandivier | Edge cases be like join our community: https://ladderly.io | Instagram, but also for instance [Wayback/Archive] Post by @doomsmoker.bsky.social — Bluesky) but, according to what I could find, originated from this February 2024 thread on [Wayback/Archive] Hash Tables | MetaFilter:

There are booleans and then there are probabilistic booleans.

As a computer nerd, I know what you are a talking about, but I just have to make this joke:

enum megabool {
  TRUE,
  FALSE,
  NEITHER,
  BOTH,
  MAYBE,
  TRUEISH,
  FALSEISH,
  IT_DEPENDS,
  OSCILLATING,
  ITS_COMPLICATED,
  DOUBLE_TRUE,
  DOUBLE_FALSE,
  ...

posted by [Wayback/Archive] DreamerFi’s profile | MetaFilter at 3:31 AM on February 12, 2024 [9 favorites]

Or maybe I should start with Three-valued logic (some call this troolean, others trinary, trivalent, ternary, or trilean storing the internal values in either of these two forms:

Then I might extend it to values consisting of multiple trits, and doing conversions to/from string and integer plus of course various operations to cover as many operators as possible.

Query: [WaybackSave/Archive] enum “megabool” – Google Search

Inspiration for a few operators: [WaybackSave/Archive] GitHub – RobTillaart/Troolean: Arduino Library for a three state logic datatype supporting {True False Unknown}

Edit 20250910: there is a new cool video about  [Wayback/Archive] The System That Could Replace Binary And Change Computers FOREVER – YouTube

Ternary computing uses -1, 0, and 1 instead of just 0 and 1, and for a brief moment in the 1950s, it looked like it could redefine how we build computers. A Soviet team even built a working ternary machine called Setun. So why did the world choose binary? And could ternary still make a comeback?

--jeroen

PS: Per comment below, Russian Bit is a cool name too (:

2 Responses to “Reminder: see if I can implement megabool in Delphi (or at least trilean)”

  1. HeartWare's avatar

    HeartWare said

    In my code, it’s called a “RussianBit” (can’t remember where that originates, but that’s the term I learned when I was a kid).

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.