On Tue, 28 Jul 2015 02:16:56 +
"lobo" wrote:
> Hi all,
>
> I have a bunch of unittests for template code taking any numeric
> type. Because I'm lazy I just use the approxEqual for both
> floating point and integer comparisons in these tests.
>
> In DMD 2067.1 everthing compiled OK but in
Hi all,
I have a bunch of unittests for template code taking any numeric
type. Because I'm lazy I just use the approxEqual for both
floating point and integer comparisons in these tests.
In DMD 2067.1 everthing compiled OK but in 2068-b2 I get the
errors shown at the end of this post for int
On Sunday, 26 July 2015 at 17:43:42 UTC, Martin Nowak wrote:
On 07/26/2015 04:16 PM, Gary Willoughby wrote:
I thought there is a recently added compiler option that
profiles the GC and creates a report now?
That's an allocation profiler, the other one mentioned by me
reports GC stats as req
On Monday, 27 July 2015 at 20:12:10 UTC, John Colvin wrote:
Yes, but then core.sync.semaphore doesn't support being shared,
so...
Ok, so I made the code run by using __gshared instead of shared.
It seems really odd that a semaphore object doesn't support being
shared, this that a bug?
Here
On Monday, 27 July 2015 at 19:56:15 UTC, Steven Schveighoffer
wrote:
On 7/27/15 3:10 PM, Jack Stouffer wrote:
Hi,
I am currently working through a book on the fundamentals of
computer
concurrency and I wanted to do all of the exercises in D. But
I ran into
a problem when I tried to have a gl
On 07/27/2015 12:56 PM, Steven Schveighoffer wrote:
Instead, do this:
shared Semaphore sem;
shared static this() {
sem = new Semaphore();
}
Which will run during runtime startup.
Or, you can initialize in main().
-Steve
I tried that as well but there are tons of issues with shared. :(
On 7/27/15 3:10 PM, Jack Stouffer wrote:
Hi,
I am currently working through a book on the fundamentals of computer
concurrency and I wanted to do all of the exercises in D. But I ran into
a problem when I tried to have a global semaphore:
/usr/local/Cellar/dmd/2.067.1/include/d2/core/sync/semap
Hi,
I am currently working through a book on the fundamentals of
computer concurrency and I wanted to do all of the exercises in
D. But I ran into a problem when I tried to have a global
semaphore:
/usr/local/Cellar/dmd/2.067.1/include/d2/core/sync/semaphore.di(35): Error:
constructor core.
On Monday, 27 July 2015 at 08:00:10 UTC, Marc Schütz wrote:
On Sunday, 26 July 2015 at 18:07:51 UTC, Gary Willoughby wrote:
In the description for Fiber in std.thread is the following[1]:
"Please note that there is no requirement that a fiber be
bound to one specific thread. Rather, fibers may
On Monday, 27 July 2015 at 17:31:08 UTC, Ali Çehreli wrote:
On 07/27/2015 08:50 AM, Alex wrote:
> a book that I bought
The program looks a lot like one of the exercises in this
chapter:
http://ddili.org/ders/d.en/if.html
You didn't actually pay for it, right? Because it is free. :)
Ali
auto self = cast(TestInterface)cast(Object) rawSelf
Works like a charm! Thank you both!
On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote:
Okay. By pure trying I found out what I did wrong:
Apparently by typing Y I entered the shift key. Could that have
been the problem?
I changed it to a small y and it at least jumped back to the
commandline instead of just being stuck.
And
On Monday, 27 July 2015 at 17:21:33 UTC, Anonymous wrote:
On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote:
Okay. By pure trying I found out what I did wrong:
Apparently by typing Y I entered the shift key. Could that
have been the problem?
I changed it to a small y and it at least jumped b
On 07/27/2015 08:50 AM, Alex wrote:
> a book that I bought
The program looks a lot like one of the exercises in this chapter:
http://ddili.org/ders/d.en/if.html
You didn't actually pay for it, right? Because it is free. :)
Ali
On Monday, 27 July 2015 at 16:48:00 UTC, Alex wrote:
Okay. By pure trying I found out what I did wrong:
Apparently by typing Y I entered the shift key. Could that have
been the problem?
I changed it to a small y and it at least jumped back to the
commandline instead of just being stuck.
And
Okay. By pure trying I found out what I did wrong:
Apparently by typing Y I entered the shift key. Could that have
been the problem?
I changed it to a small y and it at least jumped back to the
commandline instead of just being stuck.
And by changing:
writeln("Do you want to play again? Y/N?
Thank you! That helped me a lot.
I'm sure that - in order to get to the point to repeat the whole
first part of the program - I'll have to read further in the
instructions I have BUT let's just say that I don't want it to
repeat the first part of the program but just writeln something
like "O
Look at my example:
import std.stdio;
import std.string;
import std.conv : to;
void main()
{
while (true) {
write("Roll the dice: Enter a number: ");
int dieNumber = readln.strip.to!int;
if (dieNumber < 4) {
writeln("You won!");
}
else
On Monday, 27 July 2015 at 15:50:11 UTC, Alex wrote:
readf(" %s", &dieNumber);
What happens here is a bit tricky and trips up a lot of
programmers: readf leaves the end-of-line character in the
buffer, which readln then sees as meaning its job is done.
When you enter, say, 5, then p
Hey guys!
I am super new to programming and still trying to learn the very
basics via a book that I bought.
My problem is the following:
import std.stdio;
import std.string;
void main()
{
char[] yesno;
write("Roll the dice: Enter a number!");
int dieNumber;
On 7/26/15 9:11 AM, Dicebot wrote:
I remember doing something like that in druntime because of objects -
you can't override @safe method prototype with @trusted one.
But you can, at least now you can, maybe it's changed.
In answer to the original question, the given code is quite unnecessary.
On 07/27/15 14:03, Vlad Leberstein via Digitalmars-d-learn wrote:
> Hi! My use case requires interaction with C API which in turn implies storing
> object instance reference as void *. I'm using gdc 4.9.2 and everything
> worked fine with "object -> void * -> object" conversion, but "object -> vo
On Monday, 27 July 2015 at 13:11:33 UTC, anonymous wrote:
In the first example, you pass a pointer to a class instance.
You cannot get the vtbl entry for the interface like this.
Instead try to do this in 2 steps:
actually i meant you pass an untyped pointer, so when you cast as
interface it'
On Monday, 27 July 2015 at 12:03:06 UTC, Vlad Leberstein wrote:
Hi! My use case requires interaction with C API which in turn
implies storing object instance reference as void *. I'm using
gdc 4.9.2 and everything worked fine with "object -> void * ->
object" conversion, but "object -> void * -
Hi! My use case requires interaction with C API which in turn
implies storing object instance reference as void *. I'm using
gdc 4.9.2 and everything worked fine with "object -> void * ->
object" conversion, but "object -> void * -> interface" failed.
The stripped-down example is something like
On Sunday, 26 July 2015 at 18:07:51 UTC, Gary Willoughby wrote:
In the description for Fiber in std.thread is the following[1]:
"Please note that there is no requirement that a fiber be bound
to one specific thread. Rather, fibers may be freely passed
between threads so long as they are not cu
26 matches
Mail list logo