> On Apr 19, 2019, at 11:01 AM, zeRusski <vladilen.ko...@gmail.com> wrote:
> One hypothesis I have is that the (module lang-test foo/bar ...) doesn't > resolve > to the language but rather to the foo/bar.rkt Right. "if the unquoted path contains no /, then require automatically adds a "/main" to the reference". [1] Otherwise it doesn't. [1] https://docs.racket-lang.org/guide/module-basics.html?q=main.rkt#%28tech._collection%29 <https://docs.racket-lang.org/guide/module-basics.html?q=main.rkt#(tech._collection)> > 2. Why does the above report a cycle? How do I reason about it, better still > how > do I query the resolver, reflect and debug? This also reports a cycle: ;;; bar.rkt #lang racket (module foo "bar.rkt") I don't know exactly why. I'd suppose it's part of some compile-time sanity check on submodules. > 1. How would you write your tests in the situation like this when most of the > work > happens in the library but you also allow using it as #lang? I'd like to > keep > both kinds of tests local to the library, so I can run them as I code. Or > at > least be able to run tests that only test the lib and corresponding > language. Given the above, it seems impossible to invoke a language from within the module that implements it. Still, I'm not sure why you'd want to do this. #langs are naturally invoked from other files. Arguably, it's wise to make this part of the testing. (For instance, paths are something that can work correctly when invoking the language "locally", but turn out to be broken from afar.) I've gotten in the habit of putting my #lang tests in a separate collection (= just a neighboring directory, if your package is set up as 'multi) so that the test files can invoke the #lang the same way a user would. PS the `lang/reader.rkt` fandango is no longer necessary in modern Racket; if you like, you can use a `reader` submodule in your primary language file. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.