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

docs: remove direct calls to require #17277

Merged
merged 1 commit into from
Jul 19, 2016
Merged

docs: remove direct calls to require #17277

merged 1 commit into from
Jul 19, 2016

Conversation

felipenoris
Copy link
Contributor

@felipenoris felipenoris commented Jul 5, 2016

Regarding the changes on workflow-tips:

  • isinteractive() evaluates to false
  • a call to include("file.jl") on .juliarc.jl looks for files at the user's home folder, so I added a call to pwd().

@kshyatt kshyatt added the domain:docs This change adds or pertains to documentation label Jul 6, 2016
@tkelman
Copy link
Contributor

tkelman commented Jul 18, 2016

isinteractive() evaluates to false

When? It's supposed to be true for a REPL session and false for scripts.

@felipenoris
Copy link
Contributor Author

Inside .juliarc.jl:

~$ cat .juliarc.jl

if isinteractive()
    println("Interactive")
else
    println("Not interactive")
end
~$ ~/Documents/src/julia/julia
Not interactive

@tkelman
Copy link
Contributor

tkelman commented Jul 18, 2016

Ah. Wonder if/when that changed?

@yuyichao
Copy link
Contributor

#10779

@felipenoris
Copy link
Contributor Author

Looks like a regression. I should put it back in the docs.

@yuyichao
Copy link
Contributor

It's intentional afaict.

@felipenoris
Copy link
Contributor Author

So I guess there's nothing to change for this PR.

@yuyichao
Copy link
Contributor

yuyichao commented Jul 18, 2016

If you only want to use it in repo, you should call it in atreplinit instead.

@@ -75,7 +75,7 @@ issuing the command::

If you further add the following to your ``.juliarc.jl`` file ::

isinteractive() && isfile("_init.jl") && require("_init.jl")
isfile("_init.jl") && include(joinpath(pwd(), "_init.jl"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd just do include("_init.jl"), why is the joinpath needed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include is relative to current file. so at least this makes it consistent with the isfile check. I'm not sure which one (relative to current file or PWD) is the goal here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The example on the docs puts the case when _init.jl is in the current dir:
...then calling julia from that directory...
I figured isfile checks current dir, but include will check the dir where .juliarc.jl is located.

@tkelman tkelman merged commit 93ee8dd into JuliaLang:master Jul 19, 2016
@felipenoris felipenoris deleted the fn/require-docs branch August 11, 2016 13:37
mfasi pushed a commit to mfasi/julia that referenced this pull request Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:docs This change adds or pertains to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants