sorawee
2020-12-12 04:58:38

I wish the require is not optimized for non-prefix-in and non-only-in.


sorawee
2020-12-12 04:58:49

Currently, it’s so easy to write (require racket/string)


sorawee
2020-12-12 04:59:07

but that causes compatibility issues when we want to add a new function to racket/string


sorawee
2020-12-12 04:59:22

sorawee
2020-12-12 05:01:31

Maybe a better API should be (require (all-from-in racket/string))? Similar to import * from racket/string


sorawee
2020-12-12 05:02:21

Like, it’s OK if you want everything, but it should be explicit, and if you do that, we don’t guarantee that there won’t be compatibility issues


sorawee
2020-12-12 05:04:59

Also hope that Rhombus will have .. Qualified import is great.


kellysmith12.21
2020-12-12 05:22:36

@sorawee Thanks for mentioning this, I like this idea and I’m changing my lang’s require accordingly.


notjack
2020-12-12 06:25:19

Yeah. Honestly I like java’s approach of one line per imported symbol, as long as I don’t have to write those lines by hand.


rokitna
2020-12-12 06:25:45

I use only-in very consistently, and sometimes it means I end up with quite a lot of listed imports in every file. I’ve been thinking of changing over to an approach where:

  • One file in the codebase defines some macros that expand to require forms. (To be a little fancier, these could be require transformers or even a whole #lang.)

  • Many of the other files in the codebase just use those macros to require everything.

This way, most of the files wouldn’t just have a few lines of imports, but the codebase as a whole would still be meticulous about what it depends on from other codebases.