Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relative paths by default. #564

Closed
wants to merge 3 commits into from
Closed

Relative paths by default. #564

wants to merge 3 commits into from

Conversation

theemathas
Copy link

I believe that absolute paths by default in use statements are a bad idea.

@pnkfelix
Copy link
Member

pnkfelix commented Jan 9, 2015

Notes from previous discussion of this topic at a team meeting : https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-02-25.md#relative-ref--req-leading--in-use

(and here is the ticket that that discussion refers to; this predates the RFC repo so it was a ticket on the rust repo tagged with the RFC label. rust-lang/rust#10910 )

@glaebhoerl
Copy link
Contributor

Rendered

@theemathas theemathas changed the title Local paths by default. Relative paths by default. Jan 10, 2015
@theemathas
Copy link
Author

@pnkfelix I didn't see that discussion before. However, the resolution of that discussion seems unclear to me.

Additionally, I think that doing it this way would help users to better understand modules, since you just have to do everything the same way as you do in a typical file system, but with :: instead of /

@nikomatsakis
Copy link
Contributor

Regardless of the merits of the proposal, I think it is simply too late to make a breaking change of this magnitude.

@theemathas
Copy link
Author

@nikomatsakis I believe that my proposal does not break as much code as the int/uint -> isize/usize and deriving -> derive changes.

Changes in user code would be able to be mostly (if not entirely) automated. Even if there is a lot of non-automate-able changes, you can just add a feature gate for the old behavior.

Also note that there aren't any backwards compatibility promises for 1.0 alpha.
(From http://blog.rust-lang.org/2014/12/12/1.0-Timeline.html)

A pre-release version indicates that the version is unstable and might not
satisfy the intended compatibility requirements as denoted by its associated
normal version.

Actually, I don't know of any valid reasons not to make this change. (Except if the compiler requires a lot of modification, and I believe that it doesn't)

Please correct me if I am wrong.

@sinistersnare
Copy link

valid reasons not to make this change

  • nobody wants to implement it
  • people want absolute paths in imports
  • too much craziness going on in the compiler to do it in time for 1.0.

There's three.

@sinistersnare
Copy link

-1, changing semantics like this so close to 1.0 might not be a good idea.

@yedpodtrzitko
Copy link

would this mean that modules called super or crate would collide on import?

@theemathas
Copy link
Author

@yedpodtrzitko IIRC modules named super or crate are already compile errors.

@theemathas
Copy link
Author

@nikomatsakis @sinistersnare I have realized that I misinterpreted the 1.0 alpha compatibility guarantees. I am retracting this RFC.

@theemathas theemathas closed this Jan 15, 2015
@bombless
Copy link

Relative-path including reminds me of PHP file including, which is a pain in the neck for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants