Proposal: allow top-level values to be declared in...
# language-proposals
b
Proposal: allow top-level values to be declared in a separate package from the file Example:
Copy code
package org.bh.tools.io.logging

// file stuff like the primary class go here ...
// For this example, the class is Log and it takes a java.util.Logger in its constructor

// Proposed Syntax A: place `log` in a specific other package using 1-line syntax
val org.bh.log = Log(Logger.getDefault())

// Proposed Syntax B: place `log` in a specific other package using block syntax
package <http://org.bh|org.bh> {
    val log = Log(Logger.getDefault())
}

// Proposed Syntax C: place `log` in the default package using block syntax
package {
    val log = Log(Logger.getDefault())
}