On Saturday, 30 April 2016 at 23:11:20 UTC, Laeeth Isharc wrote:
All the design/discussion/implementation of this scheme for
handling integer overflow would be wasted if it didn’t actually
find any bugs in practice. I personally have had quite a few
bugs found nearly as I write them, with expre
On Saturday, 23 April 2016 at 01:11:49 UTC, Ramon wrote:
mmm, I figured the problem, but don't know how to solve it.
my struct has a destructor which clears itself:
struct json_value
{
~this() { .ValueClear(&data); }
}
so how I can I put a struct in the heap? (not in the stack, as
is the def
On Wednesday, 20 August 2014 at 09:13:15 UTC, Jonathan M Davis
via Digitalmars-d-learn wrote:
On Wed, 20 Aug 2014 01:38:52 +
uri via Digitalmars-d-learn
wrote:
Hi all,
Bit new to D so this might be a very naive question...
Can the compiler auto infer function attributes?
I am often ad
d
in looking at.
http://forum.dlang.org/thread/mailman.470.1386845003.3242.digitalmar...@puremagic.com
https://github.com/FeedBackDevs/feedback
Cheers,
ed
On Thursday, 5 June 2014 at 11:07:54 UTC, 1100110 wrote:
On 6/5/14, 6:05, 1100110 wrote:
On 5/31/14, 7:57, ed wrote:
On Saturday, 31 May 2014 at 07:28:32 UTC, Mineko wrote:
So, I've gotten interested in kernel programming in D.. And
as much as
I like C/C++, I wanna try innovating, I
On Wednesday, 4 June 2014 at 04:46:59 UTC, ed wrote:
On Wednesday, 4 June 2014 at 03:49:25 UTC, Harpo wrote:
Hello I am having the following problem. I am trying to turn a
program I have written into a shared object. I have ran into
some problems however. When I use writeln instead of printf
writeln requires the D runtime
to be initialised.
Check out
http://dlang.org/phobos/core_runtime.html#.Runtime.initialize
http://dlang.org/phobos/core_runtime.html#.Runtime.terminate
Cheers,
ed
Cheers,
ed
loader issues
I was having as well.
Cheers,
ed
On Wednesday, 14 May 2014 at 06:14:16 UTC, FrankLike wrote:
On Tuesday, 13 May 2014 at 23:26:20 UTC, ed wrote:
On Tuesday, 13 May 2014 at 15:20:36 UTC, FrankLike wrote:
DFL is just a thin wrapper around Win32, no surprise. I've
found my apps written using DFL work quite fine in Linux via
3. DFL uses less LOC and reduces code complexity comapred to
GTK-d and DWT
Then the comparison between DFL and other GUI libraries would be
interesting.
Cheers,
ed
main() {
auto s1 = S(&func);
auto s2 = S(&Object.classinfo.create);
// s1 is S!(void* function())
// s2 is S!(Object delegate() const);
}
---
Is this a good idea or am I way off?
Thanks,
ed
=%s", &aa, aa);
}
void main()
{
string[int] aa;
aa[1] = "one";
writefln("[MAIN1]&aa:%s=%s", &aa, aa);
func(aa);
writefln("[MAIN2]&aa:%s=%s", &aa, aa);
}
---
It is the same as passing a C++ shared_ptr<> by value.
Cheers,
ed
On Thursday, 3 April 2014 at 06:23:40 UTC, Jonathan M Davis wrote:
On Tuesday, April 01, 2014 03:54:07 Jonathan M Davis wrote:
On Tuesday, April 01, 2014 05:35:28 ed wrote:
> OK, lazy me just read the std.satetime article again. It
> appears
> the design is for no invalid values
On Tuesday, 1 April 2014 at 10:54:41 UTC, Jonathan M Davis wrote:
On Tuesday, April 01, 2014 05:35:28 ed wrote:
OK, lazy me just read the std.satetime article again. It
appears
the design is for no invalid values and it is currently a known
limitation due to CTFE.
---
d_time_nan There is no
.
---
I would still like to know if there is a way around this so I can
have my struct default init.
Thanks,
ed
ult struct ctor so I can init
the SysTime member?
If this is by design I don't think it should crash. A Date/Time
error is often something user code can safely recover from.
Thanks,
ed
On Monday, 31 March 2014 at 06:25:40 UTC, Jonathan M Davis wrote:
On Monday, March 31, 2014 05:09:22 ed wrote:
Hi,
Just wondering what the best replacement for C timeval is in D.
I'm looking at std.datetime.SysTime, but std.datetime is huge
so
I'm not sure.
If you want an o
Hi,
Just wondering what the best replacement for C timeval is in D.
I'm looking at std.datetime.SysTime, but std.datetime is huge so
I'm not sure.
Thanks,
ed
://github.com/dcarp/cmake-d
You beat me to it :)
I was going to github my version today at work but I'll drop it
now and work from your repo.
Thanks setting it up!
Cheers,
ed
n for CMake+D
also.
Cheers,
ed
On Friday, 14 March 2014 at 19:24:21 UTC, Chris Williams wrote:
It looks like you might be right after all about the code being
invalid D. It could be a bug when it compiles without the cast.
I filed a bug report about it, see where it leads :D
Thanks,
ed
On Friday, 14 March 2014 at 23:10:57 UTC, bearophile wrote:
ed:
void main()
{
int[] a = [1,2,3,4];
int[2][2] b = a; // fine, does an array copy
}
Is it a bug or by design?
That looks like a compiler bug. You are supposed to use a cast
to do an assignment like that.
Bye
it a bug or by design?
(and if by design why?)
Cheers,
ed
aise a new question asking why this doesn't work as I
expect:
int[2][2] b;
b=a;
Thanks for your help on this one. It has forced me to drill into
the internals a bit more, which is always a good thing :)
Cheers,
ed
On Friday, 14 March 2014 at 04:18:18 UTC, ed wrote:
On Thursday, 13 March 2014 at 18:17:03 UTC, Chris Williams
wrote:
On Thursday, 13 March 2014 at 03:31:09 UTC, ed wrote:
On Thursday, 13 March 2014 at 00:15:19 UTC, Chris Williams
wrote:
[snip]
It shouldn't and probably isn't wor
On Thursday, 13 March 2014 at 18:17:03 UTC, Chris Williams wrote:
On Thursday, 13 March 2014 at 03:31:09 UTC, ed wrote:
On Thursday, 13 March 2014 at 00:15:19 UTC, Chris Williams
wrote:
[snip]
It shouldn't and probably isn't working.
It is working and in fact it is in a "c
asts work perfectly albeit a little ugly :D
Cheers,
ed
the to!
function. I didn't realise this until after bearophile's reply :D
Thanks,
ed
On Wednesday, 12 March 2014 at 02:14:45 UTC, bearophile wrote:
ed:
I am trying to convert a 1D array to a 2D array
If you have a dynamic array (1D), you can convert it to a
dynamic array of dynamic arrays (2D) using chunks:
void main() {
import std.stdio, std.range, std.algorithm
this the case and why would it be so? If not,
what is happening here?
Thanks,
ed
On Tuesday, 4 February 2014 at 11:01:01 UTC, Jakob Ovrum wrote:
On Tuesday, 4 February 2014 at 09:30:22 UTC, ed wrote:
Hi,
given a struct like so:
struct S(alias N, T) {...}
is there a way to get the template parameters of S? Something
like:
S.typetuple[0] == N,
S.typetuple[1] == T
I
On Tuesday, 4 February 2014 at 09:46:01 UTC, evilrat wrote:
On Tuesday, 4 February 2014 at 09:39:48 UTC, evilrat wrote:
On Tuesday, 4 February 2014 at 09:30:22 UTC, ed wrote:
Hi,
given a struct like so:
struct S(alias N, T) {...}
is there a way to get the template parameters of S? Something
a way to do the above.
Thanks,
ed
it gives the same
results as approxEquals ... yay! ...only took me several hours to
achieve about 10 LOC but I finally understand it
Cheers,
Ed
approaches are very similar in terms of code though.
Next year I have a whole semester on numerical computing,
covering floating point numbers, machine imprecision and how to
deal with etcI'm determined to ace that subject :D
Cheers,
Ed
true;}
else {return false;}
Why does Phobos not check lhs < rhs? Does this imply that in some
cases:
approxEqual(X, Y) != approxEqual(Y, X) ??
Thanks,
Ed
) < std::numeric_limits::min()) {}
# if(fabs(x) < std::numeric_limits::epsilon()) {}
# if(!(fabs(x) > 0.0)) {}
# double eps = 1/(1/x);
# if(!(fabs(eps) > 0.0)) {}
So you can see we're all confused!
Thanks,
Ed
PS: I have read this great article and the links it provides:
http:/
letter variable names, no whitespace,
etc.) There are sudoku solvers in under 200 bytes in Perl and Python; a
D version would just prove that we too can write code that looks like
line noise.
--Ed
fdef CRAY
#define WORD64
#endif
WORD64 should only be defined when building on a Cray. I've sent a pull
request to the deimos/x11 repo.
--Ed
On 03/23/2012 04:14 AM, Andrej Mitrovic wrote:
On 3/23/12, Ed McCardell wrote:
Is there a way to write a template constraint that matches any
specialization of a given type?
Nope. But there are simple workarounds:
class Foo(bool feature1, bool feature2) { enum _isFoo = true; }
template
== Foo!(false, false)) || is(T == Foo!(false, true)) ||
is(T == Foo!(true, false)) || is(T == Foo!(true, true)))
{
// call methods of foo that don't change based on feature1/feature2
}
Thanks,
--Ed
41 matches
Mail list logo