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

Automatically remove .jl termination in Pkg.add #20630

Closed
dpsanders opened this issue Feb 16, 2017 · 11 comments · Fixed by #20681
Closed

Automatically remove .jl termination in Pkg.add #20630

dpsanders opened this issue Feb 16, 2017 · 11 comments · Fixed by #20681
Labels
domain:packages Package management and loading good first issue Indicates a good issue for first-time contributors to Julia status:help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@dpsanders
Copy link
Contributor

julia> Pkg.add("Lint.jl")
ERROR: unknown package Lint.jl
@tkelman tkelman added the domain:packages Package management and loading label Feb 16, 2017
@StefanKarpinski
Copy link
Sponsor Member

Very good idea. Should be simple to implement.

@StefanKarpinski StefanKarpinski added status:help wanted Indicates that a maintainer wants help on an issue or pull request good first issue Indicates a good issue for first-time contributors to Julia labels Feb 16, 2017
@dpsanders
Copy link
Contributor Author

Also in e.g.
using Lint.jl
import Lint.jl

@timholy
Copy link
Sponsor Member

timholy commented Feb 16, 2017

PkgDev is another: how many times have I said PkgDev.generate("MyNewPackage.jl") and created a MyNewPackage.jl.jl?

@cossio
Copy link
Contributor

cossio commented Feb 16, 2017

What if a package is named "package.jl"? That is, the source file is "package.jl.jl". Such a naming pattern is not hard to imagine. Maybe somebody has a package for different languages, and decided to append .py, .jl, etc to the package name to identify the language.

@dpsanders
Copy link
Contributor Author

Would anybody really have a source file package.jl.jl? Have you ever actually seen that? We should definitely be anti-encouraging that.

@cossio
Copy link
Contributor

cossio commented Feb 16, 2017

I have never seen it. But it should be kept in mind if one decides that Pkg.add("Lint.jl") automatically removes the .jl. Maybe mention it in the documentation.

@yuyichao
Copy link
Contributor

Also in e.g.
using Lint.jl
import Lint.jl

Note that these are already legal expressions.

@dpsanders
Copy link
Contributor Author

Ah, I was checking on 0.5 where they weren't, thanks.

@yuyichao
Copy link
Contributor

It always is

               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-pc-linux-gnu

julia> module A
       jl = 1
       end
A

julia> using A.jl

@dpsanders
Copy link
Contributor Author

Ah, oops, thanks.

@StefanKarpinski
Copy link
Sponsor Member

As @yuyichao pointed out, using Foo.jl already has a meaning. Package names can't contain dots so there's no actual danger of a package named Foo.jl with source file Foo.jl.jl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:packages Package management and loading good first issue Indicates a good issue for first-time contributors to Julia status:help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants