On Sunday, 27 August 2017 at 10:46:53 UTC, Andrew Chapman wrote:
[...]
Oh interesting. Does DUB support passing through the
--enable-contracts flag to ldc? Also, if this is an ldc
specific thing it's probably not a good idea i'd imagine, since
in the future one may want to use a GDC, or
In the docs regarding contract programming and the use of enforce
/ assert:
https://dlang.org/library/std/exception/enforce.html
it says:
"enforce is used to throw exceptions and is therefore intended to
aid in error handling. It is not intended for verifying the logic
of your program. That
On Sunday, 27 August 2017 at 10:46:53 UTC, Andrew Chapman wrote:
On Sunday, 27 August 2017 at 10:37:50 UTC, Moritz Maxeiner
wrote:
[...]
Oh interesting. Does DUB support passing through the
--enable-contracts flag to ldc?
Sure, using platform specific build settings [1] such as
On Saturday, 26 August 2017 at 09:03:03 UTC, Hasen Judy wrote:
What if I want to include a 3rd party library? Surely before
dub existed, people were incorporating other libraries in their
projects.
sometimes pragma("lib", ...) very usefull (if i understand you
correctly)
On Sunday, 27 August 2017 at 10:37:50 UTC, Moritz Maxeiner wrote:
On Sunday, 27 August 2017 at 10:17:47 UTC, Andrew Chapman wrote:
On Sunday, 27 August 2017 at 10:08:15 UTC, ag0aep6g wrote:
[...]
Thanks, that explains it. I think it's a bit of a shame that
the "in" blocks can't be used in
On Sunday, 27 August 2017 at 01:58:04 UTC, Jonathan M Davis wrote:
[...]
Thanks Jonathan, that makes sense. As it turns out, the Mutex
approach actually makes things slower. In this case I believe
trying to use multiple cores isn't worth it.
Cheers.
On 08/27/2017 12:02 PM, Andrew Chapman wrote:
However, I am finding that BOTH enforce and assert are compiled out by
dmd and ldc in release mode. Is there a standard way of doing what
enforce does inside an "in" contract block that will work in release mode?
I'm guessing I should write my
More than once I have downloaded a DUB package which almost
compiles but not quite. The fixes are often so trivial that even
the user can do them, and the package starts working.
But one may want to create a pull request to fix those issues for
others too. Is there any way to make the
On Sunday, 27 August 2017 at 10:08:15 UTC, ag0aep6g wrote:
On 08/27/2017 12:02 PM, Andrew Chapman wrote:
However, I am finding that BOTH enforce and assert are
compiled out by dmd and ldc in release mode. Is there a
standard way of doing what enforce does inside an "in"
contract block that
On Sunday, 27 August 2017 at 10:17:47 UTC, Andrew Chapman wrote:
On Sunday, 27 August 2017 at 10:08:15 UTC, ag0aep6g wrote:
On 08/27/2017 12:02 PM, Andrew Chapman wrote:
However, I am finding that BOTH enforce and assert are
compiled out by dmd and ldc in release mode. Is there a
standard
On Saturday, 26 August 2017 at 10:53:03 UTC, Vino.B wrote:
On Saturday, 26 August 2017 at 10:45:13 UTC, Vino.B wrote:
On Saturday, 26 August 2017 at 10:07:53 UTC, user1234 wrote:
[...]
Hi,
Now there is no duplicate , but the sequence is still not
correct
[...]
Hi,
If I execute the
On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote:
Hi, all.
Can anybody explain to me why
void main()
{
import std.numeric;
assert(gcd(0.5,32) == 0.5);
assert(gcd(0.2,32) == 0.2);
}
fails on the second assert?
I'm aware, that calculating gcd on doubles is not so
Hi, all.
Can anybody explain to me why
void main()
{
import std.numeric;
assert(gcd(0.5,32) == 0.5);
assert(gcd(0.2,32) == 0.2);
}
fails on the second assert?
I'm aware, that calculating gcd on doubles is not so obvios, as
on integers. But if the library accepts
On Sunday, 27 August 2017 at 22:21:11 UTC, Enjoys Math wrote:
static int dataReadDelay;
That's thread-local. Use shared to make it shared across all
threads, and/or initialize it in the same thread as the use.
See:
https://dlang.org/migrate-to-shared.html
whoa, you can use a struct as a basetype for an enum? I'm
guessing it allows you to associate more information with the
enum without using lookup tables and the like? And equality is
probably just a memberwise comparison of the struct itself?
That seems interesting like an interesting idea,
On Sunday, 27 August 2017 at 19:47:59 UTC, Alex wrote:
[..]
Is there a workaround, maybe?
To expand on the earlier workaround: You can also adapt a
floating point to string algorithm in order to dynamically
determine an upper bound on the number of after decimal point
digits required. Below
ok... googled a little bit.
Seems to be the problem of the kind floating poing <--> decimal...
Will try to get by with some division and lrint logic, as there
is a lack of definition, how to define a gcd in general case.
For example with 30 and 0.16.
Never mind...
I have:
class DataSignal : Thread
{
public:
static int dataReadDelay;
void run() {
while (true) {
Thread.sleep(dur!"msecs"(dataReadDelay));
// Read in the new file data
}
}
}
in main I have:
DataSignal.dataReadDelay = 8000;
// initialize a
On Sunday, August 27, 2017 22:01:52 Michael Reiland via Digitalmars-d-learn
wrote:
> whoa, you can use a struct as a basetype for an enum? I'm
> guessing it allows you to associate more information with the
> enum without using lookup tables and the like? And equality is
> probably just a
On Sunday, 27 August 2017 at 11:53:29 UTC, Vino.B wrote:
On Saturday, 26 August 2017 at 10:53:03 UTC, Vino.B wrote:
[...]
Hi,
After analyzing a bit further was able to find that the out
data before sorting is like below(4 - 2 dimensional array)
hence the sorting is not working, so may i
On Sunday, 27 August 2017 at 00:20:47 UTC, ag0aep6g wrote:
On 08/27/2017 01:53 AM, Cecil Ward wrote:
On Saturday, 26 August 2017 at 23:49:30 UTC, Cecil Ward wrote:
[...]
I think I understand, but I'm not sure. I should have
explained properly. I suspect what I should have said was
that I was
On Saturday, 26 August 2017 at 21:59:10 UTC, Thomas Mader wrote:
Hello,
I am building ldc on Nix (https://nixos.org/nix/) but keep
getting an error while running the cppa.d test from the dmd
testsuite (https://github.com/ldc-developers/dmd-testsuite).
1588: ... runnable/cppa.d
On Sunday, 27 August 2017 at 15:56:14 UTC, Saigon wrote:
Hi,
Can I have Timeout function like this one [1] in Ruby? I want
to check if a TCP service is running, and the check would
return error if timeout occurs.
Thanks a lot
[1] https://github.com/ruby/ruby/blob/trunk/lib/timeout.rb
Can
Hi,
Can I have Timeout function like this one [1] in Ruby? I want to
check if a TCP service is running, and the check would return
error if timeout occurs.
Thanks a lot
[1] https://github.com/ruby/ruby/blob/trunk/lib/timeout.rb
On Sunday, 27 August 2017 at 17:36:54 UTC, Cecil Ward wrote:
On Sunday, 27 August 2017 at 00:20:47 UTC, ag0aep6g wrote:
[...]
Static had already been tried. Failed. Thanks to your tip, I
tried enum next. Failed as well, wouldn't compile with GDC.
[...]
I wonder if there is anything
On Sunday, 27 August 2017 at 15:56:55 UTC, Jerry wrote:
On Sunday, 27 August 2017 at 15:56:14 UTC, Saigon wrote:
Hi,
Can I have Timeout function like this one [1] in Ruby? I want
to check if a TCP service is running, and the check would
return error if timeout occurs.
Thanks a lot
[1]
Trying to set a callback for portaudio and it's seeing zero for
the value passed.
Pa_OpenStream(, input, output, sampleRate, cast(ulong)0,
cast(PaStreamFlags)(PaStreamFlags.NoFlag +
0*PaStreamFlags.PrimeOutputBuffersUsingStreamCallback),
Looking at the assembly shows something like this:
0041ea98 push 0x0
0041ea9a push 0x0
0041ea9c push 0x0
0041ea9e push dword 0x100
0041eaa3 mov ecx, [typeid(PaStreamParameters)+0xe36fc (0x80d4cc)]
0041eaa9 mov eax, [fs:0x2c]
0041eaaf mov edx, [eax+ecx*4]
0041eab2 push dword [edx+0x1c]
On Sunday, 27 August 2017 at 17:47:54 UTC, Cecil Ward wrote:
I wonder if there is anything written up anywhere about what
kinds of things are blockers to either CTFE or to successful
constant-folding optimisation in particular compilers or in
general?
Would be useful to know what to stay
29 matches
Mail list logo