Comment

Comment by kazinator

   // power cycle computer

   bool was_on = set_computer_on(true); // returns prior value

   if (was_on) {
     set_computer_on(false);
     set_computer_on(true);
   } else {
     // was previously off, is now on: nothing to do!
   }
parent kazinator 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton