I think my original example was even a bit over complicated. I'd just like to be able to create /notebooks/mymodule/module.modulemap and import it in my notebook. Your workaround works for now, thanks for the help.
For the future, have you thought of any of the following:
- adding $cwd/ to the search path for .modulemap files? Not sure if that counts as principled though :D
- is there a way to pass -I$cwd (or $cwd/modules etc) to the swift repl? Ultimately this is all I'm looking to do.
- Updating %include to support including a module, or even any directory in the sources
- Allowing the user to directly update/override the Package.swift template that is used behind the scenes? This way the user would not have to learn an extra abstraction that manipulates the package manifest. I could see myself wanting to create a /notebook/Sources folder and wanting to use targets[ .systemLibrary(name: "mymodule") ]. Perhaps that is too fancy though.