| Anonymous | Login | Signup for a new account | 2013-05-23 05:54 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004751 | OCaml | OCaml general | public | 2009-03-18 20:10 | 2013-03-15 15:02 | ||||||
| Reporter | mottl | ||||||||||
| Assigned To | garrigue | ||||||||||
| Priority | normal | Severity | feature | Reproducibility | N/A | ||||||
| Status | assigned | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.11.0 | ||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0004751: caml_hash_variant not available in standard library | ||||||||||
| Description | The runtime C-function "caml_hash_variant", which takes a string and calculates the hash value associated with e.g. a polymorphic variant of that name, is currently not callable from within OCaml. Could you please add a binding for it to some module in the standard library (maybe Hashtbl, next to "hash")? | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0007497) garrigue (manager) 2012-06-01 09:45 |
What would you need hash_variant for? I see no legal use from inside ocaml. You can already do it for fixed strings by (Obj.magic `Variant : int). You can also copy the corresponding function from ocaml sources (it is supposed to be fixed forever). |
|
(0007502) mottl (reporter) 2012-06-01 15:04 |
If I remember correctly, this function was needed back then for some code generation or preprocessing stuff. I implemented it in OCaml for the type_conv library, but it's actually not used by any public library anymore. It's presumably not super-important. |
|
(0007695) gares (reporter) 2012-07-10 18:52 |
+1 for this function in the Obj module. I have a use case. Coq marshals to disk its data structures (creating .vo files). The coqchk tool verifies that .vo files have the right format (and also that their content is sound). It is written in OCaml and uses Obj.* introspection facilities to verify the format (the type) of the marshaled data. Without Obj.hash_variant polymorphic variants cannot be used in the data structures Coq marshals to disk. |
|
(0008973) mbarbin (reporter) 2013-03-15 15:02 |
+1 for this function in the Obj module. If you do some type related preprocessing it is likely that you'll end up needing it. I also have a use case for it in a piece of code that deals with runtime types. > You can also copy the corresponding function from ocaml sources > (it is supposed to be fixed forever). this is indeed in practice what we do for now at janestreet, paired with a few unit tests to make sure this matches what the compiler does, but it seems like a binding would be better. the stability of the computation can be discussed separately I guess. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-03-18 20:10 | mottl | New Issue | |
| 2009-04-29 15:42 | doligez | Status | new => acknowledged |
| 2012-06-01 09:45 | garrigue | Note Added: 0007497 | |
| 2012-06-01 09:45 | garrigue | Assigned To | => garrigue |
| 2012-06-01 09:45 | garrigue | Status | acknowledged => feedback |
| 2012-06-01 15:04 | mottl | Note Added: 0007502 | |
| 2012-06-01 15:04 | mottl | Status | feedback => assigned |
| 2012-07-10 18:52 | gares | Note Added: 0007695 | |
| 2013-03-15 15:02 | mbarbin | Note Added: 0008973 | |
| Copyright © 2000 - 2011 MantisBT Group |