I like to think about open Core.Std as the equivalent to Racket's #lang directive.<br><br>That is open Core.Std => #lang js_ocaml<br><br>Cheers,<br><br>Bene<br><div class="gmail_extra"><br><br><div class="gmail_quote">
On 8 November 2012 11:41, Yaron Minsky <span dir="ltr"><<a href="mailto:yminsky@janestreet.com" target="_blank">yminsky@janestreet.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Nov 8, 2012 at 3:09 AM, Francois<br>
<<a href="mailto:francois.berenger.fun@gmail.com">francois.berenger.fun@gmail.com</a>> wrote:<br>
> What is the effect of doing an open of Core.Std (I don't need async for the<br>
> moment)?<br>
><br>
> Does it override the standard prelude and the standard library?<br>
<br>
</div>Yes.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> On Thursday, November 8, 2012 3:12:06 PM UTC+9, Malcolm wrote:<br>
>><br>
>> Core.Std and Async.Std are designed to be opened.<br>
>><br>
>> Francois <<a href="mailto:francois.b...@gmail.com">francois.b...@gmail.com</a>> writes:<br>
>><br>
>> > On Thursday, November 8, 2012 1:42:41 AM UTC+9, Anil Madhavapeddy wrote:<br>
>> >><br>
>> >> You should also add "#camlp4o" so that toplevel syntax extensions work<br>
>> >> too.<br>
>> >><br>
>> ><br>
>> > In the future, I think only the one from janestreet to do automatic<br>
>> > translations to/from s-expressions interests me.<br>
>> > I prefer to read standard OCaml code usually.<br>
>> ><br>
>> ><br>
>> >><br>
>> >> I'd really recommend using 'utop' (installable via OPAM) instead of the<br>
>> >> default toplevel. It doesn't require the extra -I that the default<br>
>> >> toplevel<br>
>> >> needs, and has a really nice interactive interpreter.<br>
>> >><br>
>> ><br>
>> > I have to read about it.<br>
>> > I'm conservative about using new things (I'm an isolated OCaml<br>
>> > developper,<br>
>> > no one nearby to help me in case<br>
>> > I mess with something, that's why I'm so active on mailing lists).<br>
>> ><br>
>> ><br>
>> >><br>
>> >> My full .ocamlinit with utop is:<br>
>> >><br>
>> >> #use "topfind"<br>
>> >> #camlp4o<br>
>> >> #thread<br>
>> >> #require "core.top";;<br>
>> >> #require "async";;<br>
>> >> open Core.Std<br>
>> >> open Async.Std<br>
>> >><br>
>> ><br>
>> > Thanks for sharing this.<br>
>> > I'm very worried about the open directives<br>
>> > and try to never use them so I don't think<br>
>> > it would fit me for the moment.<br>
>> ><br>
>> > Best regards,<br>
>> > Francois.<br>
>> ><br>
>> ><br>
>> ><br>
>> >><br>
>> >> -anil<br>
>> >><br>
>> >> On 7 Nov 2012, at 05:33, Francois Berenger<br>
>> >> <<a href="mailto:francois.ber...@gmail.com">francois.ber...@gmail.com</a><javascript:>><br>
>> >> wrote:<br>
>> >><br>
>> >> Thanks a lot.<br>
>> >><br>
>> >> So, the whole recipe in my case was:<br>
>> >><br>
>> >> ocaml -I $OCAML_TOPLEVEL_PATH<br>
>> >> #thread;;<br>
>> >> #require "core.top";;<br>
>> >> #require "async";;<br>
>> >><br>
>> >> Regards,<br>
>> >> F.<br>
>> >><br>
>> >> On Wednesday, November 7, 2012 12:09:15 PM UTC+9, Sebastien Mondet<br>
>> >> wrote:<br>
>> >>><br>
>> >>><br>
>> >>><br>
>> >>> I think that one is the<br>
>> >>> #thread;;<br>
>> >>> thing<br>
>> >>><br>
>> >>><br>
>> >>><br>
>> >>><br>
>> >>> On Tue, Nov 6, 2012 at 10:06 PM, Francois Berenger <<br>
>> >>> <a href="mailto:francois.ber...@gmail.com">francois.ber...@gmail.com</a>> wrote:<br>
>> >>><br>
>> >>>> Thanks! That fixes the problem partially.<br>
>> >>>><br>
>> >>>> Now, I get:<br>
>> >>>><br>
>> >>>> # #require "core.top";;<br>
>> >>>> # #require "core.top";;stem/lib/core/core.cma: loaded<br>
>> >>>> Error: Reference to undefined global `Condition'<br>
>> >>>> # #require "core";;<br>
>> >>>> # #require "core";;m/system/lib/core/core.cma: loaded<br>
>> >>>> Error: Reference to undefined global `Condition'<br>
>> >>>> # #require "async";;<br>
>> >>>> # #require "async";;/system/lib/core/core.cma: loaded<br>
>> >>>> Error: Reference to undefined global `Condition'<br>
>> >>>><br>
>> >>>> Any hint?<br>
>> >>>><br>
>> >>>><br>
>> >>>> On Wednesday, November 7, 2012 11:54:47 AM UTC+9, Sebastien Mondet<br>
>> >>>> wrote:<br>
>> >>>><br>
>> >>>>><br>
>> >>>>> I'm not sure if this is your problem, but there was something with<br>
>> >>>>> the<br>
>> >>>>> toplevel (comming with the system compiler) not knowing about opam<br>
>> >>>>> packages.<br>
>> >>>>> I have to launch:<br>
>> >>>>><br>
>> >>>>> ocaml -I $OCAML_TOPLEVEL_PATH<br>
>> >>>>><br>
>> >>>>> (the variable OCAML_TOPLEVEL_PATH is set by eval `opam config -env`)<br>
>> >>>>><br>
>> >>>>><br>
>> >>>>> On Tue, Nov 6, 2012 at 9:37 PM, Francois Berenger<br>
>> >>>>> <francois.ber...@**<br>
>> >>>>> <a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
>> >>>>><br>
>> >>>>>> Apparently, ocamlfind knows where these libraries are:<br>
>> >>>>>><br>
>> >>>>>> $ ocamlfind -query core<br>
>> >>>>>> /home/berenger/.opam/system/**lib/core<br>
>> >>>>>> $ ocamlfind -query async<br>
>> >>>>>> /home/berenger/.opam/system/**lib/async<br>
>> >>>>>> $ ocamlfind -query async_extra<br>
>> >>>>>> /home/berenger/.opam/system/**lib/async_extra<br>
>> >>>>>><br>
>> >>>>>><br>
>> >>>>>> On Wednesday, November 7, 2012 11:32:43 AM UTC+9, Francois Berenger<br>
>> >>>>>> wrote:<br>
>> >>>>>>><br>
>> >>>>>>> Hello,<br>
>> >>>>>>><br>
>> >>>>>>> I'd like to play with core in my toplevel.<br>
>> >>>>>>><br>
>> >>>>>>> Is there a recipe?<br>
>> >>>>>>><br>
>> >>>>>>> I have installed everything with OPAM:<br>
>> >>>>>>> $ opam list | egrep "core|async"<br>
>> >>>>>>> async 108.07.01 Monadic concurrency library<br>
>> >>>>>>> async_core 108.07.01 Monadic concurrency library<br>
>> >>>>>>> async_extra 108.07.01 Monadic concurrency library<br>
>> >>>>>>> async_unix 108.07.01 Monadic concurrency library<br>
>> >>>>>>> core 108.07.01 Industrial strength alternative<br>
>> >>>>>>> to<br>
>> >>>>>>> OCaml's standard library<br>
>> >>>>>>> core_extended -- Extra components that are not as<br>
>> >>>>>>> closely vetted or as stable as Core<br>
>> >>>>>>><br>
>> >>>>>>> In my toplevel, I type<br>
>> >>>>>>> #use "topfind";;<br>
>> >>>>>>> #list;;<br>
>> >>>>>>><br>
>> >>>>>>> Nothing about core or async shows up.<br>
>> >>>>>>> While parmap is there, for example.<br>
>> >>>>>>><br>
>> >>>>>>> Is this normal?<br>
>> >>>>>>><br>
>> >>>>>>> I guess there is some configuration file of findlib to tweak<br>
>> >>>>>>> somewhere.<br>
>> >>>>>>><br>
>> >>>>>>> Regards,<br>
>> >>>>>>> F.<br>
>> >>>>>>><br>
>> >>>>>>><br>
>> >>>>><br>
>> >>><br>
>> >><br>
</div></div></blockquote></div><br></div>