Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

rtop only understands old function syntax #81

Open
svoynow opened this issue Jul 17, 2018 · 1 comment
Open

rtop only understands old function syntax #81

svoynow opened this issue Jul 17, 2018 · 1 comment

Comments

@svoynow
Copy link

svoynow commented Jul 17, 2018

Not sure if this is the right place for this, or if this is a known issue:

Reason # let foo = fun(x) => x + 2;
let foo : int => int = <fun>                                                    
Reason # let foo = (x) => x + 2;
Error: Syntax error 
 $ rtop -version
The universal toplevel for OCaml, version 1.19.3, compiled for OCaml version 4.02.3

I know that "Try ReasonML" is preferred as a sandbox/repl solution, but I find rtop useful when explaining types to people.

@brooklynrob
Copy link

brooklynrob commented Jan 1, 2019

Disregard comment below, though leaving for context as to how I recreated the same problem @svoynow had. I am still having the same problem described above - (rtop only supports "old" Reason 2 syntax)

In my investigations I did notice that the dune-project file requires Dune 1.4, but isn't the latest version from Jane Street 1.2.1? Don't think it's related by I noted it.

I experienced the same problem just as described above by @svoynow today (2019.1.1) after installing Reason (via opam).

I was able to remedy by running opam update and then opam upgrade which hds the effect of upgrading menhir from the version tagged "20171013" to the version tagged "20180905". Once that happened, the new Reason 3 syntax worked in rtop.

@svoynow did you install via yarn/npm or via opam? As context I have/had existing OCaml switches and installed Reason via opam (on a separate 4.04.2 switch I created to segregate my Reason work) using the instructions here, https://github.com/facebook/reason/blob/master/src/README.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants