Re: Question over C++ to D conversion

2018-05-15 Thread Richard via Digitalmars-d
On Monday, 12 March 2018 at 03:42:41 UTC, jmh530 wrote: On Monday, 12 March 2018 at 02:48:17 UTC, Laeeth Isharc wrote: [snip] For conversion of C headers, watch this space. C first, C++ eventually. Might be a talk at Dconf on it. I think I saw a reference to this somewhere else. Sounds

Question over C++ to D conversion

2018-03-11 Thread Richard via Digitalmars-d
Hi, I'm sure this question has been asked a few times before But I'm currently looking at something that will convert Cpp code to D I've recently setup a proof of concept demo which uses mbed for an embedded LPC1769 Arm board This is just a test, but I've recently managed to get debugging

Re: question about conditional operator (?:)

2016-07-26 Thread Richard via Digitalmars-d-learn
On Tuesday, 26 July 2016 at 13:19:54 UTC, ag0aep6g wrote: Operator precedence is different from what you think. `a ? b : c = d` means `(a ? b : c) = d`. But you want `a ? b : (c = d)`. So you need parentheses around `p+=1`. Or just go with `if` and `else`. It's clearer anyway. From

question about conditional operator (?:)

2016-07-26 Thread Richard via Digitalmars-d-learn
Hello all, I've got a program that correctly computes the largest factor in the prime decomposition of a positive number: * import std.math std.stdio; ulong largestPrimeFactor(ulong n) { for(ulong p=2; p<=sqrt(cast(real)n); ) {

LDC / BetterC / _d_run_main

2018-03-09 Thread Richard via Digitalmars-d-learn
Hi, I've been trying to see if I can get an mbed project to work with Dlang basically compiling D code for use on a Cortex-M Proccessor So far I've been using the latest release of LDC with the -BetterC Flag From what I can gather, normally without -BetterC it works like this: * main() -

Re: LDC / BetterC / _d_run_main

2018-03-10 Thread Richard via Digitalmars-d-learn
On Saturday, 10 March 2018 at 07:54:33 UTC, Mike Franklin wrote: On Saturday, 10 March 2018 at 02:25:38 UTC, Richard wrote: Hi, I've been trying to see if I can get an mbed project to work with Dlang basically compiling D code for use on a Cortex-M Proccessor You might be interested in the

Re: LDC / BetterC / _d_run_main

2018-03-10 Thread Richard via Digitalmars-d-learn
On Saturday, 10 March 2018 at 10:57:05 UTC, Johan Engelen wrote: On Saturday, 10 March 2018 at 07:54:33 UTC, Mike Franklin wrote: On Saturday, 10 March 2018 at 02:25:38 UTC, Richard wrote: Hi, I've been trying to see if I can get an mbed project to work with Dlang basically compiling D code