News for hackers. Stuff that matters.
Re:Writing a C Compiler, Part 1 by cpeterso on Friday December 01, 2017 @12:19PM (#15825362)
I really liked how Icon handles function success/failure separately from return values. It seems very close to Go's error handling conventions, but with a little more magic. Wikipedia gives the following Icon example code:

  if a := read() then write(a)
which would translate into something like the following Go code:

  a, err := read()
  if err == nil {
      write(a)
  }
Re:Writing a C Compiler, Part 1 by oldandtired on Sunday December 03, 2017 @04:13AM (#15836752)
Simplify this to

write(a := read())

where write will not be executed if read fails, nor will a have any value assigned to it. Failure is an option and not an error.

So to copy standard input to standard output, we do

every write(read())

At the end of file, the read fails, the write fails and then the every fails and on you go.