Re: What do you use to generate documentation?

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-01-19 19:45, Suliman wrote: It's seems that there is no any big changes in this deal. The upcoming 2.073.0 (now in release candidate) has a completely new default Ddoc theme. -- /Jacob Carlborg

Re: What do you use to generate documentation?

2017-01-19 Thread Jacob Carlborg via Digitalmars-d-learn
On 2013-03-13 10:35, Andrea Fontana wrote: I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? Yes :). The upcoming 2.073.0 (now in release candidate) has a completely new default Ddoc theme.

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread rikki cattermole via Digitalmars-d-learn
On 20/01/2017 9:29 AM, Rene Zwanenburg wrote: On Thursday, 19 January 2017 at 14:04:36 UTC, aberba wrote: Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual calcula

Re: Making .exe

2017-01-19 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 19 January 2017 at 21:47:53 UTC, Dlearner wrote: Yo! Okay I did this and I run the .exe and it works, but if I try to copy/paste it on my desktop and run it, it (obviously) doesn't work. Is there a way to somehow compile the source, .dll's and image file that I'm using together

with not working wtih BitFlags

2017-01-19 Thread Jot via Digitalmars-d-learn
struct EnumToFlags(alias E) { template opDispatch(string Name) { enum opDispatch = 1 << __traits(getMember, E, Name); }; }; enum X { a,b,c } auto q = EnumtoFlags!X; auto m = q.a; with(q) { auto m = a; } a undefined. Any way to get it to work? Maybe a f

Re: cannot alias array ;/

2017-01-19 Thread Jot via Digitalmars-d-learn
On Thursday, 19 January 2017 at 12:50:06 UTC, John Colvin wrote: On Thursday, 19 January 2017 at 07:48:03 UTC, Jot wrote: alias a = myarray[k]; fails myarray is a multidimensial array that I want to reduce writing it every time but D complains that it can't alias it. I simply want it to do

Re: iterating through members of bitfields

2017-01-19 Thread Nestor via Digitalmars-d-learn
On Wednesday, 18 January 2017 at 12:52:56 UTC, drug wrote: I've "solved" the same problem by using AliasSeq to generate bitfields so that for iterating over bitfields I can iterate over alias sequence and mixin code. Not very good but it works. Interesting, could you provide a working example?

Re: Making .exe

2017-01-19 Thread Dlearner via Digitalmars-d-learn
On Thursday, 19 January 2017 at 20:56:41 UTC, Nemanja Boric wrote: On Thursday, 19 January 2017 at 18:58:31 UTC, Dlearner wrote: [...] Hello! The binary should be in the working directory: ``` ➜ dub init Package recipe format (sdl/json) [json]: Name [test-dub]: Description [A minimal D app

Re: Making .exe

2017-01-19 Thread Nemanja Boric via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:58:31 UTC, Dlearner wrote: Hey! I wrote a little program that has an image bounce around and change colours, like the old DVD player screensavers. How can I build this as a little .exe file that I can send to someone? In the dub documentation there is somet

Re: Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread Rene Zwanenburg via Digitalmars-d-learn
On Thursday, 19 January 2017 at 14:04:36 UTC, aberba wrote: Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual calculations but from Phobos functions. You can ge

Making .exe

2017-01-19 Thread Dlearner via Digitalmars-d-learn
Hey! I wrote a little program that has an image bounce around and change colours, like the old DVD player screensavers. How can I build this as a little .exe file that I can send to someone? In the dub documentation there is something like `dub --build=`, but I'm not entirely sure what this

Re: What do you use to generate documentation?

2017-01-19 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:45:05 UTC, Suliman wrote: It's seems that there is no any big changes in this deal. I made my doc gen since then and ddox has grown since then as well. Only other major change is ddoc just got new styling in the newest dmd beta. Still the same ddoc, just nic

Re: What do you use to generate documentation?

2017-01-19 Thread Suliman via Digitalmars-d-learn
On Thursday, 19 January 2017 at 18:09:20 UTC, Basile B. wrote: On Thursday, 19 January 2017 at 15:20:37 UTC, Suliman wrote: What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Thursday, 19 January 2017 at 15:20:37 UTC, Suliman wrote: What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of app what is the reason to use this flag? Oh no 2013 !! I thou

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Thursday, 19 January 2017 at 17:06:39 UTC, Nemanja Boric wrote: On Thursday, 19 January 2017 at 16:47:07 UTC, Basile B. wrote: [...] I've submitted few PRs but they never got merged. We're maintaining, unofficially, fork that does compile and it's available at: https://github.com/socioma

Re: What do you use to generate documentation?

2017-01-19 Thread Nemanja Boric via Digitalmars-d-learn
On Thursday, 19 January 2017 at 16:47:07 UTC, Basile B. wrote: On Wednesday, 13 March 2013 at 09:35:18 UTC, Andrea Fontana wrote: [...] I use harbored-mod (https://github.com/kiith-sa/hmod-dub). What I like about it: 1/ I'm not good with web things. The default styling is Okay for me so I

Re: What do you use to generate documentation?

2017-01-19 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 13 March 2013 at 09:35:18 UTC, Andrea Fontana wrote: I've tried to build documentation using ddoc format and dmd. dmd -c -D -o- ... Generated documentation looks ugly and without stylesheet. Am I wrong? I expected a phobos-like documentation. So, what do you use to generate you

Re: What do you use to generate documentation?

2017-01-19 Thread Suliman via Digitalmars-d-learn
What do dflag: `-c do not link`. Should I pass it during the generation of the docs? dub is append it's automatically, but if I want to generate new docs every rebuild of app what is the reason to use this flag?

Phobos: Determining number of hours or minutes or seconds till now

2017-01-19 Thread aberba via Digitalmars-d-learn
Using the standard library, how do a get number of hours or seconds or minutes or days or months or years till current time from a past timestamp (like "2 mins ago")? Not with manual calculations but from Phobos functions.

Re: cannot alias array ;/

2017-01-19 Thread John Colvin via Digitalmars-d-learn
On Thursday, 19 January 2017 at 07:48:03 UTC, Jot wrote: alias a = myarray[k]; fails myarray is a multidimensial array that I want to reduce writing it every time but D complains that it can't alias it. I simply want it to do a direct substitution, nothing fancy, just to reducing typing.

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 01:06 AM, Ali Çehreli wrote: > In other words, D's string > mixins are the same as C's macros. I was testing you! :p I meant "NOT the same as". :p Ali

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 12:41 AM, Chris Katko wrote: > 1 - Is there any way TO get the output 64,64? You can mixin the entire statement. I used the ~ operator but you can use format() or the return value of a function as well: mixin("array_t!(" ~ sizer2D!() ~ ") case2;"); // ... mixin("arra

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Daniel N via Digitalmars-d-learn
On Thursday, 19 January 2017 at 08:41:53 UTC, Chris Katko wrote: Thank you! So: 1 - Is there any way TO get the output 64,64? Would this work for you? import std.meta; alias sizer1D = AliasSeq!(64); alias sizer2D = AliasSeq!(64,64); array_t!sizer2D caseX; array2_t!sizer1D caseY;

Re: switch statement with variable branches

2017-01-19 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 19 January 2017 at 01:22:56 UTC, Yuxuan Shui wrote: Somehow I can't use ubyte variables behind 'case', but ulong works fine. Why is that? void main() { alias TestType = ulong; // won't compile if = ubyte import std.stdio; TestType a,b,c; readf("%s %s

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
Thank you! So: 1 - Is there any way TO get the output 64,64? It seems like being able to get a comma out of a mixin is a useful feature. 2 - Is this very non-standard / unrecommended practice and there's a much better way to do this? For example, in my actual code, I have an enumerator: e

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/19/2017 12:03 AM, Chris Katko wrote: > template sizer2D() // no params here for simplicity > { > const char [] sizer2D = "64,64"; > } > array_t!(mixin(sizer2D!())) case2; // FAILS (error below) > Error: template instance array_t!64 does not match template declaration > arr

Re: Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
Addendum: Writing the following: writeln(mixin(sizer2D!())); simply dumps 64 to stdout. What's going on here? Have I run into a compiler bug?

Re: cannot alias array ;/

2017-01-19 Thread ketmar via Digitalmars-d-learn
On Thursday, 19 January 2017 at 07:48:03 UTC, Jot wrote: alias a = myarray[k]; fails myarray is a multidimensial array that I want to reduce writing it every time but D complains that it can't alias it. I simply want it to do a direct substitution, nothing fancy, just to reducing typing.

Re: cannot alias array ;/

2017-01-19 Thread Ali Çehreli via Digitalmars-d-learn
On 01/18/2017 11:48 PM, Jot wrote: alias a = myarray[k]; fails myarray is a multidimensial array that I want to reduce writing it every time but D complains that it can't alias it. I simply want it to do a direct substitution, nothing fancy, just to reducing typing. Nested functions work pr

Mixin template confusion / compiler error.

2017-01-19 Thread Chris Katko via Digitalmars-d-learn
I've tried to narrow this down to the minimum code that exhibits the problem. When I use a mixin, to supply the parameters for a template, it works with ONE argument, but NOT TWO. template sizer2D() // no params here for simplicity { const char [] sizer2D = "64,64";