Hacker News new | past | comments | ask | show | jobs | submit login

A variable in algebra is exactly what you consider a constant in a programming language. If I say "x = 5" in algebra,that means "x represents the value 5" (and I can substitute one for the other anywhere). The variable x can't suddenly represent the value 6 halfway through my calculations. Variables in Racket and Erlang work exactly as in algebra: single-assignment binding.



> A variable in algebra is exactly what you consider a constant in a programming language.

I disagree. A constant is not expected to change, a variable is absolutely expected to change.

The difference is that a mathematical variable changes "between invocations" of a mathematical statement. An "assignable" changes "within invocations".


True of Erlang but not of Racket; the latter can change "definitions" using set!.




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: