elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

Unexpected variable assignment (by reference rather than value) #133

Open designrubenz opened 7 years ago

designrubenz commented 7 years ago

elm-repl 0.17.1

> a = [3,2,1]
[3,2,1] : List number
> b = 4 :: a
[4,3,2,1] : List number
> a = [1]
[1] : List number
> b
[4,1] : List number

I would expect b to stay unchanged ( [4,3,2,1] ) when a changes.

Also I would like to suggest a little warning message that reassigning the same variable is possible in the REPL (as a convenience) but is not supported in an Elm application.

process-bot commented 7 years ago

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.