On 29 April 2014 11:31, will wrote:
Does golang support the following:
- Lazy evaluation (define a variable, load it in memory and only use
it when needed)
Yes and no. It depends on how much work your're prepared to do before
one stops saying it's "supported".
It's not there as an automatic pervasive property of the language
(unlike Haskell). Mixing lazy evaluation with an avowedly imperative
language is likely to be ... complicated.
- immutability (i.e creating a variable that is immutable) e.g. int,
double, long?
Yes and no. It depends on how much work your're prepared to do before
one stops saying it's "supported".
To make a variable immutable, (a) make it unexported, and (b) don't
assign to it in its declaring package.
Or don't use a variable; use a const, for those types and initialising
expressions that permit it.
Are you trying to solve a programming problem or just characterise
the language?
Chris
--
Chris "allusive" Dollin
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.