Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce and Parallel Prefix - DummyArray type definition not working #39

Open
Paul-Yuchao-Dong opened this issue Jan 22, 2019 · 3 comments

Comments

@Paul-Yuchao-Dong
Copy link

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.

@mbauman
Copy link
Member

mbauman commented Jan 22, 2019

Unfortunately, that tutorial is out of date — it's written against version 0.6 (or maybe even older) and hasn't been updated for 1.0.

@mbauman
Copy link
Member

mbauman commented Jan 22, 2019

Looks like @alanedelman has an updated version from a few months ago — I've not tried it but that should give us a better starting point at getting the version here back up to date!

https://github.com/alanedelman/18.337_2018/blob/master/Lectures/Lecture18_11_07/Reduce%20and%20Parallel%20Prefix.ipynb

@Paul-Yuchao-Dong
Copy link
Author

@mbauman thanks for the pointer, tried the @alanedelman version without any luck.

Completely understand the growing pains of young language. I am interested in Julia precisely because it is at a stage where any member of the community can still contribute and shape its future. I am particularly excited because julia is mostly written in julia.

Would be great if there's an up-to-date tutorial for Julia 1.x, but I understand the resources is limited.

is there anywhere I can learn about type and struct in 1.x? some example code would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants