Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005792OCamlstandard librarypublic2012-10-16 01:342016-12-08 11:42
Assigned Todoligez 
PrioritynormalSeverityfeatureReproducibilityhave not tried
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0005792: request for Weak.set_some function
DescriptionCould we get the following function added to the [Weak] module?

  val set_some : 'a t -> int -> 'a -> unit

It would satisfy the equation:

  set_some t i a = set t i (Some a)

but would have the benefit that one is not forced to allocate a [Some]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
bjeannet (reporter)
2013-06-06 11:56

I would be also glad also to have such a function.

1) It is not practical to implement it as a normal programmer, because one needs access to .h files that are not installed by the compiler.

2) It is a trivial addition.

3) I tried it (by modifying directly byterun/weak.c), and on a benchmark where I used to Weak arrays for memoization (modification of Filliatre BDD library), I gained 10%.
frisch (developer)
2016-12-08 11:42

Sounds like a useful addition to make. Marking this as "Suspended" for now, but a PR is welcome!

- Issue History
Date Modified Username Field Change
2012-10-16 01:34 sweeks New Issue
2013-06-06 11:56 bjeannet Note Added: 0009420
2013-06-07 19:03 xleroy Assigned To => doligez
2013-06-07 19:03 xleroy Status new => acknowledged
2016-12-08 11:42 frisch Note Added: 0016843
2016-12-08 11:42 frisch Status acknowledged => resolved
2016-12-08 11:42 frisch Resolution open => suspended
2017-02-23 16:43 doligez Category OCaml standard library => standard library

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker