Re: DIP-1000 and return

2017-03-08 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 2 January 2017 at 15:28:57 UTC, Nordlöw wrote: Should I file a bug report? Yes please

Re: DMD + Dynamic Library.

2017-03-08 Thread Damien Gibson via Digitalmars-d-learn
Well i guess ill try turning it to export everywhere then in a bit and report back if it worked out.

Re: DMD + Dynamic Library.

2017-03-08 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 18:21:35 UTC, Damien Gibson wrote: On Wednesday, 8 March 2017 at 06:28:47 UTC, Jerry wrote: You have to use "export" for any symbol to be visible from a dll. On Windows by default nothing is exported. Would "export" and "export extern(D):" not be the same? Im con

Re: Best way to manage non-memory resources in current D, ex: database handles.

2017-03-08 Thread Chad Joan via Digitalmars-d-learn
Awesome, thank you! On Thursday, 9 March 2017 at 00:47:48 UTC, Adam D. Ruppe wrote: Now, if you forget to scope(exit), it is OK, the garbage collector WILL get around to it eventually, and it is legal to work with C handles and functions from a destructor. It is only illegal to call D's garbag

Re: Best way to manage non-memory resources in current D, ex: database handles.

2017-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 23:54:56 UTC, Chad Joan wrote: What's the best way to implement such a range in current D? I'd go with a struct with disabled copying and default construction, then make the destructor free it and the function that returns it populate it. So basically Unique.

Re: DMD + Dynamic Library.

2017-03-08 Thread Damien Gibson via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 06:28:47 UTC, Jerry wrote: You have to use "export" for any symbol to be visible from a dll. On Windows by default nothing is exported. Would "export" and "export extern(D):" not be the same? Im confuseled..

Re: Date formatting in D

2017-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 16:00:26 UTC, aberba wrote: Your docs page is really effective, not pretty though. If you have specific complaints/suggestions, feel free to make a thread in the General forum, or email me destructiona...@gmail.com and I'll see what I can do (just don't want to

Re: Date formatting in D

2017-03-08 Thread aberba via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 15:46:42 UTC, Adam D. Ruppe wrote: On Wednesday, 8 March 2017 at 15:29:11 UTC, aberba wrote: [...] The PHP function is basically just (translated to D): string date(string format, time_t timestamp) { char[256] buffer; auto ret = strftime(buffer.ptr, buff

Re: Date formatting in D

2017-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 15:29:11 UTC, aberba wrote: Having to do these stuff with C is a punch in the face. Or PHP was: date(format, timestamp); The PHP function is basically just (translated to D): string date(string format, time_t timestamp) { char[256] buffer; auto ret = st

Re: Date formatting in D

2017-03-08 Thread aberba via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 20:52:39 UTC, ikod wrote: On Tuesday, 7 March 2017 at 20:29:07 UTC, aberba wrote: I've been trying to figure out an inbuilt functionality in phobos for formatting date. In my use case, I've been trying to format current Unix timestamp to something like "Thu, 08 Mar

Re: Passing macros from commandline or enumerating versions

2017-03-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 12:00:40 UTC, Martin Drašar wrote: Yeah, that's definitely an option, but I expect to have troubles with DUB if I use this approach. ugh dub really show offer some way to pass individual modules too. Maybe we can request a `--passthrough something_to_pass_to_dmd_

Re: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled?

2017-03-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 12:28:13 UTC, Jacob Carlborg wrote: On 2017-03-08 12:59, Guillaume Piolat wrote: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled? I had a quick look through the imports, I could not find anything that I know uses

Re: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled?

2017-03-08 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-03-08 12:59, Guillaume Piolat wrote: Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled? I had a quick look through the imports, I could not find anything that I know uses the runtime. Although it does use exceptions and asserts in some p

Re: Best memory management D idioms

2017-03-08 Thread Moritz Maxeiner via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 06:42:40 UTC, ag0aep6g wrote: [...] Yes and yes. GCAllocator.allocate calls core.memory.GC.malloc with does pretty much the same thing as the builtin `new`. Nitpicking: `new` is typed (i.e. allocation+construction), `malloc` and `allocate` are not (only allocati

Re: Passing macros from commandline or enumerating versions

2017-03-08 Thread Martin Drašar via Digitalmars-d-learn
Dne 7.3.2017 v 22:36 Adam D. Ruppe via Digitalmars-d-learn napsal(a): > The way I like to do it is to pass a module on the command line that > contains the custom config. So in the app: > > --- > import myapp.config; > > // use the variables defined in there like normal > --- > > > Now, to defi

Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled?

2017-03-08 Thread Guillaume Piolat via Digitalmars-d-learn
Is it possible to use std.experimental.allocator without the runtime or with the runtime disabled? It would be ideal for allocating audio buffers in the audio thread. malloc is tolerated but using a pre-allocated area with a fallback on malloc would be way better and faster too.

Re: Can i using D & LLVM & SDL2 for Android?

2017-03-08 Thread Joakim via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 12:06:48 UTC, dummy wrote: Just thought. I do want to know. :-) As far as I know is, * LDC2 woring on NDK(yah!) * Native OpenGLES: http://wiki.dlang.org/Build_LDC_for_Android#Build_a_sample_OpenGL_Android_app_ported_to_D * Dlangui working on Android that based

Re: DUB specify version identifier on command line?

2017-03-08 Thread XavierAP via Digitalmars-d-learn
On Wednesday, 8 March 2017 at 02:15:00 UTC, Nicholas Wilson wrote: Setting version identifiers is done by the `-version=ident` command line flag (this is equivalent to `version = ident` at source level) . This should therefore be settable by the "dflags" dub configuration setting. The way I w

Re: Cconditional expression in return statement. Bug?

2017-03-08 Thread Jack Applegame via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 16:00:54 UTC, kinke wrote: Definitely a very bad bug. It works too if you mark `fun()` as nothrow. Please file a DMD issue. https://issues.dlang.org/show_bug.cgi?id=17246