Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Marco Leise via Digitalmars-d
Am Fri, 10 Apr 2015 14:04:39 + schrieb Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com: On Friday, 10 April 2015 at 10:28:03 UTC, Walter Bright wrote: That's what ref counting is about. That would require pervasive ref-counting. You make is sound like there was an alternative

Formatted output ranges

2015-04-11 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, Is it possible to write somehow shorter using formatted output and other library functions? - import std.stdio, std.range; void main() { auto a = iota(100, 201); writefln(%(;; %(%s, %),\n%)., [ a[0 .. 15], a[15 .. 30],

Re: Function name from function pointer

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
On Saturday, 11 April 2015 at 19:08:50 UTC, Marco Leise wrote: Am Sat, 11 Apr 2015 18:28:35 + schrieb Paul D Anderson claude.re...@msnmail.com: Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int

Re: Function name from function pointer

2015-04-11 Thread Marco Leise via Digitalmars-d-learn
Am Sat, 11 Apr 2015 18:28:35 + schrieb Paul D Anderson claude.re...@msnmail.com: Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int function() fp; void test() { static int a = 7;

Re: Function name from function pointer

2015-04-11 Thread bearophile via Digitalmars-d-learn
Paul D Anderson: Is there a way to return the name of a function (a string) from a pointer to that function? Perhaps creating a string[void*] AA and initializing with all the function pointers you care about. Bye, bearophile

Re: D1: Out of memory problems

2015-04-11 Thread Kagamin via Digitalmars-d-learn
Parsers unique duplicated strings via a name table: string udup(string s, ref string[string] nameTable) { if(s in nameTable)return nameTable[s]; string s1=s.dup; nameTable[s1]=s1; return s1; } This way you avoid extra duplicates. You can also try to free file content manually when it's

Re: Which D IDE do you use?(survey)

2015-04-11 Thread Iain Buclaw via Digitalmars-d
On 11 April 2015 at 12:27, weaselcat via Digitalmars-d digitalmars-d@puremagic.com wrote: On Saturday, 11 April 2015 at 10:00:45 UTC, Iain Buclaw wrote: On 10 April 2015 at 21:19, Adam D. Ruppe via Digitalmars-d digitalmars-d@puremagic.com wrote: On Friday, 10 April 2015 at 19:08:13 UTC,

Function name from function pointer

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
Is there a way to return the name of a function (a string) from a pointer to that function? Function pointer example from D Reference: --- int function() fp; void test() { static int a = 7; static int foo() { return a + 3; } fp = foo; } void bar() { test(); int i = fp();

vibed - best approach to manage central state (cached records)

2015-04-11 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. Two questions: 1. On startup I load various indexes from file storage into memory in the shared static this segment, and I would like to access these from threads serving web requests. The data can be considered immutable once loaded. What is the best way to make this data accessible?

Re: Formatted output ranges

2015-04-11 Thread Dennis Ritchie via Digitalmars-d-learn
On Saturday, 11 April 2015 at 20:37:17 UTC, anonymous wrote: On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie wrote: writefln(%(;; %(%s, %),\n%)., [ a[0 .. 15], a[15 .. 30], a[30 .. 45], a[45 .. 60],

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread deadalnix via Digitalmars-d
On Saturday, 11 April 2015 at 09:28:46 UTC, Marc Schütz wrote: It's not acceptable that it happens behind the user's back. Costly operations must be explicit. Nothing is costly here.

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread deadalnix via Digitalmars-d
On Saturday, 11 April 2015 at 18:20:51 UTC, Marco Leise wrote: Am Fri, 10 Apr 2015 14:04:39 + schrieb Ola Fosheim Grøstad ola.fosheim.grostad+dl...@gmail.com: On Friday, 10 April 2015 at 10:28:03 UTC, Walter Bright wrote: That's what ref counting is about. That would require pervasive

Re: if(arr) now a warning

2015-04-11 Thread Martin Nowak via Digitalmars-d
On 04/11/2015 01:03 PM, w0rp wrote: At the moment, auto-decoding isn't part of the language That won't change anytime soon.

Re: Formatted output ranges

2015-04-11 Thread anonymous via Digitalmars-d-learn
On Saturday, 11 April 2015 at 20:10:49 UTC, Dennis Ritchie wrote: writefln(%(;; %(%s, %),\n%)., [ a[0 .. 15], a[15 .. 30], a[30 .. 45], a[45 .. 60], a[60 .. 75], a[75 .. 90],

Mitigating the attribute proliferation - attribute inference for functions

2015-04-11 Thread Martin Nowak via Digitalmars-d
Sorry to open yet another topic. I'm repeatedly finding myself in situations where I write functions like this. private @property bool empty() const @safe pure nothrow @nogc { return impl is null || !impl.count; } This is obviously a joke, because the compiler very well

[Issue 14358] DMD should prevent declaring a function with a reserved name

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

Re: Context Sensitive Gui Library

2015-04-11 Thread Rikki Cattermole via Digitalmars-d
On 11/04/2015 6:09 p.m., Rashad Vinshy wrote: On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: Thats nice. Now where is the source code? I would like to know what I do to contribute the library? Is there a site I should upload to or should I start a git repository?

Re: Context Sensitive Gui Library

2015-04-11 Thread jkpl via Digitalmars-d
On Saturday, 11 April 2015 at 07:28:50 UTC, Rikki Cattermole wrote: On 11/04/2015 7:24 p.m., jkpl wrote: On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: On 11/04/2015 5:43 p.m., Rashad Vinshy wrote: CSGL: I would like to announce the release of my beta library for D!

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Walter Bright via Digitalmars-d
On 4/11/2015 2:28 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: It's not acceptable that it happens behind the user's back. Costly operations must be explicit. Don't know of a better solution.

[Issue 14361] [SDC] Allow aliasing integer and other literals

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

[Issue 14363] [SDC] Error with inheriting nested classes in nested functions

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

Re: Context Sensitive Gui Library

2015-04-11 Thread jkpl via Digitalmars-d
On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: On 11/04/2015 5:43 p.m., Rashad Vinshy wrote: CSGL: I would like to announce the release of my beta library for D! What is the best plan of action at this point to contribute it to the D community? (the library still needs

[Issue 14378] Parse block statement followed by ';' as a function literal

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

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread w0rp via Digitalmars-d
I was thinking about this again, and how the first 'ref' would create a copy in order to keep the object around. At first I thought I didn't like that, but then I realised that it's actually not far from what I wanted for taking r-values by reference. I commonly write functions which take

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Walter Bright via Digitalmars-d
On 4/11/2015 2:18 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: On Friday, 10 April 2015 at 21:26:14 UTC, Walter Bright wrote: On 4/10/2015 11:28 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Example: void foo() @safe { RCArray!int arr = [0,1,2]; { int*

Re: Make a type tuple from an array

2015-04-11 Thread John Colvin via Digitalmars-d-learn
On Friday, 10 April 2015 at 22:55:23 UTC, Nordlöw wrote: On Friday, 10 April 2015 at 15:36:42 UTC, John Colvin wrote: if (TL.length == 1 isInputRange!(typeof(TL[0]))) Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't

Re: Context Sensitive Gui Library

2015-04-11 Thread John Colvin via Digitalmars-d
On Saturday, 11 April 2015 at 05:43:14 UTC, Rashad Vinshy wrote: CSGL: I would like to announce the release of my beta library for D! What is the best plan of action at this point to contribute it to the D community? (the library still needs debugging and optimization support, I've only

[Issue 14439] New: aa's are essentially unusable in @safe contexts

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14439 Issue ID: 14439 Summary: aa's are essentially unusable in @safe contexts Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: major

Re: Context Sensitive Gui Library

2015-04-11 Thread Rikki Cattermole via Digitalmars-d
On 11/04/2015 8:34 p.m., jkpl wrote: On Saturday, 11 April 2015 at 07:28:50 UTC, Rikki Cattermole wrote: On 11/04/2015 7:24 p.m., jkpl wrote: On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: On 11/04/2015 5:43 p.m., Rashad Vinshy wrote: CSGL: I would like to announce the

Re: Make a type tuple from an array

2015-04-11 Thread Dicebot via Digitalmars-d-learn
On Saturday, 11 April 2015 at 09:05:19 UTC, Nordlöw wrote: On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote: Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't even input ranges... Ahh, my mistake. Could

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread via Digitalmars-d
On Saturday, 11 April 2015 at 09:15:19 UTC, Martin Nowak wrote: On Friday, 10 April 2015 at 21:26:14 UTC, Walter Bright wrote: This would be a bad design of an RCO. RCO's must be constructed to not allow pointers to the payload other than by ref. And taking the address of that is already

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread via Digitalmars-d
On Friday, 10 April 2015 at 21:26:14 UTC, Walter Bright wrote: On 4/10/2015 11:28 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: Example: void foo() @safe { RCArray!int arr = [0,1,2]; { int* p = arr[0]; // legal under new scope rules This would be a bad design of

[Issue 14359] [SDC] Allow inferring template parameter from type of template value parameter

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

Re: Make a type tuple from an array

2015-04-11 Thread Nordlöw
On Saturday, 11 April 2015 at 07:18:26 UTC, John Colvin wrote: Why not use isStaticArray instead of isInputRange here? Because that would be completely different. Static arrays aren't even input ranges... Ahh, my mistake. Could somebody explain when this feature is needed?

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread via Digitalmars-d
On Friday, 10 April 2015 at 23:12:55 UTC, deadalnix wrote: On Friday, 10 April 2015 at 10:02:01 UTC, Martin Nowak wrote: On Wednesday, 8 April 2015 at 23:11:08 UTC, Walter Bright wrote: http://wiki.dlang.org/DIP77 So someone passes an RCO via ref to avoid the inc/dec, and because that

Re: Context Sensitive Gui Library

2015-04-11 Thread Rashad Vinshy via Digitalmars-d
On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: Thats nice. Now where is the source code? I would like to know what I do to contribute the library? Is there a site I should upload to or should I start a git repository? BTW, I should have mentioned the goal of the

[Issue 14362] DMD should compile SDC test0159.d

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14362 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 14359] [SDC] Allow inferring template parameter from type of template value parameter

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14359 --- Comment #3 from yebblies yebbl...@gmail.com --- *** Issue 14362 has been marked as a duplicate of this issue. *** --

Re: make std/concurrency.test fails but others don't... why?

2015-04-11 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 10 April 2015 at 23:04:44 UTC, Andrei Alexandrescu wrote: Martin Nowak added recently a nice feature to the Phobos makefile: by specifying e.g. make std/stdio.test only the unittests for std/stdio.d would build and run. This greatly improves development turnaround for Phobos.

Re: Context Sensitive Gui Library

2015-04-11 Thread Rikki Cattermole via Digitalmars-d
On 11/04/2015 7:24 p.m., jkpl wrote: On Saturday, 11 April 2015 at 05:45:10 UTC, Rikki Cattermole wrote: On 11/04/2015 5:43 p.m., Rashad Vinshy wrote: CSGL: I would like to announce the release of my beta library for D! What is the best plan of action at this point to contribute it to the D

[Issue 14358] [SDC] DMD should prevent declaring a function with a reserved name

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14358 yebblies yebbl...@gmail.com changed: What|Removed |Added Summary|DMD should prevent |[SDC] DMD should prevent

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread via Digitalmars-d
On Friday, 10 April 2015 at 15:44:32 UTC, Andrei Alexandrescu wrote: We hope to do better than Rust. -- Andrei Hope does not cut it. A design that breaks down even on a linked list (e.g. you have to turn to ref-counted pointers everywhere) and that makes findByRef(container,node) break

Re: Which D IDE do you use?(survey)

2015-04-11 Thread Jacob Carlborg via Digitalmars-d
On 2015-04-10 21:02, Idan Arye wrote: Many of these Vim users are not really Vim users - not in the sense that Emacs users are Emacs users anyways. Sure, they use Vim - but only because it's a default editor in Unix-like systems. If Windows Notepad was the default text they wouldn't have

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Martin Nowak via Digitalmars-d
On Friday, 10 April 2015 at 21:26:14 UTC, Walter Bright wrote: This would be a bad design of an RCO. RCO's must be constructed to not allow pointers to the payload other than by ref. And taking the address of that is already unsafe.

Re: Which D IDE do you use?(survey)

2015-04-11 Thread Iain Buclaw via Digitalmars-d
On 10 April 2015 at 21:19, Adam D. Ruppe via Digitalmars-d digitalmars-d@puremagic.com wrote: On Friday, 10 April 2015 at 19:08:13 UTC, Paulo Pinto wrote: - Move a method to another class located in another module, while updating all references to it, including module imports in the new file

Auto ref function : How is this possible ?

2015-04-11 Thread matovitch via Digitalmars-d-learn
Hi, I just learn about auto ref functions and tried this : import std.stdio; auto ref foo(int i, ref float f) { if (i f) { return i; } else { return f; } } void main() { int i = 1; float f1 =

Re: Auto ref function : How is this possible ?

2015-04-11 Thread matovitch via Digitalmars-d-learn
In fact I am now thinking it's great...I tried with string instead of float and got a clear error message. I should have read the spec more thoroughly.

Re: Why is indexed foreach restricted to build in array ?

2015-04-11 Thread Jakob Ovrum via Digitalmars-d-learn
On Saturday, 11 April 2015 at 10:50:17 UTC, matovitch wrote: Hello, The question is in the title. It should be possible for a finite random access ranges to perform an indexed foreach no ? I mean like : foreach(size_t i = 0, auto ref x; R) { /*...*/ } Why are other foreach statements

[Issue 14427] Regression: navigation for phobos documentation has disappeared

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

Why is indexed foreach restricted to build in array ?

2015-04-11 Thread matovitch via Digitalmars-d-learn
Hello, The question is in the title. It should be possible for a finite random access ranges to perform an indexed foreach no ? I mean like : foreach(size_t i = 0, auto ref x; R) { /*...*/ } Why are other foreach statements overloadable but this one ? Thanks in advance.

[Issue 12422] [REG2.055] Templated nested function is inferred as `pure` even if it calls impure functions

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12422 --- Comment #5 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/128849de37d51ec6cd08860d1db08741bbd82046 Merge pull request #4441

[Issue 13390] [REG2.066] std.range.cycle ctor fails when empty input passed

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13390 --- Comment #13 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e2d774fc85804ce1eabdaf5f526fb287a2d48417 Merge pull request

[Issue 14213] Strange deprecated message in std.typecons.Proxy with using method

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14213 --- Comment #5 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/b8627ba4f639f57a079fbba2b93a913d91404f6b Merge pull request

[Issue 14212] frexp for const and immutable fails to compile

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14212 --- Comment #8 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/cf57c7529a63ac970167c65cb659d5249a3a1ab9 Merge pull request

[Issue 13116] Should not be able to return ref to 'this'

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13116 --- Comment #11 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4d7040a5296a3a5e155b1dd37c0fbad480a2061b Merge pull request #4463

[Issue 14235] [REG2.066] full-qualified template instantiation misses its error location

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14235 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/643ca3f02c237631aa4415386e8abd253f4d66bf Merge pull request #4452

Re: Why is indexed foreach restricted to build in array ?

2015-04-11 Thread John Colvin via Digitalmars-d-learn
On Saturday, 11 April 2015 at 12:04:06 UTC, matovitch wrote: On Saturday, 11 April 2015 at 11:24:32 UTC, John Colvin wrote: On Saturday, 11 April 2015 at 11:03:28 UTC, matovitch wrote: On Saturday, 11 April 2015 at 10:53:46 UTC, Jakob Ovrum wrote: On Saturday, 11 April 2015 at 10:50:17 UTC,

[Issue 14375] static assert leads to __traits(allMembers) retuning an extra empty entry

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14375 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2dfede5829685a97e58f7d32f1d3b6448b4969e4 Fix issue 14375 - static

[Issue 14375] static assert leads to __traits(allMembers) retuning an extra empty entry

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

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread weaselcat via Digitalmars-d
On Saturday, 11 April 2015 at 10:14:00 UTC, w0rp wrote: I think the one thing in the DIP I'm not sure of is the definition of what is a reference counted object. I believe it's still defined by DIP74? http://wiki.dlang.org/DIP74

Re: Which D IDE do you use?(survey)

2015-04-11 Thread weaselcat via Digitalmars-d
On Saturday, 11 April 2015 at 10:00:45 UTC, Iain Buclaw wrote: On 10 April 2015 at 21:19, Adam D. Ruppe via Digitalmars-d digitalmars-d@puremagic.com wrote: On Friday, 10 April 2015 at 19:08:13 UTC, Paulo Pinto wrote: - Move a method to another class located in another module, while updating

[Issue 14301] [2.067-rc1] Private symbols of module conflicts with public from another

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14301 --- Comment #19 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d7ea0ef8e31e5c431821e079416c56c90c6f3c8e Merge pull request

[Issue 14297] [2.067-rc1] Broken links in phobos/index.html

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14297 --- Comment #5 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/e7d02844d58b1290b1dfea2528ec20cefd59c4b5 Merge pull request

[Issue 14317] [REG2.066] ICE (cgcod.c 1767) when compiing with -profile -O -inline

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14317 --- Comment #6 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/c6b489b4cde70ec194fde21c2603b3e127f51479 Merge pull request #4511

[Issue 14197] replace was moved from std.string without alias added

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14197 --- Comment #10 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/9350b01825157f210edc9139c6e1c5c7e985a894 Merge pull request

[Issue 14299] [REG2.067.0-rc1] ref parameter in CTFE handled incorrectly for recursive calls

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14299 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3d8ba6346e92938301c7da036b22f9eb613e3a62 Merge pull request #4501

[Issue 14232] redundant attribute 'const'

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14232 --- Comment #22 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9edd2223950b919a201cf104601f877283cca2bf Merge pull request #4458

Re: Make a type tuple from an array

2015-04-11 Thread Artur Skawina via Digitalmars-d-learn
On 04/10/15 17:36, John Colvin via Digitalmars-d-learn wrote: On Friday, 10 April 2015 at 15:13:54 UTC, Marc Schütz wrote: Is there a way to turn an array (known at compile time) into a TypeTuple? For input ranges in general: import std.range : isInputRange; template TypeTupleOf(TL...)

[Issue 14421] Variadic args array force on heap

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

Re: Wiki page: Coming From C++

2015-04-11 Thread David Nadlinger via Digitalmars-d
On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote: http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article *Un*signed integer overflow isn't undefined in C/C++ either. — David

[Issue 8667] selective import breaks normal overload resolution

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8667 Martin Nowak c...@dawg.eu changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 12359] implicit overload merging with selective imports should be removed

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12359 Martin Nowak c...@dawg.eu changed: What|Removed |Added CC||dmitry.o...@gmail.com ---

Re: __attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 15:59:53 UTC, David Nadlinger wrote: On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: […] (Also LDC?) in druntime and flag all of the symbols like this appropriately, so that creating executables with gc-sections will Just Work in some cases without a

[Issue 12655] foldRange

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12655 --- Comment #4 from bearophile_h...@eml.cc --- (In reply to jens.k.mueller from comment #3) A cumulate returning the same number elements can be written using map. ... I leave this here for reference and others to decide whether such a function

__attribute__((used)) and druntime

2015-04-11 Thread w0rp via Digitalmars-d
I've been looking into compiling smaller executables, and the trick I learned from watching sessions from the last DConf is to use the KEEP symbol in a linker script with something like gc-sections. So at the compilation stage, symbols are put in different sections, a linker script marks some

[Issue 14428] Link all book formats available from dlang.org

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14428 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Status|REOPENED|RESOLVED

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Martin Nowak via Digitalmars-d
On 04/09/2015 01:10 AM, Walter Bright wrote: http://wiki.dlang.org/DIP77 It's a very interesting proposal to tackle this specific problem. As with all the scope/lifetime related stuff, I find it extremely difficult to anticipate all the needs and foresee how this will integrate with the rest of

[Issue 14421] Variadic args array force on heap

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14421 --- Comment #2 from John Colvin john.loughran.col...@gmail.com --- What I want is a way of writing char[] foo(char[] args ...) { return args.dup; } with a guarantee that only one allocation is made. --

Re: D1: Out of memory problems

2015-04-11 Thread jicman via Digitalmars-d-learn
On Friday, 10 April 2015 at 13:47:52 UTC, Kagamin wrote: On Tuesday, 7 April 2015 at 15:28:21 UTC, jicman wrote: H... Will you be able to give me an example of what is bad and then fix that bad to a good? This may be my problem... maybe aTUs = AddToTrackerRepeat(aTUs, source.dup, fn, 1,

Re: STL and Phobos

2015-04-11 Thread w0rp via Digitalmars-d
On Saturday, 11 April 2015 at 17:01:42 UTC, Dennis Ritchie wrote: Will the STL included in Phobos or is it impossible? STL won't be included in Phobos, at least as far as I know, but I believe it should be possible to interface to parts of it with extern(C++). To do it, you need to create

[Issue 14367] Print warnings by default

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14367 --- Comment #4 from bearophile_h...@eml.cc --- (In reply to Martin Krejcirik from comment #3) Since -dw is turned on by default, there is no need for -wi by default too. I'd like warnings by default, regardless what the compiler does regarding

Re: __attribute__((used)) and druntime

2015-04-11 Thread David Nadlinger via Digitalmars-d
On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: […] (Also LDC?) in druntime and flag all of the symbols like this appropriately, so that creating executables with gc-sections will Just Work in some cases without a linker script? LDC is shipping with --gc-sections enabled by default

Re: __attribute__((used)) and druntime

2015-04-11 Thread Jens Bauer via Digitalmars-d
On Saturday, 11 April 2015 at 15:35:47 UTC, w0rp wrote: From what I just read, __attribute__((used)) in GCC should do the job, and I think it should be usable from GDC with its attribute pragmas. I wouldn't mind having this functionality. For a long time, I've wanted it in C in those cases

STL and Phobos

2015-04-11 Thread Dennis Ritchie via Digitalmars-d
Will the STL included in Phobos or is it impossible?

Re: Associative Arrays in the data segment

2015-04-11 Thread Andrei Alexandrescu via Digitalmars-d
On 4/10/15 8:45 PM, Daniel Murphy wrote: Andrei Alexandrescu wrote in message news:mg94od$1v4g$1...@digitalmars.com... Can you make a salient argument that this is a step in the right direction? In that case what's the vision for future steps? Thanks! -- Andrei This approach makes the

Re: mixin template question

2015-04-11 Thread lobo via Digitalmars-d-learn
On Sunday, 12 April 2015 at 03:51:03 UTC, Paul D Anderson wrote: I don't understand why the following code compiles and runs without an error: import std.stdio; mixin template ABC(){ int abc() { return 3; } } mixin ABC; int abc() { return 4; } void main() { writefln(abc() = %s, abc());

Re: vibed - best approach to manage central state (cached records)

2015-04-11 Thread Rikki Cattermole via Digitalmars-d-learn
On 12/04/2015 7:24 a.m., Laeeth Isharc wrote: Hi. Two questions: 1. On startup I load various indexes from file storage into memory in the shared static this segment, and I would like to access these from threads serving web requests. The data can be considered immutable once loaded. What is

Re: if(arr) now a warning

2015-04-11 Thread Andrei Alexandrescu via Digitalmars-d
On 4/11/15 4:03 AM, w0rp wrote: Having thought about it more, I think that is why we cannot put the range primitives for slices into object.d. Because that makes it impossible to define the primitives differently, so that no auto-decoding occurs. At the moment, auto-decoding isn't part of the

Re: vibed - best approach to manage central state (cached records)

2015-04-11 Thread Laeeth Isharc via Digitalmars-d-learn
On Sunday, 12 April 2015 at 02:54:27 UTC, Rikki Cattermole wrote: On 12/04/2015 7:24 a.m., Laeeth Isharc wrote: Hi. Two questions: 1. On startup I load various indexes from file storage into memory in the shared static this segment, and I would like to access these from threads serving web

Re: Associative Arrays in the data segment

2015-04-11 Thread Daniel Murphy via Digitalmars-d
Andrei Alexandrescu wrote in message news:mgcqml$2e67$1...@digitalmars.com... This is nice work, but sorry it is hardly conductive to warm fuzzy feelings. -- Andrei It's not ideal, just better than what we have now.

Re: Wiki page: Coming From C++

2015-04-11 Thread Jakob Ovrum via Digitalmars-d
On Saturday, 11 April 2015 at 16:02:53 UTC, David Nadlinger wrote: On Saturday, 11 April 2015 at 10:24:53 UTC, Jakob Ovrum wrote: http://wiki.dlang.org/Coming_From/C_Plus_Plus_WIP_article *Un*signed integer overflow isn't undefined in C/C++ either. — David I removed the section on

Re: Wiki page: Coming From C++

2015-04-11 Thread Jakob Ovrum via Digitalmars-d
Thanks for the feedback, I think I've incorporated all the suggested changes. Also added a section on how D deals with object slicing. I can't seem to get the compiler to error on dangling else. I tried the examples in the original PR[1], but they seem to compile without error with DMD

mixin template question

2015-04-11 Thread Paul D Anderson via Digitalmars-d-learn
I don't understand why the following code compiles and runs without an error: import std.stdio; mixin template ABC(){ int abc() { return 3; } } mixin ABC; int abc() { return 4; } void main() { writefln(abc() = %s, abc()); } Doesn't the mixin ABC create a function with the same

Re: D1: Out of memory problems

2015-04-11 Thread jicman via Digitalmars-d-learn
On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote: Parsers unique duplicated strings via a name table: string udup(string s, ref string[string] nameTable) { if(s in nameTable)return nameTable[s]; string s1=s.dup; nameTable[s1]=s1; return s1; } This way you avoid extra

Re: make std/concurrency.test fails but others don't... why?

2015-04-11 Thread Andrei Alexandrescu via Digitalmars-d
On 4/11/15 12:25 AM, Vladimir Panteleev wrote: On Friday, 10 April 2015 at 23:04:44 UTC, Andrei Alexandrescu wrote: Martin Nowak added recently a nice feature to the Phobos makefile: by specifying e.g. make std/stdio.test only the unittests for std/stdio.d would build and run. This greatly

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread Andrei Alexandrescu via Digitalmars-d
On 4/11/15 5:35 AM, matovitch wrote: I am not convinced by the dip77, what about raii managed classes with costly opAssign operator (like in w0rn example) ? The goal of passing an object by reference is to avoid the copy and here you guess the parameter is ref-counted and made a (pseudo-)copy ?

Re: stdout redirect

2015-04-11 Thread Philip Stuckey via Digitalmars-d-learn
On Thursday, 12 April 2012 at 08:11:58 UTC, Andrea Fontana wrote: On Wednesday, 11 April 2012 at 15:25:56 UTC, Stefan wrote: On Wednesday, 11 April 2012 at 13:00:45 UTC, Andrea Fontana wrote: On Wednesday, 11 April 2012 at 12:46:30 UTC, Andrea Fontana wrote: How can I redirect stdout / stderr

[Issue 14421] Variadic args array force on heap

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14421 --- Comment #3 from yebblies yebbl...@gmail.com --- Is there a reason you can't overload and forward the variadic version to the non-variadic after calling dup? --

Re: DIP77 - Fix unsafe RC pass by 'ref'

2015-04-11 Thread via Digitalmars-d
On Saturday, 11 April 2015 at 09:41:07 UTC, Walter Bright wrote: On 4/11/2015 2:28 AM, Marc =?UTF-8?B?U2Now7x0eiI=?= schue...@gmx.net wrote: It's not acceptable that it happens behind the user's back. Costly operations must be explicit. Don't know of a better solution. How about this?

[Issue 14283] [2.067-b4]: Spurious this is not an lvalue deprecation message for auto ref arguments

2015-04-11 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14283 --- Comment #6 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/56e59d841a3854afb8509f5930bfa4016fa7443d Merge pull request #4497

  1   2   >