# Removal of workspace() and a way to clear variables

**URL:** <https://discourse.julialang.org/t/removal-of-workspace-and-a-way-to-clear-variables/11107>\
**Category:** Internals & Design\
**Created:** [May 23, 2018, 6:26pm UTC](https://discourse.julialang.org/t/removal-of-workspace-and-a-way-to-clear-variables/11107 "2018-05-23T18:26:46Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [May 23, 2018, 6:58pm UTC](https://discourse.julialang.org/t/removal-of-workspace-and-a-way-to-clear-variables/11107/4 "2018-05-23T18:58:18Z")

</div>

My understanding is that when you type `x=1` in the REPL, it adds an `x` binding in the Main module, it’s a bit like typing:

```julia
module Main
    x = 1
end

```

It seems Julia keeps some sort of list of [all the bindings](https://github.com/JuliaLang/julia/blob/6a02edfae865054cdc643580ba5fc5269c1654a9/src/module.c#L661) in a module, is there a reason why we can’t remove an element from that table ? e.g. `delete!(Main,:x)`.

Otherwise maybe something like [REPLinModule](https://github.com/tshort/REPLinModule.jl) might a workaround, to get a clean workspace you would do `module Testing end`, `REPLinModule.set(Testing)` and your REPL would then be evaluating in an empty module (which is more or less what workspace does, as I understand).

---

_[View the full topic](https://discourse.julialang.org/t/removal-of-workspace-and-a-way-to-clear-variables/11107)._
