Re: Date formatting in D

2017-03-07 Thread Daniel Kozak via Digitalmars-d-learn
Dne 7.3.2017 v 21:29 aberba via Digitalmars-d-learn napsal(a): 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 2017 12:00:00 GMT". How do I go by this

Date formatting in D

2017-03-07 Thread aberba via Digitalmars-d-learn
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 2017 12:00:00 GMT". How do I go by this easily (Currently, long concatenation of strings is what I'm

Re: Date formatting in D

2017-03-07 Thread ikod via Digitalmars-d-learn
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 2017 12:00:00 GMT". How do I go by this easily

Re: Date formatting in D

2017-03-07 Thread Daniel Kozak via Digitalmars-d-learn
I do not know? Is this some ISO/ANSI format for dates? If yes than we should add it. If no there is no reason. Dne 7.3.2017 v 22:07 aberba via Digitalmars-d-learn napsal(a): On Tuesday, 7 March 2017 at 20:29:07 UTC, aberba wrote: I've been trying to figure out an inbuilt functionality in

Re: Best memory management D idioms

2017-03-07 Thread Eugene Wissner via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 20:15:37 UTC, XavierAP wrote: On Tuesday, 7 March 2017 at 18:21:43 UTC, Eugene Wissner wrote: To avoid this from the beginning, it may be better to use allocators. You can use "make" and "dispose" from std.experimental.allocator the same way as New/Delete. Thanks!

Re: Date formatting in D

2017-03-07 Thread aberba via Digitalmars-d-learn
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 2017 12:00:00 GMT". How do I go by this easily

Re: Date formatting in D

2017-03-07 Thread Daniel Kozak via Digitalmars-d-learn
Dne 7.3.2017 v 22:07 aberba via Digitalmars-d-learn napsal(a): 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

Passing macros from commandline or enumerating versions

2017-03-07 Thread Martin DraĊĦar via Digitalmars-d-learn
Hi, I was wondering, if there is a way to pass a macro with value to the compiled program, i.e., something like -Dfoo="bar". And if that is not possible, if there is a way to enumerate all set versions. I want my application built with different string imported configurations and I have no idea

Re: Best memory management D idioms

2017-03-07 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 18:21:43 UTC, Eugene Wissner wrote: To avoid this from the beginning, it may be better to use allocators. You can use "make" and "dispose" from std.experimental.allocator the same way as New/Delete. Thanks! looking into it. Does std.experimental.allocator have a

Can i using D & LLVM & SDL2 for Android?

2017-03-07 Thread dummy via Digitalmars-d-learn
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 on SDL2: https://github.com/buggins/dlangui /

Re: How to compile against GitHub fork of Phobos?

2017-03-07 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 01:14:28 UTC, Q. Schroll wrote: I have a fork of the standard-library in the folder "phobos". DMD looking for the built-in phobos is specified in the configuration file (sc.ini on Windows, dmd.conf on Linux), not hardcoded. You may want to remove it from there.

Cconditional expression in return statement. Bug?

2017-03-07 Thread Jack Applegame via Digitalmars-d-learn
Code (https://dpaste.dzfl.pl/8e7a9c380e99): import std.stdio; struct Foo { int val; this(int val) { writefln("%s.this(int)", val); this.val = val; } this(this) { writefln("%s.this(this)", val); this.val = val; } ~this() {

Re: Cconditional expression in return statement. Bug?

2017-03-07 Thread kinke via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 14:26:18 UTC, Jack Applegame wrote: I'm pretty sure this is a bug. And very bad bug. I spent several hours looking for it. What do you think? Definitely a very bad bug. It works too if you mark `fun()` as nothrow. Please file a DMD issue.

Re: Best memory management D idioms

2017-03-07 Thread Kagamin via Digitalmars-d-learn
On Sunday, 5 March 2017 at 20:54:06 UTC, XavierAP wrote: What I want to learn (not debate) is the currently available types, idioms etc. whenever one wants deterministic memory management. There's nothing like that of C++. Currently you have Unique, RefCounted, scoped and individual people

Re: Best memory management D idioms

2017-03-07 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 16:51:23 UTC, Kagamin wrote: There's nothing like that of C++. Don't you think New/Delete from dlib.core.memory fills the bill? for C++ style manual dynamic memory management? It looks quite nice to me, being no more than a simple malloc wrapper with

Re: Problems with setting up dub for publication

2017-03-07 Thread Samwise via Digitalmars-d-learn
On Sunday, 5 March 2017 at 01:54:22 UTC, Mike Parker wrote: ... I was getting the same problem and created on issue on this project's repository (https://github.com/ZILtoid1991/pixelperfectengine), which I think (although I don't know) was the reason this thread was created. Using the

DUB specify version identifier on command line?

2017-03-07 Thread XavierAP via Digitalmars-d-learn
I'm talking about the conditional compilation keyword "version", not about version strings. I've looked in DUB's help and reference [1][2] but can't seem to find how to solve my problem. On the command line it seems to be possible to specify debug identifiers, but not version identifiers. [3]

Re: Date formatting in D

2017-03-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 07, 2017 22:15:39 Daniel Kozak via Digitalmars-d-learn wrote: > I do not know? Is this some ISO/ANSI format for dates? If yes than we > should add it. If no there is no reason. The ISO formats are already there. There's to/fromISOString and to/fromISOExtString on SysTime,

Re: DMD Refuses to Compile Multiple Source Files

2017-03-07 Thread Samwise via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 04:25:42 UTC, Mike Parker wrote: extern(C), not simply extern. It turns off the name mangling. But really, the proper thing to do is to drop the prototype and import the module with the implementation. It's tge way modules are intended to be used. Unless

Re: Best memory management D idioms

2017-03-07 Thread XavierAP via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 18:21:43 UTC, Eugene Wissner wrote: To avoid this from the beginning, it may be better to use allocators. You can use "make" and "dispose" from std.experimental.allocator the same way as New/Delete. OK I've been reading on std.experimental.allocator; it looks

Re: DUB specify version identifier on command line?

2017-03-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 22:30:30 UTC, XavierAP wrote: I'm talking about the conditional compilation keyword "version", not about version strings. I've looked in DUB's help and reference [1][2] but can't seem to find how to solve my problem. On the command line it seems to be possible to

DMD + Dynamic Library.

2017-03-07 Thread Damien Gibson via Digitalmars-d-learn
Hi everyone. My first post here - I'm not one to usually resort to trying to ask forums directly for help but I'm a bit desperate at this point as I have wasted about 3 days in total of no-life googling trying to figure something out here. My current setup works fine for creation of EXE's and

Re: DMD + Dynamic Library.

2017-03-07 Thread Jerry via Digitalmars-d-learn
You have to use "export" for any symbol to be visible from a dll. On Windows by default nothing is exported.

Re: Best memory management D idioms

2017-03-07 Thread ag0aep6g via Digitalmars-d-learn
On 03/08/2017 02:15 AM, XavierAP wrote: I see the default allocator is the same GC heap used by 'new'. Just for my learning curiosity, does this mean that if I theAllocator.make() something and then forget to dispose() it, it will be garbage collected the same once no longer referenced? And so

Re: Passing macros from commandline or enumerating versions

2017-03-07 Thread Adam D. Ruppe via Digitalmars-d-learn
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 define a config file, you do something like: myconfiguration.d # note that the file name

removing module level from ddox output

2017-03-07 Thread Bryce via Digitalmars-d-learn
Is there a way to flatten out the documentation hierarchy generated by ddox? To be more clear, when we generate documentation with dub -b ddox, the main page lists all my modules, and each module page lists all the classes in that module, etc. I want to remove the modules from the main page

Re: Best memory management D idioms

2017-03-07 Thread Eugene Wissner via Digitalmars-d-learn
On Tuesday, 7 March 2017 at 17:37:43 UTC, XavierAP wrote: On Tuesday, 7 March 2017 at 16:51:23 UTC, Kagamin wrote: There's nothing like that of C++. Don't you think New/Delete from dlib.core.memory fills the bill? for C++ style manual dynamic memory management? It looks quite nice to me,