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

add missing let blocks and array comprehensions #28519

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gdkrmr
Copy link
Contributor

@gdkrmr gdkrmr commented Aug 8, 2018

I think these were missing from the documentations. I am not sure about the proper indentation.

I think these were missing from the documentations. I am not sure about the proper indentation.
@gdkrmr gdkrmr mentioned this pull request Aug 8, 2018
@iamed2
Copy link
Contributor

iamed2 commented Aug 8, 2018

Is there a reason let would need to be used rather than begin? If so, could you include that reasoning?

@tknopp
Copy link
Contributor

tknopp commented Aug 8, 2018

begin is not valid in 0.7/1.0

@gdkrmr
Copy link
Contributor Author

gdkrmr commented Aug 9, 2018

I personally have no idea why it has to be a let block now. I tried to update some code to 0.7 and failed because there was no reference in the manual, so I decided to add it.

@iamed2
Copy link
Contributor

iamed2 commented Aug 9, 2018

begin is not valid in 0.7/1.0

This works:

julia> [ begin
           x = 2
           i + x
         end for i=1:10 ]
10-element Array{Int64,1}:
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12

@gdkrmr
Copy link
Contributor Author

gdkrmr commented Aug 9, 2018

you are right, let and begin work now without a warning in both

Julia Version 0.7.1-pre.0
Commit 36cddc1 (2018-08-09 00:19 UTC)

and

Julia Version 1.0.0
Commit 5d4eaca (2018-08-08 20:58 UTC)

@JeffBezanson
Copy link
Member

Yeah, I don't really love how we no longer allow begin in indexing expressions. Every expression should be allowed everywhere if at all possible. There just hasn't been a good alternate proposal for how to reference first and last indices.

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

Successfully merging this pull request may close these issues.

4 participants