@r3trofitted @noelrap It’s used as a literal in an API. The important thing about it is that it’s unique. Imagine it like `nil` except labeled with a name. It can’t be nil since that would otherwise be a valid value. The specific use case is a lot to explain.

Alternately I considered a Singleton instance, but the ergonomics of that weren’t great imo.

1
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
Bradley Schaefer

@r3trofitted @noelrap As a method it would return a different Class/object every time, which does not allow you to, say, compare it to a value

(Via method): MyGem.delete != MyGem.delete # this would be a problem!

1
1y
Replies