Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
I would like to contribute to the D ecosystem, but as I'm still in the learning process I do not want to get my sticky fingers all over someones nice clean code. I have poured over the documentation and see that there are a few low-hanging fruit that I would like to pluck. So I have decided t

Re: Can we get a forum section devoted to documentation? [dox]

2013-08-16 Thread Andre Artus
H. S. Teoh wrote: Most Phobos modules suffer from this problem. The first paragraph often just says something to the effect of "this is module X (we already know that) and it contains Y, Z, W (we can see that already)". Very unhelpful. We need descriptions of: 1) What: what this module does -

Re: Can we get a forum section devoted to documentation? [dox]

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 18:09:04 UTC, Andrei Alexandrescu wrote: On 8/16/13 10:56 AM, Dicebot wrote: On Friday, 16 August 2013 at 17:41:19 UTC, Andrei Alexandrescu wrote: The converse risk is balkanization. We already have subgroups that are effectively dead, for which similar arguments we

[dox] Fixing the lexical rule for BinaryInteger

2013-08-16 Thread Andre Artus
BinaryDigit character. I'm busy working on the HexadecimalInteger, which has related issues. 1. https://github.com/andre-artus/dlang.org/blob/LexBinaryDigit/lex.dd

[dox] Fixes to HexadecimalInteger and other issues spawing from HexLetter

2013-08-16 Thread Andre Artus
HexDigit HexDigit HexDigit) \U (from \U etc.) I have changed this and also specified HexDigitUS as it was left out. You can find the changes on my GitHub repo, here: https://github.com/andre-artus/dlang.org/commit/291c2742b0a779d3aa6b678ceb0273e9aa82d8f9 It has the same issue as

Re: Can we get a forum section devoted to documentation? [dox]

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 19:12:46 UTC, Mr. Anonymous wrote: On Friday, 16 August 2013 at 18:12:57 UTC, Andre Artus wrote: Is there a way to break the pages into a more of a hierarchy, so that documentation for each module doesn't have to be on one page? Perhaps a DDOC Section

Re: Can we get a forum section devoted to documentation? [dox]

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 18:41:57 UTC, Wyatt wrote: On 8/16/13 10:56 AM, Dicebot wrote: it. I'd probably favor deleting such obsolete groups (dtl, dwt, debugger?) but it is a different topic. Archive, don't delete. On Friday, 16 August 2013 at 18:25:02 UTC, Andre Artu

Re: Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 19:29:46 UTC, Jonathan M Davis wrote: On Friday, August 16, 2013 10:41:19 Andrei Alexandrescu wrote: The converse risk is balkanization. We already have subgroups that are effectively dead, for which similar arguments were made in the past. Plus, if one of the mai

Re: Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 17:45:35 UTC, Suliman wrote: On Friday, 16 August 2013 at 16:07:59 UTC, Andre Artus wrote: I would like to contribute to the D ecosystem, but as I'm still in the learning process I do not want to get my sticky fingers all over someones nice clean code. I

Re: Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:12:20 UTC, Jonathan M Davis wrote: On Friday, August 16, 2013 21:57:01 Andre Artus wrote: It is disheartening to think that the people with potential for the most valuable contributions or insight will be avoiding discussions regarding the documentation. But I

Re: Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:12:20 UTC, Jonathan M Davis wrote: On Friday, August 16, 2013 21:57:01 Andre Artus wrote: It is disheartening to think that the people with potential for the most valuable contributions or insight will be avoiding discussions regarding the documentation. But I

Re: Can we get a forum section devoted to documentation?

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:42:28 UTC, H. S. Teoh wrote: On Fri, Aug 16, 2013 at 10:24:55PM +0200, Andre Artus wrote: On Friday, 16 August 2013 at 17:45:35 UTC, Suliman wrote: >On Friday, 16 August 2013 at 16:07:59 UTC, Andre Artus wrote: >>I would like to contribute to the D ecosy

Re: [dox] List of Phobos documentation improvement candidates (Was: Re: Can we get a forum section devoted to documentation? [dox])

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:03:10 UTC, H. S. Teoh wrote: On Fri, Aug 16, 2013 at 08:25:00PM +0200, Andre Artus wrote: On Friday, 16 August 2013 at 18:09:04 UTC, Andrei Alexandrescu wrote: [...] >Things should happen organically, i.e. creating a specialized >group should follow

[dox] Text describing Sections in Documentation Generator page needs improvement

2013-08-16 Thread Andre Artus
The text describing Sections in Documentation Generator page (http://dlang.org/ddoc.html) needs improvement. It reads: Sections The document comment is a series of Sections. A Section is a name that is the first non-blank character on a line immediately followed by a ':'. This name forms th

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:00:35 UTC, Brian Schott wrote: I've been doing some work with the language grammar specification. You may find these resources useful: http://d.puremagic.com/issues/show_bug.cgi?id=10233 https://github.com/Hackerpilot/DGrammar/blob/master/D.g4 You have done imp

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-16 Thread Andre Artus
On Friday, 16 August 2013 at 20:00:35 UTC, Brian Schott wrote: I've been doing some work with the language grammar specification. You may find these resources useful: http://d.puremagic.com/issues/show_bug.cgi?id=10233 https://github.com/Hackerpilot/DGrammar/blob/master/D.g4 I have fixed up a

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-16 Thread Andre Artus
-- SNIP -- I wrote that grammar as part of my work on DCD and DScanner. My lexer, parser, and AST library need some more testing. Please download DScanner and run it with either the --ast or --syntaxCheck options. If you find issues, please report them on Github. I forked just under an hour

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-16 Thread Andre Artus
On Saturday, 17 August 2013 at 00:51:57 UTC, H. S. Teoh wrote: On Sat, Aug 17, 2013 at 01:03:35AM +0200, Brian Schott wrote: On Friday, 16 August 2013 at 22:43:13 UTC, Andre Artus wrote: [...] >2. Your BinaryInteger and HexadecimalInteger only allow for >one of >the following (reduc

[dox] DDOX (was Re: Can we get a forum section devoted to documentation?)

2013-08-17 Thread Andre Artus
On Friday, 16 August 2013 at 19:32:41 UTC, Mr. Anonymous wrote: On Friday, 16 August 2013 at 19:27:58 UTC, Andre Artus wrote: On Friday, 16 August 2013 at 19:12:46 UTC, Mr. Anonymous wrote: On Friday, 16 August 2013 at 18:12:57 UTC, Andre Artus wrote: Is there a way to break the pages into a

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-17 Thread Andre Artus
Andre Artus wrote: 2. Your BinaryInteger and HexadecimalInteger only allow for one of the following (reduced) cases: 0b1__ : works 0b_1_ : fails 0b__1 : fails Brian Schott wrote: It's my opinion that the compiler should reject all of these because I think of the underscore as a sepa

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-17 Thread Andre Artus
urry about what should/shouldn't be allowed. Andre Artus wrote: I don't think I've seen lexemes defined using (a variant of) BNF before, most often a form of regular expressions are used. One could cut down and clarify the page describing the lexical syntax significantly

Re: [dox] Fixing the lexical rule for BinaryInteger

2013-08-17 Thread Andre Artus
[...] For fun I made a scanner rule that forces BinaryInteger to conform to a power of 2 grouping of nibbles. I think it loses it's clarity after 16 bits. I made the underscore optional between nibbles, but required for groups of 2 bytes and above. Some passing cases from my test inputs.

Re: [dox] Text describing Sections in Documentation Generator page needs improvement

2013-08-24 Thread Andre Artus
On Friday, 23 August 2013 at 21:41:01 UTC, H. S. Teoh wrote: Sorry for the late reply, it's kinda hard keeping up with this high-volume mailing list. :) Tell me about it :) On Sat, Aug 17, 2013 at 12:08:06AM +0200, Andre Artus wrote: The text describing Sections in Documentation Gene

Re: [dox] Text describing Sections in Documentation Generator page needs improvement

2013-08-24 Thread Andre Artus
I have been racking my brain to find a suitable replacement for the section description, I would appreciate your critique. "A section is a block of text that is processed by the document generator. There are only two unlabeled sections, summary and description, all other sections are identifie

Re: Adding D books to the list of freely available programming books

2013-08-26 Thread Andre Artus
On Monday, 26 August 2013 at 08:57:36 UTC, Mr. Anonymous wrote: On Stack Overflow: http://stackoverflow.com/questions/194812/list-of-freely-available-programming-books I don't have a user with edit privileges, but it would be nice to add the D books: Programming in D ddili.org/ders/d.en/ D T

Re: [dox] enum specs vs reality

2013-08-27 Thread Andre Artus
On Tuesday, 27 August 2013 at 23:52:59 UTC, captaindet wrote: i admit that i am not very good at reading/understanding language definition syntax. but yet i think the given enum specs ( http://dlang.org/enum.html ) are not quite in order. they seem to imply that both enum ; enum WhatAmI ; Y

Correct forum for discussing documentation issues?

2013-08-03 Thread Andre Artus
What would be the correct forum to discuss a possible correction to the D Language specification? I started a thread on the Learn forum asking a question regarding 'import', it soon became apparent to me that there may be an error in the specification. What is the correct forum in which to di

Re: Correct forum for discussing documentation issues?

2013-08-03 Thread Andre Artus
On Saturday, 3 August 2013 at 10:31:47 UTC, Peter Alexander wrote: On Saturday, 3 August 2013 at 10:26:53 UTC, Andre Artus wrote: What would be the correct forum to discuss a possible correction to the D Language specification? Do you want to discuss it, or just report it? If it looks like

Re: D dropped in favour of C# for PSP emulator

2013-08-03 Thread Andre Artus
On Friday, 11 May 2012 at 23:51:47 UTC, Mehrdad wrote: On Friday, 11 May 2012 at 21:53:06 UTC, Jonathan M Davis wrote: I know that haskell has such a function, and there were a number of complaints previously that we _didn't_ have an any function which does exactly what std.algorithm.any now do

Re: D dropped in favour of C# for PSP emulator

2013-08-03 Thread Andre Artus
On Saturday, 12 May 2012 at 03:42:10 UTC, Ary Manzana wrote: On 5/12/12 3:40 AM, Mehrdad wrote: On Friday, 11 May 2012 at 20:20:36 UTC, Jonathan M Davis wrote: That's definitely an example of something that depends on your background. std.algorithm.any does _exactly_ what it would do in a fun

Re: D component programming is a joke (Was: Re: Component programming)

2013-08-03 Thread Andre Artus
On Thursday, 1 August 2013 at 22:45:10 UTC, bearophile wrote: Walter Bright: But consider that optimizers are built to optimize typical code patterns. Component programming is fairly non-existent in C and C++, and is new in D. Hence, optimizers are not set up to deal with those patterns (yet)

Re: Correct forum for discussing documentation issues?

2013-08-03 Thread Andre Artus
On Saturday, 3 August 2013 at 12:22:48 UTC, Peter Alexander wrote: On Saturday, 3 August 2013 at 11:22:42 UTC, Andre Artus wrote: I'm not sure that I am explaining this properly as it seems that at least 2 different people were under the impression I was making a point quite different fro

Re: D component programming is a joke (Was: Re: Component programming)

2013-08-03 Thread Andre Artus
On Saturday, 3 August 2013 at 13:46:38 UTC, David Nadlinger wrote: On Saturday, 3 August 2013 at 13:35:56 UTC, Andre Artus wrote: import std.stdio; import std.algorithm; void main() { auto values = [ 1, 2, 3, 4, 5 ]; writeln(values .map!(a => a * 10) .map!(a => a / 3) .fil

Re: request switch statement with common block

2013-08-03 Thread Andre Artus
On Saturday, 3 August 2013 at 18:56:47 UTC, JS wrote: On Saturday, 3 August 2013 at 17:45:11 UTC, w0rp wrote: I can see you saving a little bit of typing with this, but it's not worth it. Um, it can actually save a lot of type and errors. having two places to change is very error prone. if

Re: request switch statement with common block

2013-08-03 Thread Andre Artus
So, depending on how you define "not worth it", which I take "I'm too lazy to implement it", you could be correct. YaAA: If the implementation is so obviously trivial why don't you implement a proof of concept? The compiler is open source after all. JS: because I have better things to do a

Re: D component programming is a joke (Was: Re: Component programming)

2013-08-03 Thread Andre Artus
Bearophile: If not already present this array should go in std.datetime or core.time: static immutable string[] monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; It should probab

Re: request switch statement with common block

2013-08-04 Thread Andre Artus
On Sunday, 4 August 2013 at 10:14:50 UTC, Kagamin wrote: On Saturday, 3 August 2013 at 18:56:47 UTC, JS wrote: Um, it can actually save a lot of type and errors. having two places to change is very error prone. if (cond) { } switch(cond) What is error-prone is evaluation of a complex conditi

Re: request switch statement with common block

2013-08-04 Thread Andre Artus
On Sunday, 4 August 2013 at 15:57:32 UTC, Andre Artus wrote: On Sunday, 4 August 2013 at 10:14:50 UTC, Kagamin wrote: On Saturday, 3 August 2013 at 18:56:47 UTC, JS wrote: Um, it can actually save a lot of type and errors. having two places to change is very error prone. if (cond) { } switch

Re: request switch statement with common block

2013-08-04 Thread Andre Artus
Andre Artus: int number; string message; switch (number) { default: // valid: ends with 'throw' throw new Exception("unknown number"); case 3: message ~= "three "; break; case 4: message ~= &qu

Re: request switch statement with common block

2013-08-04 Thread Andre Artus
On Monday, 5 August 2013 at 04:07:55 UTC, Andre Artus wrote: Andre Artus: int number; string message; switch (number) { default: // valid: ends with 'throw' throw new Exception("unknown number"); case 3: message ~= "three

Re: Ironclad C++

2013-08-04 Thread Andre Artus
On Sunday, 4 August 2013 at 22:26:19 UTC, Timon Gehr wrote: On 08/04/2013 11:55 PM, bearophile wrote: Timon Gehr: Formal proofs require a formalization of language semantics. It's not just a matter of finding someone to carry out the proof. (Anyone can learn online how to do this.) I think

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
On Monday, 5 August 2013 at 06:28:12 UTC, luminousone wrote: perhaps a more generic solution should be looked at, extend contracts to work with all scope blocks. switch(somenumber) in { ... before stuff ... } out { after stuff ... } body { case 1: in { ... etc

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
On Monday, 5 August 2013 at 11:32:14 UTC, QAston wrote: On Monday, 5 August 2013 at 09:37:11 UTC, dennis luehring wrote: this type of sub-branching "de-looping" is slow (if performance is relevant) and just not foreach-able, and so not functional-style programming - its called "for loop index

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
Andre Artus: It may not always be the case, but in my experience this often leads to write-only code. I'm pretty new to D, so I'm not quite up to speed with the metaprogramming abilities, but I'm under the impression that this is what mixin's are for. MattCoder: Well

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
On Monday, 5 August 2013 at 09:37:11 UTC, dennis luehring wrote: Am 05.08.2013 08:28, schrieb luminousone: or perhaps for( int i = 0 ; i < 10 ; i ++ ) in { assert( i == 0 ); } out { assert( i == 9 ); } body { ... stuff ... } that is just evil code if you got something todo befo

Re: With statement become like C#'s using?

2013-08-05 Thread Andre Artus
--snip-- Bosak: class Resource { //can be any resource from files to streams to anything Resource[] used; void opDispose() { writeln("Resource disposed!"); You should avoid doing IO in a destructor/finaliser. Writing to STDOUT can fail which may lead to resource leaks (if

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
On Monday, 5 August 2013 at 19:58:21 UTC, ron wrote: On Monday, 5 August 2013 at 08:46:54 UTC, Andre Artus wrote: On Monday, 5 August 2013 at 06:28:12 UTC, luminousone wrote: perhaps a more generic solution should be looked at, extend contracts to work with all scope blocks. switch

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
Borislav Kosharov wrote: Speaking of contracts, and reading the docs I see: "Pre and Post Contracts The pre contracts specify the preconditions before a statement is executed. The most typical use of this would be in validating the parameters to a function. The post contracts validate the res

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
As Andrei points out in his book ("The D Programming Language") contracts are not used to validate/scrub user (or any external) input as they can be compiled out of the executable. Contracts are there to check sanity at compile time, or at the very least during testing. The contract is (or

Compiling DMD with C++11

2013-08-05 Thread Andre Artus
I decided to see whether dmd would compile with VS2013 and Clang. So far the only issue seems to be that C++11 RTL already defines 'strtold'. http://www.cplusplus.com/reference/cstdlib/strtold/ Compiling results in the following error: Error 1 error C2556: 'longdouble strtold(const char *,cha

Re: Compiling DMD with C++11

2013-08-05 Thread Andre Artus
I see there is quite a lot of code commented out with '#if 0', most of which looks like testing code. Unit tests in D is one of the 'killer' features. THE killer D feature for me is 'scope'. I bring this up because I see extern "C" longdouble strtold(const char *p,char **endp); //strtold.c(583

Re: Compiling DMD with C++11

2013-08-05 Thread Andre Artus
I forgot about the joys of C++, e.g. the code, build, make coffee, read forum posts, run, cycle.

Re: Compiling DMD with C++11

2013-08-05 Thread Andre Artus
I could refactor the code to rename dmd/strtold, but that may not go down well (play nice with others). I did a rename refactor on strtold (changed it to strtolongdouble) for S&G and everything seems to work just fine for VC++ 2013.

Re: request switch statement with common block

2013-08-05 Thread Andre Artus
On Saturday, 3 August 2013 at 19:22:53 UTC, Walter Bright wrote: On 8/3/2013 12:00 PM, JS wrote: What I really don't get it is why people think that just because they won't use such a feature then it must be useless to everyone else. You could provide supporting evidence by examining every us

Re: Future of string lambda functions/string predicate functions

2013-08-06 Thread Andre Artus
I would vote for marking it as deprecated, and clearly indicating it as such in the docs.

Re: request switch statement with common block

2013-08-06 Thread Andre Artus
On Tuesday, 6 August 2013 at 07:44:46 UTC, QAston wrote: I was under the impression that D has nested functions, unless by inner function you mean something else. Yeah, pardon my terminology. Not an issue, they normally mean the same thing. I believe JS's use case can be covered easily and c

Re: Compiling DMD with C++11

2013-08-06 Thread Andre Artus
On Tuesday, 6 August 2013 at 16:18:54 UTC, bearophile wrote: Andre Artus: I decided to see whether dmd would compile with VS2013 and Clang. So far the only issue seems to be that C++11 RTL already defines 'strtold'. I suggest to put most of those small bug reports in Bugzilla (or

Re: Compiling DMD with C++11

2013-08-06 Thread Andre Artus
On Tuesday, 6 August 2013 at 22:38:58 UTC, bearophile wrote: Andre Artus: If there is agreement with the new name, or if a better alternative is offered then I will be more than happy to make a comprehensive change. I didn't talk about the strtosomething name, I was referring to every

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote: Hello! This may seem like a simple question, maybe an embarassing question but how would I fetch the absolute path to the directory where my executable is located? My wording is known to be confusing so I will give an example: cd ~/pr

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
On Wednesday, 7 August 2013 at 06:10:35 UTC, Alan wrote: On Wednesday, 7 August 2013 at 06:08:44 UTC, Andre Artus wrote: On Wednesday, 7 August 2013 at 05:31:24 UTC, Alan wrote: Hello! This may seem like a simple question, maybe an embarassing question but how would I fetch the absolute path

Re: Finding the path to a executable?

2013-08-06 Thread Andre Artus
On Wednesday, 7 August 2013 at 06:22:25 UTC, evilrat wrote: On Wednesday, 7 August 2013 at 06:18:26 UTC, Alan wrote: Believe me I have tried all sorts of combonations of this but it's not guarunteed accuracy in certain situations, I thought there would be a solution in phobos library I was miss

Re: Compiling DMD with C++11

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 08:18:26 UTC, David Nadlinger wrote: On Tuesday, 6 August 2013 at 22:58:21 UTC, Andre Artus wrote: Okay. I already changed those in my copy. Just out of interest: what would be an acceptable name to change 'strtold' to? strtold is a C standard librar

Re: Question on Interface.

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 08:18:43 UTC, SteveGuo wrote: what? O_o let me explain, abstract class requires its successors to implement all methods, but may have fields. class successors *always* do something, either their methods has derived behavior or overridden ones. so does interface, i

Re: Phobos and older DMD versions

2013-08-07 Thread Andre Artus
On Wednesday, 7 August 2013 at 18:37:22 UTC, Jesse Phillips wrote: On Tuesday, 6 August 2013 at 22:23:03 UTC, Andrei Alexandrescu wrote: I think it should be fair to require the new compiler with the new stdlib. They are released in unison. Andrei I agree, but there is at least potential ben

Re: std.array string.split("") bug

2013-08-08 Thread Andre Artus
On Wednesday, 7 August 2013 at 19:10:11 UTC, Borislav Kosharov wrote: Something strange happens when I do this: unittest { import std.array, std.string; string s = "test"; //assert(s.toUpper.split("").join("-") == "T-E-S-T"); //"Memory allocation failed" //[Finished in 26.5s]