Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: