On Monday, 16 October 2023 at 18:05:04 UTC, Paul wrote:
On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
wrote:
look like?
Types can have static members.
Basically what it comes down to is that outside of immutable
data, pure functions only have access to their arguments and
On Monday, October 16, 2023 12:05:04 PM MDT Paul via Digitalmars-d-learn
wrote:
> On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
>
> wrote:
> > look like?
> >
> > Types can have static members.
> >
> > Basically what it comes down to is that outside of immutable
> > data, pure
On Monday, October 16, 2023 12:05:04 PM MDT Paul via Digitalmars-d-learn
wrote:
> On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
>
> wrote:
> > look like?
> >
> > Types can have static members.
> >
> > Basically what it comes down to is that outside of immutable
> > data, pure
On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
wrote:
look like?
Types can have static members.
Basically what it comes down to is that outside of immutable
data, pure functions only have access to their arguments and to
what they can access via their arguments (be it by
On Thursday, 12 October 2023 at 21:20:44 UTC, Jonathan M Davis
wrote:
Thanks Jonathan
On Thursday, 12 October 2023 at 19:33:32 UTC, Paul wrote:
If **int x** is global mutable state, what does static mutable
state look like?
In addition to Jonathan's reply, see:
https://dlang.org/spec/function.html#local-static-variables
On Thursday, October 12, 2023 1:33:32 PM MDT Paul via Digitalmars-d-learn
wrote:
> The spec doc has the following statement and corresponding
> example:
> ***"Pure functions cannot directly access global or static
> mutable state."***
>
> ```d
> int x;
> immutable int y;
>
> pure int foo(int i)
>