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

Creating Vectors by range in Julia should be change. #67

Open
sppmg opened this issue May 16, 2019 · 1 comment
Open

Creating Vectors by range in Julia should be change. #67

sppmg opened this issue May 16, 2019 · 1 comment
Assignees

Comments

@sppmg
Copy link

sppmg commented May 16, 2019

Hi I am new in Julia.

The Integers from j to n with step size k in Creating Vectors write:

A = j:k:n

It just is a range object in Julia, but in Matlab, it can create a array.
So I think maybe change to

A = collect(j:k:n)

or maybe add a row for range and create array.

Thanks your beautiful cheatsheet.

@arnavs
Copy link
Member

arnavs commented May 16, 2019

I can see how this is confusing. I'd rather not teach people to collect() things by default (because the whole point is that it's "lazy," in that it only gives you the actual array if you need it.)

The best approach is probably to explain briefly in a comment. Will do that. Thanks for your helpful feedback, and I'm glad you found the cheatsheet useful.

@arnavs arnavs self-assigned this May 16, 2019
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