JuliaAcademy / JuliaAcademy/JuliaTutorials

Reduce and Parallel Prefix - DummyArray type definition not working

Open
#39 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
1.4k
Forks
655
PR merge metrics
No merged PRs in 30d

Description

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:

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the prefix notebook for the DummyArray definition shown in the issue and run that cell with the repository's tutorial environment. Check the Julia type syntax against the version used by the tutorial, then verify that the notebook proceeds past the definition without the reported syntax error.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.