laurent.orseau
2020-12-12 09:06:56

What do you mean here?


sorawee
2020-12-12 09:18:52

In, say, Python, import json gives you json (which is an object, so you can refer to things in json by json.blah) rather than all symbols in json.


sorawee
2020-12-12 09:19:14

Haskell has the same thing


sorawee
2020-12-12 09:20:22

For Rhombus, it might look like:

require racket/string string.split "a,b,c" ","


sorawee
2020-12-12 09:21:36

Though string can’t be an object like Python, because it wouldn’t make sense to invoke a macro in a runtime object


sorawee
2020-12-12 09:24:06

Though… this doesn’t really solve the problem I originally posted, does it? Cause other people might write:

require racket/string require mylib/string and we now have conflicting string.split


sorawee
2020-12-12 09:34:01

One possible solution is that by default, you can’t import the two collections ending with .../string.

However, you can:

require racket/string as string require mylib/string as string and now you are on your own for any conflict.


laurent.orseau
2020-12-12 10:47:43

So that’s what the . meant :)


laurent.orseau
2020-12-12 10:56:07

My opinion is that we should not allow any shadowing with requires. Any conflict must be resolved manually. However, when a conflict is discovered, the error should mention when the identifier was introduced in both libraires—at least for well designed libraries—so as to help the user resolve it easily. In particular it’s likely that the conflict must be resolved in favor of the library that introduced it first, especially if the timestamps largely differ. Timestamps could be correctly synced at least for packages of the same catalog.


shu--hung
2020-12-13 05:28:09

@shu—hung has joined the channel