# Juno, modules and keyword \`end\`

**URL:** https://discourse.julialang.org/t/juno-modules-and-keyword-end/2797
**Category:** General Usage
**Created:** [March 21, 2017, 5:42pm UTC](https://discourse.julialang.org/t/juno-modules-and-keyword-end/2797 "2017-03-21T17:42:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![j2b2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j2b2/32/3387_2.png) [@j2b2](https://discourse.julialang.org/u/j2b2)
#### Post date: [March 21, 2017, 5:42pm UTC](https://discourse.julialang.org/t/juno-modules-and-keyword-end/2797/1 "2017-03-21T17:42:13Z")

</div>

I much appreciate workflow made available by Juno while developing a module (see [atom-julia-client/workflow.md at master · JunoLab/atom-julia-client · GitHub](https://github.com/JunoLab/atom-julia-client/blob/master/manual/workflow.md)). But I encountered this silly situation:

```julia
module abc
function f(a::Vector{Int})
  s = 0
  for x in a[2:end]
    s += x*x
  end
end
end

```

When the cursor is on the `end` of function `f`, I see `Main` on the status bar, no more `Main/abc`. And if I add a new function `alpha` at the end of my module, and evaluate its definition as usual, I can’t use it:

```julia
abc.alpha(3) UndefVarError: alpha not defined

```

I was very perturbed (because I use daily module’s development with Juno), until I realized that `end` in `a[2:end]` was misinterpreted by Juno, and ruined following scopes – of course my module was a little larger, and I needed some time to discover this bug, sigh.

---

<div class="post-metadata">

### Author: ![MikeInnes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikeinnes/32/3656_2.png) [@MikeInnes](https://discourse.julialang.org/u/MikeInnes)
#### Post date: [March 21, 2017, 5:46pm UTC](https://discourse.julialang.org/t/juno-modules-and-keyword-end/2797/2 "2017-03-21T17:46:33Z")

</div>

Can you try `Pkg.status()` and find out what version of CodeTools you are on? This should be fixed, but I’m not sure if we released the fix yet.

---

<div class="post-metadata">

### Author: ![j2b2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/j2b2/32/3387_2.png) [@j2b2](https://discourse.julialang.org/u/j2b2)
#### Post date: [March 21, 2017, 6:51pm UTC](https://discourse.julialang.org/t/juno-modules-and-keyword-end/2797/3 "2017-03-21T18:51:40Z")

</div>

```julia
 - CodeTools 0.4.3

```

If you are aware of the problem, it’s ok, I’m not in a hurry 🙂 There is another related situation, where a macro, e.g. `@inbounds`, precedes a `for` loop, and so on.

Many thanks for your beautiful work !
