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

Ocaml keyword conflicts #24

Closed
edmcman opened this issue Feb 27, 2013 · 4 comments
Closed

Ocaml keyword conflicts #24

edmcman opened this issue Feb 27, 2013 · 4 comments

Comments

@edmcman
Copy link

edmcman commented Feb 27, 2013

I am using piqi to serialize some language related types. The following type names result in errors when compiling piqi-generated ML code:

  • assert
  • type
  • mod
  • and
  • or
  • let

I am sure there are more; these are only the ones I ran into. It would probably be a good idea to check for any ocaml keywords and disallow them as type or field names in piqi.

@bookshelfdave
Copy link

Hello -

I don't work on Piqi, however I had the same issue. See https://gist.github.com/metadave/3195858 for @alavrik's response.

Cheers -
Dave

@alavrik
Copy link
Owner

alavrik commented Feb 28, 2013

Take a look at the @metadave's example. There is a very simple and elegant solution to this practical problem. The use of ocaml-name is also mentioned in the docs.

As for the checks, I think it it would be a nice addition to piqic ocaml.

@edmcman
Copy link
Author

edmcman commented Mar 1, 2013

Thanks, I like @metadave's example. For me, though, it's just as easy to change the names, because I only use ocaml. I think adding the checks to piqic ocaml is a good idea; it's better to catch the problem early in my opinion.

@alavrik
Copy link
Owner

alavrik commented Feb 5, 2014

Moving this issue to the newly created piqi-ocaml repo.

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

No branches or pull requests

3 participants