On 6/30/15 9:29 PM, Tofu Ninja wrote:
On Wednesday, 1 July 2015 at 00:13:36 UTC, Jesse Phillips wrote:
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer wrote:
Have you tried placing const on the function signature?
On Wednesday, 1 July 2015 at 12:34:35 UTC, Steven Schveighoffer
wrote:
immutable is probably incorrect without a cast, since immutable
cannot be applied implicitly to non-immutable data, and if the
data is all immutable already, no sense in tagging it immutable.
I really see use in allowing
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the
On Wednesday, 1 July 2015 at 00:13:36 UTC, Jesse Phillips wrote:
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = ()
On Tuesday, 30 June 2015 at 22:23:40 UTC, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the
On Tuesday, 30 June 2015 at 22:05:43 UTC, Steven Schveighoffer
wrote:
Have you tried placing const on the function signature? i.e.:
pure int delegate() const d = () const {...
That's how you'd do it (I think, didn't test) if the delegate
context pointer was a class/struct.
-Steve
Nah,
On 6/30/15 5:44 PM, Tofu Ninja wrote:
On Tuesday, 30 June 2015 at 21:31:05 UTC, Steven Schveighoffer wrote:
On 6/30/15 5:23 PM, Tofu Ninja wrote:
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
const x = 4 ;)
But even if
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
On 6/30/15 5:23 PM, Tofu Ninja wrote:
On Sunday, 28 June 2015 at 10:19:05 UTC, anonymous wrote:
[...]
Is there any way to annotate the context as const?
const x = 4 ;)
But even if you could annotate just the *reference* as const, it doesn't
stop foo from changing it as you did in the
On Sunday, 28 June 2015 at 09:19:16 UTC, Tofu Ninja wrote:
module main;
import std.stdio;
void main(string[] args)
{
auto d = foo();
writeln(d()); // prints 25
}
auto foo()
{
int x = 4;
pure int delegate() d = delegate()
{
return x*x;
module main;
import std.stdio;
void main(string[] args)
{
auto d = foo();
writeln(d()); // prints 25
}
auto foo()
{
int x = 4;
pure int delegate() d = delegate()
{
return x*x;
};
writeln(d()); // prints 16
x = 5;
On Sunday, 28 June 2015 at 09:19:16 UTC, Tofu Ninja wrote:
module main;
import std.stdio;
void main(string[] args)
{
auto d = foo();
writeln(d()); // prints 25
}
auto foo()
{
int x = 4;
pure int delegate() d = delegate()
{
return x*x;
12 matches
Mail list logo