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

Extract predicates for compiler versions #1091

Merged
merged 1 commit into from
Aug 6, 2018

Conversation

emillon
Copy link
Collaborator

@emillon emillon commented Aug 3, 2018

Instead of comparing on the version numbers, add some predicates in Context that describe the compiler behavior.

(as discussed in #1079)

@emillon emillon requested a review from rgrinberg August 3, 2018 09:09
Copy link
Member

@rgrinberg rgrinberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than compiler I would suggest to use ocamlc.

Also, we might consider grouping these checks in a submodules and shortening the names, but this is a matter of taste.

@emillon
Copy link
Collaborator Author

emillon commented Aug 3, 2018

Do you mean ocamlc in contrast to ocamlopt?

I think there might be some room to extract a module for the compiler version itself (int * int * int), I'll try to do that.

@rgrinberg
Copy link
Member

Well we also have a C compiler that we sometimes use. But actually, we already have a val compiler function, so we might as well keep the compiler prefix

@emillon emillon force-pushed the compiler-version-predicates branch from 54d9be2 to 2bd5af0 Compare August 6, 2018 09:56
@emillon
Copy link
Collaborator Author

emillon commented Aug 6, 2018

I extracted a module with an abstract type that does this. It will play nice with Comparable as well. Let me know what you think.

@ghost
Copy link

ghost commented Aug 6, 2018

Looks good but I find the name Ocaml_compiler_version a bit long, what do you think of just Ocaml_version?

Instead of comparing on the version numbers, add some predicates in a
new `Ocaml_version` module that describe the compiler behavior.

Signed-off-by: Etienne Millon <me@emillon.org>
@emillon emillon force-pushed the compiler-version-predicates branch from 2bd5af0 to 4bacf48 Compare August 6, 2018 11:49
@emillon
Copy link
Collaborator Author

emillon commented Aug 6, 2018

Sure, good idea! Just changed this and rebased.

@emillon emillon merged commit 48ece7f into master Aug 6, 2018
@emillon emillon deleted the compiler-version-predicates branch August 6, 2018 12:28
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

Successfully merging this pull request may close these issues.

2 participants