Re: AST like coding syntax. Easy upgrade!

2015-09-07 Thread Dmitry Olshansky via Digitalmars-d
On 07-Sep-2015 08:25, anonymous wrote: On Monday 07 September 2015 02:24, Idan Arye wrote: That's not considered as syntax check - that's an earlier stage of the compilation process called "lexical analysis"(https://en.wikipedia.org/wiki/Lexical_analysis) From the Wikipedia article: "a

Re: Unordered Element Pairs of a Range

2015-09-07 Thread cym13 via Digitalmars-d-learn
On Monday, 7 September 2015 at 09:06:05 UTC, Nordlöw wrote: Is there a range in Phobos for accessing all unordered combinations of a range as: foreach (const i, const a; r) { for (auto j = i + 1; j < r.length; ++j) { const b = r[j]; // Use a and b } } excluding

[Issue 14140] Bad codegen for CTFE union initialisers for immutable structs

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14140 Kenji Hara changed: What|Removed |Added Keywords||pull, wrong-code ---

Using dub configurations with libraries

2015-09-07 Thread FreeSlave via Digitalmars-d-learn
Let's say I have two dub packages: A and B. A is a library. B is library or application (does not matter) and depends on A. A has several configurations in dub.json. How to build the B package that way it will use non-default configuration of A?

Re: Benchmarking suite

2015-09-07 Thread Dmitry Olshansky via Digitalmars-d
On 07-Sep-2015 11:29, qznc wrote: Maybe std.regex has just space for optimization? Sure thing, see WIP here (~25% faster but not yet complete): https://github.com/D-Programming-Language/phobos/pull/3314 -- Dmitry Olshansky

[Issue 15020] New: pragma(lib) not implemented with 2.068.1

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15020 Issue ID: 15020 Summary: pragma(lib) not implemented with 2.068.1 Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: regression

[Issue 15014] Win64: Invalid C++ mangling for multiple long arguments

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15014 --- Comment #2 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/63f19847131f89a6b526b7d1008b7214b9002dac Merge pull request #5038

Re: Benchmarking suite

2015-09-07 Thread qznc via Digitalmars-d
On Sunday, 30 August 2015 at 13:21:42 UTC, qznc wrote: On Saturday, 29 August 2015 at 19:17:47 UTC, Dmitry Olshansky wrote: On 29-Aug-2015 21:14, qznc wrote: On Saturday, 29 August 2015 at 12:35:14 UTC, Dmitry Olshansky wrote: Well, here is the regex-dna one with 3 versions including C-T

Odd stacktrace: Access Violation in object.TypeInfo_Interface.getHash

2015-09-07 Thread Fra via Digitalmars-d-learn
I encountered a runtime error in my code and all I can get (even in debug mode) is the following stacktrace: object.Error@(0): Access Violation 0x0051C308 in const(nothrow @trusted uint function(const(void*))) object.TypeInfo_Interface.getHash 0x0058D2C0 in

Re: How To: Passing curried functions around

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 03:55:01 UTC, Meta wrote: The name validator_t is not idiomatic in D. Something like ValidatorFun should be preferred. Same for intReader_t; ReadIntFun is probably preferred, or even IntReader (but that would imply that it's a struct/class in my mind). Noted.

[Issue 15001] Duplicate error message without line number on if statement

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15001 --- Comment #2 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/36e83282e5c52e1f4dde667fd07138667ff69fea fix Issue 15001 - Duplicate

Re: Is D suitable for my latest project?

2015-09-07 Thread Kagamin via Digitalmars-d-learn
On Sunday, 6 September 2015 at 15:15:03 UTC, chris stevens wrote: I guess you're right it wouldn't be too difficult to do it all using strings. The code generation I'd done before in c# I'd used some 3rd person library where you build up an object model rather than using strings. Maybe with

Re: dmd codegen improvements

2015-09-07 Thread Walter Bright via Digitalmars-d
On 9/6/2015 4:39 PM, Manu via Digitalmars-d wrote: It didn't happen for me because I changed my gmail settings after Walter requested some time back to only include plain text. My NG experience is much less enjoyable as a result of the change; I prefer the blue quote line, but now I just have a

[Issue 15020] pragma(lib) not implemented with 2.068.1

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15020 Tomáš Chaloupka changed: What|Removed |Added Status|NEW |RESOLVED

Re: Abstractioning away main/winMain

2015-09-07 Thread Kagamin via Digitalmars-d-learn
On Saturday, 5 September 2015 at 01:43:43 UTC, Prudence wrote: Any ideas? See how vibe does it.

Unordered Element Pairs of a Range

2015-09-07 Thread Nordlöw
Is there a range in Phobos for accessing all unordered combinations of a range as: foreach (const i, const a; r) { for (auto j = i + 1; j < r.length; ++j) { const b = r[j]; // Use a and b } } excluding self-pairs, that is i != j

Re: DCD 0.7.0

2015-09-07 Thread Daniel Kozák via Digitalmars-d-announce
On Sun, 06 Sep 2015 21:00:11 + Dicebot via Digitalmars-d-announce wrote: > On Wednesday, 2 September 2015 at 09:07:24 UTC, Chris wrote: > > Thanks, great stuff! One thing you say it's been tested with > > 2.067.1, but for this version it gives the

What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
It seems to me a good practice to mark all functions that I write as `pure` and define all the variables as `immutable`, unless there is a reason not to. I can see some serious advantages of this, most notable of which is minimum side-effect and predictability of the code. However I suppose

Re: Release D 2.068.1

2015-09-07 Thread anonymous via Digitalmars-d-announce
On Monday 07 September 2015 00:32, Martin Nowak wrote: > http://downloads.dlang.org/releases/2.x/2.068.1/ Trying to download the 7z Windows file gives me a 403. http://downloads.dlang.org/releases/2015/dmd.2.068.1.windows.7z

Re: What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread anonymous via Digitalmars-d-learn
On Monday 07 September 2015 13:12, Bahman Movaqar wrote: > I was under the impression that when a variable, that is declared > as `immutable`, is passed to a function, a copy of the value is > passed. > > However based on "marks" I can imagine that since the data is > marked as `immutable`

Re: Benchmarking suite

2015-09-07 Thread Suliman via Digitalmars-d
On Monday, 7 September 2015 at 08:33:33 UTC, Dmitry Olshansky wrote: On 07-Sep-2015 11:29, qznc wrote: Maybe std.regex has just space for optimization? Sure thing, see WIP here (~25% faster but not yet complete): https://github.com/D-Programming-Language/phobos/pull/3314 Could anybody add

[Issue 6004] std.range.unzip()

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6004 Edwin van Leeuwen changed: What|Removed |Added CC||ed...@tkwsping.nl ---

Re: How to partially forward properties of struct array member to struct (disable length property) ?

2015-09-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/6/15 3:34 AM, ParticlePeter wrote: I am working on a struct vector. The data is stored in a member static array and I want to be able to forward all array properties except length to vector. Reason is I have free functions f that take vector(s) as arguments, such that f(vector) and vector.f

Re: Behavior of opEquals

2015-09-07 Thread Timon Gehr via Digitalmars-d
On 09/05/2015 08:18 AM, Jonathan M Davis wrote: On Friday, 4 September 2015 at 20:39:14 UTC, Timon Gehr wrote: On 09/04/2015 09:21 PM, H. S. Teoh via Digitalmars-d wrote: Wait, wait, did I miss something? Since when was operator overloading allowed as free functions? Since UFCS, but DMD

Better unittest failure output

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
I am working on a simple project created with DUB[1]. When unit tests the output reads really cryptic to me; for example: $ dub test Generating test runner configuration '__test__library__' for 'library' (library). Target dunit 1.0.11 is up to date. Use --force to rebuild.

Re: Better unittest failure output

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 12:16:14 UTC, anonymous wrote: On Monday 07 September 2015 14:12, Bahman Movaqar wrote: Thanks. This is indeed helpful. OT but where can I view the documentation for `unittest` and `assert`? unittest: http://dlang.org/unittest.html assert:

Re: Release D 2.068.1

2015-09-07 Thread Martin Nowak via Digitalmars-d-announce
On 09/07/2015 12:21 PM, anonymous wrote: > Trying to download the 7z Windows file gives me a 403. > > http://downloads.dlang.org/releases/2015/dmd.2.068.1.windows.7z Thanks, I just fixed it. The aws client failed to upload that file and it was hard to notice in the log output.

Re: Better unittest failure output

2015-09-07 Thread anonymous via Digitalmars-d-learn
On Monday 07 September 2015 13:57, Bahman Movaqar wrote: > I am working on a simple project created with DUB[1]. > When unit tests the output reads really cryptic to me; for > example: > > $ dub test [...] > core.exception.AssertError@source/e002.d(111): unittest > failure [...] > >

Re: What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 11:49:32 UTC, anonymous wrote: void f(int a) {} void g(int* a) {} void main() { int xm; immutable int xi; f(xm); /* ok, obviously */ f(xi); /* ok */ int* ym = immutable int* yi = g(ym); /* ok, obviously */ g(yi); /* doesn't

Re: Better unittest failure output

2015-09-07 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 7 September 2015 at 11:57:25 UTC, Bahman Movaqar wrote: I am working on a simple project created with DUB[1]. When unit tests the output reads really cryptic to me; for example: Try using DUnit, it gives you much more readable fail messages: https://github.com/nomad-software/dunit

Re: Unordered Element Pairs of a Range

2015-09-07 Thread Nordlöw
On Monday, 7 September 2015 at 09:12:53 UTC, cym13 wrote: There is an open bug for that https://issues.dlang.org/show_bug.cgi?id=6788 Thanks. So I construct a pairwise range with two implementation cases one for RandomAccessRange and one for InputRange

Re: What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread anonymous via Digitalmars-d-learn
On Monday 07 September 2015 12:40, Bahman Movaqar wrote: > It seems to me a good practice to mark all functions that I write > as `pure` and define all the variables as `immutable`, unless > there is a reason not to. I agree. > I can see some serious advantages of this, most notable of which

Re: Odd stacktrace: Access Violation in object.TypeInfo_Interface.getHash

2015-09-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Monday, 7 September 2015 at 08:55:31 UTC, Fra wrote: I encountered a runtime error in my code and all I can get (even in debug mode) is the following stacktrace: object.Error@(0): Access Violation 0x0051C308 in const(nothrow @trusted uint function(const(void*)))

Re: What are (dis)advantages of using pure and immutable by default?

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 10:55:13 UTC, anonymous wrote: On Monday 07 September 2015 12:40, Bahman Movaqar wrote: I can see some serious advantages of this, most notable of which is minimum side-effect and predictability of the code. However I suppose it's going to impact the performance

Re: Better unittest failure output

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 12:06:09 UTC, anonymous wrote: On Monday 07 September 2015 13:57, Bahman Movaqar wrote: $ dub test [...] core.exception.AssertError@source/e002.d(111): unittest failure [...] From that one line I left intact above, you should also be able to figure

Re: AST like coding syntax. Easy upgrade!

2015-09-07 Thread Sergei Nosov via Digitalmars-d
On Monday, 7 September 2015 at 02:50:06 UTC, Adam D. Ruppe wrote: On Sunday, 6 September 2015 at 23:33:17 UTC, Walter Bright wrote: I'd always thought Javascript was an ideal extension language for a text editor. Well, I don't think *ideal*, but indeed, it wouldn't be bad. C'mon, kind sirs!

Re: Better unittest failure output

2015-09-07 Thread Gary Willoughby via Digitalmars-d-learn
On Monday, 7 September 2015 at 12:58:58 UTC, Gary Willoughby wrote: On Monday, 7 September 2015 at 11:57:25 UTC, Bahman Movaqar wrote: I am working on a simple project created with DUB[1]. When unit tests the output reads really cryptic to me; for example: Try using DUnit, it gives you much

Re: A collection of DIPs

2015-09-07 Thread rsw0x via Digitalmars-d
On Monday, 7 September 2015 at 14:52:21 UTC, Ola Fosheim Grøstad wrote: On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote: https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... Thanks for taking the time to write up your ideas. There has been much discussion on

Re: A collection of DIPs

2015-09-07 Thread via Digitalmars-d
On Monday, 7 September 2015 at 14:52:21 UTC, Ola Fosheim Grøstad wrote: 1. You need to make sure that pointers to the interior of a GC object are not live when the last pointer to the start of the GC objects disappears. 2. You need to annotate C functions that take pointers with a guarantee

[Issue 14996] only(EnumMembers!T) eats all my memory when T : string

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14996 --- Comment #4 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/2070e8e1386ad03d1d77d7beff910bfca31a8aad fix Issue 14996 -

[Issue 14996] only(EnumMembers!T) eats all my memory when T : string

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

[Issue 6744] Missing AA symbol with enum

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6744 Kenji Hara changed: What|Removed |Added Status|NEW |RESOLVED

Re: A collection of DIPs

2015-09-07 Thread BBasile via Digitalmars-d
On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote: https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... You can report issues and create pull requests :) Destroy! OK, here are a few comments on what i agree with or not. The other point simply don't interest

[Issue 14472] add separate ptr data section

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14472 --- Comment #2 from Martin Nowak --- Something along this line from Rainer. https://github.com/D-Programming-Language/dmd/pull/5047#issuecomment-138125410 https://github.com/rainers/dmd/commit/e6a3d1778ad2969fc7bcb378a084b8d865b015c7

function argument restrictions for templated struct

2015-09-07 Thread Laeeth Isharc via Digitalmars-d-learn
Hi. Is there a more elegant way to write the template arg restrictions for display? Thanks. Laeeth import std.stdio; import std.traits; struct Bar(bool test) { double a; static if(test) double b; } void display(T)(T a) if (__traits(isSame, TemplateOf!(T),

Re: D-Day for DMD is today!

2015-09-07 Thread via Digitalmars-d-announce
On Friday, 4 September 2015 at 12:38:41 UTC, Daniel Murphy wrote: It's not that phobos is bad, it's that we're following the same development pattern we had with C++. We're using a conservative subset of D features and libraries, and slowly expanding what's acceptable. For example, DMD now

Re: A collection of DIPs

2015-09-07 Thread Israel via Digitalmars-d
On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote: https://github.com/NightmareX1337/DX Destroy! Yea ill admit, i came from C# and i hate underscores. I prefer PascalCase above anything.

Re: Are there any Phobos functions to check file permissions on Windows and Posix?

2015-09-07 Thread BBasile via Digitalmars-d-learn
On Sunday, 6 September 2015 at 23:05:29 UTC, Jonathan M Davis wrote: [...] which makes treating some of this stuff in a cross-platform fashion quite difficult. And even more with ACLs that it could be: On windows, to know properly if something is readable or writable the attributes are not

Re: A collection of DIPs

2015-09-07 Thread via Digitalmars-d
On Monday, 7 September 2015 at 15:34:21 UTC, BBasile wrote: You can already create, allocate new class, struct and union instances that are not known by the GC. This is not well known because I've explained this several time on several boards to several people. So this proposal is simply

Re: function argument restrictions for templated struct

2015-09-07 Thread anonymous via Digitalmars-d-learn
On Monday 07 September 2015 17:51, Laeeth Isharc wrote: > Is there a more elegant way to write the template arg > restrictions for display? [...] > void display(T)(T a) > if (__traits(isSame, TemplateOf!(T), Bar)) > { > writefln("%s",a); > } if (isInstanceOf!(Bar, T))

Re: Are there any Phobos functions to check file permissions on Windows and Posix?

2015-09-07 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 6 September 2015 at 23:05:29 UTC, Jonathan M Davis wrote: http://dlang.org/phobos/std_file.html#.getAttributes will get you all of the file attributes for a file, though you'll have to look at the Windows and POSIX documentation to know how to interpret that. - Jonathan M Davis

Re: Are there any Phobos functions to check file permissions on Windows and Posix?

2015-09-07 Thread Kagamin via Digitalmars-d-learn
On Sunday, 6 September 2015 at 20:40:04 UTC, Gary Willoughby wrote: Are there any Phobos functions to check file permissions on Windows and Posix? For example, I want to check if a file is readable and/or writable in a cross-platform fashion. Does anyone have an example? Call fopen and check

[Issue 15002] [REG2.064] ICE with invalid static variable initializer while CTFE

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15002 --- Comment #7 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/b5b8d55d74cef95b2e5a6cf24a93438c2ae20141 fix Issue 15002 - ICE with

[Issue 14696] destructor for temporary called before statement is complete with conditional operator

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14696 --- Comment #11 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/3bbe72b5fdc278fe1293c20b39af4f94b10070bb fix Issue 14696 -

Chaining struct method invocations

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
I need some help understand the behaviour of my code[1]. Specifically I have trouble with `add` method on line 79. My impression is that since it returns `this`, multiple invocations can be chained like `obj.add(X).add(Y).add(Z)`. However the test on line 92 fails and if I do a `writeln`,

[Issue 3248] lossless floating point formatting

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3248 hst...@quickfur.ath.cx changed: What|Removed |Added CC|hst...@quickfur.ath.cx | --

Re: A collection of DIPs

2015-09-07 Thread via Digitalmars-d
On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote: https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... Thanks for taking the time to write up your ideas. There has been much discussion on the GC in the past and I agree that a GC-tracking mechanism that can

Re: Chaining struct method invocations

2015-09-07 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-09-07 16:44, Bahman Movaqar wrote: Does this mean that in the following piece of code, what is passed to `add` is actually a copy of `rec1`? auto rec1 = SalesRecord("p10", 1.0, 10); coll.add(rec1); Yes. structs have value semantics. If you want reference semantics you might

Re: Chaining struct method invocations

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 14:54:04 UTC, Jacob Carlborg wrote: On 2015-09-07 16:44, Bahman Movaqar wrote: Does this mean that in the following piece of code, what is passed to `add` is actually a copy of `rec1`? auto rec1 = SalesRecord("p10", 1.0, 10); coll.add(rec1); Yes.

Re: dmd codegen improvements

2015-09-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-06 15:24, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: Oh, actually it appears to run on both OS-X and Linux. I didn't know that. Looks very promising, thanks! Yeah, it's built on the same framework as Atom. Or were you hoping for Visual

Re: AST like coding syntax. Easy upgrade!

2015-09-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-06 21:32, Prudence wrote: template X(Y) { string X = Y.stringof; } auto s = X({int 3;}) Of course, doesn't work!! You might be interested in this [1]. [1] http://wiki.dlang.org/DIP50 -- /Jacob Carlborg

A collection of DIPs

2015-09-07 Thread nx via Digitalmars-d
https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... You can report issues and create pull requests :) Destroy!

[Issue 14708] destructor for temporary not called during stack unwinding

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14708 --- 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/e20c63cb28decb66c792b1dfc10d79aa0aebd7cf fix Issue 14708 -

[Issue 14948] [Reg 2.068.0] AA key requirement was broken w/o notice and w/ horrible error message

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14948 --- Comment #8 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/5c1d3c5b63394b7d3758f86a53eace6ffb3d3165 fix Issue 14948 - AA key

[Issue 15017] [REG2.068.1-b2] assigning a Variant to be value in a hashmap

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15017 --- Comment #5 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/4a87ff64dfdc67419a69136ce542e88c67726701 fix Issue 15017 - assigning

Re: Chaining struct method invocations

2015-09-07 Thread Namespace via Digitalmars-d-learn
On Monday, 7 September 2015 at 14:12:25 UTC, Bahman Movaqar wrote: I need some help understand the behaviour of my code[1]. Specifically I have trouble with `add` method on line 79. My impression is that since it returns `this`, multiple invocations can be chained like

Re: Chaining struct method invocations

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 14:26:57 UTC, mzf wrote: On Monday, 7 September 2015 at 14:12:25 UTC, Bahman Movaqar wrote: struct is a value type,you can convert to ref type by "ref": struct Test { int a; Test add1() { a++; return

Re: Chaining struct method invocations

2015-09-07 Thread mzfhhhh via Digitalmars-d-learn
On Monday, 7 September 2015 at 14:12:25 UTC, Bahman Movaqar wrote: I need some help understand the behaviour of my code[1]. Specifically I have trouble with `add` method on line 79. My impression is that since it returns `this`, multiple invocations can be chained like

Re: dmd codegen improvements

2015-09-07 Thread via Digitalmars-d
On Monday, 7 September 2015 at 13:41:31 UTC, Jacob Carlborg wrote: On 2015-09-06 15:24, Ola Fosheim =?UTF-8?B?R3LDuHN0YWQi?= wrote: Oh, actually it appears to run on both OS-X and Linux. I didn't know that. Looks very promising, thanks! Yeah, it's

Re: Chaining struct method invocations

2015-09-07 Thread Bahman Movaqar via Digitalmars-d-learn
On Monday, 7 September 2015 at 14:28:06 UTC, Namespace wrote: On Monday, 7 September 2015 at 14:12:25 UTC, Bahman Movaqar wrote: Structs are value types and therefore you return only a copy currently. Does this mean that in the following piece of code, what is passed to `add` is actually a

Re: Windows Header consts

2015-09-07 Thread Prudence via Digitalmars-d-learn
On that note, is there also any generic translation software for code that you can program a set of simple "rules"(matching and arranging) to translate source code? e.g., match("const WM_", ";")->WM.add(%1 + ",")). The above should be obvious but essentially it matches the first string until

Re: Windows Header consts

2015-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 7 September 2015 at 17:44:54 UTC, Prudence wrote: const WM_* -> add to enum WM; else WM_* -> WM.* I'm against that. The documentation all says WM_* and we shouldn't muck with it. const -> enum is a good idea though. These headers were all written way back when when const and

[Issue 15021] New: [Reg 2.068.1] linker error with speculative instantiation and -inline

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15021 Issue ID: 15021 Summary: [Reg 2.068.1] linker error with speculative instantiation and -inline Product: D Version: D2 Hardware: All OS: All Status:

[Issue 12090] Make std.concurrency compatible with fibers as threads

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12090 Mathias LANG changed: What|Removed |Added Status|ASSIGNED|RESOLVED

Windows Header consts

2015-09-07 Thread Prudence via Digitalmars-d-learn
Windows headers contain a ton of global const's for the various messages. Seems like a very bad way to go about this. Could one not simply put all these in an enum? e.g., enum WM { WM_CREATE = 1, etc... }? If so, because there are so many and so many references to them, this can't be done

[Issue 15023] New: debug info for extern(C++) classes don't work when debugging C++ code

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15023 Issue ID: 15023 Summary: debug info for extern(C++) classes don't work when debugging C++ code Product: D Version: D2 Hardware: All OS: Linux Status:

[Issue 14980] [REG2.068] getAddressInfo(null) broken

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14980 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/156bf68ef7008343755ab450facdd0e5604f6fac fix Issue 14980 -

[Issue 14904] [REG2.067.0] bad error message in reduce: 'Incompatible function/seed/element'

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14904 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/6579c574bbcc53944a2060f3d1eadc1fa5516f51 fix Issue 14904 - bad

[Issue 14920] [REG2.067.0] SList.insertAfter on uninitialized list triggers assertion in _first

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14920 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/0c28c7717437b10570677994112fc874e196d26a fix issue 14920

Re: function argument restrictions for templated struct

2015-09-07 Thread Laeeth Isharc via Digitalmars-d-learn
On Monday, 7 September 2015 at 16:27:21 UTC, anonymous wrote: On Monday 07 September 2015 17:51, Laeeth Isharc wrote: Is there a more elegant way to write the template arg restrictions for display? [...] void display(T)(T a) if (__traits(isSame, TemplateOf!(T), Bar)) {

Re: A collection of DIPs

2015-09-07 Thread Shammah Chancellor via Digitalmars-d
On Monday, 7 September 2015 at 14:44:05 UTC, nx wrote: https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... You can report issues and create pull requests :) Destroy! Hi NX, Thanks for the document. A lot of what you say about UDA and compile time reflection is

[Issue 15021] [Reg 2.068.1] linker error with speculative instantiation and -inline

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15021 --- Comment #1 from Martin Nowak --- Maybe we should do a 2.068.2 hotfix release for this? --

[Issue 15022] New: use __TEXT,__cstring to deduplicate strings during linking

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15022 Issue ID: 15022 Summary: use __TEXT,__cstring to deduplicate strings during linking Product: D Version: D2 Hardware: All OS: Mac OS X Status: NEW

[Issue 15024] New: Wrong keyword color for Visual Studio Dark theme

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15024 Issue ID: 15024 Summary: Wrong keyword color for Visual Studio Dark theme Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: regression

Re: template UDA

2015-09-07 Thread Adam D. Ruppe via Digitalmars-d
On Monday, 7 September 2015 at 22:00:07 UTC, bitwise wrote: Is there any real(and plausible) use case where providing a template with no argument as a UDA would be useful? Yes, you actually wrote it yourself! @MyAttribute!SomeClass class SomeClass { } That right there is a reason. When you

Re: Windows Header consts

2015-09-07 Thread Prudence via Digitalmars-d-learn
On Monday, 7 September 2015 at 20:55:25 UTC, Adam D. Ruppe wrote: On Monday, 7 September 2015 at 19:06:48 UTC, Prudence wrote: It's called encapsulation. It prevents namespace pollution and identifier collision. This is already provided by the D module system. Even if you were to define a

Re: Windows Header consts

2015-09-07 Thread Prudence via Digitalmars-d-learn
On Monday, 7 September 2015 at 22:21:28 UTC, Adam D. Ruppe wrote: On Monday, 7 September 2015 at 22:02:47 UTC, Prudence wrote: Oh, and who says you couldn't keep both systems? Nobody. There's absolutely nothing stopping you from defining your one constants and bindings. I think you should

[Issue 15026] New: cannot array assign to a slice return value

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15026 Issue ID: 15026 Summary: cannot array assign to a slice return value Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

[Issue 15026] cannot array assign to a slice return value

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15026 --- Comment #1 from Martin Nowak --- Workaround is to slice the return value, i.e. `bar()[]` and `foo[][]`. --

Re: Windows Header consts

2015-09-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 7 September 2015 at 23:11:36 UTC, Prudence wrote: I asked is there is an easy way to do it, and you replied that essentially that it shouldn't be changed because it would change things. I also said: I guessing one would need a D or C parser to deal with all this? hackerpilot's

Re: D-Day for DMD is today!

2015-09-07 Thread Daniel Murphy via Digitalmars-d-announce
On 8/09/2015 1:54 AM, "Luís Marques wrote: On Friday, 4 September 2015 at 12:38:41 UTC, Daniel Murphy wrote: It's not that phobos is bad, it's that we're following the same development pattern we had with C++. We're using a conservative subset of D features and

[Issue 15021] [REG2.068.1] linker error with speculative instantiation and -inline

2015-09-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15021 Kenji Hara changed: What|Removed |Added Keywords||link-failure, pull

How To Compile D2SQLite3 on OSX?

2015-09-07 Thread Mike McKee via Digitalmars-d
LOL, I feel like I need to do one of these "Explain like I'm 5" kind of posts you see on Reddit. I'm stuck. I'm on OSX (Yosemite). I seem to have properly installed homebrew, and then dub, and then sqlite3, and I have the dmd D compiler installed and working. Now I'm trying to get D2SQLite3

template UDA

2015-09-07 Thread bitwise via Digitalmars-d
Currently this will compile Note: -no type is supplied to @MyAttribute -"instantiated" will not be printed struct MyAttribute(T) { pragma(msg, "instantiated"); } @MyAttribute class SomeClass { } void main(string[] args) { A a = new A(); } Is there any real(and plausible) use case

Re: Windows Header consts

2015-09-07 Thread Mike Parker via Digitalmars-d-learn
On Monday, 7 September 2015 at 22:02:47 UTC, Prudence wrote: Again, it's called progress. Why keep using the same defunct system for endless years simply because that's the way it was done? Any C library binding should maintain the same interface as the C library as much as possible. That

Re: Regression?

2015-09-07 Thread Sebastiaan Koppe via Digitalmars-d-learn
Fixed it by changing into: ``` import std.conv : text; string json = File("../languages.json","r").byLineCopy().joiner.text; auto ls = json.parseJSON(); ```

Re: template UDA

2015-09-07 Thread bitwise via Digitalmars-d
On Monday, 7 September 2015 at 22:03:13 UTC, Adam D. Ruppe wrote: On Monday, 7 September 2015 at 22:00:07 UTC, bitwise wrote: Is there any real(and plausible) use case where providing a template with no argument as a UDA would be useful? Yes, you actually wrote it yourself!

Re: template UDA

2015-09-07 Thread bitwise via Digitalmars-d
On Monday, 7 September 2015 at 22:03:13 UTC, Adam D. Ruppe wrote: [...] A more useful example: http://dpaste.dzfl.pl/82a3d65be4be

Re: template UDA

2015-09-07 Thread bitwise via Digitalmars-d
On Monday, 7 September 2015 at 22:03:13 UTC, Adam D. Ruppe wrote: [...] digging deeper, this very contrived example compiles: struct S(T) { int x; } auto fun(alias T, S)(S x) { return T!S(x); } void main(string[] args) { auto s = fun!S(123); writeln(s.x); } So I suppose the

Re: "Programming in D" paper book is available for purchase

2015-09-07 Thread Paolo Invernizzi via Digitalmars-d-announce
On Wednesday, 19 August 2015 at 00:57:32 UTC, Ali Çehreli wrote: Enjoy, and go buy some books! ;) My printed copy is just arrived... very good job Ali! Paolo

  1   2   >