5 ms·
import behavior from afterlife import Heaven, Hell, Limbo try: behavior.good() return Heaven() except behavior.MoralsError as sin:
by pryelluw 3y ago
import behavior
from afterlife import Heaven, Hell, Limbo
try:
behavior.good()
return Heaven()
except behavior.MoralsError as sin:
return Hell(sin)
else:
return Limbo()
- arthurcolle 3y agobugfix: implement repentance
- darigo 3y agoWith the traffic between this world and the afterlife, using exceptions like this is really inefficient. Furthermore, a lot of souls with net bad behavior might be in a state of Grace, rescuing them from Hell. An improvement might look like this: def judgement(soul): in_grace = soul.state.is_graceful() good_works = len(soul.works) if in_grace: return 1 # Heaven if good_works > MORAL_MINIMUM: return 0 # Limbo return -1 # Welp. Although, given the moral ambiguity of the spec, it might be better to use a language with more undefined behavior like C. Terry Davis addressed a lot of this when he built the third Temple in HolyC. I actually work parttime at a startup where we're trying to use web3 to establish permanent, digital identities that you can use in the afterlife to bargain with demons. The idea is, you can use an NFT (who says web3 is dead!) to correlate the atoms in the immortal eternal one-soul with their constituent souls on earth, so you can identify your friends in Heaven (or Hell). Eventually, we hope to even link people on earth to people on heaven, via our Rust-based AngelLink blockchain. A sort of "tower to the heavens" so to speak. If anyone else on HN is interested in this space, feel free to email me (darigo.maxwell at gmail dot com). Always looking to make new friends who love God and have a passion for big data and the thirst for God's presence.
- Yoric 3y agoYou have my vote for Pitch of the Year. Possibly of Eternity, but it's a bit early for that. (also, yes, of course you'll need UB for Purgatory, etc.)
- 3PS 3y agoI know I'm taking a joke comment WAY too seriously, but... that "else" branch is unreachable, right?
- warble 3y agoDepends on the exception. Maybe the sun wasn't moral.
- froh 3y agothat's right, and absolutely make sense, as the church meanwhile realized unbaptized babies don't go to limbo but to heaven.
- Shish2k 3y agoCorrect (in a `try ... else` the else branch is executed when the try block reaches the end of the block with no exception, and the return is leaving the block without reaching the end) (Bonus context for anyone surprised that it is valid code — Python actually allows you to use “else” in more places than you’d expect - `for ... else` is my favourite (do a for loop over a list of things, `break` if you find the thing that you’re looking for, and then the `else` branch will be taken if you don’t find what you’re looking for. Much cleaner than keeping track of a separate i_found_the_thing bool IMO))
- graemep 3y agoTaking the joke a bit too seriously, but that is a statement of moralistic therapeutic deism, not Christianity. Corrected code. from behaviour import repentance from afterlife import Heaven, Hell, Limbo if person.is_baptised: if (person.state == repentance): return Heaven else: return Hell # FIXME define Hell else: # TODO I think we need something with Limbo here return None
- Yoric 3y agoWell, if that code was written at any point after the 12th century, you need to add Purgatory. Also, for Limbo, you need to never have heard of the Catholic Church, so you probably need some kind of information tainting.