# Intro to julia tutorial: Reduce and Parallel Prefix - DummyArray type definition not working

**URL:** <https://discourse.julialang.org/t/intro-to-julia-tutorial-reduce-and-parallel-prefix-dummyarray-type-definition-not-working/19929>\
**Category:** New to Julia\
**Created:** [January 22, 2019, 2:03pm UTC](https://discourse.julialang.org/t/intro-to-julia-tutorial-reduce-and-parallel-prefix-dummyarray-type-definition-not-working/19929 "2019-01-22T14:03:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paul-Yuchao-Dong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul-yuchao-dong/32/15553_2.png) [@Paul-Yuchao-Dong](https://discourse.julialang.org/u/Paul-Yuchao-Dong)\
**Post date:** [January 22, 2019, 2:03pm UTC](https://discourse.julialang.org/t/intro-to-julia-tutorial-reduce-and-parallel-prefix-dummyarray-type-definition-not-working/19929/1 "2019-01-22T14:03:02Z")

</div>

I am trying to learn Julia and I come across this set of great tutorials.

However, when something in the tutorial went wrong, I am not yet equipped to fix it.

for the prefix notebook, the definition of DummyArray gave out an error `syntax: extra token "DummyArray" after end of expression`

the definition is as below:

```julia
isdefined(:DummyArray) || type DummyArray
    length :: Int
    read :: Vector
    history :: Vector{Any}
    DummyArray(length, read=[], history=[])=new(length, read, history)
end

```

I tried JuliaBox to run the same code, and it yielded the same error message. I am a bit lost as to what the example is trying to demonstrate and how exactly should I define a type in Julia? is it with type or struct keyword? I tried struct and no luck.

---

<div class="post-metadata">

**Author:** ![improbable22](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/improbable22/32/5464_2.png) [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Post date:** [January 22, 2019, 2:16pm UTC](https://discourse.julialang.org/t/intro-to-julia-tutorial-reduce-and-parallel-prefix-dummyarray-type-definition-not-working/19929/2 "2019-01-22T14:16:30Z")

</div>

The keyword `type` got replaced with `struct` or `mutable struct` at some distant point in the past. If you use one of these, it should run.

The error is just telling you that, because it reads `type` as an ordinary variable name, it doesn’t know what to do with a space followed by more code – it expects an = or something.

---

<div class="post-metadata">

**Author:** ![Paul-Yuchao-Dong](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paul-yuchao-dong/32/15553_2.png) [@Paul-Yuchao-Dong](https://discourse.julialang.org/u/Paul-Yuchao-Dong)\
**Post date:** [January 23, 2019, 3:36am UTC](https://discourse.julialang.org/t/intro-to-julia-tutorial-reduce-and-parallel-prefix-dummyarray-type-definition-not-working/19929/3 "2019-01-23T03:36:42Z")

</div>

Many thanks works like a charm!
