Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Hell is a multi-threaded C++ program (2006). Parent comment
Yes.
> Can they be marked pure in the case that the foreign (likely C) function doesn't reference global mutable state?
Yes. Here's an example:
https://github.com/dlang/druntime/blob/master/src/core/stdc/...
It's true that the C Standard does not actually guarantee that they don't access mutable global state, but in practice they don't. We're not aware of one that does, and don't know why anyone would write one that does.
There are no comments on this comment yet.
Yes.
> Can they be marked pure in the case that the foreign (likely C) function doesn't reference global mutable state?
Yes. Here's an example:
https://github.com/dlang/druntime/blob/master/src/core/stdc/...
It's true that the C Standard does not actually guarantee that they don't access mutable global state, but in practice they don't. We're not aware of one that does, and don't know why anyone would write one that does.