On Wednesday, 18 January 2017 at 04:06:23 UTC, Samwise wrote:
On Wednesday, 18 January 2017 at 03:51:50 UTC, ketmar wrote:
On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote:
extern int getReturnCode() {
return 4;
}
still does not compile using the command from above. I may
On Wednesday, 18 January 2017 at 04:06:23 UTC, Samwise wrote:
I have both the header in hello.d and the actual function in
getReturnCode.d as extern, and it still fails with the same
error.
nope. it works.
On Wednesday, 18 January 2017 at 03:51:50 UTC, ketmar wrote:
On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote:
extern int getReturnCode() {
return 4;
}
still does not compile using the command from above. I may
very well be misunderstanding you though.
yep. *both* prototy
On Wednesday, 18 January 2017 at 00:09:42 UTC, Nordlöw wrote:
What's the easiest way to print a double in maximum precision?
%.6g for floats and %.17g for doubles. This is for example what's
used on std.json to get a perfect conversion from string to
value. the number is the maximum number of
On Wednesday, 18 January 2017 at 03:37:46 UTC, Samwise wrote:
extern int getReturnCode() {
return 4;
}
still does not compile using the command from above. I may very
well be misunderstanding you though.
yep. *both* prototype and real declaration should be `extern(C)`.
`(C)` part is
On Wednesday, 18 January 2017 at 03:25:47 UTC, Stefan Koch wrote:
On Wednesday, 18 January 2017 at 03:11:08 UTC, Samwise wrote:
On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren
wrote:
Import the source file containing the external function
instead of writing that prototype. It should
On Wednesday, 18 January 2017 at 00:23:37 UTC, pineapple wrote:
On Wednesday, 18 January 2017 at 00:09:42 UTC, Nordlöw wrote:
What's the easiest way to print a double in maximum precision?
https://github.com/pineapplemachine/mach.d/blob/master/mach/text/numeric/floats.d#L60
You can also try t
On Wednesday, 18 January 2017 at 03:11:08 UTC, Samwise wrote:
On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren
wrote:
Import the source file containing the external function
instead of writing that prototype. It should compile then.
This seems like a workaround more than a permanent
On Wednesday, 18 January 2017 at 02:48:45 UTC, James Buren wrote:
Import the source file containing the external function instead
of writing that prototype. It should compile then.
This seems like a workaround more than a permanent solution. It
would work, but still. I'm also not sure about th
Import the source file containing the external function instead
of writing that prototype. It should compile then.
Alright. For the sake of this argument, I'm going to post all the
stuff about a really tiny boring program that quite literally
does nothing, even though I found this issue when I was working
with a much larger project with more functions. Basically I'm
getting errors when I attempt to compile
On 01/17/2017 04:37 PM, Nestor wrote:
Hi,
I was just looking at an interesting function from
http://codepad.org/lSDTFd7E :
void printFields(T)(T args) {
auto values = args.tupleof;
size_t max;
size_t temp;
foreach (index, value; values) {
temp = T.tupleof[index].stringof.length;
Hi,
I was just looking at an interesting function from
http://codepad.org/lSDTFd7E :
void printFields(T)(T args) {
auto values = args.tupleof;
size_t max;
size_t temp;
foreach (index, value; values) {
temp = T.tupleof[index].stringof.length;
if (max < temp) max = temp;
}
m
On Wednesday, 18 January 2017 at 00:09:42 UTC, Nordlöw wrote:
What's the easiest way to print a double in maximum precision?
https://github.com/pineapplemachine/mach.d/blob/master/mach/text/numeric/floats.d#L60
You can also try the formatting directive "%.20f" but unlike the
former I can't of
What's the easiest way to print a double in maximum precision?
On Tuesday, 17 January 2017 at 23:38:46 UTC, Ali Çehreli wrote:
Found'em! :)
https://dlang.org/phobos/std_math.html#.nextUp
Thanks!
On 01/17/2017 03:30 PM, Nordlöw wrote:
I can't find nextUp(x) and nextDown(x) described in
https://dlang.org/d-floating-point.html
Are these D1 only? Is there anything like it in D2/Phobos?
Found'em! :)
https://dlang.org/phobos/std_math.html#.nextUp
Ali
I can't find nextUp(x) and nextDown(x) described in
https://dlang.org/d-floating-point.html
Are these D1 only? Is there anything like it in D2/Phobos?
On Monday, 16 January 2017 at 13:11:38 UTC, pineapple wrote:
On Monday, 16 January 2017 at 09:33:23 UTC, Nestor wrote:
PS. Isn't this approach considered "cheating" in quines? ;)
I'm afraid so - while the empty program has been technically
accepted as being a quine (e.g.
http://www.ioccc.org
On Tuesday, 17 January 2017 at 20:21:34 UTC, Nordlöw wrote:
Is there a way to mimic C++-style `mutable` members in D?
You could store a ptr to the member outside:
import std.stdio;
private int* _pid;
struct A
{
int id;
this(int id)
{
this
On Tuesday, 17 January 2017 at 20:50:34 UTC, Nordlöw wrote:
On Tuesday, 17 January 2017 at 20:47:35 UTC, ketmar wrote:
Is there a way to mimic C++-style `mutable` members in D?
sure: don't use `const`. otherwise — no, there is simply no
way to «mimic» 'em due to completely different meaning of
On Tuesday, 17 January 2017 at 20:47:35 UTC, ketmar wrote:
Is there a way to mimic C++-style `mutable` members in D?
sure: don't use `const`. otherwise — no, there is simply no way
to «mimic» 'em due to completely different meaning of `const`
in D and C++.
I'm aware of the difference. I'm jus
On Tuesday, 17 January 2017 at 20:21:34 UTC, Nordlöw wrote:
Is there a way to mimic C++-style `mutable` members in D?
sure: don't use `const`. otherwise — no, there is simply no way
to «mimic» 'em due to completely different meaning of `const` in
D and C++.
Is there a way to mimic C++-style `mutable` members in D?
On Tuesday, 17 January 2017 at 19:07:21 UTC, Ali Çehreli wrote:
On 01/17/2017 01:25 AM, Erdem wrote:
> void main(string[] args)
> {
> Main.init(args);
> new MyWindow();
> Main.run();
> }
I have no experience with Gtkd but the code inside main looks
fundamentally wrong. One would ex
On 01/17/2017 01:25 AM, Erdem wrote:
> void main(string[] args)
> {
> Main.init(args);
> new MyWindow();
> Main.run();
> }
I have no experience with Gtkd but the code inside main looks
fundamentally wrong. One would expect you to do something with the
MyWindow object:
auto w
On Tuesday, 17 January 2017 at 18:25:46 UTC, kinke wrote:
It should and I looked into that as well, but I didn't like the
implementation as loop:
https://github.com/dlang/phobos/blob/master/std/math.d#L5988
A special case for base x == 2 wouldn't hurt.
That seems strange. Why isn't that a bu
On Tuesday, 17 January 2017 at 17:56:13 UTC, Nordlöw wrote:
On Tuesday, 17 January 2017 at 16:40:57 UTC, kinke wrote:
If it doesn't have to be D ;), it can be as simple as
`core.stdc.math.ldexp(1, exponent)`. No CTFE though.
Isn't it a simple as
2.0^^exponent
?
It should and I looked i
On Tuesday, 17 January 2017 at 16:40:57 UTC, kinke wrote:
If it doesn't have to be D ;), it can be as simple as
`core.stdc.math.ldexp(1, exponent)`. No CTFE though.
Isn't it a simple as
2.0^^exponent
?
On Tuesday, 17 January 2017 at 00:08:24 UTC, Nordlöw wrote:
How do I best initialize a D double to an exact mantissa and
exponent representation?
I'm specifically interested in
2^^i for all i in [min_exp, max_exp]
If it doesn't have to be D ;), it can be as simple as
`core.stdc.math.lde
On Tuesday, 17 January 2017 at 08:58:33 UTC, Arun Chandrasekaran
wrote:
Interesting. Why doesn't the thread get GC'd in this case even
without any reference still active?
There will be a reference to it in druntime itself:
http://dlang.org/phobos/core_thread.html#.Thread.getThis
On Monday, 16 January 2017 at 14:47:23 UTC, Era Scarecrow wrote:
On Sunday, 15 January 2017 at 19:48:04 UTC, Nestor wrote:
I see. So correcting my original doubt:
How could I parse an UTF16LE file line by line (producing a
proper string in each iteration) without loading the entire
file into
On Tuesday, 17 January 2017 at 10:49:14 UTC, Enjoys Math wrote:
Z add(Z...)(Z a...) {
return a + b;
}
func[] operatorPool = [&add!int];
Variant library isn't liking that. Removing & causes another
error.
Essentially I want a pool of all operators that I define, but
these operators
On Tuesday, 17 January 2017 at 10:49:14 UTC, Enjoys Math wrote:
Z add(Z...)(Z a...) {
return a + b;
}
func[] operatorPool = [&add!int];
Variant library isn't liking that. Removing & causes another
error.
Essentially I want a pool of all operators that I define, but
these operators
Z add(Z...)(Z a...) {
return a + b;
}
func[] operatorPool = [&add!int];
Variant library isn't liking that. Removing & causes another
error.
Essentially I want a pool of all operators that I define, but
these operators can be of differing types (which I should be able
to programatic
On Tuesday, 17 January 2017 at 08:58:33 UTC, Arun Chandrasekaran
wrote:
Interesting. Why doesn't the thread get GC'd in this case even
without any reference still active?
basically 'cause there is no reliable way to correctly "abort" a
thread. nobody knows what is really going on inside it, so
I'd like to filter Treeview data according to user input. How
should I do that?
When I run this program it gives segmentation fault error.
import gtk.Main;
import gtk.MainWindow;
import gtk.Box;
import gtk.Entry;
import gtk.EditableIF;
import gtk.TreeModelFilter;
import gtk.TreeView;
import gtk
On Tuesday, 17 January 2017 at 08:12:50 UTC, ketmar wrote:
import core.thread;
import core.time;
import std.stdio;
void threadStarter (string path) {
new Thread({
for (;;) {
writeln(path);
Thread.sleep(1.seconds);
}
}).start();
}
class A {
~this () { import core.stdc.
On Tuesday, 17 January 2017 at 07:53:32 UTC, thedeemon wrote:
On Monday, 16 January 2017 at 22:08:56 UTC, JN wrote:
Am I correctly understanding, that after going out of scope,
it's possible for GC to destroy my thread before the file
finishes loading? How to prevent GC from destroying my thre
On Monday, 16 January 2017 at 22:08:56 UTC, JN wrote:
Am I correctly understanding, that after going out of scope,
it's possible for GC to destroy my thread before the file
finishes loading? How to prevent GC from destroying my thread
before it finishes and make sure the file is loaded complet
40 matches
Mail list logo