Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The variables are NOT immutable. The bindings ARE mutable.

a = [1,2,3,4]

x = a

x = [1,2,3,4,5]

a == [1,2,3,4] => true

x == [1,2,3,4,5] => true

This is empirically NOT the same as ruby or even mutability.

This is a HUGE misunderstanding of Elixir. Once something is created you cannot modify it, PERIOD, you can rebind variables within the same scope. You cannot change the values.

Same thing is possible in clojure, and nobody questions that its immutable.

EDIT: And to be extra clear this is only within the same function. Not possible across functions, modules or processes.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: