Re: Compiling to 68K processor (Maybe GDC?)

2019-01-21 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, January 21, 2019 10:08:23 AM MST Johan Engelen via Digitalmars-d- learn wrote: > On Saturday, 19 January 2019 at 17:45:41 UTC, Patrick Schluter > > wrote: > > Afaict NULL pointer derefernecing must fault for D to be > > "usable". At least all code is written with that assumption. > > Der

Re: Linker error

2019-01-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/21/19 5:28 PM, Jerry wrote: On Monday, 21 January 2019 at 21:02:23 UTC, Steven Schveighoffer wrote: On 1/21/19 3:37 PM, Jerry wrote: [...] I had a similar problem that I fixed myself actually last dconf: https://issues.dlang.org/show_bug.cgi?id=17968 This looks almost identical as the

Re: Linker error

2019-01-21 Thread Jerry via Digitalmars-d-learn
On Monday, 21 January 2019 at 22:31:15 UTC, H. S. Teoh wrote: On Mon, Jan 21, 2019 at 10:19:00PM +, Jerry via Digitalmars-d-learn wrote: On Monday, 21 January 2019 at 21:37:22 UTC, H. S. Teoh wrote: [...] > Looks like a problem with stale cached object files. Try: > > rm dub.selections.

Re: Linker error

2019-01-21 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jan 21, 2019 at 10:19:00PM +, Jerry via Digitalmars-d-learn wrote: > On Monday, 21 January 2019 at 21:37:22 UTC, H. S. Teoh wrote: [...] > > Looks like a problem with stale cached object files. Try: > > > > rm dub.selections.json > > dub build --force > > > > (Be sure to back

Re: Linker error

2019-01-21 Thread Jerry via Digitalmars-d-learn
On Monday, 21 January 2019 at 21:02:23 UTC, Steven Schveighoffer wrote: On 1/21/19 3:37 PM, Jerry wrote: [...] I had a similar problem that I fixed myself actually last dconf: https://issues.dlang.org/show_bug.cgi?id=17968 This looks almost identical as the issue was in the generated xtoHas

Re: Linker error

2019-01-21 Thread Jerry via Digitalmars-d-learn
On Monday, 21 January 2019 at 21:37:22 UTC, H. S. Teoh wrote: On Mon, Jan 21, 2019 at 04:02:23PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: On 1/21/19 3:37 PM, Jerry wrote: > [...] [...] > [...] [...] Looks like a problem with stale cached object files. Try: rm dub.

Re: Modulo that 'wraps' the number?

2019-01-21 Thread Matheus via Digitalmars-d-learn
On Monday, 21 January 2019 at 18:39:27 UTC, Steven Schveighoffer wrote: Not a Python user, just hoping to help answer questions :) Yes I know in fact I'm not the OP but from what I understood from his post, he want to replicate, but I may be wrong. If it's the case, this code may help him:

Re: Linker error

2019-01-21 Thread Jerry via Digitalmars-d-learn
On Monday, 21 January 2019 at 21:02:23 UTC, Steven Schveighoffer wrote: What version of the compiler are you using? My issue was fixed in 2.080.1, and then a followup fix in 2.081.1. -Steve Hello! I am using 2.084. Interestingly it works with LDC 1.9 (frontend 2.79) and that just works fine

Re: Linker error

2019-01-21 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jan 21, 2019 at 04:02:23PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 1/21/19 3:37 PM, Jerry wrote: > > Hello, I am trying to compile a 1 year old project of mine which > > uses htmld and vibed. But I get this weird linker error which does > > not make any sense to me

Re: Linker error

2019-01-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/21/19 3:37 PM, Jerry wrote: Hello, I am trying to compile a 1 year old project of mine which uses htmld and vibed. But I get this weird linker error which does not make any sense to me atleast. I am using Windows 7 and dub. htmld 0.3.6: target for configuration "library" is up to date. ta

Linker error

2019-01-21 Thread Jerry via Digitalmars-d-learn
Hello, I am trying to compile a 1 year old project of mine which uses htmld and vibed. But I get this weird linker error which does not make any sense to me atleast. I am using Windows 7 and dub. htmld 0.3.6: target for configuration "library" is up to date. taggedalgebraic 0.10.12: target for

automapper v1.0.0

2019-01-21 Thread boolangery via Digitalmars-d-learn
Hi, AutoMapper is an object-object mapper. It use compile-time generated mapper to try to avoid any overhead. I'm posting in this section, because I'm not a D expert and any feedback will be appreciated :) Have a look: https://github.com/boolangery/d-automapper

Re: Modulo that 'wraps' the number?

2019-01-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/21/19 10:54 AM, Matheus wrote: On Monday, 21 January 2019 at 15:01:27 UTC, Steven Schveighoffer wrote: Probably, this optimizes into better code, but maybe the optimizer already does this with the expression above: auto tmp = n % 3; if(tmp < 0)    tmp += 3; It's just not a nice single

Re: Compiling to 68K processor (Maybe GDC?)

2019-01-21 Thread AvritSase via Digitalmars-d-learn
Hi...none of the 68k family are 100% compatible - The 68060 has many opcodes that did not exist in the 68000, and the 68000 has addressing modes that are missing from the 68060. The same applies to the ColdFire. Still, the ISA is the same.

Re: Compiling to 68K processor (Maybe GDC?)

2019-01-21 Thread Johan Engelen via Digitalmars-d-learn
On Monday, 21 January 2019 at 17:08:23 UTC, Johan Engelen wrote: For LDC, dereferencing `null` invokes Undefined Behavior [1]. For completeness, you can tell LDC that dereferencing `null` is _not_ UB in a particular function by specifying `@llvmAttr("null-pointer-is-valid", "true")`: https

Re: Compiling to 68K processor (Maybe GDC?)

2019-01-21 Thread Johan Engelen via Digitalmars-d-learn
On Saturday, 19 January 2019 at 17:45:41 UTC, Patrick Schluter wrote: Afaict NULL pointer derefernecing must fault for D to be "usable". At least all code is written with that assumption. Dereferencing `null` in D is implementation defined (https://dlang.org/spec/arrays.html#pointers). For L

Re: LDC2 with -fxray-instrument

2019-01-21 Thread Johan Engelen via Digitalmars-d-learn
On Monday, 21 January 2019 at 14:36:15 UTC, Márcio Martins wrote: On Thursday, 17 January 2019 at 00:11:10 UTC, Johan Engelen wrote: OK, got it :-) LLVM 7 changed things a little, so it's broken with LDC 1.13 [*]. For now, you can use LDC 1.12 (LLVM 6). You also have to add `-L-lstdc++` as

Re: Why D isn't the next "big thing" already

2019-01-21 Thread bauss via Digitalmars-d-learn
On Monday, 21 January 2019 at 11:41:36 UTC, Simen Kjærås wrote: On Monday, 21 January 2019 at 11:37:52 UTC, sneha wrote: [snip] I agree with you. Holy thread necromancy, batman! -- Simen He's probably using IE so he just got the latest forum updates there.

Re: Modulo that 'wraps' the number?

2019-01-21 Thread Matheus via Digitalmars-d-learn
On Monday, 21 January 2019 at 15:01:27 UTC, Steven Schveighoffer wrote: Probably, this optimizes into better code, but maybe the optimizer already does this with the expression above: auto tmp = n % 3; if(tmp < 0) tmp += 3; It's just not a nice single expression. -Steve I don't think y

Re: Modulo that 'wraps' the number?

2019-01-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/21/19 2:33 AM, Paul Backus wrote: On Monday, 21 January 2019 at 04:52:53 UTC, NaN wrote: On Sunday, 20 January 2019 at 18:51:54 UTC, Steven Schveighoffer wrote: On 1/20/19 1:28 PM, faissaloo wrote: In Python -1%3 == 2 however in D -1%3 == -1 Is there a standard library function or somethi

Re: LDC2 with -fxray-instrument

2019-01-21 Thread Márcio Martins via Digitalmars-d-learn
On Thursday, 17 January 2019 at 00:11:10 UTC, Johan Engelen wrote: On Wednesday, 16 January 2019 at 23:29:45 UTC, Johan Engelen wrote: On Wednesday, 16 January 2019 at 22:10:14 UTC, Johan Engelen wrote: On Wednesday, 16 January 2019 at 17:36:31 UTC, Márcio Martins wrote: On Tuesday, 15 January

Re: Debugging a dub build

2019-01-21 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-01-21 12:14, Per Nordlöw wrote: What's the easiest way to debug a dub app build? Is there a better way than     dub run followed by     gdb run PATH_TO_APP_BINARY No, there's nothing specific with an application built using Dub. Dub doesn't provide any help with debugging. Just m

Re: Why D isn't the next "big thing" already

2019-01-21 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 21 January 2019 at 11:37:52 UTC, sneha wrote: [snip] I agree with you. Holy thread necromancy, batman! -- Simen

Re: Why D isn't the next "big thing" already

2019-01-21 Thread sneha via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 10:42:50 UTC, lkfsdg wrote: On Tuesday, 26 July 2016 at 15:11:00 UTC, llaine wrote: Hi guys, I'm using D since a few month now and I was wondering why people don't jump onto it that much and why it isn't the "big thing" already. Everybody is into javascript now

Re: Debugging a dub build

2019-01-21 Thread JN via Digitalmars-d-learn
On Monday, 21 January 2019 at 11:16:31 UTC, Per Nordlöw wrote: Correction should be dub build --build=unittest or dub build --build=debug followed by gdb PATH_TO_APP_BINARY Does using an IDE count? Some D IDEs should be able to assist in debugging.

Re: Debugging a dub build

2019-01-21 Thread Per Nordlöw via Digitalmars-d-learn
On Monday, 21 January 2019 at 11:14:35 UTC, Per Nordlöw wrote: What's the easiest way to debug a dub app build? Is there a better way than dub run followed by gdb run PATH_TO_APP_BINARY ? Correction should be dub build --build=unittest or dub build --build=debug followe

Debugging a dub build

2019-01-21 Thread Per Nordlöw via Digitalmars-d-learn
What's the easiest way to debug a dub app build? Is there a better way than dub run followed by gdb run PATH_TO_APP_BINARY ?

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-21 Thread John Burton via Digitalmars-d-learn
On Monday, 21 January 2019 at 07:57:58 UTC, Simen Kjærås wrote: On Saturday, 19 January 2019 at 14:26:31 UTC, Zenw wrote: On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: [...] how about this auto With(string code,T)(T value) { with(value) { mixin(code ~";");

Re: Is there a nice syntax to achieve optional named parameters?

2019-01-21 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 19 January 2019 at 14:26:31 UTC, Zenw wrote: On Tuesday, 15 January 2019 at 11:14:54 UTC, John Burton wrote: As an example let's say I have a type 'Window' that represents a win32 window. I'd like to be able to construct an instance of the type with some optional parameters that de