chrisvoncsefalvay / learn-julia-the-hard-way

Learn Julia the hard way!
https://app.gitbook.com/@chrisvoncsefalvay/s/learn-julia-the-hard-way/
Other
772 stars 153 forks source link

Sets / deprecated constructor, and confusion... #18

Closed sbromberger closed 9 years ago

sbromberger commented 9 years ago

Hi,

julia> stooges = Set({"Moe", "Curly", "Larry"})
    Set{Any}({"Moe","Larry","Curly"})

throws a deprecation warning in 0.4.0.

Also, from a newbie, this construction seems unintuitive since curly braces are usually used to denote type. Why are you using it in the constructor when Set("Moe", "Curly", "Larry") is equivalent (down to the deprecation warning) and Set(["Moe", "Curly", "Larry"]) is the nondeprecated constructor that gives a type-relevant set (Set(ASCIIString["Moe","Larry","Curly"]))?

Thanks - this is a great book and I'm learning a lot by going through the examples.

chrisvoncsefalvay commented 9 years ago

Ah. I transitioned the whole project to 0.4.0 after that part was written, and I'm afraid I might have left that in. I'm so sorry.

You're right, the correct syntax as of 0.4.0 is:

julia> stooges = Set(["Moe", "Curly", "Larry"])
Set(ASCIIString["Moe","Larry","Curly"])
sbromberger commented 9 years ago

No apologies necessary at all - I'm learning a lot from the book, even though it's draft!

How would you like feedback/comments? For some reason, since it's not code, I can't seem to do line annotations, and PRs seem too heavyweight when I'm not actually changing content.

chrisvoncsefalvay commented 9 years ago

Comments are best as issues, while changes can be PRs or issues, whichever suits you most. Thank you for your contributions!