Skip to content

Commit

Permalink
remove workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
fredrikekre committed Dec 12, 2017
1 parent 7708eb1 commit 4d99bc6
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 105 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,8 @@ Deprecated or removed
* `trues(A::AbstractArray)` and `falses(A::AbstractArray)` are deprecated in favor of
`trues(size(A))` and `falses(size(A))` respectively ([#24595]).

* `workspace` is discontinued ([#25046]).

* `cumsum`, `cumprod`, `accumulate`, and their mutating versions now require a `dim`
argument instead of defaulting to using the first dimension ([#24684]).

Expand Down
1 change: 0 additions & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,6 @@ export
varinfo,
versioninfo,
which,
workspace,
@isdefined,

# loading source files
Expand Down
27 changes: 0 additions & 27 deletions base/interactiveutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -666,33 +666,6 @@ functionality instead.
"""
download(url, filename)

# workspace management

"""
workspace()
Replace the top-level module (`Main`) with a new one, providing a clean workspace. The
previous `Main` module is made available as `LastMain`.
If `Package` was previously loaded, `using Package` in the new `Main` will re-use the
loaded copy. Run `reload("Package")` first to load a fresh copy.
This function should only be used interactively.
"""
function workspace()
last = Core.Main # ensure to reference the current Main module
b = Base # this module
ccall(:jl_new_main_module, Any, ()) # make Core.Main a new baremodule
m = Core.Main # now grab a handle to the new Main module
ccall(:jl_add_standard_imports, Void, (Any,), m)
eval(m, Expr(:toplevel,
:(const Base = $b),
:(const LastMain = $last),
:(using Base.MainInclude)))
empty!(package_locks)
return m
end

# testing

"""
Expand Down
2 changes: 1 addition & 1 deletion base/reflection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module_name(m::Module) = ccall(:jl_module_name, Ref{Symbol}, (Any,), m)
"""
module_parent(m::Module) -> Module
Get a module's enclosing `Module`. `Main` is its own parent, as is `LastMain` after `workspace()`.
Get a module's enclosing `Module`. `Main` is its own parent.
# Examples
```jldoctest
Expand Down
2 changes: 1 addition & 1 deletion doc/src/manual/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ code to help the user avoid other wrong-behavior situations:
emitted when the incremental precompile flag is set.
2. `global const` statements from local scope after `__init__()` has been started (see issue #12010
for plans to add an error for this)
3. Replacing a module (or calling [`workspace()`](@ref)) is a runtime error while doing an incremental precompile.
3. Replacing a module is a runtime error while doing an incremental precompile.

A few other points to be aware of:

Expand Down
1 change: 0 additions & 1 deletion doc/src/stdlib/base.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Base.methods
Base.methodswith
Base.@show
Base.versioninfo
Base.workspace
ans
```

Expand Down
2 changes: 1 addition & 1 deletion test/choosetests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function choosetests(choices = [])
"replutil", "sets", "goto", "llvmcall", "llvmcall2", "grisu",
"nullable", "meta", "stacktraces", "libgit2", "docs",
"markdown", "serialize", "misc", "threads",
"enums", "cmdlineargs", "i18n", "workspace", "libdl", "int",
"enums", "cmdlineargs", "i18n", "libdl", "int",
"checked", "bitset", "floatfuncs", "compile", "distributed", "inline",
"boundscheck", "error", "ambiguous", "cartesian", "asmvariant", "osutils",
"channels", "iostream", "specificity", "codegen", "codevalidation",
Expand Down
73 changes: 0 additions & 73 deletions test/workspace.jl

This file was deleted.

0 comments on commit 4d99bc6

Please sign in to comment.