[wg-camlp4] getting bitstring to work with Core

Stephen Weeks sweeks at janestreet.com
Tue May 28 17:03:09 BST 2013


We'll add [String.unsafe_{get,set}] to Core.  We'll also add
[Char.code] as a temporary measure.  Please speak up if there's
anything else.

It seems to me that it should be easy for someone to tweak the
bitstring preprocessor to accept a -core switch so that all references
to variables in OCaml's standard library are of the form
[Core.Std.Caml.x].  I don't see a need to wait for namespaces.

On Mon, May 27, 2013 at 2:23 PM, Yaron Minsky  wrote:
> The basic issue is that Core is a new library, not an overlay on the
> stdlib.  As such, it has its own interface conventions, and so we have
> Char.to_int and Char.of_int rather than Char.code and Char.chr.
>
> Hiding unsafe_set and unsafe_get is another issue, and I agree those
> can just be shown.  And I don't even mind adding Char.code as a
> temporary measure.  But in the end, there should be a way for syntax
> extensions to refer to the standard library without confusion.
> Namespaces I believe should help here.
>
> y
>
> On Mon, May 27, 2013 at 9:53 AM, Richard W.M. Jones  wrote:
>> On Mon, May 27, 2013 at 11:47:27AM +0100, Anil Madhavapeddy wrote:
>>> Core currently hides two functions needed by the Bitstring syntax
>>> extension: Char.code and String.unsafe_get.  I'm not sure what the
>>> best way to work around this is. Possibilities are:
>>
>> I guess, *why* are they hidden?  Bitstring should use both functions
>> in a safe way.
>>
>> Rich.
>>
>> --
>> Richard Jones
>> Red Hat
>> _______________________________________________
>> wg-camlp4 mailing list
>> wg-camlp4 at lists.ocaml.org
>> http://lists.ocaml.org/listinfo/wg-camlp4
>
> --
> You received this message because you are subscribed to the Google Groups "ocaml-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to ocaml-core+unsubscribe at googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>


More information about the wg-camlp4 mailing list