Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005154OCamlruntime system and C interfacepublic2010-09-23 10:032016-12-08 09:46
Reporterygrek 
Assigned Todoligez 
PrioritynormalSeverityfeatureReproducibilityalways
StatusassignedResolutionopen 
PlatformOSOS Version
Product Version3.11.2 
Target VersionFixed in Version 
Summary0005154: #define Val_some
DescriptionOCaml C interface defines many macros to construct/access primitive ocaml values from C code. One thing that I often find missing and have to copy-paste myself in almost every binding is code to handle option type.
Additional Information#define Val_none Val_int(0)

value Val_some(value v)
{
    CAMLparam1(v);
    CAMLlocal1(some);
    some = caml_alloc_small(1, 0);
    Field(some, 0) = v;
    CAMLreturn(some);
}

#define Some_val(v) Field(v,0)
Tagspatch
Attached Files

- Relationships

-  Notes
(0016822)
shinwell (developer)
2016-12-08 09:43

@doligez I find the lack of this functionality to be a bit of a nuisance as well; what do you think?

- Issue History
Date Modified Username Field Change
2010-09-23 10:03 ygrek New Issue
2011-05-20 15:56 doligez Status new => acknowledged
2013-10-07 16:17 doligez Tag Attached: patch
2016-12-07 18:15 shinwell Category OCaml general => OCaml runtime system
2016-12-08 09:43 shinwell Note Added: 0016822
2016-12-08 09:43 shinwell Assigned To => doligez
2016-12-08 09:43 shinwell Status acknowledged => assigned
2016-12-08 09:43 shinwell Status assigned => feedback
2016-12-08 09:46 shinwell Status feedback => assigned
2017-02-23 16:43 doligez Category OCaml runtime system => runtime system
2017-03-03 17:45 doligez Category runtime system => runtime system and C interface


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker