It seems to me a good practice to mark all functions that I write
as `pure` and define all the variables as `immutable`, unless
there is a reason not to.
I can see some serious advantages of this, most notable of which
is minimum side-effect and predictability of the code. However I
suppose it
On Monday 07 September 2015 12:40, Bahman Movaqar wrote:
> It seems to me a good practice to mark all functions that I write
> as `pure` and define all the variables as `immutable`, unless
> there is a reason not to.
I agree.
> I can see some serious advantages of this, most notable of which
On Monday, 7 September 2015 at 10:55:13 UTC, anonymous wrote:
On Monday 07 September 2015 12:40, Bahman Movaqar wrote:
I can see some serious advantages of this, most notable of
which is minimum side-effect and predictability of the code.
However I suppose it's going to impact the performance
On Monday 07 September 2015 13:12, Bahman Movaqar wrote:
> I was under the impression that when a variable, that is declared
> as `immutable`, is passed to a function, a copy of the value is
> passed.
>
> However based on "marks" I can imagine that since the data is
> marked as `immutable` only
On Monday, 7 September 2015 at 11:49:32 UTC, anonymous wrote:
void f(int a) {}
void g(int* a) {}
void main()
{
int xm;
immutable int xi;
f(xm); /* ok, obviously */
f(xi); /* ok */
int* ym = &xm;
immutable int* yi = ΞΎ
g(ym); /* ok, obviously */
g(yi); /* doesn't c