5 ms·
What's a good use case for knowing how many times a signal was raised? Signal once raised has no more context than the signal itself.
by general_failure 12y ago
What's a good use case for knowing how many times a signal was raised? Signal once raised has no more context than the signal itself.
- rurounijones 12y agoIf the signal is received more than once it means it is more important :p "Oh shit!" "^C^C^C^C^C^C~C^C"
- lucozade 12y agoIn my experience it usual means that you need some form of time reversal e.g. unsend an email or put a BEGIN TRAN before the SQL you just executed. Reasonably sure that can't be done in C even with all that undefined behaviour. However, if your IO monad implementation is sufficiently slow, you could ^C between when you thought the code had executed and when it actually bothered to get around to it. I can't believe that none of the functional ninjas thought to add time travel as a benefit. Most remiss...
- taejo 12y ago> I can't believe that none of the functional ninjas thought to add time travel as a benefit. Most remiss... Ahem: https://hackage.haskell.org/package/tardis https://hackage.haskell.org/package/tardis
- lucozade 12y agoWith much delight, I stand corrected. Haskell perpetually astonishes me. Not only is it, more or less single-handedly, keeping the Holy Wars alive, it now appears to supply punchlines to jokes. Amazing.
- steveklabnik 12y agoWouldn't you do the same if you had a time machine?
- anuragbiyani 12y agoAlthough I cannot recall any specific name right now, I have certainly seen programs handling a single Ctrl-C different than say two Ctrl-C in quick succession. Example: Pressing one Ctrl-C will display a message like this on some programs (which do not want to terminate themselves upon receiving a single SIGINT, because accidents happen): "Press Ctrl-C again to quit."