Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread Bahman Movaqar via Digitalmars-d-learn
On 09/12/2015 12:52 PM, NX wrote: > What if I told you, you should search the official reference before > asking such things in the forum? I did search the net for terms such as "d lang back quoted string" or "d lang multi line string" or "d lang string interpolation" before asking here. However

Re: Adjacent Pairs Range

2015-09-12 Thread Nordlöw
On Saturday, 12 September 2015 at 10:35:41 UTC, Bahman Movaqar wrote: On 09/12/2015 02:47 PM, "Nordlöw" wrote: How do I most elegantly iterate all the adjacent pairs in an `InputRange` using Phobos? Something like [1,2,3,4] => [(1,2), (2,3), (3,4)] That's call `collate`ing IIRC. A

Re: Adjacent Pairs Range

2015-09-12 Thread Bahman Movaqar via Digitalmars-d-learn
On 09/12/2015 02:47 PM, "Nordlöw" wrote: > How do I most elegantly iterate all the adjacent pairs in an > `InputRange` using Phobos? > > Something like > > [1,2,3,4] => [(1,2), (2,3), (3,4)] That's call `collate`ing IIRC. A quick solution would be using `std.range.transposed`: auto a =

Re: Calling D from C, C++, Python…

2015-09-12 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2015-09-11 at 21:50 +0200, Jacob Carlborg via Digitalmars-d -learn wrote: > On 2015-09-10 20:01, Russel Winder via Digitalmars-d-learn wrote: > > Is there an easy way of knowing when you do not have to initialize > > the > > D runtime system to call D code from, in this case, Python via a

Re: Calling D from C, C++, Python…

2015-09-12 Thread Jacob Carlborg via Digitalmars-d-learn
On 2015-09-12 10:56, Russel Winder via Digitalmars-d-learn wrote: I have a small D function (C linkage) compiled to a shared object that I am calling from Python via CFFI that works fine with no D runtime initialization. Thus I have experimental evidence "always" is not entirely the case! I

Re: std.experimental.testing formal review

2015-09-12 Thread Atila Neves via Digitalmars-d
On Friday, 11 September 2015 at 15:54:57 UTC, Jacob Carlborg wrote: On 2015-09-11 13:27, Atila Neves wrote: Unit tests should run in a fraction of a second... no, there's no such functionality. Why would I not use this for other kinds of tests? I guess you're right. In any case, getting

Re: v0.2.1 of EMSI's containers library

2015-09-12 Thread Nordlöw
On Tuesday, 1 September 2015 at 04:03:48 UTC, Brian Schott wrote: Please report bugs on Github here: https://github.com/economicmodeling/containers/issues Move semantics anyone? https://github.com/economicmodeling/containers/issues/25

Re: Better lambdas!!!!!!!!!!

2015-09-12 Thread Pierre Krafft via Digitalmars-d
On Saturday, 12 September 2015 at 03:32:51 UTC, Prudence wrote: On Saturday, 12 September 2015 at 02:13:11 UTC, Pierre Krafft wrote: On Saturday, 12 September 2015 at 01:03:54 UTC, Prudence wrote: On Thursday, 10 September 2015 at 18:02:36 UTC, Ali Çehreli wrote: On 09/10/2015 10:55 AM,

[Issue 14058] 'make install' option copies everything in std/ and etc/, not just .d and .di files

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14058 --- Comment #2 from Dmitry Olshansky --- (In reply to Joseph Rushton Wakeling from comment #1) > PR submitted: https://github.com/D-Programming-Language/phobos/pull/2918 Unattended by now. Anyone is welcome to redo it. --

Re: Why does reverse also flips my other dynamic array?

2015-09-12 Thread Namal via Digitalmars-d-learn
Why is also b flipped here? This doesn't happen if I use static arrays. nvm. I need to .dup that.

Re: Hello World Example with Glade?

2015-09-12 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2015-09-12 at 06:58 +, Mike McKee via Digitalmars-d-learn wrote: […] > I just tested and you are correct. Now, is there a way that I can > edit /etc/dmd.conf and make it so that I don't need to do this > pkg-config stuff all the time? I think editing /etc/dmd.conf would be the wrong

[Issue 15046] New: [REG2.068] isForwardRange documentation is documenting issue 14544

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15046 Issue ID: 15046 Summary: [REG2.068] isForwardRange documentation is documenting issue 14544 Product: D Version: D2 Hardware: All OS: All Status: NEW

[Issue 15046] [REG2.068] isForwardRange documentation is documenting issue 14544

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15046 Kenji Hara changed: What|Removed |Added Keywords||pull --- Comment #2 from

[Issue 15046] [REG2.068] isForwardRange documentation is documenting issue 14544

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15046 --- Comment #1 from Kenji Hara --- Introduced in: https://github.com/D-Programming-Language/phobos/pull/3276 --

Floating point in the type system

2015-09-12 Thread Robert via Digitalmars-d
Hi all, I came across this example, and wondered what your thoughts on it are: ``` void main(string[] args) { struct Foo(float f) { alias VAL = f; float getF() { return f; } } Foo!(float.nan) f; Foo!(float.nan) f2; // This will fail

Re: Floating point in the type system

2015-09-12 Thread Atila Neves via Digitalmars-d
On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote: Hi all, I came across this example, and wondered what your thoughts on it are: ``` void main(string[] args) { struct Foo(float f) { alias VAL = f; float getF() { return f; } }

Re: A collection of DIPs

2015-09-12 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 12 September 2015 at 06:25:45 UTC, NX wrote: Is there even a compiler switch to disable GC altogether so the program doesn't have a GC thread? No, I can't see it... D programs *never* have a GC thread. The way the D garbage collector works is something like this: void*

Re: version and configuration

2015-09-12 Thread tcak via Digitalmars-d-learn
On Saturday, 12 September 2015 at 14:41:45 UTC, Spacen Jasset wrote: If I say this in one module: version = current version (Current) { version = featurea; version = featureb; version = featurec; } It appears that I can't put this in a module and import it elsewhere to test the

Re: Floating point in the type system

2015-09-12 Thread Robert via Digitalmars-d
On Saturday, 12 September 2015 at 15:49:23 UTC, Atila Neves wrote: On Saturday, 12 September 2015 at 15:13:27 UTC, Robert wrote: Hi all, I came across this example, and wondered what your thoughts on it are: ``` void main(string[] args) { struct Foo(float f) { alias VAL = f;

Re: shared array?

2015-09-12 Thread Prudence via Digitalmars-d-learn
On Saturday, 12 September 2015 at 06:23:12 UTC, Jonathan M Davis wrote: On Friday, September 11, 2015 23:29:05 Laeeth Isharc via Digitalmars-d-learn wrote: On Friday, 11 September 2015 at 21:58:28 UTC, Adam D. Ruppe wrote: > [...] Seems to be quite a lot of FUD wrt use of standard library and

Re: A collection of DIPs

2015-09-12 Thread ZombineDev via Digitalmars-d
On Wednesday, 9 September 2015 at 10:00:10 UTC, Ola Fosheim Grøstad wrote: On Wednesday, 9 September 2015 at 06:13:59 UTC, Dominikus Dittes Scherkl wrote: IMHO "friend" is a misconception, that is only there to compensate for the lack of modules in C++. It can be useful. Say you have a

Re: A collection of DIPs

2015-09-12 Thread via Digitalmars-d
On Saturday, 12 September 2015 at 13:48:14 UTC, ZombineDev wrote: That's what the `package` access modifier is for. Then you would have to be in the same package, and that is rather broad? The advantage of "friend" is that you can pinpoint what might be a source for trouble when debugging,

Re: Operator overloading or alternatives to expression templates

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-12 01:47, Andrei Alexandrescu wrote: There's two canonical ways to do that. 1. Use lambdas, which seem to already do what you want: db.get!Person.filter!(p => p.age > 21 && p.name == "Peter") The way this'd go, the db.get!Person() call returns an input range of Person. Presumably

Re: Operator overloading or alternatives to expression templates

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-11 21:40, Martin Nowak wrote: I find the reasons for turining down my ER a bit moot. [Issue 14593 – operator overloading can't be used with expression templates](https://issues.dlang.org/show_bug.cgi?id=14593) AFAIK expression templates are the primary choice tom implement SIMD and

Re: Operator overloading or alternatives to expression templates

2015-09-12 Thread via Digitalmars-d
On Friday, 11 September 2015 at 19:41:41 UTC, Martin Nowak wrote: Does anyone have a different idea how to make a nice query language? db.get!Person.where!(p => p.age > 21 && p.name == "Peter") Do it at runtime?

Re: module std.stream is deprecated - Will be removed by phobos version 2.070

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-12 01:06, Jonathan M Davis wrote: Walter and Andrei publicly agreed at dconf that it should be removed. As I understand it, it was removed from the documentation with 2.068 (but not yet deprecated), and now it's been deprecated. Now, that being said, I think 2.070 is too soon to

[Issue 14433] std.encoding does not support Central European ISO-8859-2 and CP1250 encodings

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

[Issue 14433] std.encoding does not support Central European ISO-8859-2 and CP1250 encodings

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

Re: module std.stream is deprecated - Will be removed by phobos version 2.070

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-12 03:23, Jonathan M Davis wrote: Though, now that I think about it, we should probably also put it in undead now. I think it can be put in undead as soon as something is deprecated or to-be-deprecated in the documentation. -- /Jacob Carlborg

Re: Build It And They Will Not Come

2015-09-12 Thread Nick Sabalausky via Digitalmars-d-announce
On 09/11/2015 01:59 PM, Bill Baxter via Digitalmars-d-announce wrote: To be fair, wasn't the movie talking about dead baseball player ghosts coming? For people to take that example and apply it to other endeavors in life is a bit ridiculous. That's pretty similar to how I felt about Doom3:

Re: Mixin templates accessing mixed out scope

2015-09-12 Thread Ali Çehreli via Digitalmars-d-learn
On 09/12/2015 06:37 AM, Prudence wrote: Says the creating new SingleStore is not an expression Reduced: mixin template ObjectStore(TKey) { class SingleStore { static void New()// Removing 'static' compiles { new SingleStore(); } } } class

[Issue 12210] dlang.org home page example - Run button does not work

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12210 Vladimir Panteleev changed: What|Removed |Added Assignee|nazriel6...@gmail.com

version and configuration

2015-09-12 Thread Spacen Jasset via Digitalmars-d-learn
If I say this in one module: version = current version (Current) { version = featurea; version = featureb; version = featurec; } It appears that I can't put this in a module and import it elsewhere to test the version specifications as they are all in their own namespaces. Is this

Re: Better lambdas!!!!!!!!!!

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-10 20:23, Jonathan M Davis wrote: That's one of the main reasons that I hate the idea of named arguments. In Ruby named arguments need to be explicitly requested when declaring a method: def bar(a) a == { a: 3 } # A hash (associative array) end def foo(a:) a == 3 end

Re: std.experimental.testing formal review

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-12 11:52, Atila Neves wrote: I guess you're right. In any case, getting what's in there to get accepted is work enough as it is. Yes, absolutely. I wasn't arguing for the feature, just the reason not to add it :) -- /Jacob Carlborg

Re: Better lambdas!!!!!!!!!!

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-10 23:03, Meta wrote: You could, but then doesn't that defeat the point a bit? No, I don't think it does. For example in Scala you can do like this: foo(_ < _) Which would be the same as: foo((a, b) a < b) But if you want to use the same parameter more than once then you cannot

Re: std.experimental.testing formal review

2015-09-12 Thread Jacob Carlborg via Digitalmars-d
On 2015-09-12 15:34, Dicebot wrote: I also don't like mixing unittest and higher level functional tests (with setup and cleanup phases) into the same buckets - this doesn't fit nice with D module system. Latter should be placed in a separate modules/package to avoid being picked up by rdmd & Co

Re: std.experimental.testing formal review

2015-09-12 Thread Dicebot via Digitalmars-d
On Saturday, 12 September 2015 at 14:50:32 UTC, Jacob Carlborg wrote: Not sure I understand the problem. Does this prevent one from writing functional tests in a completely separate directory? Nope but the fact that they are treated the same (no separate category, no output separation, no

Re: Better lambdas!!!!!!!!!!

2015-09-12 Thread via Digitalmars-d
On Saturday, 12 September 2015 at 14:40:05 UTC, Jacob Carlborg wrote: Not supplying the name of the parameter in the call to "foo" would result in an error. Python has similar semantics. Very useful to force explicitness when you have complex changing APIs that have many parameters of the

Re: Adjacent Pairs Range

2015-09-12 Thread Bahman Movaqar via Digitalmars-d-learn
On 09/12/2015 04:04 PM, Bahman Movaqar wrote: > Oops! Here's one using only `InputRange` interface: I believe I need to warn you that I'm just learning D; so take my solution at your own risk :-) -- Bahman Movaqar

Re: Reasons to use D

2015-09-12 Thread Sebastiaan Koppe via Digitalmars-d
On Saturday, 12 September 2015 at 04:05:44 UTC, Adam D. Ruppe wrote: On Saturday, 12 September 2015 at 03:52:11 UTC, skoppe wrote: That is not the only way it behaves differently. jQuery's html() will actually execute inline script, whereas innerHTML won't. I'm pretty sure it is the other

[Issue 15047] New: "used before set" error with void initialization (only with -O)

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15047 Issue ID: 15047 Summary: "used before set" error with void initialization (only with -O) Product: D Version: D2 Hardware: x86_64 OS: Linux Status:

Re: reading file byLine

2015-09-12 Thread Namal via Digitalmars-d-learn
On Monday, 7 September 2015 at 10:28:20 UTC, deed wrote: On Monday, 7 September 2015 at 10:25:09 UTC, deed wrote: writeln(x);// or you can pass it to a function. I meant `writeln(x + 5)` If I have just red your post before I started using reverse on dynamic arrays... Anyway, there is

Re: A collection of DIPs

2015-09-12 Thread Edmund Smith via Digitalmars-d
On Saturday, 12 September 2015 at 06:25:45 UTC, NX wrote: On Friday, 11 September 2015 at 19:30:56 UTC, ponce wrote: Some of us use and need @nogc all the time. The other parts of an application can use the GC: best of both worlds. Is there even a compiler switch to disable GC altogether so

Re: Better lambdas!!!!!!!!!!

2015-09-12 Thread Idan Arye via Digitalmars-d
On Saturday, 12 September 2015 at 10:44:05 UTC, Pierre Krafft wrote: myfunc({return "x:"~x~"y:"-y;}); is infered to mean myfunc((x,y){return "x:"~x~"y:"-y;}); while myfunc({return "y:"~y~"x:"~x;}); is infered to mean myfunc((y,x){return "y:"~y~"x:"~x;}); which is not what I expect since the

Re: std.experimental.testing formal review

2015-09-12 Thread Dicebot via Digitalmars-d
On Wednesday, 9 September 2015 at 15:20:41 UTC, Robert burner Schadek wrote: This post marks the start of the two week review process of std.experimental.testing. PR: https://github.com/D-Programming-Language/phobos/pull/3207 Dub: http://code.dlang.org/packages/unit-threaded Doc: See

Mixin templates accessing mixed out scope

2015-09-12 Thread Prudence via Digitalmars-d-learn
The following code simply does not work, it might be buggy now after fiddling with it but basically remove and the SingleStore.New are not working(Says the creating new SingleStore is not an expression, which makes no sense to me). Essentially I'm creating a mixin template so I can have

Re: Adjacent Pairs Range

2015-09-12 Thread Bahman Movaqar via Digitalmars-d-learn
On 09/12/2015 03:09 PM, "Nordlöw" wrote: > InputRange please, not RandomAccessRanges ;) Oops! Here's one using only `InputRange` interface: T[][] collate(T)(T[] a) { alias CollateResult = Tuple!(T[][], "result", T, "tlHd"); CollateResult _collate(CollateResult collres)

Re: Adjacent Pairs Range

2015-09-12 Thread Nordlöw
On Saturday, 12 September 2015 at 11:34:03 UTC, Bahman Movaqar wrote: On 09/12/2015 03:09 PM, "Nordlöw" wrote: InputRange please, not RandomAccessRanges ;) Oops! Here's one using only `InputRange` interface: I wrote my own as adjacentTuples and adjacentPairs:

Re: Adjacent Pairs Range

2015-09-12 Thread Nordlöw
On Saturday, 12 September 2015 at 11:46:55 UTC, Nordlöw wrote: I wrote my own as adjacentTuples and adjacentPairs: https://github.com/nordlow/justd/blob/master/range_ex.d#L702 Note: No yet extended to N > 2. An alternative naming would be overlappingTuples/Pairs. Should this go into Phobos?

[Issue 15046] [REG2.068] isForwardRange documentation is documenting issue 14544

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

Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 12 September 2015 at 08:22:03 UTC, NX wrote: What if I told you, you should search the official reference before asking such things in the forum? Searching is kinda hard, so I encourage people to ask if something doesn't come up quickly. And then we need to be sure to always

[Issue 15048] New: "tuple" term used wrongly on dlang.org/variadic-function-templates.html

2015-09-12 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15048 Issue ID: 15048 Summary: "tuple" term used wrongly on dlang.org/variadic-function-templates.html Product: D Version: D2 Hardware: All OS: All Status:

<    1   2