Is there a way to make sure a delegate only reads state, without
changing it? I tried annotating the delegate as const, but that
does not seem to work.
```D
void main()
{
import std.stdio : writeln;
auto r = [0,1,2,3];
auto f = delegate() const // Compiles even though we are
chang
On Sunday, 3 April 2016 at 02:03:29 UTC, stunaep wrote:
I am trying to use the bzip2 bindings that are available on
code.dlang.org/packages, but I am having a really hard time
using it due to the pointers. It needs to be an array once it's
decompressed.
Here is what I have:
import std.stdio;
On Monday, April 04, 2016 02:32:56 Yuxuan Shui via Digitalmars-d-learn wrote:
> On Monday, 4 April 2016 at 00:50:27 UTC, Jonathan M Davis wrote:
> > On Sunday, April 03, 2016 23:46:10 John Colvin via
> >
> > Digitalmars-d-learn wrote:
> >> On Saturday, 2 April 2016 at 16:00:51 UTC, Jonathan M Davis
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
Note that annotating with pure also doesn't help. As a result we
can have
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
```
Yeah this is a nasty old issue. The underlying problem is that a
deleg
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
https://issues.dlang.org/show_bug.cgi?id=1983
Bug 1983 is about usage of delegates after creation, restrictions
during creation are enforced. AIU, OP wants to have const check
during creation.
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
On Monday, 4 April 2016 at 08:10:10 UTC, Edwin van Leeuwen
wrote:
Is there a way to make sure a delegate only reads state,
without changing it? I tried annotating the delegate as const,
but that does not seem to work.
```
Yeah t
On Monday, 4 April 2016 at 02:32:56 UTC, Yuxuan Shui wrote:
On Monday, 4 April 2016 at 00:50:27 UTC, Jonathan M Davis wrote:
On Sunday, April 03, 2016 23:46:10 John Colvin via
Digitalmars-d-learn wrote:
On Saturday, 2 April 2016 at 16:00:51 UTC, Jonathan M Davis
wrote:
> [...]
Maybe
aa.byKey
On Monday, 4 April 2016 at 11:39:55 UTC, Kagamin wrote:
On Monday, 4 April 2016 at 11:32:23 UTC, Rene Zwanenburg wrote:
https://issues.dlang.org/show_bug.cgi?id=1983
Bug 1983 is about usage of delegates after creation,
restrictions during creation are enforced. AIU, OP wants to
have const ch
On Monday, 4 April 2016 at 03:55:26 UTC, Yuxuan Shui wrote:
On Monday, 4 April 2016 at 03:28:01 UTC, Yuxuan Shui wrote:
auto clobber(ref Set x, ref Set o) {
Set ret;
ret.aa = x.aa;
assert(x.aa.length > 0); // <-- boom
return ret;
}
No idea myself but that's
On Monday, 14 March 2016 at 03:46:02 UTC, Gerald wrote:
On Sunday, 13 March 2016 at 19:53:35 UTC, karabuta wrote:
On Sunday, 13 March 2016 at 19:34:36 UTC, WebFreak001 wrote:
and in the (not quite complete) documentation you can find
widgets you might want to use. Its a great place for getting
In my server program, when a request comes, I create a new thread
for that.
I put memory limit to program with setrlimit. So, when the limit
is reached, new thread cannot be created.
I want to tell client back that there is system problem. But
catching "Throwable" does not suffice for this i
On Monday, 4 April 2016 at 20:28:13 UTC, tcak wrote:
In my server program, when a request comes, I create a new
thread for that.
I put memory limit to program with setrlimit. So, when the
limit is reached, new thread cannot be created.
I want to tell client back that there is system problem.
On 04/04/2016 09:36 AM, Anonymouse wrote:
On Monday, 4 April 2016 at 03:55:26 UTC, Yuxuan Shui wrote:
On Monday, 4 April 2016 at 03:28:01 UTC, Yuxuan Shui wrote:
auto clobber(ref Set x, ref Set o) {
Set ret;
ret.aa = x.aa;
assert(x.aa.length > 0); // <-- boom
return ret;
}
On Monday, 4 April 2016 at 08:26:07 UTC, Thomas Brix Larsen wrote:
On Sunday, 3 April 2016 at 02:03:29 UTC, stunaep wrote:
I am trying to use the bzip2 bindings that are available on
code.dlang.org/packages, but I am having a really hard time
using it due to the pointers. It needs to be an arra
On 04/04/2016 09:33 PM, Karabuta wrote:
On Monday, 14 March 2016 at 03:46:02 UTC, Gerald wrote:
On Sunday, 13 March 2016 at 19:53:35 UTC, karabuta wrote:
On Sunday, 13 March 2016 at 19:34:36 UTC, WebFreak001 wrote:
and in the (not quite complete) documentation you can find widgets
you might wa
Well, at least I think that it's unicode confusion. When a store values
into a string (in an array of structs) and then compare it against
itself, it compares fine, and if I write it out at that point it writes
out fine. And validate says it's good unicode.
But later...
valid = true, len = 1
On Monday, 4 April 2016 at 21:32:10 UTC, stunaep wrote:
Can you please explain what the scope keyword does and if there
scope was originally intended to be used primarily with classes
in order to get deterministic destruction. It ensures the
destructor of a class is called when the scope exi
I was writing my output to two different files. Only one of them was
set to utf-8, the other must have been some other encoding, because when
I set the encoding to utf-8 everything cleared up.
On 04/04/2016 04:04 PM, Charles Hixson via Digitalmars-d-learn wrote:
Well, at least I think that it'
On Monday, 4 April 2016 at 21:31:08 UTC, Ali Çehreli wrote:
On 04/04/2016 09:36 AM, Anonymouse wrote:
On Monday, 4 April 2016 at 03:55:26 UTC, Yuxuan Shui wrote:
[...]
assert(x.aa.length > 0); // <-- boom
[...]
No idea myself but that's where it seems to go wrong.
Looks like
I'm sorry for this total newbie question, but for some reason
this is eluding me. I must be overlooking something obvious, but
I haven't been able to figure this out and haven't found anything
helpful.
I am invoking an entry point in a D DLL from C# (via extern (C)),
and one of the parameters
On Tuesday, 5 April 2016 at 01:21:55 UTC, Thalamus wrote:
I'm sorry for this total newbie question, but for some reason
this is eluding me. I must be overlooking something obvious,
but I haven't been able to figure this out and haven't found
anything helpful.
I am invoking an entry point in a
22 matches
Mail list logo