# Creating a new Symbol from two strings with a point

**URL:** https://discourse.julialang.org/t/creating-a-new-symbol-from-two-strings-with-a-point/16631
**Category:** General Usage
**Created:** [October 22, 2018, 2:58pm UTC](https://discourse.julialang.org/t/creating-a-new-symbol-from-two-strings-with-a-point/16631 "2018-10-22T14:58:30Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [October 22, 2018, 4:07pm UTC](https://discourse.julialang.org/t/creating-a-new-symbol-from-two-strings-with-a-point/16631/4 "2018-10-22T16:07:58Z")

</div>

Please see [PSA: how to quote code with backticks](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530).

> [@drmartinrohde](#):
>
> What is there I don’t understand?

That `eval` operates on global scope. From what you have shown so far there is no need for any of this `parse` + `eval` stuff, just do something like:

```julia
mutable struct MyType
    a::Int
    b::Int
end

function foo!(B::MyType)
   var1 = "b = 10" # from data file
   sym, val = strip.(split(var1, "="))
   setproperty!(B, Symbol(sym), parse(Int, val))
end

```

with the result

```julia
julia> B = MyType(1, 2)
MyType(1, 2)

julia> foo!(B)
10

julia> B # B.b has been changed
MyType(1, 10)

```

---

_[View the full topic](https://discourse.julialang.org/t/creating-a-new-symbol-from-two-strings-with-a-point/16631)._
