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

Duplicate Dynlink.is_native as Sys.is_native #5566

Closed
vicuna opened this issue Mar 29, 2012 · 4 comments
Closed

Duplicate Dynlink.is_native as Sys.is_native #5566

vicuna opened this issue Mar 29, 2012 · 4 comments

Comments

@vicuna
Copy link

vicuna commented Mar 29, 2012

Original bug ID: 5566
Reporter: Hendrik Tews
Assigned to: @alainfrisch
Status: resolved (set by @alainfrisch on 2016-12-06T15:01:24Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 3.12.1
Fixed in version: 4.04.0
Category: standard library
Monitored by: meurer mehdi @glondu @hcarty

Bug description

I would like to suggest to have the is_native flag also in module
Sys. This way, code running in the toplevel could distinguish
whether it is running inside ocaml or inside ocamlnat, in order
to decide whether it should call Topdirs.load_file with cmo or
cmxs arguments.

@vicuna
Copy link
Author

vicuna commented Mar 29, 2012

Comment author: @protz

I can already run the following sequence in a toplevel:

#use "topfind";;
#require "dynlink";;
Dynlink.is_native;;

Is that not enough? There's different Dynlink implementations in the source tree, so it's easy to define is_native as being true or false, but I'm not sure how we would do that inside the Sys module...

@vicuna
Copy link
Author

vicuna commented Mar 29, 2012

Comment author: Hendrik Tews

Having Sys.is_native is useful especially in those cases where
the dynlink library is not required. In those cases one doesn't
really want to load findlib and dynlink to access just one boolean.

One can always check at program invocation whether one is going
to run a native program and use different source code or
additional arguments for the native program.

@vicuna
Copy link
Author

vicuna commented Mar 29, 2012

Comment author: @alainfrisch

I'm not sure how we would do that inside the Sys module...

We could have the runtime environment provide such a function (with different implementation in byterun and asmrun).

@vicuna
Copy link
Author

vicuna commented Dec 6, 2016

Comment author: @alainfrisch

We have Sys.backend_type (since 4.04).

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

2 participants