Skip to content

Toplevel: please add a primitive to compile a file test.ml as a module Test. #5825

Description

@vicuna

Original bug ID: 5825
Reporter: hnrgrgr
Assigned to: meyer
Status: closed (set by @xavierleroy on 2015-12-11T18:21:15Z)
Resolution: fixed
Priority: normal
Severity: feature
Fixed in version: 4.01.0+dev
Category: ~DO NOT USE (was: OCaml general)
Duplicate of: #3121
Monitored by: @hcarty

Bug description

This bugs is a follow-up to a thread of the caml-list:

https://sympa.inria.fr/sympa/arc/caml-list/2012-11/msg00021 .html

While testing/debugging some code with the OCaml toplevel, one may want to "#load" a module while keeping access to functions hidden by a .mli

The primitive "#use" already allow this, but when loading multiple files the "module-as-namespace" paradigm is not usable.

Here is a small patch that introduces a new primitive: #mod_use "file.ml"
It behaves as '#use "file.ml"', but wrap the content of 'file.ml' in a module 'File'.

File attachments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions