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

Array initialization Bug or Expected? #845

Closed
DavidWhit opened this Issue Mar 16, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@DavidWhit

DavidWhit commented Mar 16, 2017

Windows 7
Elm REPL 0.18

someArray = Array.empty
Array.push someNewVal someArray -- REPL shows pushed
Array.push someNewVal someArray -- same
Array.length someArray  = 0 

hmm ok; but then

someArray = Array.push someNewVal  Array.empty
Array.push someNewVal someArray -- shows pushed
Array.length somArray = 1 not 2?

For the above

image

Thanks, Dave

@process-bot

This comment has been minimized.

Show comment
Hide comment
@process-bot

process-bot Mar 16, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

process-bot commented Mar 16, 2017

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 16, 2017

Contributor

Expected. Elm is a functional language. Values (like someArray) are immutable.

Contributor

jvoigtlaender commented Mar 16, 2017

Expected. Elm is a functional language. Values (like someArray) are immutable.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 16, 2017

Contributor

Lists are not any more or less manipulable than arrays in Elm. In your example, the length of tasks is still 2 after the append call.

Contributor

jvoigtlaender commented Mar 16, 2017

Lists are not any more or less manipulable than arrays in Elm. In your example, the length of tasks is still 2 after the append call.

@jvoigtlaender

This comment has been minimized.

Show comment
Hide comment
@jvoigtlaender

jvoigtlaender Mar 17, 2017

Contributor

Don't you want to close the issue now?

Contributor

jvoigtlaender commented Mar 17, 2017

Don't you want to close the issue now?

@DavidWhit DavidWhit closed this Mar 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment