Skip to content
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

with returns Syntax Error #43

Open
gjaldon opened this issue Oct 23, 2016 · 3 comments
Open

with returns Syntax Error #43

gjaldon opened this issue Oct 23, 2016 · 3 comments

Comments

@gjaldon
Copy link

gjaldon commented Oct 23, 2016

I'm trying to run the below code but get a syntax error for with:

module Logon = struct
  type t =
    { session_id: string;
      time: Time.t;
      user: string;
      credentials: string;
    } with fields
end;;

I've already loaded core with open Core.Std;;. Is there some other step I'm missing or does fieldslib no longer work with Ocaml 4.03? I'm running the code above in utop (1.19.3), btw.

@ackerleytng
Copy link

Same issue here! OCaml 4.02.3 here.

This shows another syntax [@@deriving fields], which works.

Not sure what that means though.

@yixing-liu
Copy link

Same issue here!
module type M = sig type t with sexp end;;
The above is a textbook example, however, utop returns syntax error with "with" word underlined.

@brooklynrob
Copy link

brooklynrob commented Jun 17, 2017

Ran into same issue. See reply in Google Groups from @yminsky: https://groups.google.com/d/msg/ocaml-core/g9UfzyQ0hL8/HWqDU2UlBAAJ

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

No branches or pull requests

4 participants