4 ms·
Because when you're writing a reusable, self-contained function, you often don't know enough of the context to "handle" the error. Let's say you've got a funct
by boloust 5y ago
Because when you're writing a reusable, self-contained function, you often don't know enough of the context to "handle" the error.
Let's say you've got a function that reads from a file. If the file doesn't exist, what do you do? That entirely depends on the context the function is called in. If it's in a web server, you might return a 404. If it's a background task polling for some data, you might sleep for a while until the file is uploaded. Or you might want to create the file yourself.
- jhgb 5y agoCommon Lispers in the back are excitedly waving their hands and whispering: "Restarts! Restarts!"