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

Expose caml_string_equal &c to OCaml #6494

Closed
vicuna opened this issue Jul 22, 2014 · 2 comments
Closed

Expose caml_string_equal &c to OCaml #6494

vicuna opened this issue Jul 22, 2014 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Jul 22, 2014

Original bug ID: 6494
Reporter: @whitequark
Assigned to: @gasche
Status: closed (set by @xavierleroy on 2016-12-07T10:37:17Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.02.0+beta1 / +rc1
Target version: undecided
Category: standard library
Tags: junior_job
Monitored by: @gasche @hcarty

Bug description

Currently, it is possible to call an optimized equality function by forcing specialization, e.g. with:

let string_eq = fun (a:string) b -> a = b

However, it's fragile and not guaranteed by anything in the compiler.

I think modules Char/String/Bytes/Int64/Int32/Nativeint should definitely offer an "equal" function. I'm not sure where the corresponding functions for bool, int and float should go.

@vicuna
Copy link
Author

vicuna commented Jul 31, 2014

Comment author: dinosaure

I send a new PR :) #84

@vicuna
Copy link
Author

vicuna commented Dec 21, 2014

Comment author: @gasche

I merged dinosaure's patch in trunk. There may be some further changes depending on whether people think the name "equal" has a too-high risk of shadowing existing names when opening modules.

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