any logger in core?

David House dhouse at janestreet.com
Thu Nov 8 10:12:21 GMT 2012


On Thu, Nov 8, 2012 at 3:48 AM, Francois
<francois.berenger.fun at gmail.com> wrote:
> I don't know where to find never_returns.

It's there if you open Core.Std.

> But the following did work (and never stop):

You need to explicitly shut down async using the shutdown function in Async.Std.

> I'm affraid of open directives, I try to keep my code _very_ explicit
> about what it is doing and which function from which module is used
> (maybe because of past overexposure to some C++ code).

I think that's exactly the right approach -- I often find myself
making similar comments when doing code review at work. Things are
much easier to follow if opens are reduced, or made more local, and
more explicit.

That being said, I do allow myself the luxury of opening Core.Std and
Async.Std in most of my modules that use core / async. I find this to
strike a good balance between concision and explicitness.

One of the reasons is that there are very few *values* brought into
scope by opening Core.Std and Async.Std. This conversation has contain
disproportionally many: never_returns, shutdown, etc. -- an unlucky
coincidence! But nearly everything is squirreled away inside a module,
which helps a lot. (In other words, our "Pervasives" is much smaller
than the ocaml standard library's.)



More information about the core mailing list