News for hackers. Stuff that matters.
Re:Higher RAII and the seven arcane uses of linear types by fallingsquirrel on Wednesday May 15, 2024 @12:13PM (#40368901)
I bet expect_empty could be defined roughly as:

  fn expect_empty(list) {
      drop_into(list, () => panic());
  }
(pardon my made up syntax)

If you want to discourage runtime checks, you could even make the programmer do the above themselves since it's a one-liner anyway.

There are no comments on this comment yet.