Re: Complexity nomenclature

2015-12-03 Thread Jack Stouffer via Digitalmars-d
On Friday, 4 December 2015 at 02:21:12 UTC, Andrei Alexandrescu wrote: On 12/03/2015 09:10 PM, Idan Arye wrote: The complexities of the operations is a property of the data structure being used. If each collection type will have it's own set of method names based on the complexity of

Re: https everywhere update - dlang.org gets an "A" now!

2015-12-03 Thread Jacob Carlborg via Digitalmars-d-announce
On 2015-12-04 02:38, Brad Anderson wrote: It's unfortunate it didn't come a bit sooner because now the NSA knows I read the entire DUB JSON thread, much to my shame. You can expect a bill for "Wasting Time" in the mail anytime soon now :) -- /Jacob Carlborg

Re: Pseudo namespaces

2015-12-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-03 23:54, Andrei Alexandrescu wrote: Nothing. But one thing I was keeping an eye for would be to allow lst.stable.linear.xxx and lst.linear.stable.xxx with one body. -- Andrei How do you plan to differentiate the functionality? -- /Jacob Carlborg

Re: Pseudo namespaces

2015-12-03 Thread Minas Mina via Digitalmars-d
On Thursday, 3 December 2015 at 22:54:53 UTC, Andrei Alexandrescu wrote: Nothing. But one thing I was keeping an eye for would be to allow lst.stable.linear.xxx and lst.linear.stable.xxx with one body. -- Andrei Please don't. Choose one to be the outer and one to be the inner. Otherwise

Re: Pseudo namespaces

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 09:59 PM, Steven Schveighoffer wrote: FWIW, I don't believe this complexity of API is worth it. It's essential. -- Andrei

Re: Reset all Members of a Aggregate Instance

2015-12-03 Thread Tofu Ninja via Digitalmars-d-learn
On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote: ... I think reflection will be a bad choice for this because of private members and what not. I think the correct way is: void reset(C)(ref C c) { static if(is(C == class)) { auto init =

Re: Reset all Members of a Aggregate Instance

2015-12-03 Thread Tofu Ninja via Digitalmars-d-learn
On Friday, 4 December 2015 at 04:08:33 UTC, Tofu Ninja wrote: On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote: ... I think reflection will be a bad choice for this because of private members and what not. I think the correct way is: void reset(C)(ref C c) { static

[Issue 15405] New: FormatSpec.writeUpToNextSpec() not documented

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15405 Issue ID: 15405 Summary: FormatSpec.writeUpToNextSpec() not documented Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor

Re: OT: Swift is now open source

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 9:59 PM, tcak wrote: On Thursday, 3 December 2015 at 20:37:04 UTC, Steven Schveighoffer wrote: On 12/3/15 3:16 PM, Meta wrote: On Thursday, 3 December 2015 at 19:10:04 UTC, Steven Schveighoffer wrote: And the lack of semi-colons has poisoned me from writing syntactically valid

Re: Complexity nomenclature

2015-12-03 Thread Idan Arye via Digitalmars-d
On Friday, 4 December 2015 at 01:27:42 UTC, Andrei Alexandrescu wrote: I know names are something we're awfully good at discussing :o). Destroy! Andrei I find it ironic that this thread has moved to discuss how to name complexity/running-time...

Re: OT: Swift is now open source

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 10:22 PM, rsw0x wrote: On Friday, 4 December 2015 at 03:18:02 UTC, Steven Schveighoffer wrote: On 12/3/15 9:59 PM, tcak wrote: [...] It is meant to be a replacement for Objective C. I'd put it more at the C level, but there are something that are very UNLIKE C. For example, they

Re: Complexity nomenclature

2015-12-03 Thread Tofu Ninja via Digitalmars-d
On Friday, 4 December 2015 at 03:37:10 UTC, Andrei Alexandrescu wrote: On 12/3/15 10:29 PM, Jack Stouffer wrote: On Friday, 4 December 2015 at 02:21:12 UTC, Andrei Alexandrescu wrote: On 12/03/2015 09:10 PM, Idan Arye wrote: The complexities of the operations is a property of the data

Re: Pseudo namespaces

2015-12-03 Thread Walter Bright via Digitalmars-d
On 12/3/2015 1:05 PM, FreeSlave wrote: When talking about namespaces in the C++ sense, the feature of namespace is that it can be scattered among many files and can be 'using'. I call that a bug, not a feature, since one loses all control over overloading of names and encapsulation. If

Re: Pseudo namespaces

2015-12-03 Thread Walter Bright via Digitalmars-d
On 12/3/2015 1:29 PM, Andrei Alexandrescu wrote: FWIW I wanted to use it to allow lst.linear.stable.insert() and lst.stable.linear.insert() to refer to the same function, but this is not working. Qualifies as a bug? I don't want this to become a D idiom. It's too clever, too confusing, too

Re: Palindromes

2015-12-03 Thread Meta via Digitalmars-d-learn
On Friday, 4 December 2015 at 01:10:41 UTC, Jim Barnett wrote: Really? If it leads to "hard to detect errors", I have a hard time believing that can be "idiomatic D". It's used throughout the standard library, granted I don't think there's any occurrences of importing inside a while loop. The

[Issue 15404] [internal] DotIdExp(TOKdot) and DotExp(TOKdotexp)

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

[Issue 15404] [internal] DotIdExp(TOKdot) and DotExp(TOKdotexp)

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15404 --- 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/c82fa39aae1dbb5960c709fab63aa01150bad684 fix Issue 15404 (1) - Use

Re: Pseudo namespaces

2015-12-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-03 22:02, Dicebot wrote: And for that specific "stable" example - just make it a separate module, problem solved. To make use of module system for symbol resolution one needs to have many small modules, _that_ should become D idiom. I agree. I will just be difficult to convince the

Re: Pseudo namespaces

2015-12-03 Thread Walter Bright via Digitalmars-d
On 12/3/2015 12:59 PM, Dicebot wrote: This isn't any different from namespace struct idiom, is it? I don't like it because it forces the namespace usage even if it isn't needed. If you use mixin templates, you can use or not use the namespace. prefix.

Re: Palindromes

2015-12-03 Thread Jim Barnett via Digitalmars-d-learn
On Friday, 4 December 2015 at 03:33:55 UTC, Meta wrote: I have never seen a language that encourages the user to specify dependencies inside a loop. I am hoping I misunderstood something here. Sorry, I thought you were referring more generally to nested imports. No, imports in a while loop

Re: Complexity nomenclature

2015-12-03 Thread Timon Gehr via Digitalmars-d
On 12/04/2015 03:36 AM, Andrei Alexandrescu wrote: On 12/03/2015 09:27 PM, Timon Gehr wrote: On 12/04/2015 03:19 AM, Andrei Alexandrescu wrote: On 12/03/2015 08:55 PM, Timon Gehr wrote: I don't really understand what calling it 'complexity' actually buys though. Instant understanding by

Re: Complexity nomenclature

2015-12-03 Thread Walter Bright via Digitalmars-d
On 12/3/2015 5:27 PM, Andrei Alexandrescu wrote: Now this primitive may have three complexities: * linear in the length of r (e.g. c is a singly-linked list) * linear in the number of elements after r in the collection (e.g. c is an array) * constant (c is a doubly-linked list) These

Re: OT: Swift is now open source

2015-12-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-04 04:18, Steven Schveighoffer wrote: In D-speak, it looks like this: enum Foo { Bar, Baz } Foo foo; switch(foo) { case .Bar: // Foo is implied case .Baz: } void fun(Foo); fun(.Bar); // Foo is implied I don't think we could have this exact syntax, though. I

Re: OT: Swift is now open source

2015-12-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-03 20:10, Steven Schveighoffer wrote: The truth is, swift is orders of magnitude better than Objective C. I have gotten used to the nullable API, though it sometimes seems more clunky than useful. I find it very clunky as well. Sometimes it's too strict. I was a bit surprised

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 December 2015 at 01:31:05 UTC, rsw0x wrote: On Wednesday, 2 December 2015 at 19:54:26 UTC, Vladimir Panteleev wrote: On Wednesday, 2 December 2015 at 19:39:47 UTC, Andrei Alexandrescu wrote: Once done, this is a fantastic example of (a) the power of generative programming, and

Re: Strange behaviour of to!string and JSON

2015-12-03 Thread Sönke Ludwig via Digitalmars-d
Am 03.12.2015 um 09:46 schrieb Suliman: void login(HTTPServerRequest req, HTTPServerResponse res) { Json request = req.json; writeln(to!string(request["username"])); writeln(request["username"].to!string); } Why first code print output with quotes, and second not? "asd" asd The first

Re: Strange behaviour of to!string and JSON

2015-12-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 December 2015 at 10:17:17 UTC, Sönke Ludwig wrote: But isn't there a way to customize std.conv.to!T for T other than string? I believe you do that by implementing opCast?

improving scope(finally/success)

2015-12-03 Thread Tomer Filiba via Digitalmars-d
it'd be really helpful if scope() statements got hold of the return value or exception, e.g., scope(success, retval) { writeln("the retval is", retval) } scope(failure, ex) { if(typeid(ex) == typeid(MyException)) { callTheCops(); } } it would make logging very easy, and

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Marc Schütz via Digitalmars-d
On Wednesday, 2 December 2015 at 23:38:33 UTC, deadalnix wrote: On Wednesday, 2 December 2015 at 23:04:16 UTC, ZombineDev wrote: On Wednesday, 2 December 2015 at 19:39:47 UTC, Andrei Alexandrescu wrote: Once done, this is a fantastic example of (a) the power of generative programming, and (b)

How to check session before access to static page?

2015-12-03 Thread Suliman via Digitalmars-d-learn
void main() { auto router = new URLRouter; router.get("/", serveStaticFiles("D:\\code\\onlineTest\\index.html")); router.get("/admin", serveStaticFiles("D:\\code\\onlineTest\\admin.html")); router.any("/foo", ); auto settings = new HTTPServerSettings; settings.port =

Re: Strange behaviour of to!string and JSON

2015-12-03 Thread wobbles via Digitalmars-d
On Thursday, 3 December 2015 at 08:46:44 UTC, Suliman wrote: void login(HTTPServerRequest req, HTTPServerResponse res) { Json request = req.json; writeln(to!string(request["username"])); writeln(request["username"].to!string); } Why first code print output with quotes, and second not? "asd"

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 December 2015 at 00:31:46 UTC, Andrei Alexandrescu wrote: Nice. What I'd say is that at the end of the day there's documentation. -- Andrei Just to provide a bit of perspective... Although memory corruption may not seem so scary in short-lived programs where it can be

Re: utils.toBulkString is not accesible from utils

2015-12-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, December 02, 2015 06:33:32 Andre via Digitalmars-d-learn wrote: > Hi, > > for following coding there is an error during compilation: > >module utils; > >package string toBulkString(string s) >{ > import std.string: format; > return "$%s\r\n%s\r\n".format(s.length,

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/2/15 6:51 PM, Andrei Alexandrescu wrote: On 12/02/2015 06:04 PM, ZombineDev wrote: On Wednesday, 2 December 2015 at 19:39:47 UTC, Andrei Alexandrescu wrote: Once done, this is a fantastic example of (a) the power of generative programming, and (b) the advantages of using library

[Issue 10544] writeln!(inout(int)) does not work

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10544 gerleim changed: What|Removed |Added Status|NEW |RESOLVED

Re: "Getting involved" on dlang.org?

2015-12-03 Thread Chris via Digitalmars-d
On Wednesday, 2 December 2015 at 21:46:39 UTC, Andrei Alexandrescu wrote: There is awareness. Good documentation is something we know we need and is an ideal to live into. Problem is prioritizing. I must be spending cumulatively a couple of hours everyday just deciding what to work on next.

Strange behaviour of to!string and JSON

2015-12-03 Thread Suliman via Digitalmars-d
void login(HTTPServerRequest req, HTTPServerResponse res) { Json request = req.json; writeln(to!string(request["username"])); writeln(request["username"].to!string); } Why first code print output with quotes, and second not? "asd" asd

Re: I hate new DUB config format

2015-12-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 3 December 2015 at 01:40:12 UTC, Matt Soucy wrote: Interestingly, bazel has D mentioned in its docs: http://bazel.io/docs/be/d.html Hah, yes! And Dub too, but they link to the json page...

[Issue 15394] [internal] CompileExp and FileExp has same op TOKmixin

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

[Issue 15394] [internal] CompileExp and FileExp has same op TOKmixin

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15394 --- 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/6d99a0312ae62fafcbcd63b89a3df5819a16beeb fix Issue 15394 -

Re: OT: Swift is now open source

2015-12-03 Thread rsw0x via Digitalmars-d
On Friday, 4 December 2015 at 03:18:02 UTC, Steven Schveighoffer wrote: On 12/3/15 9:59 PM, tcak wrote: [...] It is meant to be a replacement for Objective C. I'd put it more at the C level, but there are something that are very UNLIKE C. For example, they do not have any direct instance

Re: Complexity nomenclature

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/3/15 10:29 PM, Jack Stouffer wrote: On Friday, 4 December 2015 at 02:21:12 UTC, Andrei Alexandrescu wrote: On 12/03/2015 09:10 PM, Idan Arye wrote: The complexities of the operations is a property of the data structure being used. If each collection type will have it's own set of method

Re: Pseudo namespaces

2015-12-03 Thread Walter Bright via Digitalmars-d
On 12/3/2015 2:54 PM, Andrei Alexandrescu wrote: But one thing I was keeping an eye for would be to allow lst.stable.linear.xxx and lst.linear.stable.xxx with one body. -- Andrei lst.xxx!(stable, linear)

Re: Complexity nomenclature

2015-12-03 Thread Minas Mina via Digitalmars-d
On Friday, 4 December 2015 at 03:46:39 UTC, Walter Bright wrote: On 12/3/2015 5:27 PM, Andrei Alexandrescu wrote: Now this primitive may have three complexities: * linear in the length of r (e.g. c is a singly-linked list) * linear in the number of elements after r in the collection (e.g. c

[Issue 13443] stdin/stdout/stderr should be accessible from @safe code

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13443 Infiltrator changed: What|Removed |Added CC|

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 06:13 AM, Vladimir Panteleev wrote: You said that "at the end of the day there's documentation". I would argue that at least in this case, it may not be enough. Consider, for example, a hypothetical user type "Pack", which takes a tuple/struct and automatically arranges the fields

[Issue 13443] stdin/stdout/stderr should be accessible from @safe code

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13443 --- Comment #2 from Vladimir Panteleev --- Not sure, but one thing to keep in mind is that C I/O is already implicitly synchronized (see e.g. LockingTextReader/Writer). --

Re: Forum structure

2015-12-03 Thread Chris via Digitalmars-d
On Thursday, 3 December 2015 at 14:41:55 UTC, Ola Fosheim Grøstad wrote: On Thursday, 3 December 2015 at 13:20:43 UTC, Steven Schveighoffer wrote: I see no problem with asking dub questions (or DWT or GDC or LDC questions) on this forum or d.learn. Sönke will see messages here as well. I

Re: Forum structure

2015-12-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 3 December 2015 at 13:20:43 UTC, Steven Schveighoffer wrote: I see no problem with asking dub questions (or DWT or GDC or LDC questions) on this forum or d.learn. Sönke will see messages here as well. I think it's more that having a dedicated forum lowers the threshold for

Re: improving scope(finally/success)

2015-12-03 Thread Idan Arye via Digitalmars-d
On Thursday, 3 December 2015 at 11:41:29 UTC, Tomer Filiba wrote: it'd be really helpful if scope() statements got hold of the return value or exception, e.g., scope(success, retval) { writeln("the retval is", retval) } scope(failure, ex) { if(typeid(ex) == typeid(MyException)) {

__traits and string mixins

2015-12-03 Thread Christian Köstlin via Digitalmars-d-learn
Hi, I started an experiment with the informations that are available for compile time reflection. What I wanted to create is a thor like cli parser library, that forces you to encapsulate your programs into subclasses of Dli. The commands and options, that are understood by the generated cli

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Marc Schütz via Digitalmars-d
On Thursday, 3 December 2015 at 13:02:24 UTC, Steven Schveighoffer wrote: First I will say, there is confusion on what is valid and what is not. Misaligned pointers are pointers that are stored misaligned. In other words, they are stored not on a 4-byte or 8-byte boundary for 32 bits or 64

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 07:45 AM, Steven Schveighoffer wrote: On 12/2/15 6:51 PM, Andrei Alexandrescu wrote: On 12/02/2015 06:04 PM, ZombineDev wrote: On Wednesday, 2 December 2015 at 19:39:47 UTC, Andrei Alexandrescu wrote: Once done, this is a fantastic example of (a) the power of generative

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 7:20 AM, Marc Schütz wrote: On Wednesday, 2 December 2015 at 23:38:33 UTC, deadalnix wrote: On Wednesday, 2 December 2015 at 23:04:16 UTC, ZombineDev wrote: On Wednesday, 2 December 2015 at 19:39:47 UTC, Andrei Alexandrescu wrote: Once done, this is a fantastic example of (a) the

[Issue 9717] `std.math.round` rounds away from zero instead of to the nearest even integer

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9717 --- Comment #6 from Infiltrator --- https://github.com/D-Programming-Language/phobos/pull/3849 --

Re: Forum structure

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/2/15 5:03 AM, Chris wrote: On Tuesday, 1 December 2015 at 14:45:04 UTC, Steven Schveighoffer wrote: On 12/1/15 5:31 AM, Luis wrote: Being DUB very important for D language... why there isn't an entry for DUB on ecosystem ? Also, looks that DWT isn't very active. Not should be a "GUI"

Re: improving scope(finally/success)

2015-12-03 Thread Marc Schütz via Digitalmars-d
On Thursday, 3 December 2015 at 13:07:53 UTC, Idan Arye wrote: On Thursday, 3 December 2015 at 11:41:29 UTC, Tomer Filiba wrote: int f() { scope(exit) writeln("bye"); return 5; } is rewritten as something like int f() { try { auto tmp = 5; } finally {

Re: Formal Review of std.range.ndslice

2015-12-03 Thread Ilya Yaroshenko via Digitalmars-d
On Thursday, 3 December 2015 at 15:07:55 UTC, Andrei Alexandrescu wrote: On 12/01/2015 11:03 AM, Jack Stouffer wrote: On Sunday, 29 November 2015 at 20:53:43 UTC, Jack Stouffer wrote: On Monday, 16 November 2015 at 22:45:35 UTC, Jack Stouffer wrote: This is the start of the two week formal

Re: Three people out of four dislike SDL

2015-12-03 Thread Luis via Digitalmars-d
On Monday, 30 November 2015 at 22:59:04 UTC, retard wrote: Just voted at http://www.easypolls.net/poll.html?p=565587f4e4b0b3955a59fb67 - 140 votes, 75% are against SDL. That should count for something? Sonke? Last time that I look it, there was a 51% of people saying that like SDlang..

OT: Swift is now open source

2015-12-03 Thread Jack Stouffer via Digitalmars-d
https://github.com/apple/swift

Re: OT: Swift is now open source

2015-12-03 Thread Jack Stouffer via Digitalmars-d
On Thursday, 3 December 2015 at 17:13:49 UTC, Jack Stouffer wrote: https://github.com/apple/swift Fun Fact: in the time it took apple to open source this (announcement to now), D has had six open source releases (2.068 - 2.069.2).

[Issue 6921] Request for a 'static final switch' statement

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6921 Tanel Tagaväli changed: What|Removed |Added CC||tane...@hotmail.com --

[Issue 9282] Add std.textmacro module

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9282 Infiltrator changed: What|Removed |Added CC|

Re: Formal Review of std.range.ndslice

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/01/2015 11:03 AM, Jack Stouffer wrote: On Sunday, 29 November 2015 at 20:53:43 UTC, Jack Stouffer wrote: On Monday, 16 November 2015 at 22:45:35 UTC, Jack Stouffer wrote: This is the start of the two week formal review Friendly reminder that the review ends tomorrow. The two week

Re: Forum structure

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 9:41 AM, Ola Fosheim Grøstad wrote: On Thursday, 3 December 2015 at 13:20:43 UTC, Steven Schveighoffer wrote: I see no problem with asking dub questions (or DWT or GDC or LDC questions) on this forum or d.learn. Sönke will see messages here as well. I think it's more that having a

Re: Formal Review of std.range.ndslice

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 10:07 AM, Andrei Alexandrescu wrote: * The code should use "private" appropriately. And "package" etc. -- Andrei

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 8:02 AM, Steven Schveighoffer wrote: An interior pointer is a pointer that is *properly aligned* but does not point at the first byte of a piece of memory. taggedPointer and taggedClassRef create *interior pointers*, not *misaligned pointers*. Andrei's proposal will create *misaligned

Re: Forum structure

2015-12-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 3 December 2015 at 15:12:37 UTC, Steven Schveighoffer wrote: It has a link on the front page: "DUB - The D package registry" I don't think it can be more official than that. I didn't think of it as "official" until the recent debate. YMMV. The look and feel is completely

Another fun one: partialSort with two ranges

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
This should be pretty cool: https://issues.dlang.org/show_bug.cgi?id=15401 Andrei

Re: improving scope(finally/success)

2015-12-03 Thread Chris Wright via Digitalmars-d
You can already do it with a slight change, and it's not so painful, at least in simple functions: int foo(bool b) { auto result = 2; scope(exit) writeln(result); if (b) { result = 1; } return result; }

[Issue 13429] icmp (and friends) should be @nogc

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13429 ag0ae...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED CC|

Re: Forum structure

2015-12-03 Thread Bubbasaur via Digitalmars-d
On Tuesday, 1 December 2015 at 10:31:55 UTC, Luis wrote: Being DUB very important for D language... why there isn't an entry for DUB on ecosystem ? Also, looks that DWT isn't very active. Not should be a "GUI" entry to talk about GtkD, TkD and other GUI toolkits, instead focusing on one that

[Issue 13429] icmp (and friends) should be @nogc

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=13429 Infiltrator changed: What|Removed |Added Status|NEW |RESOLVED

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 9:28 AM, Andrei Alexandrescu wrote: On 12/03/2015 07:45 AM, Steven Schveighoffer wrote: taggedPointer and taggedClassRef are GC safe (despite the incorrect warning listed in the docs). Your proposed mechanism is not. It can be restricted to support what tagged* do. This is a

Re: Struct initializers as expressions

2015-12-03 Thread Chris Wright via Digitalmars-d-learn
On Thu, 03 Dec 2015 06:38:20 +, Mike Parker wrote: > AFAIK, your only option is to use a struct constructor. This is the sort > of thing they're used for. Which brings be back to positional arguments, which means that someone wishing to supply a limit on the number of query results must

Re: Another fun one: partialSort with two ranges

2015-12-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 December 2015 at 15:18:16 UTC, Andrei Alexandrescu wrote: This should be pretty cool: https://issues.dlang.org/show_bug.cgi?id=15401 Andrei Does chain not provide random access, thus allowing sorting a chain of two ranges?

Re: Dub use

2015-12-03 Thread Jacob Carlborg via Digitalmars-d
On 2015-12-02 21:26, Marc Schütz wrote: IMO it really should be auto-generated only, and fully determine the exact combination of package versions, so that it can be checked into SCM and be used to reproduce the same package state later on on a different machine. But currently that's not the

Re: Neat project: add pointer capability to std.bitmanip.bitfields

2015-12-03 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 3 December 2015 at 14:24:52 UTC, Andrei Alexandrescu wrote: On 12/03/2015 06:13 AM, Vladimir Panteleev wrote: You said that "at the end of the day there's documentation". I would argue that at least in this case, it may not be enough. Consider, for example, a hypothetical user

[Issue 15401] New: partialSort should accept two ranges

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15401 Issue ID: 15401 Summary: partialSort should accept two ranges Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: improving scope(finally/success)

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 10:24 AM, Chris Wright wrote: You can already do it with a slight change, and it's not so painful, at least in simple functions: int foo(bool b) { auto result = 2; scope(exit) writeln(result); if (b) { result = 1; } return result; } auto ref logCall(alias f,

Re: Another fun one: partialSort with two ranges

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 12:59 PM, Timon Gehr wrote: On 12/03/2015 05:09 PM, Vladimir Panteleev wrote: On Thursday, 3 December 2015 at 15:18:16 UTC, Andrei Alexandrescu wrote: This should be pretty cool: https://issues.dlang.org/show_bug.cgi?id=15401 Andrei Does chain not provide random access, thus

Re: Formal Review of std.range.ndslice

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 11:50 AM, Ilya Yaroshenko wrote: No functions change data in `ndslice` package. Then probably "-ed" is appropriate. -- Andrei

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Jakob Jenkov via Digitalmars-d
Great to hear! Looking forward to learning more about how this all works!

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Ali Çehreli via Digitalmars-d
On 12/03/2015 10:36 AM, Jakob Jenkov wrote: > Either the speed of the software didn't matter, and thus the garbage > collector didn't matter either. > > Or, the speed of the software mattered, and the garbage collector was > never good enough, so you end up designing your software to avoid the >

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 3 December 2015 at 19:03:35 UTC, Nerve wrote: changes, and no insights into how to improve such a system. But I do see why they went that route. Type safety is a top concern. Did you mean memory safety? Neither C++ or D offer much help if you want strong nominal typing. Which is

http://dlang.org/bugstats.php is back

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
It's been out for a while, thanks Vladimir for fixing it! An easy access point to see where bugs numbers are and see them by category: http://dlang.org/bugstats.php Andrei

Re: OT: Swift is now open source

2015-12-03 Thread Steven Schveighoffer via Digitalmars-d
On 12/3/15 12:56 PM, tcak wrote: On Thursday, 3 December 2015 at 17:13:49 UTC, Jack Stouffer wrote: https://github.com/apple/swift Everytime I get excited about another programming language, I notice that it lacks some nice features of D, and I become sad suddenly. Even on C#, there is

Re: Thoughts on a Future Garbage Collector

2015-12-03 Thread Jakob Ovrum via Digitalmars-d
On Thursday, 3 December 2015 at 19:03:35 UTC, Nerve wrote: I wonder what Walter and Andrei think of potentially overhauling those elements in D. Right now all of the manual memory management is basically ripped from C and C++ with no changes, and no insights into how to improve such a system.

Re: Another fun one: partialSort with two ranges

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 02:09 PM, Andrei Alexandrescu wrote: Yah, please convert to pull request. Using two ranges is just beautiful. Thanks! -- Andrei I should add that the use of chain is liable to be quite a bit less efficient - it's one of those "hamburger into cow" cases. The right way to go

[Issue 15304] [REG 2.068.0] Error about SortedRange not being nothrow in debug mode

2015-12-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15304 Jack Stouffer changed: What|Removed |Added CC||j...@jackstouffer.com

Re: Reset all Members of a Aggregate Instance

2015-12-03 Thread Sebastiaan Koppe via Digitalmars-d-learn
On Thursday, 3 December 2015 at 21:13:59 UTC, Nordlöw wrote: Need to assert that not a function and mutability (std.traits.isMutable) Yeah you need to do that.

Re: Reset all Members of a Aggregate Instance

2015-12-03 Thread Jakob Ovrum via Digitalmars-d-learn
On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote: Given class C { // lots of members } and a function f(C c) { } is there a generic way, perhaps through reflection, to reset (inside f) all members of `c` to their default values? Something along

Re: Pseudo namespaces

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 04:05 PM, FreeSlave wrote: I don't understand how it is namespace (it's just named scope for me) and why do we need template for that? Probably struct with static members would work the same without need for instantiating the template. How would one use a struct for the List

Re: Reset all Members of a Aggregate Instance

2015-12-03 Thread Nordlöw via Digitalmars-d-learn
On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote: Something along foreach(ref member; __traits(allMembers, c)) { member = typeof(member).init; } This works for me: void resetAllMembers(T)(T c) if (is(T == class)) { foreach (ref m; c.tupleof) {

Re: Palindromes

2015-12-03 Thread Justin Whear via Digitalmars-d-learn
On Thu, 03 Dec 2015 21:40:05 +, Jim Barnett wrote: > TL;DR I couldn't figure out how to write `isPalindrome` in terms of > std.algorithm.mutation.reverse > > I recognize it's more efficient in terms of CPU time and memory than my > C++ solution, but I suspect there is a shorter expression to

Re: Pseudo namespaces

2015-12-03 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 3 December 2015 at 21:29:51 UTC, Andrei Alexandrescu wrote: On 12/03/2015 04:05 PM, FreeSlave wrote: I don't understand how it is namespace (it's just named scope for me) and why do we need template for that? Probably struct with static members would work the same without need for

Re: Pseudo namespaces

2015-12-03 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 3 December 2015 at 21:46:03 UTC, Chris Wright wrote: So maybe explicit namespaces within a module are justified sometimes. I definitely think that there are times when it's justified, but I also think that they should be used sparingly. I think that the only time that I've used

Re: An interesting data structure with search time O(sqrt n)

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/02/2015 06:26 AM, Timon Gehr wrote: Assume the initial array is sorted from largest to smallest. This will be the worst case for this construction algorithm, as each element will be sifted all the way down to leaf level of the last heap. [...] Ω(n^(3/2)). Thanks. My math-fu is not good

Re: Pseudo namespaces

2015-12-03 Thread Andrei Alexandrescu via Digitalmars-d
On 12/03/2015 05:46 PM, Steven Schveighoffer wrote: On 12/3/15 3:51 PM, Andrei Alexandrescu wrote: I vaguely remembered I saw something like this a while ago: http://dpaste.dzfl.pl/f11894a098c6 The trick could be more fluent, but it might have merit. Has anyone explored it? Is it a viable

Re: Pseudo namespaces

2015-12-03 Thread deadalnix via Digitalmars-d
On Thursday, 3 December 2015 at 20:59:59 UTC, Dicebot wrote: This isn't any different from namespace struct idiom, is it? I don't like it because it forces the namespace usage even if it isn't needed. There is something wrong with the module system if one needs to resort to idioms like this.

  1   2   3   >