# Unexpected "="

**URL:** https://discourse.julialang.org/t/unexpected/14225
**Category:** General Usage
**Created:** [August 29, 2018, 2:44am UTC](https://discourse.julialang.org/t/unexpected/14225 "2018-08-29T02:44:03Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![microlifecc](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@microlifecc](https://discourse.julialang.org/u/microlifecc)
#### Post date: [August 29, 2018, 2:44am UTC](https://discourse.julialang.org/t/unexpected/14225/1 "2018-08-29T02:44:03Z")

</div>

This segment of Julia code filters keypoints in an image by an interpolation of the fields in the extremum from a difference of gaussian scale space.

```
mutable struct discrete_extremum
    o
    s
    m
    n
    intensity
end
mutable struct candidateKeypoint
    oE
    s
    m
    n
    σ
    x
    y
    ω
end

LB = Array{candidateKeypoint}(0)
for extremum in LA′
    for i = 1:5
        H̄ = Hessian(extremum.o, extremum.s, extremum.m, extremum.n)
        ḡ = ThreeDgradient(extremum.o, extremum.s, extremum.m, extremum.n)
        α⋆ = alphaStar(H̄, ḡ)
        ω = omega(H̄, ḡ, extremum.o, extremum.s, extremum.m, extremum.n)
        δOE = δMin * 2^(extremum.o - 1)
        α1⋆ = α⋆[1]
        α2⋆ = α⋆[2]
        α3⋆ = α⋆[3]
        σ = (δOE/δMin) * σMin * 2^((α1⋆ + extremum.s)/nSpo)
        x = δOE * (α2⋆ + extremum.m)
        y = δOE * (α2⋆ + extremum.n)
        extremum.s, extremum.m, extremum.n = round(Int64, extremum.s + α1⋆), round(Int64, extremum.m + α2⋆), round(Int64, extremum.n + α3⋆)
        if max(abs(α1⋆), abs(α2⋆), abs(α3⋆)) < 0.6
            break
        end
    end
    if max(abs(α1⋆), abs(α2⋆), abs(α3⋆)) < 0.6
        push!(LB, candidateKeypoint(extremum, σ, x, y, ω))
    end
end

```

I am getting this error:

> syntax: unexpected “=”

in the part starting with LB =  
There is no line number mentioned. Can you guys suggest what I am doing wrong?

---

<div class="post-metadata">

### Author: ![LeoK987](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leok987/32/4880_2.png) [@LeoK987](https://discourse.julialang.org/u/LeoK987)
#### Post date: [August 29, 2018, 2:47am UTC](https://discourse.julialang.org/t/unexpected/14225/2 "2018-08-29T02:47:25Z")

</div>

OK, sorry, I wasn’t concentrating enough, due to the special characters, I guess. Perhaps Julia behave in the same way? I have not used special characters in a code, so I can’t answer about it.

---

<div class="post-metadata">

### Author: ![microlifecc](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@microlifecc](https://discourse.julialang.org/u/microlifecc)
#### Post date: [August 29, 2018, 2:50am UTC](https://discourse.julialang.org/t/unexpected/14225/3 "2018-08-29T02:50:19Z")

</div>

Hi @LeoK987! Thanks for the help.  
It’s just after the two structure definitions. Should I remove the special characters from variable names?

---

<div class="post-metadata">

### Author: ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)
#### Post date: [August 29, 2018, 2:56am UTC](https://discourse.julialang.org/t/unexpected/14225/4 "2018-08-29T02:56:40Z")

</div>

You can just say:

```julia
LB = candidateKeypoint[]

```

Which initializes an empty `candidateKeypoint` Vector.

---

<div class="post-metadata">

### Author: ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)
#### Post date: [August 29, 2018, 3:09am UTC](https://discourse.julialang.org/t/unexpected/14225/5 "2018-08-29T03:09:16Z")

</div>

It is not `LB =` that is giving you grief. Instead it is the ‘⋆’ character in the variables `α1⋆`, `α2⋆`, and `α3⋆`. I don’t know why.

---

<div class="post-metadata">

### Author: ![jandehaan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jandehaan/32/6805_2.png) [@jandehaan](https://discourse.julialang.org/u/jandehaan)
#### Post date: [August 29, 2018, 3:17am UTC](https://discourse.julialang.org/t/unexpected/14225/6 "2018-08-29T03:17:59Z")

</div>

If you inspect line 28 in file [julia/julia-parser.scm at master · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm) you’ll find that the ‘⋆’ character is defined as an operator with the same precedence as the ‘\*’ operator. That is why the Julia parser reports that the ‘=’ character is unexpected. It expects another operand.

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [August 29, 2018, 4:10am UTC](https://discourse.julialang.org/t/unexpected/14225/7 "2018-08-29T04:10:34Z")

</div>

Please don’t double post, especially without cross referencing: [image processing - syntax: unexpected "=" in Julia - Stack Overflow](https://stackoverflow.com/questions/52068346/syntax-unexpected-in-julia/52069285#52069285)

---

<div class="post-metadata">

### Author: ![microlifecc](https://avatars.discourse-cdn.com/v4/letter/m/ed655f/32.png) [@microlifecc](https://discourse.julialang.org/u/microlifecc)
#### Post date: [August 29, 2018, 4:15am UTC](https://discourse.julialang.org/t/unexpected/14225/8 "2018-08-29T04:15:21Z")

</div>

Oh sorry I forgot to put the reference! My bad!

---

<div class="post-metadata">

### Author: ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)
#### Post date: [August 29, 2018, 6:27am UTC](https://discourse.julialang.org/t/unexpected/14225/9 "2018-08-29T06:27:52Z")

</div>

> [@microlifecc](#):
>
> `LB = Array{candidateKeypoint}(0)`

@quinnj already posted an alternative, but I expect this to fail, since `Array{candidateKeypoint}` is an abstract type.

Use `Array{.., 1}()` or `Vector{..}()` (in my view better), or, as suggested, `T[]`.

This is the reason I always prefer `Vector` and `Matrix` over `Array{ ..,1}` and `Array{..,2}`. More readable, and less likely to mistype.
