if I have a file, utility.jakt that defines a cool array --> string join method, like so:
function join(anon strings: [String], separator: String) throws -> String {
mut output = ""
mut i = 0uz
for s in strings.iterator() {
output += s
if i < strings.size() - 1 {
output += separator
}
i++
}
return output
}
The generated C++ function is always static
, so, file local to the translation unit that's ultimately created from utility.jakt.
This poses problems for:
A "simple" solution to this issue would be to introduce a new keyword, export
.
Export would have some cute semantics:
Probably would want both a function decorator and a block context, similar to namespaces
export function join(anon strings: [String], separator: String) throws -> String {
...
}
export {
function join(anon strings: [String], separator: String) throws -> String
function union(anon strings: [String], other_strings: [String]) throws -> String {
}
Should we allow exporting imported items?
Now it's sounding like all the things C++ modules are supposed to do :)
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too