Re: DConf: register now!

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/6/2015 10:08 PM, Daniel Murphy wrote: w0rp wrote in message news:zynuvcoprfgplvboq...@forum.dlang.org... I spotted a typo in the schedule. Daniel Murphy's talk says Motivation for converting the project to C++. That should say to D. My secret plan is to convert it back to C++ after

Re: Strange behavior std.range.takeNone

2015-04-07 Thread Andrea Fontana via Digitalmars-d-learn
Yes it is. takeNone() take a char from a string. So you are going to append a char (with code 5) on the next line. If you replace that line with: s ~= 65; it will print A. (65 is ascii code for letter 'A') On Tuesday, 7 April 2015 at 02:24:00 UTC, Dennis Ritchie wrote: Hi, Is it OK? -

Re: Static if to compare two types are the exact same

2015-04-07 Thread w0rp via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 06:37:50 UTC, Jonathan wrote: static if (is(T == V)) Are static ifs always checked outside of runtime? Is it possible for a static if condition to be undeterminable outside of runtime, or would such a condition throw a compiler error? 'static if' is always run

[Issue 14419] [CTFE] Need infinite loop detection?

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14419 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment

Re: Why I'm Excited about D

2015-04-07 Thread John Colvin via Digitalmars-d
On Monday, 6 April 2015 at 23:51:17 UTC, Adam Hawkins wrote: Hello everyone, this is my first post on the forum. I've been investigating the language for the past few weeks. I was able to complete my first useful program thanks to very helpful people in #d on IRC . The experience made me very

Re: Why I'm Excited about D

2015-04-07 Thread cym13 via Digitalmars-d
On Tuesday, 7 April 2015 at 01:12:20 UTC, bachmeier wrote: The thing I liked, coming from languages like R and Ruby, was that I could write D code in the most convenient, least efficient manner possible and still get good enough performance that it wouldn't matter. I find D to be easier to

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread w0rp via Digitalmars-d
On Tuesday, 7 April 2015 at 04:05:38 UTC, Vladimir Panteleev wrote: On Tuesday, 7 April 2015 at 03:17:26 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP76 I am against this. It can lead to silent irreversible data corruption. I can see the value in both. With something like Objective

Re: getting started with std.csv

2015-04-07 Thread yazd via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 05:51:33 UTC, yazd wrote: On Tuesday, 7 April 2015 at 05:49:48 UTC, yazd wrote: I got this to work with: ``` import std.stdio, std.file, std.csv, std.range; void main() { std.file.write(test.csv, 0,1,abc\n2,3,def); scope(exit)

Re: Reggae v0.0.5 super alpha: A build system in D

2015-04-07 Thread Dicebot via Digitalmars-d-announce
On Sunday, 5 April 2015 at 12:50:52 UTC, Kagamin wrote: On Sunday, 5 April 2015 at 12:22:15 UTC, Dicebot wrote: Unless LDC does some D specific WPO magic I am not aware of this is not what your original statement was about. llvm does normal WPO in a sense that compiled code is not opaque.

Re: Reggae v0.0.5 super alpha: A build system in D

2015-04-07 Thread Dicebot via Digitalmars-d-announce
On Monday, 6 April 2015 at 11:29:20 UTC, Sergei Nosov wrote: On Sunday, 5 April 2015 at 00:22:35 UTC, Atila Neves wrote: It seems to me that different projects might benefit from different compilation strategies. It might just be a case of unit tests alongside production code vs in separate

[Issue 14350] Unit test failures are not displayed in Windows GUI programs

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14350 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/6833d64a4f3ab2fb7af979ddf9ab1558dd369606 fix Issue 14350 -

[Issue 14350] Unit test failures are not displayed in Windows GUI programs

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14350 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 14420] New: partial template ordering with specialization and different arities seems broken

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14420 Issue ID: 14420 Summary: partial template ordering with specialization and different arities seems broken Product: D Version: D2 Hardware: All OS: All

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 7 April 2015 at 07:42:02 UTC, w0rp wrote: Maybe autodecoding could throw an Error (No 'new' allowed) when debug mode is on, and use replacement characters in release mode. I haven't thought it through, but that's an idea. No no no, terrible idea. This means your program will pass

Re: Mid-term vision review

2015-04-07 Thread Dicebot via Digitalmars-d
On Monday, 6 April 2015 at 18:17:31 UTC, deadalnix wrote: On the other hand, many features in the language could be implementation as macro in object.d, reducing language complexity. Mixin has some severe limitation when you want to pass symbols that are not accessible down the road (the

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Kagamin via Digitalmars-d
On Tuesday, 7 April 2015 at 03:17:26 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP76 Deprecation can be reported by checking version: version(EnableNothrowAutodecoding) alias autodecode=autodecodeImpl; else @deprecated(compile with -version=EnableNothrowAutodecoding) alias

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Dicebot via Digitalmars-d
On Tuesday, 7 April 2015 at 03:17:26 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP76 I have doubts about it similar to Vladimir. Main problem is that I have no idea what actually happens if replacement characters appear in some unicode text my program processes. So far I have that

[Issue 14420] partial template ordering with specialization and different arities seems broken

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14420 --- Comment #1 from Ketmar Dark ket...@ketmar.no-ip.org --- i'm expecting the same (with second instantiates non-specialized template, which it does currently). --

Re: Why I'm Excited about D

2015-04-07 Thread ketmar via Digitalmars-d
On Mon, 06 Apr 2015 23:51:16 +, Adam Hawkins wrote: I've been reading the forums here so I can see that there is a focus on improving the marketing for the language and growing the community. I see most of the effort is geared towards C++ programmers, but have you considered looking at us

Re: Static if to compare two types are the exact same

2015-04-07 Thread Jonathan via Digitalmars-d-learn
static if (is(T == V)) Are static ifs always checked outside of runtime? Is it possible for a static if condition to be undeterminable outside of runtime, or would such a condition throw a compiler error?

Re: DConf: register now!

2015-04-07 Thread Iain Buclaw via Digitalmars-d
On 7 April 2015 at 07:08, Daniel Murphy via Digitalmars-d digitalmars-d@puremagic.com wrote: w0rp wrote in message news:zynuvcoprfgplvboq...@forum.dlang.org... I spotted a typo in the schedule. Daniel Murphy's talk says Motivation for converting the project to C++. That should say to D. My

Re: [WORK] Bringing http://dlang.org/phobos/ in good shape

2015-04-07 Thread Walter Bright via Digitalmars-d
On 3/31/2015 12:32 PM, Andrei Alexandrescu wrote: I'm looking at the dlang.org statistics and am seeing the top pages looked at are: download.html, changelog.html, and phobos/. The first two are nice, but http://dlang.org/phobos/ is in serious need of completion - many modules don't have a brief

Re: Why I'm Excited about D

2015-04-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-07 01:51, Adam Hawkins wrote: Only trade off in the Ruby case is metaprogramming. You can do metaprogramming in D, it's just a bit different compared to Ruby. -- /Jacob Carlborg

Re: Why I'm Excited about D

2015-04-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-07 02:29, Adam D. Ruppe wrote: On Tuesday, 7 April 2015 at 00:15:51 UTC, w0rp wrote: [...]and runtime templates. The last two haven't been written yet. Really? Runtime templates aren't even hard to implement vibe.d has a template system. It's based on Jade, which seems to be

Re: Making regex replace CTFE by removing malloc

2015-04-07 Thread ketmar via Digitalmars-d
thank you. and i read the code a little, and found that matching engine using stream- like interface to work with data, so it wouldn't be very hard to use ranges instead of strings. and for real regexps (those without backtracking) range seems to doesn't even require random access.

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread bearophile via Digitalmars-d
Vladimir Panteleev: std.conv doesn't return NaN if you try to convert banana to a double. I have suggested to add a nothrow function like maybeTo that returns a Nullable result. Bye, bearophile

Re: D1: Out of memory problems

2015-04-07 Thread Kagamin via Digitalmars-d-learn
Depends on how you fill aTUs.

Re: Why I'm Excited about D

2015-04-07 Thread ixid via Digitalmars-d
import std.stdio, std.parallelism; auto names = [ Adam Hawkins, Peter Esselius ]; foreach(name; taskPool.parallel(names)) { writeln(name); } There is a convenience function in std.parallelism that allows you to write the following instead for your foreach loop: foreach (name;

Re: D1: Out of memory problems

2015-04-07 Thread Kagamin via Digitalmars-d-learn
For example if you slice the original string, it will be preserved in memory. That's why parsers keep parsed substrings by duplicating them - this can result in smaller memory footprint.

Re: Mid-term vision review

2015-04-07 Thread Andrea Fontana via Digitalmars-d
On Friday, 3 April 2015 at 15:35:15 UTC, Iain Buclaw wrote: On 3 April 2015 at 12:10, Andrea Fontana via Digitalmars-d digitalmars-d@puremagic.com wrote: It would be great to have dmd on embedded platforms. We have GDC supporting ARM, MIPS, PPC, S390, etc... LDC supporting ARM... what more

Re: Strange behavior std.range.takeNone

2015-04-07 Thread Dennis Ritchie via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 08:49:58 UTC, Andrea Fontana wrote: Yes it is. takeNone() take a char from a string. So you are going to append a char (with code 5) on the next line. If you replace that line with: s ~= 65; it will print A. (65 is ascii code for letter 'A') Thanks. I am

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Vladimir Panteleev via Digitalmars-d
On Tuesday, 7 April 2015 at 09:04:09 UTC, Walter Bright wrote: On 4/7/2015 1:19 AM, Dicebot wrote: I have doubts about it similar to Vladimir. Main problem is that I have no idea what actually happens if replacement characters appear in some unicode text my program processes. It's much like

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/7/2015 2:10 AM, Vladimir Panteleev wrote: On Tuesday, 7 April 2015 at 09:04:09 UTC, Walter Bright wrote: On 4/7/2015 1:19 AM, Dicebot wrote: I have doubts about it similar to Vladimir. Main problem is that I have no idea what actually happens if replacement characters appear in some

Re: Mid-term vision review

2015-04-07 Thread Adam Hawkins via Digitalmars-d
On Thursday, 2 April 2015 at 22:44:56 UTC, Andrei Alexandrescu wrote: It's the end of Q1. Walter and I reviewed our vision document. We're staying the course with one important addition: switching to ddmd, hopefully with 2.068. http://wiki.dlang.org/Vision/2015H1 Andrei vibe.d is a

Re: getting started with std.csv

2015-04-07 Thread gjansen via Digitalmars-d-learn
Many thanks for the feedback yazd! I've tested the approach with a large csv file and it works fine. Unfortunately csvReader seems very convenient but it is no speed daemon. To my dismay it was much slower (about 4x) than a simple approach I am using in Python, which is essentially equivalent

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/7/2015 1:19 AM, Dicebot wrote: I have doubts about it similar to Vladimir. Main problem is that I have no idea what actually happens if replacement characters appear in some unicode text my program processes. It's much like floating point NaN values, which are 'sticky'. So far I have

Re: getting started with std.csv

2015-04-07 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 09:44:11 UTC, gjansen wrote: Many thanks for the feedback yazd! I've tested the approach with a large csv file and it works fine. Unfortunately csvReader seems very convenient but it is no speed daemon. To my dismay it was much slower (about 4x) than a simple

Re: Why I'm Excited about D

2015-04-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-07 10:33, John Colvin wrote: (parentheses are optional for all function calls), Optional for all function calls taking no arguments. Note that in Ruby parentheses are optional for function calls taking arguments as well. -- /Jacob Carlborg

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread via Digitalmars-d
On Tuesday, 7 April 2015 at 07:50:40 UTC, Vladimir Panteleev wrote: On Tuesday, 7 April 2015 at 07:42:02 UTC, w0rp wrote: Maybe autodecoding could throw an Error (No 'new' allowed) when debug mode is on, and use replacement characters in release mode. I haven't thought it through, but that's

Re: Why I'm Excited about D

2015-04-07 Thread Martin Nowak via Digitalmars-d
On 04/07/2015 08:28 AM, Jacob Carlborg wrote: vibe.d has a template system. It's based on Jade, which seems to be based on Haml. There is also a runtime template system, http://code.dlang.org/packages/mustache-d. See https://github.com/D-Programming-GDC/gdcproject for an example.

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread via Digitalmars-d
On Tuesday, 7 April 2015 at 09:21:52 UTC, Walter Bright wrote: On 4/7/2015 2:10 AM, Vladimir Panteleev wrote: On Tuesday, 7 April 2015 at 09:04:09 UTC, Walter Bright wrote: On 4/7/2015 1:19 AM, Dicebot wrote: I have doubts about it similar to Vladimir. Main problem is that I have no idea what

[Issue 14421] New: Variadic args array force on heap

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14421 Issue ID: 14421 Summary: Variadic args array force on heap Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority:

[DerelictOrg] Forum down ?

2015-04-07 Thread ParticlePeter via Digitalmars-d-learn
Hi, I think I have a bug report for DerelictGL3, but cannot find the related Forum ( http://dblog.aldacron.net/forum/index.php ), is it still in the process of being moved ? Regards, ParticlePeter

Re: [DerelictOrg] Forum down ?

2015-04-07 Thread Namespace via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 10:48:38 UTC, ParticlePeter wrote: Hi, I think I have a bug report for DerelictGL3, but cannot find the related Forum ( http://dblog.aldacron.net/forum/index.php ), is it still in the process of being moved ? Regards, ParticlePeter Post it there:

Re: getting started with std.csv

2015-04-07 Thread gjansen via Digitalmars-d-learn
dmd -O (2.066.1) and gdc -O3 (4.9.2) But... as I tried to convey, I was comparing apples to oranges. I have now rewritten the D test simply using split(',') instead of csvReader, to be more similar to the python test, and it runs about 2x faster in D with dmd and about 4x faster with gdc

Re: json parsing performance

2015-04-07 Thread Martin Nowak via Digitalmars-d
On 04/06/2015 11:09 PM, Brad Anderson wrote: We actually have a JSON parser meant to replace std.json that should be very high performance. You can try it out now using dub: http://code.dlang.org/packages/std_data_json It also includes a stream parser for the highest performance

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Abdulhaq via Digitalmars-d
On Tuesday, 7 April 2015 at 03:17:26 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP76 The DIP lists the benefits but does not mention any cons. A con that I can see is that it is violating the 'fail fast' principle. By silently replacing data the developer will be presented with a

Re: Standardpaths library

2015-04-07 Thread Kagamin via Digitalmars-d-announce
On Monday, 6 April 2015 at 21:40:28 UTC, Marco Leise wrote: So if some configuration is portable and you want to create something really fine grained you could offer that directory as an alternative roaming config dir (returning null or ~/.config on Linux). Though it's unusual for an average

[Issue 14422] std.process: Pipes do not append to files on Win64

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14422 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Keywords||pull ---

Re: Reggae v0.0.5 super alpha: A build system in D

2015-04-07 Thread Kagamin via Digitalmars-d-announce
On Tuesday, 7 April 2015 at 08:28:08 UTC, Dicebot wrote: And I have never been speaking about normal WPO, only about one specific to D semantics. AFAIK, hypothetical D-specific optimizations were never implemented (like elision of pure calls and optimization of immutable data). But they work

Future of contract-based programming in D

2015-04-07 Thread Delirius via Digitalmars-d
The D features which interest me the most are those supporting contract-based programming. I want to experiment with that and I know no other production ready language which has this level of support, except the original gangsta Eiffel but the only supported Eiffel compiler is proprietary and

Berlin D Meetup April 2015

2015-04-07 Thread Ben Palmer via Digitalmars-d-announce
Hi All, The next Berlin D Meetup will be happening as always on the third Friday of the month, April the 17th at 19:30. The venue will be Berlin Co-Op (http://co-up.de/) on the 3rd floor. Mihails Strasuns will be doing a presentation titled Highway to D2. After the presentation we will have

Re: Future of contract-based programming in D

2015-04-07 Thread rumbu via Digitalmars-d
On Tuesday, 7 April 2015 at 13:11:01 UTC, Ola Fosheim Grøstad wrote: On Tuesday, 7 April 2015 at 12:51:45 UTC, Delirius wrote: I know no other production ready language which has this level of support, except the original gangsta Eiffel but the only Ada2012? Some languages use require and

Re: Future of contract-based programming in D

2015-04-07 Thread Paulo Pinto via Digitalmars-d
On Tuesday, 7 April 2015 at 12:51:45 UTC, Delirius wrote: The D features which interest me the most are those supporting contract-based programming. I want to experiment with that and I know no other production ready language which has this level of support, except the original gangsta Eiffel

Re: UFCS and overloading

2015-04-07 Thread cym13 via Digitalmars-d-learn
EDIT: mis-formatted previous snippet import std.algorithm, std.stdio, std.range, std.conv; void main() { stdin .byLine .filter!(s = !s.empty s.front != '#’) // Filter with this lambda function .map!(s = s.to!double) // Map the strings to doubles .array //

[Issue 14420] partial template ordering with specialization and different arities seems broken

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14420 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 07, 2015 at 02:21:50AM -0700, Walter Bright via Digitalmars-d wrote: On 4/7/2015 2:10 AM, Vladimir Panteleev wrote: [...] I think the correct solution to that is to kill auto-decoding :) Then all decoding is explicit, and since it is explicit, it is trivial to allow specifying the

[Issue 14413] Spurious newline in ddoc JSON output for multiple successive line doc comments

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14413 --- Comment #2 from Sönke Ludwig slud...@outerproduct.org --- Do you know if that been a concious decision or is it just an artefact of the implementation? I don't think it makes much sense as it is. Personally I always use /** */ style comments, but

Re: Why I'm Excited about D

2015-04-07 Thread Jens Bauer via Digitalmars-d
On Tuesday, 7 April 2015 at 01:28:03 UTC, Rikki Cattermole wrote: I'm watching your progress closely. I think we are ready to get D properly on micro controllers and you are really testing, exploring it even. Johannes made some very important additions for regarding this. It might already be

Re: UFCS and overloading

2015-04-07 Thread cym13 via Digitalmars-d-learn
On Monday, 6 April 2015 at 18:00:46 UTC, Szymon Gatner wrote: Why is that? The use case is to provide a set of convenience extension methods to a basic interface. Say, given: This is not the only use case, another (maybe even more common) use is to allow pipeline programming. Example from

Re: Future of contract-based programming in D

2015-04-07 Thread via Digitalmars-d
On Tuesday, 7 April 2015 at 12:51:45 UTC, Delirius wrote: I know no other production ready language which has this level of support, except the original gangsta Eiffel but the only Ada2012? Some languages use require and ensure or a similar notion in the body of a function for pre/post

Re: getting started with std.csv

2015-04-07 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 11:36:54 UTC, gjansen wrote: dmd -O (2.066.1) and gdc -O3 (4.9.2) But... as I tried to convey, I was comparing apples to oranges. I have now rewritten the D test simply using split(',') instead of csvReader, to be more similar to the python test, and it runs about

[Issue 14413] Spurious newline in ddoc JSON output for multiple successive line doc comments

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14413 --- Comment #1 from Kenji Hara k.hara...@gmail.com --- (In reply to Sönke Ludwig from comment #0) --- /// This function is here to aid in making your /// software do cool stuff. void foo() {} --- It's equivalent with: --- /** This function is

Re: Why I'm Excited about D

2015-04-07 Thread John Colvin via Digitalmars-d
On Tuesday, 7 April 2015 at 11:16:56 UTC, Jacob Carlborg wrote: On 2015-04-07 10:33, John Colvin wrote: (parentheses are optional for all function calls), Optional for all function calls taking no arguments. Note that in Ruby parentheses are optional for function calls taking arguments as

Re: Why I'm Excited about D

2015-04-07 Thread Jens Bauer via Digitalmars-d
On Tuesday, 7 April 2015 at 08:33:58 UTC, John Colvin wrote: @property isn't really about parentheses-less calls (parentheses are optional for all function calls), it's more for this sort of thing: [snip] @property void val(int v) { a_ = (a_ flagMask) (v ~flagMask); }

Re: Why I'm Excited about D

2015-04-07 Thread John Colvin via Digitalmars-d
On Tuesday, 7 April 2015 at 14:20:58 UTC, Jens Bauer wrote: On Tuesday, 7 April 2015 at 08:33:58 UTC, John Colvin wrote: @property isn't really about parentheses-less calls (parentheses are optional for all function calls), it's more for this sort of thing: [snip] @property void val(int v)

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 07, 2015 at 09:10:32AM +, Vladimir Panteleev via Digitalmars-d wrote: [...] I think the correct solution to that is to kill auto-decoding :) Then all decoding is explicit, and since it is explicit, it is trivial to allow specifying the desired behavior upon encountering invalid

Implementing cent/ucent...

2015-04-07 Thread Kai Nacke via Digitalmars-d-announce
Hi all! I started to work on cent/ucent support in LDC (and possible in upstream DMD). Here is the current state: 1) The pull request https://github.com/ldc-developers/ldc/pull/891/files implements cent/ucent based on the upcoming major LDC release (branch merge-2.067). It is usable but

Re: D1: Out of memory problems

2015-04-07 Thread jicman via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 09:03:19 UTC, Kagamin wrote: For example if you slice the original string, it will be preserved in memory. That's why parsers keep parsed substrings by duplicating them - this can result in smaller memory footprint. H... Will you be able to give me an example

Re: D1: Out of memory problems

2015-04-07 Thread jicman via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 08:58:31 UTC, Kagamin wrote: Depends on how you fill aTUs. Ok, I will bite... ;-) I have the wText string which could be 20 mgs or so, I start finding pieces of data like this, wText = wText[std.string.find(wText,/ut) + 5 .. $]; so, everything before /ut,

Re: Shall I use immutable or const while passing parameters to functions

2015-04-07 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 15:11:39 UTC, tcak wrote: I have data in memory, and I want a function to take a part of data for processing only. It will only read and won't change. char[] importantData; With Immutable, void dataProcessor( string giveMeAllYourData ){} dataProcessor( cast(

Re: Why I'm Excited about D

2015-04-07 Thread Andrei Alexandrescu via Digitalmars-d
On 4/6/15 4:51 PM, Adam Hawkins wrote: Hello everyone, this is my first post on the forum. I've been investigating the language for the past few weeks. I was able to complete my first useful program thanks to very helpful people in #d on IRC . The experience made me very interested in the

[Issue 14419] [CTFE] Need infinite loop detection?

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14419 --- Comment #15 from Iain Buclaw ibuc...@gdcproject.org --- (In reply to yebblies from comment #14) (In reply to Martin Nowak from comment #9) If you really think we should fix this, then a time limit for CTFE execution might be feasible. An

[Issue 14419] [CTFE] Need infinite loop detection?

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14419 --- Comment #16 from Jens Bauer jens-bugzi...@gpio.dk --- (In reply to Iain Buclaw from comment #15) So then you just need to decide what is a suitable iteration limit, short.max? ushort.max? If it's just to make sure that we're not stuck forever,

Re: Why I'm Excited about D

2015-04-07 Thread Jens Bauer via Digitalmars-d
On Tuesday, 7 April 2015 at 16:39:39 UTC, Jens Bauer wrote: :C - :D Even better (includes the meaning of '=' in place of 'when'): =C - =D

alias this of non-public member

2015-04-07 Thread via Digitalmars-d-learn
Hi! Excuse me if this is obvious, but I can't recall coming across anything similar and a quick search returns nothing relevant: struct Foo { } struct FooWrapper { alias x_ this; private Foo* x_; // doesn't work, as x_ is private } Basically, I want x_ to never be visible, except

Re: Reggae v0.0.5 super alpha: A build system in D

2015-04-07 Thread Sergei Nosov via Digitalmars-d-announce
On Tuesday, 7 April 2015 at 08:25:02 UTC, Dicebot wrote: See, the problem with this approach is that you can trivially get out of 1GB of memory with DMD even when compiling single module, all you need is to do enough compile-time magic. Separate compilation here delays the issue but does not

Re: Shall I use immutable or const while passing parameters to functions

2015-04-07 Thread Adam D. Ruppe via Digitalmars-d-learn
If you're just looking at the data, use const. immutable becomes more important if it is shared across threads or stored for later. Functions that accept const will work with almost anything you pass to it.

Re: UFCS and overloading

2015-04-07 Thread Szymon Gatner via Digitalmars-d-learn
On Tuesday, 7 April 2015 at 14:46:52 UTC, cym13 wrote: EDIT: mis-formatted previous snippet import std.algorithm, std.stdio, std.range, std.conv; void main() { stdin .byLine .filter!(s = !s.empty s.front != '#’) // Filter with this lambda function .map!(s =

[Issue 14413] Spurious newline in ddoc JSON output for multiple successive line doc comments

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14413 --- Comment #3 from Kenji Hara k.hara...@gmail.com --- (In reply to Sönke Ludwig from comment #2) Do you know if that been a concious decision or is it just an artefact of the implementation? I don't think it makes much sense as it is. Personally I

Shall I use immutable or const while passing parameters to functions

2015-04-07 Thread tcak via Digitalmars-d-learn
I have data in memory, and I want a function to take a part of data for processing only. It will only read and won't change. char[] importantData; With Immutable, void dataProcessor( string giveMeAllYourData ){} dataProcessor( cast( immutable )( importantData[5 .. 14] ) ); With Const,

DMD AST Docs/Reference or Dumper?

2015-04-07 Thread bitwise via Digitalmars-d
I'm trying to add some compile-time function generation to dmd, but wasn't sure exactly how to click all the little legos together. Is there any documentation or reference for the DMD AST? Or maybe some examples somewhere of what an AST may look like for a given function? As a last resort,

[Issue 14413] Spurious newline in ddoc JSON output for multiple successive line doc comments

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14413 --- Comment #4 from Sönke Ludwig slud...@outerproduct.org --- Just that concatenation as paragraphs instead of concatenation as lines precludes the use of this documentation style: /// This is the summary, possibly going /// over multiple lines. ///

Wanted: Review manager for std.data.json

2015-04-07 Thread Sönke Ludwig via Digitalmars-d
Anyone up to this? The issues of the previous discussion [1] have all been addressed now more or less, so the package is ready for a more thorough review. Code: https://github.com/s-ludwig/std_data_json Docs: http://s-ludwig.github.io/std_data_json/ [1]:

Re: Why I'm Excited about D

2015-04-07 Thread Jens Bauer via Digitalmars-d
On Tuesday, 7 April 2015 at 16:29:40 UTC, Walter Bright wrote: I noticed a bug in one of the examples: assert(Adam Hawkins == myName()); should be: assert(Adam Hawkins == myName()); -It already is. :) By the way; the reason to switch from C to D can be put *very* simple: :C - :D

Re: Shall I use immutable or const while passing parameters to functions

2015-04-07 Thread bearophile via Digitalmars-d-learn
tcak: void dataProcessor( string giveMeAllYourData ){} dataProcessor( cast( immutable )( importantData[5 .. 14] ) ); With Const, void dataProcessor( in char[] giveMeAllYourData ){} dataProcessor( cast( const )( importantData[5 .. 14] ) ); Don't cast to const/immutable unless you have a

Re: Why I'm Excited about D

2015-04-07 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 7 April 2015 at 06:28:49 UTC, Jacob Carlborg wrote: vibe.d has a template system. It's based on Jade, which seems to be based on Haml. Aye, though it is compile time rather than runtime which hurts the edit/run cycle - you have to recompile, redeploy (maybe), and restart just to

Re: Why I'm Excited about D

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/6/2015 4:51 PM, Adam Hawkins wrote: Hello everyone, this is my first post on the forum. I've been investigating the language for the past few weeks. I was able to complete my first useful program thanks to very helpful people in #d on IRC . The experience made me very interested in the

Re: Why I'm Excited about D

2015-04-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-07 18:06, Adam D. Ruppe wrote: Aye, though it is compile time rather than runtime which hurts the edit/run cycle - you have to recompile, redeploy (maybe), and restart just to see a quick text change. Oh, right, that was what he meant with runtime :) -- /Jacob Carlborg

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/7/2015 5:04 AM, Abdulhaq wrote: On Tuesday, 7 April 2015 at 03:17:26 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP76 The DIP lists the benefits but does not mention any cons. A con that I can see is that it is violating the 'fail fast' principle. By silently replacing data the

Re: dsource.org moved

2015-04-07 Thread Stewart Gordon via Digitalmars-d-announce
I haven't been active on the newsgroups lately, so lose track of what's going on. Has anything happened? Just now I tried to commit to the bindings project on dsource, but got an error POST request on '/projects/bindings/!svn/me' failed: 500 Internal Server Error Has it been doing this for a

[Issue 14419] [CTFE] Need infinite loop detection?

2015-04-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14419 --- Comment #17 from Jens Bauer jens-bugzi...@gpio.dk --- (In reply to Jens Bauer from comment #16) As a fail-safe, an unsigned 32-bit counter could be used as an 'absolutely maximum limit'. ... and if the 32-bit counter wraps, then an error

Re: [DerelictOrg] Forum down ?

2015-04-07 Thread ParticlePeter via Digitalmars-d-learn
Done On Tuesday, 7 April 2015 at 10:50:35 UTC, Namespace wrote: On Tuesday, 7 April 2015 at 10:48:38 UTC, ParticlePeter wrote: Hi, I think I have a bug report for DerelictGL3, but cannot find the related Forum ( http://dblog.aldacron.net/forum/index.php ), is it still in the process of being

Re: Why I'm Excited about D

2015-04-07 Thread Walter Bright via Digitalmars-d
On 4/7/2015 9:28 AM, Walter Bright wrote: I noticed a bug in one of the examples: assert(Adam Hawkins == myName()); er, the example is: assert(Adam Hawkins = myName()); should be: assert(Adam Hawkins == myName());

Re: Questions about phobos additions mentioned in 2015H1 vision document

2015-04-07 Thread Gary Willoughby via Digitalmars-d
On Monday, 6 April 2015 at 03:19:03 UTC, Rikki Cattermole wrote: On that note, anyone willing to help create and ODBC host via Derelict or will I be doing something like that? I don't understand this sentence. :/

Re: Questions about phobos additions mentioned in 2015H1 vision document

2015-04-07 Thread Suliman via Digitalmars-d
Andrei, if vibed will include in DMD distribution, would it's mean that common libs (like json) will be merged with DMD? I think it would very rational step.

Re: DIP76: Autodecode Should Not Throw

2015-04-07 Thread w0rp via Digitalmars-d
On Tuesday, 7 April 2015 at 09:21:52 UTC, Walter Bright wrote: On 4/7/2015 2:10 AM, Vladimir Panteleev wrote: I think the correct solution to that is to kill auto-decoding :) Then all decoding is explicit, and since it is explicit, it is trivial to allow specifying the desired behavior upon

Re: Fun project - faster associative array algorithm

2015-04-07 Thread w0rp via Digitalmars-d
On Tuesday, 7 April 2015 at 17:25:00 UTC, Walter Bright wrote: The current D associative array algorithm https://github.com/D-Programming-Language/druntime/blob/master/src/rt/aaA.d uses an array of buckets with a linked list attached to the buckets to resolve collisions. Linked lists

Re: Why I'm Excited about D

2015-04-07 Thread Ary Borenszweig via Digitalmars-d
On 4/7/15 2:16 PM, deadalnix wrote: On Tuesday, 7 April 2015 at 08:58:57 UTC, ixid wrote: Or to be more consistent with UFCS: foreach (name; names.parallel) { name.writeln; } no.please wat

Re: Release D 2.067.0

2015-04-07 Thread Martin Nowak via Digitalmars-d-announce
On 03/25/2015 10:38 PM, weaselcat wrote: Anyone know if there's been any comparisons of different heapSizeFactor values? Primarly, compared to the default 2, 1.5 or 1.618. has anyone working on the GC actually done any comparisons of the new options? Yes, we compared different values and 2

  1   2   3   >