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

vicuna opened this issue Jul 22, 2014 · 2 comments

Expose caml_string_equal &c to OCaml #6494

vicuna opened this issue Jul 22, 2014 · 2 comments


Copy link

@vicuna 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.

Copy link

@vicuna vicuna commented Jul 31, 2014

Comment author: dinosaure

I send a new PR :) #84

Copy link

@vicuna 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
None yet

No branches or pull requests

2 participants