# Debugging with @enter returns different return value of function

**URL:** <https://discourse.julialang.org/t/debugging-with-enter-returns-different-return-value-of-function/10779>\
**Category:** New to Julia\
**Tags:** debugging\
**Created:** [May 8, 2018, 2:04pm UTC](https://discourse.julialang.org/t/debugging-with-enter-returns-different-return-value-of-function/10779 "2018-05-08T14:04:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![moesphere](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/moesphere/32/3348_2.png) [@moesphere](https://discourse.julialang.org/u/moesphere)\
**Post date:** [May 8, 2018, 2:04pm UTC](https://discourse.julialang.org/t/debugging-with-enter-returns-different-return-value-of-function/10779/1 "2018-05-08T14:04:55Z")

</div>

If the minimal example below is executed with @enter for debugging, it returns a different value compared when the function is invoked naturally.  
Is there a reason for it?

```julia
function foo(s::String)
    sp = parse(s)
    if isa(sp,Symbol)
        return "Symbol"
    else
        return "Not a symbol."
    end
end
foo(":A") # returns "Not a Symbol."
@enter foo(":A") # returns "Symbol"

```

![REPL](https://global.discourse-cdn.com/julialang/original/3X/a/d/ad1f78290217dbb543207b58c82fac968a592e1c.png)
