Code Monkey home page Code Monkey logo

Comments (3)

latkin avatar latkin commented on May 18, 2024

@dsyme - related to https://visualfsharp.codeplex.com/workitem/29 and/or #27 ?

from fsharp.

dsyme avatar dsyme commented on May 18, 2024

For F# 4.0 (and F# 3.x) it seems best to resolve this as by design. In F#, "private" means "private to the enclosing module or type". However, the meaning of "private" for a construct in a namespace needs clarification.

The F# Language Spec for F# 2.x-4.0 will be adjusted to clarify that "private" on a type or module in a namespace declaration group "namespace N = " means "accessible from that namespace declaration group, or any namespace declaration group in the same assembly contributing to either N of a sub-namespace of N." This means that a private construct in namespace N is accessible from all other namespace declaration groups in the same assembly contributing to N.

I understand that this is a weaker form of "private" than simply "private to the encloding namespace declaration group" or "private to the file". However, it is as F# 2.0-3.x has always implemented. Any adjustment to restrict this is surprisingly non-trivial, partly because we must give a warning for existing uses, rather than an error. This needs a lot of care beyond what I'd like to see for F# 4.0 at this stage.

I've added an F# Language User Voice suggestion suggesting we consider restricting this in future versions of F#.

(BTW the only other modification that looks reasonable here for F# 4.0 would be to simply give a warning to recommend that people use "internal" rather than "private" for types and modules in namespaces)

from fsharp.

dsyme avatar dsyme commented on May 18, 2024

Tracked by the user voice request

from fsharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.