top | item 10289255 (no title) nightwolf | 10 years ago The variable isn't mutated, actually — it's rebound. See http://natescottwest.com/elixir-for-rubyists-part-2/, for example. discuss order hn newest rdtsc|10 years ago Yes it is. x is the variable. It changed from 1 to 2. Mutation is a synonym for change. Try it yourself in the interpreter! So data is immutable, but variables are mutable in Elixir. andruby|10 years ago But if you passed that first x to a process, it would still be 1 even after you ran `x = 2`.
rdtsc|10 years ago Yes it is. x is the variable. It changed from 1 to 2. Mutation is a synonym for change. Try it yourself in the interpreter! So data is immutable, but variables are mutable in Elixir. andruby|10 years ago But if you passed that first x to a process, it would still be 1 even after you ran `x = 2`.
andruby|10 years ago But if you passed that first x to a process, it would still be 1 even after you ran `x = 2`.
rdtsc|10 years ago
andruby|10 years ago