[Issue 14552] New: SIGSEGV with compile construction nested class in predicate

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14552 Issue ID: 14552 Summary: SIGSEGV with compile construction nested class in predicate Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Merging one Array with Another

2015-05-07 Thread via Digitalmars-d-learn
On Thursday, 7 May 2015 at 09:21:58 UTC, Per Nordlöw wrote: I was only interested in removing equal consequtive elements within the same range. I looked at UniqResult. What we need is to fix the typesystem with perhaps some traits the figure out which ranges (multi-layered meta-ranges)

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Chris via Digitalmars-d-learn
On Thursday, 7 May 2015 at 09:27:39 UTC, Chris wrote: On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote: You're not setting a port. add: settings.port = 8080; before listenHTTP(); then it'll work. It's do not help :( This should work, put it in your `app.d` file: import vibe.d;

Re: Merging one Array with Another

2015-05-07 Thread via Digitalmars-d-learn
On Wednesday, 6 May 2015 at 16:05:15 UTC, Andrea Fontana wrote: Maybe a way like this could be useful: http://dpaste.dzfl.pl/7b4b37b490a7 If r is a SortedRange this is very unneccesary wasteful because of the use AA. In that case you, instead, only want to remove equal consequtive elements

[Issue 14538] ICE(cast.c, typeMerge) - Assertion failed: (t1-ty == t2-ty)

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14538 --- Comment #1 from Iain Buclaw ibuc...@gdcproject.org --- https://github.com/D-Programming-Language/dmd/pull/4636 --

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Suliman via Digitalmars-d-learn
Is next example is enough to serv simple index.html page? void setupServer() { auto router = new URLRouter; // add other routes here router.get(*, serveStaticFiles(public/)); auto settings = new HTTPServerSettings; listenHTTP(settings, router); } After

Re: Merging one Array with Another

2015-05-07 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 7 May 2015 at 06:53:39 UTC, Per Nordlöw wrote: On Wednesday, 6 May 2015 at 16:05:15 UTC, Andrea Fontana wrote: Maybe a way like this could be useful: http://dpaste.dzfl.pl/7b4b37b490a7 If r is a SortedRange this is very unneccesary wasteful because of the use AA. In that case

[Issue 14534] Front-end should lower all non-scalar condition expressions

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14534 --- Comment #5 from Iain Buclaw ibuc...@gdcproject.org --- Attempt: https://github.com/D-Programming-Language/dmd/pull/4630 --

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Suliman via Digitalmars-d-learn
You're not setting a port. add: settings.port = 8080; before listenHTTP(); then it'll work. It's do not help :(

Re: Merging one Array with Another

2015-05-07 Thread via Digitalmars-d-learn
On Thursday, 7 May 2015 at 08:03:41 UTC, Andrea Fontana wrote: It's not that difficult to implement. You just need to implement a merge() range that returns the min of all ranges' front(). Then you can define distinct() for SortedRange as: merge(sortedrange1, sortedrange2, sortedrange3).uniq

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread wobbles via Digitalmars-d-learn
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote: You're not setting a port. add: settings.port = 8080; before listenHTTP(); then it'll work. It's do not help :( You're sure? My app.d is: import std.stdio; import vibe.d; shared static this(){ auto router = new URLRouter;

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread wobbles via Digitalmars-d-learn
On Thursday, 7 May 2015 at 09:08:53 UTC, wobbles wrote: On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote: You're not setting a port. add: settings.port = 8080; before listenHTTP(); then it'll work. It's do not help :( You're sure? My app.d is: import std.stdio; import vibe.d;

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Chris via Digitalmars-d-learn
On Thursday, 7 May 2015 at 08:25:30 UTC, Suliman wrote: You're not setting a port. add: settings.port = 8080; before listenHTTP(); then it'll work. It's do not help :( This should work, put it in your `app.d` file: import vibe.d; shared static this() { auto settings = new

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread wobbles via Digitalmars-d-learn
On Thursday, 7 May 2015 at 08:09:50 UTC, Suliman wrote: Is next example is enough to serv simple index.html page? void setupServer() { auto router = new URLRouter; // add other routes here router.get(*, serveStaticFiles(public/)); auto settings = new

Re: Good examples of value types

2015-05-07 Thread via Digitalmars-d
On Thursday, 7 May 2015 at 02:09:34 UTC, Freddy wrote: It doesn't matter whether they are by value or by ref but by value usually has performance increases(especially considering you can by a value type by ref in D if you need to). Yep, this is very much true, but on x86 the register size is

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Brian Schott via Digitalmars-d
On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_porcelain.html Andrei *Reads module name* ...toilets? Oh. Wait. This is is allocator stuff. Looks like there's a macro expansion problem in makeArray's

Re: RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

2015-05-07 Thread Dan Olson via Digitalmars-d
Mike n...@none.com writes: I've gotten even further thanks to everyone's help, but LDC is still giving me a little grief. Take a look at these undefined references (abbreviated for this forum): (_D10TypeInfo_l6__vtblZ+0x8): undef ref `_D6object8TypeInfo8toStringMxFNaNbNfZAya' -- snip --

[Issue 14383] documented unittests don't work for module declaration

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14383 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added CC||and...@erdani.com

Re: Clean process exit

2015-05-07 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 7 May 2015 at 16:15:29 UTC, Dmitri wrote: My questions are, * is it legit to want to terminate not from the main thread? * if not, what is the recommended simpler way of doing it? Not the simplest, but I think the best way for an event-driven network application to exit is,

Re: Good examples of value types

2015-05-07 Thread Russel Winder via Digitalmars-d
On Thu, 2015-05-07 at 07:36 -0700, Andrei Alexandrescu via Digitalmars-d wrote: […] Reference types don't compose nicely that way. In a language with valye types, the juxtaposition of two items (value or reference) is a va;ue. In Java, it's a reference (so you need to allocate a new object

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread yawniek via Digitalmars-d-learn
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote: 1. Do I need write ./public/ ? In examples often simply public/ will work too. even public it goes trough Path struct, see: https://github.com/rejectedsoftware/vibe.d/blob/11578aa956a9b3b0e305d655f9668a867fdd89bd/source/vibe/inet/path.d

Re: Breaking changes in Visual C++ 2015

2015-05-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-05-06 20:26, Brad Anderson wrote: https://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.140).aspx I'm sharing this specifically so we can have an unproductive flamewar about whether breaking changes in D are sometimes worth it or if they are holding D back from mass adoption

[Issue 14004] (╯▔︹▔)╯don't use this file https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js, can't access it in china

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14004 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Clean process exit

2015-05-07 Thread Jacob Carlborg via Digitalmars-d
On 2015-05-07 18:15, Dmitri wrote: I'm a D noob, so my question is perhaps naive. At work, we develop servers that are 24/7 and as such they don't have a clean exit path. Sometimes, however, I'd like to troubleshoot a process and use valgrind, in which case I have to come with a way of forcing a

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Ali Çehreli via Digitalmars-d
On 05/07/2015 02:18 AM, Brian Schott wrote: On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_porcelain.html Andrei *Reads module name* ...toilets? Oh. Wait. I thought dishes and tea cups. :) This is is

[Issue 677] [Tracker] Get the documentation cleaned up for 1.0

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=677 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 677] [Tracker] Get the documentation cleaned up for 1.0

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=677 Issue 677 depends on issue 3007, which changed state. Issue 3007 Summary: .stringof is underdocumented https://issues.dlang.org/show_bug.cgi?id=3007 What|Removed |Added

[Issue 3007] .stringof is underdocumented

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3007 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 3108] [meta] Protection

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=3108 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Blocks|677 | --

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Suliman via Digitalmars-d-learn
shared static this() { auto router = new URLRouter; router.get(/, root); auto settings = new HTTPServerSettings; settings.port = 8080; listenHTTP(settings, router); } void root(HTTPServerRequest req, HTTPServerResponse res) { serveStaticFiles(public/); }

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread yawniek via Digitalmars-d-learn
On Thursday, 7 May 2015 at 18:59:13 UTC, Suliman wrote: shared static this() { auto router = new URLRouter; router.get(/, root); auto settings = new HTTPServerSettings; settings.port = 8080; listenHTTP(settings, router); } void root(HTTPServerRequest req,

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 18:04, Jens Bauer via Digitalmars-d digitalmars-d@puremagic.com wrote: I'm sorry for opening such a topic; I've heard it's not liked a lot, but I think it might be necessary. I'm not asking for a 'volatile' keyword, but rather to find out what the right thing to use is.

Bitfield-style enum to strings?

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
Assuming a plain old bitfield-style enum like: enum Foo { optionA = 10; optionB = 11; optionC = 12; optionD = 13; optionE = 14; } Does a function already exist somewhere to take an instance of Foo and get a list of the switch names as strings? Something kinda like: Foo

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 7 May 2015 at 17:57:24 UTC, Andrei Alexandrescu wrote: On 5/6/15 11:00 PM, Vladimir Panteleev wrote: On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_porcelain.html Andrei Now that

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Johannes Pfau via Digitalmars-d
Am Thu, 07 May 2015 16:04:55 + schrieb Jens Bauer doc...@who.no: I'm sorry for opening such a topic; I've heard it's not liked a lot, but I think it might be necessary. I'm not asking for a 'volatile' keyword, but rather to find out what the right thing to use is. After reading a few

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Namespace via Digitalmars-d
Not what I meant. This is your idea: http://forum.dlang.org/post/l4ccb4$25ul$1...@digitalmars.com Oh, my dream could come true... :)

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Andrei Alexandrescu via Digitalmars-d
On 5/7/15 11:06 AM, Vladimir Panteleev wrote: On Thursday, 7 May 2015 at 17:57:24 UTC, Andrei Alexandrescu wrote: On 5/6/15 11:00 PM, Vladimir Panteleev wrote: On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote:

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Andrei Alexandrescu via Digitalmars-d
On 5/7/15 11:13 AM, Ali Çehreli wrote: On 05/07/2015 02:18 AM, Brian Schott wrote: On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_porcelain.html Andrei *Reads module name* ...toilets? Oh. Wait. I

Re: Good examples of value types

2015-05-07 Thread Nikolay via Digitalmars-d
java.lang.String It is big problem in java. You have pointer to String object with fields: hashCode and chars array (UTF-16). But every array is object itself. So it is pointer to object again. There is pointer compression option in x64 JVM (it uses 32 bits per pointer), but in any way it is

Re: Bitfield-style enum to strings?

2015-05-07 Thread Baz via Digitalmars-d-learn
On Thursday, 7 May 2015 at 17:41:10 UTC, Nick Sabalausky wrote: Assuming a plain old bitfield-style enum like: enum Foo { optionA = 10; optionB = 11; optionC = 12; optionD = 13; optionE = 14; } Does a function already exist somewhere to take an instance of Foo and get a

[Issue 12935] Cannot log in to code.lang.org with current accounts on Bugzilla or Wiki

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

Re: Sneak preview into std.allocator's porcelain

2015-05-07 Thread Andrei Alexandrescu via Digitalmars-d
On 5/6/15 11:00 PM, Vladimir Panteleev wrote: On Thursday, 7 May 2015 at 02:28:45 UTC, Andrei Alexandrescu wrote: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_porcelain.html Andrei Now that https://issues.dlang.org/show_bug.cgi?id=8269 was fixed, how about that idea of

[Issue 14538] ICE(cast.c, typeMerge) - Assertion failed: (t1-ty == t2-ty)

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14538 --- 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/c00f4e55cf5ee9c1f7fb5373b811d3a0fe0b4da9 Issue 14538: Fix ICE in

Re: RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

2015-05-07 Thread Johannes Pfau via Digitalmars-d
Am Thu, 07 May 2015 16:29:50 + schrieb Jens Bauer doc...@who.no: {snip} Every port is in its own branch In this case, the files must share the same parent directory, in order to be updated by a merge with master; correct ? IIRC it's not always necessary. Git can detect if you moved

[Issue 14019] Include a Dynamic Content section on the dlang front page

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14019 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Breaking changes in Visual C++ 2015

2015-05-07 Thread Walter Bright via Digitalmars-d
On 5/7/2015 5:16 AM, d user wrote: the truth is, one of the biggest things holding D back from mass adoption is the complete lack of tooling compared to basically every other mainstream language. D has some excellent tools that are generally nonstandard, klunky or nonexistent in other

Re: Baffled by compilation error for formattedRead

2015-05-07 Thread PhilipDaniels via Digitalmars-d-learn
On Thursday, 7 May 2015 at 23:23:08 UTC, Justin Whear wrote: formattedRead takes its input by ref and consumes it. Your first two attempts are both passing the result of functions (dropExactly and opSlice) which are temporary rvalues and can thus not be passed by reference. Here's more

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

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14427 --- Comment #10 from Andrei Alexandrescu and...@erdani.com --- @Cybershadow: before I archive this, you may want to document this as a tool if you want this to become our standard way of changing the website. Otherwise it will be forgotten. --

Re: Baffled by compilation error for formattedRead

2015-05-07 Thread Dennis Ritchie via Digitalmars-d-learn
On Thursday, 7 May 2015 at 23:13:41 UTC, PhilipDaniels wrote: On Thursday, 7 May 2015 at 23:10:26 UTC, PhilipDaniels wrote: Let's try reformatting that... ubyte r, g, b; // does not compile auto numRead = formattedRead(dropExactly(input, 4), %x/%x/%x, r, g, b); // does not compile auto

Re: Making `object.opEquals' replaceable

2015-05-07 Thread Jonathan M Davis via Digitalmars-d
On Thursday, 7 May 2015 at 14:37:14 UTC, Manfred Nowak wrote: According to the specs http://dlang.org/operatoroverloading.html#equals `object.opEquals' denies to call the `opEquals'-function tailored for the class of two objects `a' an `b' if for those objects `a is b' holds. Although this

[Issue 14540] +~30% increase in compilation time of Hello, world program

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

Re: Making `object.opEquals' replaceable

2015-05-07 Thread Kapps via Digitalmars-d
On Thursday, 7 May 2015 at 14:37:14 UTC, Manfred Nowak wrote: According to the specs http://dlang.org/operatoroverloading.html#equals `object.opEquals' denies to call the `opEquals'-function tailored for the class of two objects `a' an `b' if for those objects `a is b' holds. Although this

[Issue 14431] [REG 2.067.0] huge slowdown of compilation speed

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14431 Martin Nowak c...@dawg.eu changed: What|Removed |Added CC||thecybersha...@gmail.com ---

Re: Bitfield-style enum to strings?

2015-05-07 Thread Meta via Digitalmars-d-learn
On Thursday, 7 May 2015 at 21:41:06 UTC, Nick Sabalausky wrote: On 05/07/2015 05:19 PM, Justin Whear wrote: On Thu, 07 May 2015 16:55:42 -0400, Nick Sabalausky wrote: // There's gotta be a better way to convert EnumMembers!T // to a range, right? But std.range.only() didn't work, //

Re: Looking for MQTT client library

2015-05-07 Thread Orfeo via Digitalmars-d-learn
On Thursday, 23 April 2015 at 14:40:01 UTC, Frank Pagliughi wrote: I got the OK to submit the D library to Eclipse Paho. So, hopefully within the next few weeks there will be a Paho incubator project for the D language client. Hi Frank, any news about your MQTT client project? Thank you

Re: Good examples of value types

2015-05-07 Thread Andrei Alexandrescu via Digitalmars-d
On 5/7/15 12:29 PM, Russel Winder via Digitalmars-d wrote: On Thu, 2015-05-07 at 07:36 -0700, Andrei Alexandrescu via Digitalmars-d wrote: […] Reference types don't compose nicely that way. In a language with valye types, the juxtaposition of two items (value or reference) is a va;ue. In Java,

New adapter: std.allocator.quantizer

2015-05-07 Thread Andrei Alexandrescu via Digitalmars-d
Helps an allocator without good reallocation capabilities: http://erdani.com/d/phobos-prerelease/std_experimental_allocator_quantizer.html Destruction welcome. Andrei

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 20:18, Johannes Pfau via Digitalmars-d digitalmars-d@puremagic.com wrote: If variable 'alice' and variable 'bob' are both shared, and reading from 'bob', then writing to 'alice'; would instructions be moved around, so reading from 'bob' could actually occur after writing to

Re: Merging one Array with Another

2015-05-07 Thread via Digitalmars-d-learn
On Thursday, 7 May 2015 at 13:38:23 UTC, Andrea Fontana wrote: Because it is a more generic operation and you can work on a lazy range. Anyway, to sort and to do uniq it isn't the fastest way. Or maybe I just didn't understand what you really need. :) Thanks. These are good ideas in general.

Re: RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

2015-05-07 Thread Kagamin via Digitalmars-d
On Tuesday, 5 May 2015 at 02:26:28 UTC, Mike wrote: Porting to a New Platform ** The platform-agnostic code in d delgates implementation details to the platform-specific code using `extern(C) extern _d_sys_name` system calls (for lack of a better term). You plan

Re: vibed: how to use pure HTML instead of template engine?

2015-05-07 Thread Chris via Digitalmars-d-learn
Later you can have more sophisticated methods, e.g. if you want to handle query strings you could do something like this: import vibe.d; shared static this() { auto settings = new HTTPServerSettings; settings.port = 8080; settings.bindAddresses = [::1, 127.0.0.1]; auto router = new

Re: Static function template

2015-05-07 Thread Daniel Kozak via Digitalmars-d-learn
On Thursday, 7 May 2015 at 10:19:44 UTC, Lemonfiend wrote: Is it not possible to have a static function template with the same name as the non-static version? struct S { int i; auto foo(T)(int j) { i=j; } static auto foo(T)(int j) { S s; s.foo!T(j);

[Issue 14530] [REG2.068a] TickDuration to! is broken

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14530 Martin Krejcirik m...@krej.cz changed: What|Removed |Added Summary|TickDuration to! is broken |[REG2.068a] TickDuration

Re: Static function template

2015-05-07 Thread Daniel Kozák via Digitalmars-d-learn
On Thu, 07 May 2015 10:19:42 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Is it not possible to have a static function template with the same name as the non-static version? struct S { int i; auto foo(T)(int j) { i=j; }

Re: Breaking changes in Visual C++ 2015

2015-05-07 Thread via Digitalmars-d
On Thursday, 7 May 2015 at 12:16:18 UTC, d user wrote: If there's anything to learn from Go's success, it's that you don't need a good language design to be successful. If you want D to be successful, submit some PRs to SDC. If you want D to stay unpopular, keep moving towards Haskell with

Re: Static function template

2015-05-07 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, May 07, 2015 10:19:42 Lemonfiend via Digitalmars-d-learn wrote: Is it not possible to have a static function template with the same name as the non-static version? No. Unfortunately, you can't overload based on static. I believe that it works if they're overloaded on parameters but

Re: Static function template

2015-05-07 Thread Daniel Kozák via Digitalmars-d-learn
On Thu, 07 May 2015 10:19:42 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Is it not possible to have a static function template with the same name as the non-static version? struct S { int i; auto foo(T)(int j) { i=j; }

[Issue 14553] New: The return types of std.array.array for narrow strings conflicts with its documentation

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14553 Issue ID: 14553 Summary: The return types of std.array.array for narrow strings conflicts with its documentation Product: D Version: D2 Hardware: All OS: All

Static function template

2015-05-07 Thread Lemonfiend via Digitalmars-d-learn
Is it not possible to have a static function template with the same name as the non-static version? struct S { int i; auto foo(T)(int j) { i=j; } static auto foo(T)(int j) { S s; s.foo!T(j); return s; } } void main() { auto s =

Re: Static function template

2015-05-07 Thread Lemonfiend via Digitalmars-d-learn
On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote: On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote: On Thu, 07 May 2015 10:33:44 + Vadim Lopatin via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: struct S { int i; auto foo2(T)(int j) {

Re: Static function template

2015-05-07 Thread Daniel Kozák via Digitalmars-d-learn
On Thu, 07 May 2015 10:46:19 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thursday, 7 May 2015 at 10:43:28 UTC, Daniel Kozak wrote: On Thursday, 7 May 2015 at 10:39:09 UTC, Daniel Kozák wrote: On Thu, 07 May 2015 10:33:44 + Vadim Lopatin via

Re: RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

2015-05-07 Thread Mike via Digitalmars-d
On Thursday, 7 May 2015 at 07:00:58 UTC, Dan Olson wrote: Mike, try creating an empty ldc2.conf file where you compile from (I just tried so it should work). That will override the one that came with your ldc2 installation that has searches the real druntime/phobos before your versions. It

[Issue 14554] New: dmd generate wrong error message for multiple template with same name

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14554 Issue ID: 14554 Summary: dmd generate wrong error message for multiple template with same name Product: D Version: D2 Hardware: All OS: All Status:

Re: Static function template

2015-05-07 Thread Daniel Kozak via Digitalmars-d-learn
On Thursday, 7 May 2015 at 11:18:17 UTC, Daniel Kozak wrote: On Thursday, 7 May 2015 at 11:15:02 UTC, Daniel Kozak wrote: On Thursday, 7 May 2015 at 11:08:50 UTC, Daniel Kozák wrote: On Thu, 07 May 2015 10:46:19 + Lemonfiend via Digitalmars-d-learn digitalmars-d-learn@puremagic.com

Re: Breaking changes in Visual C++ 2015

2015-05-07 Thread d user via Digitalmars-d
On Wednesday, 6 May 2015 at 18:26:27 UTC, Brad Anderson wrote: https://msdn.microsoft.com/en-us/library/vstudio/bb531344(v=vs.140).aspx I'm sharing this specifically so we can have an unproductive flamewar about whether breaking changes in D are sometimes worth it or if they are holding D

Re: Multiple template alias parameters

2015-05-07 Thread Rikki Cattermole via Digitalmars-d-learn
On 8/05/2015 1:53 p.m., Brian Schott wrote: I have some code that automatically wires up control flow based on annotations. Use of this code looks something like this: ``` import some_package.some_module; void main(string[] args) { doMagicStuff!(some_package.some_module)(args); } ``` All

[Issue 14557] New: Check typedef usage at semantic stage

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14557 Issue ID: 14557 Summary: Check typedef usage at semantic stage Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: minor Priority: P1

Re: Moving from Python to D

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
I'm not really sure exactly what parts are the issue, but I'll point out what I can: On 05/07/2015 11:24 PM, avarisclari wrote: Hello, Sorry to bother you with something trivial, but I am having trouble translating a block of code I wrote in Python over to D. Everything else I've figured out

Re: Moving from Python to D

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
On 05/08/2015 12:06 AM, Nick Sabalausky wrote: On 05/07/2015 11:24 PM, avarisclari wrote: scene = scenes[title] It looks like scenes is a dictionary that stores dictionaries of strings? If so, then in D, scenes would be declared like this: string[string][string] scenes; Then the above line

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

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14427 --- Comment #11 from Vladimir Panteleev thecybersha...@gmail.com --- Document it where? It's still an internal tool to which a few people need to have access. --

Multiple template alias parameters

2015-05-07 Thread Brian Schott via Digitalmars-d-learn
I have some code that automatically wires up control flow based on annotations. Use of this code looks something like this: ``` import some_package.some_module; void main(string[] args) { doMagicStuff!(some_package.some_module)(args); } ``` All of this works and everything is happy (Except

Why .dup not work with multidimensional arrays?

2015-05-07 Thread Dennis Ritchie via Digitalmars-d-learn
Hi, Should the method .dup work with multidimensional arrays for copying? - import std.stdio; void main() { auto a = [1, 2, 3]; auto b = a.dup; b[] *= 2; writeln(a = , a); // [1, 2, 3] // OK writeln(b = , b); // [2, 4, 6] // OK auto c =

Re: Why .dup not work with multidimensional arrays?

2015-05-07 Thread Dennis Ritchie via Digitalmars-d-learn
On Friday, 8 May 2015 at 02:23:23 UTC, E.S. Quinn wrote: It's because arrays are references types, and .dup is a strictly shallow copy, so you're getting two outer arrays that reference the same set of inner arrays. You'll have to duplicated each of the inner arrays yourself if you need to make

Moving from Python to D

2015-05-07 Thread avarisclari via Digitalmars-d-learn
Hello, Sorry to bother you with something trivial, but I am having trouble translating a block of code I wrote in Python over to D. Everything else I've figured out so far. Could someone help me understand how to get this right? Here's the python: scene = scenes[title] while 1 == 1:

[Issue 14557] Check typedef usage at semantic stage

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14557 Walter Bright bugzi...@digitalmars.com changed: What|Removed |Added CC|

DLL symbol identity

2015-05-07 Thread Benjamin Thaut via Digitalmars-d
To implement shared libraries on a operating system level generally two steps have to be taken 1) Locate which shared library provides a required symbol 2) Load that library and retrieve the final address of the symbol Linux does both of those steps at program start up time. As a result all

Re: Why .dup not work with multidimensional arrays?

2015-05-07 Thread E.S. Quinn via Digitalmars-d-learn
It's because arrays are references types, and .dup is a strictly shallow copy, so you're getting two outer arrays that reference the same set of inner arrays. You'll have to duplicated each of the inner arrays yourself if you need to make a deep copy. On Friday, 8 May 2015 at 02:15:38 UTC,

Re: RFC: Pay-as-you-go, Portable D Runtime for Microcontrollers (and maybe more)

2015-05-07 Thread Mike via Digitalmars-d
On Thursday, 7 May 2015 at 09:55:11 UTC, Kagamin wrote: On Tuesday, 5 May 2015 at 02:26:28 UTC, Mike wrote: Porting to a New Platform ** The platform-agnostic code in d delgates implementation details to the platform-specific code using `extern(C) extern

Re: Bitfield-style enum to strings?

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
On 05/07/2015 09:17 PM, Meta wrote: On Thursday, 7 May 2015 at 21:41:06 UTC, Nick Sabalausky wrote: On 05/07/2015 05:19 PM, Justin Whear wrote: T[] members = [ EnumMembers!T ]; Doh! Yup, that works. Still, I would think there should be a way to do it without allocating an array. But it's

[Issue 14552] SIGSEGV with compile construction nested class in predicate

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

Re: Merging one Array with Another

2015-05-07 Thread Andrea Fontana via Digitalmars-d-learn
On Thursday, 7 May 2015 at 09:21:58 UTC, Per Nordlöw wrote: On Thursday, 7 May 2015 at 08:03:41 UTC, Andrea Fontana wrote: It's not that difficult to implement. You just need to implement a merge() range that returns the min of all ranges' front(). Then you can define distinct() for

Re: Bitfield-style enum to strings?

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
Gah, missed some imports that time: On 05/07/2015 05:04 PM, Nick Sabalausky wrote: Minor fix to work right for none fields. Already worked fine on combination fields liek all. - enum Foo { none = 0, optionA = 10, optionB = 11, optionC =

Re: Baffled by compilation error for formattedRead

2015-05-07 Thread Justin Whear via Digitalmars-d-learn
On Thu, 07 May 2015 23:10:26 +, PhilipDaniels wrote: Why do the first two fail to compile but the last one does?! I cannot see any difference between the 's2' case and the second case, it is a completely mechanical source code transformation I have made. formattedRead takes its input by

Re: Bitfield-style enum to strings?

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
On 05/07/2015 01:41 PM, Nick Sabalausky wrote: Assuming a plain old bitfield-style enum like: enum Foo { optionA = 10; optionB = 11; optionC = 12; optionD = 13; optionE = 14; } Does a function already exist somewhere to take an instance of Foo and get a list of the

Re: Bitfield-style enum to strings?

2015-05-07 Thread Justin Whear via Digitalmars-d-learn
On Thu, 07 May 2015 16:55:42 -0400, Nick Sabalausky wrote: // There's gotta be a better way to convert EnumMembers!T // to a range, right? But std.range.only() didn't work, // due to a template instantiation error. T[] members; foreach(m; EnumMembers!(T))

Re: Dare I ... another volatile discussion ?

2015-05-07 Thread Iain Buclaw via Digitalmars-d
On 7 May 2015 at 23:39, Iain Buclaw ibuc...@gdcproject.org wrote: When used properly though, it's properties make it a prime candidate for the foundation of libraries/programs that centre around the use of atomics. However, shared is not to be confused with a thread-safe atomic type.

[Issue 14555] New: ModuleInfo should weakly link against classes

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14555 Issue ID: 14555 Summary: ModuleInfo should weakly link against classes Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: Bitfield-style enum to strings?

2015-05-07 Thread anonymous via Digitalmars-d-learn
On Thursday, 7 May 2015 at 20:55:42 UTC, Nick Sabalausky wrote: // There's gotta be a better way to convert EnumMembers!T // to a range, right? But std.range.only() didn't work, // due to a template instantiation error. T[] members; foreach(m; EnumMembers!(T)) members

Re: Bitfield-style enum to strings?

2015-05-07 Thread Nick Sabalausky via Digitalmars-d-learn
On 05/07/2015 05:19 PM, Justin Whear wrote: On Thu, 07 May 2015 16:55:42 -0400, Nick Sabalausky wrote: // There's gotta be a better way to convert EnumMembers!T // to a range, right? But std.range.only() didn't work, // due to a template instantiation error. T[]

[Issue 14534] Front-end should lower all non-scalar condition expressions

2015-05-07 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14534 --- Comment #6 from Iain Buclaw ibuc...@gdcproject.org --- This in particular what really irks me. --- int test() { int[int] aa = [1:2]; int[] array = [1,2]; aa.remove(1); array.length = 0; if (__ctfe) assert(!aa);

  1   2   >