New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use dependencies like Core with Reason & rebuild? #556
Comments
Yes! I totally agree. On the Reason landing page, you'll see that there are three main "pillars" of Reason: Syntax, Build, Share. The Build and Share items are faded out as a sort of acknowledgment of what you've observed, and conveying our intent to eventually "fill them in". I hope @yunxing knows the answer to your question to unblock you in the short term though. We're hoping that eventually, you'll just be able to make a |
@jordwalke thanks for the reply. I'm not sure about the |
@davidpelaez I'm developing jengaboot a bit silently. If you want, jump on #reasonml in free node and ping me =) |
In theory I thought you could do something like this: /* Hello.re */
open! Core.Std;
let rec read_and_accumulate accum => {
let line = In_channel.input_line In_channel.stdin;
switch line {
| None => accum
| Some x => read_and_accumulate (accum +. Float.of_string x)
}
};
let () = printf "Total: %F\n" (read_and_accumulate 0.);
I tried it the CommonML way, but this gives me I'll try Jenga later this evening, hopefully I'll have more success 😄 |
|
After a lot of help from @chenglou I could figure out how to do it. Basically the _tags indicated in https://janestreet.github.io/installation.html have to be added and three more flags and values: open Core.Std;
let rec read_and_accumulate accum => {
let line = In_channel.input_line In_channel.stdin;
switch line {
| None => accum
| Some x => read_and_accumulate (accum +. Float.of_string x)
}
};
let () = printf "Total: %F\n" (read_and_accumulate 0.); I can compile it to a native binary with:
I would like to use ocamlbuild but I couldn't find a way to set the |
@davidpelaez Thank you for sharing your solution so others can use it! |
Hi @davidpelaez, just got back to town. Thanks for checking out Reason. You actually helped us to discover a bug in rebuild -- rebuild doesn't work with First of all, here are some contexts about how What's the problem here? After a package is installed, one needs to call However, remember we just replaced all the calls to The fix? Instead of changing the subcommand from I'm going to submit a fix about this soon. |
maybe this is somehow related. I am using https://github.com/reasonml/ReasonNativeProject to start a native reason project and i hit the same error when i try to add
this time I cannot easily pass in the |
The solution @Jimexist is looking for (and anyone else is looking for) is the
|
This question will probably get more discussion in the reasonml forums -- https://reasonml.chat/ |
I had never taken the time to learn OCaml but Reason does indeed feel more accessible to me. Thank you for contributing to make OCaml easier for people like me! I'm using the weekend to get started and trying to follow Real World OCaml examples with Reason syntax. I've been unable to
open Core.Std
. Here's the question I wrote in StackOverflow:I'm new to OCaml and I'm trying to try (:P) Facebook Reason syntax. I cannot find a way to make this compile because if cannot find the Core module (already installed with opam).
I'm trying to compile a sample program from Real World OCaml
This is the command I'm using for compilation:
rebuild accum.native.
When I have this in _tags (from the instructions in https://janestreet.github.io/installation.html)
My error changes but I still don't know what to do:
What do I have to do to use Core with Reason?
Adopting the syntax is pretty easy and I have only been reading for a couple hours, but there's zero docs about how to use Reason for non OCaml users.
I posted this in http://stackoverflow.com/questions/37504534/how-to-use-jane-streets-core-with-reason so it would be helpful if you reply there, otherwise I'll copy any help received here :)
The text was updated successfully, but these errors were encountered: