How should I compare immutable ints to ensure that they are actually equal?
I was quite surprised to receive the following error message:
cbt2.d(732): Error: function object.Object.opEquals (Object o) is not
callable using argument types (immutable(int))
when I tried to assert that two values
On 06/18/2013 12:40 PM, Steven Schveighoffer wrote:
On Tue, 18 Jun 2013 15:37:44 -0400, Charles Hixson
wrote:
(Sorry if this double posts. I'm having trouble getting through at
all.)
How should I compare immutable ints to ensure that they are actually
equal?
I was quite surprised to rec
On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
Thank you very much.
Now, is there any way to get Google to find my question/your
answer if someone searches for "dlang numeric limits"?
Cheers,
Craig
Yes, get the text, "numeric limits" onto the page.
Though, "dlang max int" se
I haven't actually used Qt for a while and never used qml but
I'll betcha this binding is going to be a pretty difficult task.
Simply using it might not be bad, can probably just use a few
extern(C) functions to take strings, but expanding it surely will
involve talking to complex C++ objects,
http://stackoverflow.com/questions/17235375/how-to-create-bindings-qml-to-d
Andrei
On Friday, 21 June 2013 at 21:11:42 UTC, Adam D. Ruppe wrote:
On Friday, 21 June 2013 at 19:51:16 UTC, Craig Dillabaugh wrote:
I guess I need to ween myself off my Google dependency.
Good idea! I became a Bing guy a couple years ago and only go
to google for those rare times when the bing res
On Thursday, 20 June 2013 at 21:48:49 UTC, Joseph Rushton
Wakeling wrote:
On 06/04/2013 01:03 PM, Diggory wrote:
Still a few places to optimise, and I think the compiler
optimisation should be
able to give a decent speed up as well. Would be interested to
see how it
compares in your benchmark!
On Friday, 21 June 2013 at 19:51:16 UTC, Craig Dillabaugh wrote:
I guess I need to ween myself off my Google dependency.
Good idea! I became a Bing guy a couple years ago and only go to
google for those rare times when the bing results just suck. I
find bing to be a much faster website too. (
On 06/21/2013 12:19 PM, Craig Dillabaugh wrote:
I feel kind of dumb asking this, as I thought I could solve it
with 30 seconds on Google, but no luck.
Where can I get values for min/max values for D numeric types,
like what is available in limits.h and float.h for C/C++?
I have the following
On Friday, 21 June 2013 at 19:39:06 UTC, Adam D. Ruppe wrote:
On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
Now, is there any way to get Google to find my question/your
answer if someone searches for "dlang numeric limits"?
Beats me :(
Oddly enough, using Bing or Yahoo (sa
On Fri, Jun 21, 2013 at 09:19:36PM +0200, Craig Dillabaugh wrote:
> I feel kind of dumb asking this, as I thought I could solve it
> with 30 seconds on Google, but no luck.
>
> Where can I get values for min/max values for D numeric types,
> like what is available in limits.h and float.h for C/C++
On Friday, 21 June 2013 at 19:30:28 UTC, Craig Dillabaugh wrote:
Now, is there any way to get Google to find my question/your
answer if someone searches for "dlang numeric limits"?
Beats me :(
Adam D. Ruppe:
etc etc etc. The one that's weird is float.min_normal I think.
Don't use float.min/double.min/real.min. I have opened a bug
report:
http://d.puremagic.com/issues/show_bug.cgi?id=10439
Bye,
bearophile
On Friday, 21 June 2013 at 19:22:15 UTC, Adam D. Ruppe wrote:
On Friday, 21 June 2013 at 19:19:37 UTC, Craig Dillabaugh wrote:
Where can I get values for min/max values for D numeric types,
like what is available in limits.h and float.h for C/C++?
Literally type:
int.max
int.min
long.max
long
On Friday, 21 June 2013 at 17:47:49 UTC, Gary Willoughby wrote:
Do you import the module that declares the __gshared var or
import the var itself?
Import the module then use the variable.
module globals;
int a; // or could be __gshared if you don't want it to be thread
local
module test1
On Friday, 21 June 2013 at 19:19:37 UTC, Craig Dillabaugh wrote:
Where can I get values for min/max values for D numeric types,
like what is available in limits.h and float.h for C/C++?
Literally type:
int.max
int.min
long.max
long.min
etc etc etc. The one that's weird is float.min_normal I t
I feel kind of dumb asking this, as I thought I could solve it
with 30 seconds on Google, but no luck.
Where can I get values for min/max values for D numeric types,
like what is available in limits.h and float.h for C/C++?
My efforts have demonstrated that using a search engine for D
related to
On Fri, Jun 21, 2013 at 12:36:13AM +0100, Joseph Rushton Wakeling wrote:
[...]
> private size_t diceImpl(Rng, Range)(ref Rng rng, Range proportions)
> if (isForwardRange!Range && isNumeric!(ElementType!Range) &&
> isForwardRange!Rng)
> {
> double sum = reduce!("(assert(b >= 0),
On Friday, 21 June 2013 at 16:29:06 UTC, bearophile wrote:
Gary Willoughby:
is it possible to use global variables spanning modules?<
Why don't you use a __gshared module-global var, and then
import it in all the modules where you need it?
Bye,
bearophile
I've just been looking at that b
On 06/21/2013 02:56 AM, Joseph Rushton Wakeling wrote:
> I did also have to think about it for a few seconds. You have
> a sum of values from an array; you generate a
> uniformly-distributed random number point in [0.0, sum); you
> sequentially sum values from the same array, and return when
> t
Gary Willoughby:
is it possible to use global variables spanning modules?<
Why don't you use a __gshared module-global var, and then import
it in all the modules where you need it?
Bye,
bearophile
Yes i know it's horrible but is it possible to use global
variables spanning modules?
I need to capture a small amount of program data and deal with it
in termination signal handlers. The data will be captured from
various classes spread around different modules.
I'm thinking the easiest sol
On Thu, 20 Jun 2013 15:48:38 -0400, Joseph Rushton Wakeling
wrote:
Is it considered good/recommended practice to insert an assert(false)
statement
in parts of the code that should be unreachable? Or simply an optional
choice
that may be useful for debugging?
I think it's more than good
On Fri, 21 Jun 2013 06:14:38 -0400, Jonathan M Davis
wrote:
On Friday, June 21, 2013 12:09:09 Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
f
Hi!
I've been thinking about how alias template parameters work and
I'm really confused =)
It makes perfect sense for literals, names, etc. But what I can't
get is how does it work for delegates.
If I have a function
auto apply(alias fun, T...)(T args)
{
return fun(args);
}
And then I
It's worth pointing out that Appender supports ~= so it's very
easy to swap it in, replacing builtin concatenation.
This works since 2.062 AFAIK. So is still quite new.
On Friday, 21 June 2013 at 11:33:29 UTC, monarch_dodra wrote:
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo =
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo = foo ~ bar ~ baz ~ qux;
I've used std.string.format(...)
On Friday, June 21, 2013 12:09:09 Gary Willoughby wrote:
> Have you any tips for using D when you need fast string
> concatenation? I regularly use code like this:
>
> foreach (i, range)
> {
> foo ~= bar;
> }
>
> or:
>
> foo = foo ~ bar ~ baz ~ qux;
>
> I've used st
On Friday, 21 June 2013 at 10:09:10 UTC, Gary Willoughby wrote:
Are there faster ways of appending strings?
You'll want to use appender, from std.array:
http://dlang.org/phobos/std_array.html#.Appender
Have you any tips for using D when you need fast string
concatenation? I regularly use code like this:
foreach (i, range)
{
foo ~= bar;
}
or:
foo = foo ~ bar ~ baz ~ qux;
I've used std.string.format(...) in some instances which sped
things up which surprised me.
Are
On 06/21/2013 09:51 AM, monarch_dodra wrote:
> Reading that code, it's not immediately obvious to me: The assert makes it
> self
> documenting.
I did also have to think about it for a few seconds. You have a sum of values
from an array; you generate a uniformly-distributed random number point in
On Thursday, 20 June 2013 at 23:36:35 UTC, Joseph Rushton
Wakeling wrote:
On 06/20/2013 11:36 PM, Jonathan M Davis wrote:
... one is necessary as it's in a function that is supposed
to return a
value.
I don't think that that's supposed to be necessary. The only
reason that that should happen
phabricator looks pretty decent for code review, bug tracking etc. It was
created at facebook and is used by many other companies; it's actively
maintained and developed.
It could be a good replacement for bugzilla and other components.
34 matches
Mail list logo