[Issue 17231] Function to get name from Tid

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17231 --- Comment #6 from Vladimir Panteleev --- (In reply to RazvanN from comment #5) > I made a PR for that issue and since you closed your PR for this one, I > thought that marking this one as a duplicate would make

Re: Auto-decoding

2017-07-14 Thread ag0aep6g via Digitalmars-d-learn
On 07/15/2017 06:21 AM, bauss wrote: I understand what it is and how it works, but I don't understand anything of how it solves any problems? Could someone give an example of when auto-decoding actually is useful in contrast to not using it? 1) Drop two elements from "Bär". With

[Issue 17643] std.traits.getSymbolsByUDA doesn't work with private attributes

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17643 Vladimir Panteleev changed: What|Removed |Added Severity|normal

Re: sorting a string

2017-07-14 Thread ag0aep6g via Digitalmars-d-learn
On 07/15/2017 04:33 AM, Namal wrote: Why does it have to be char[]? auto bytes = line.representation.dup; bytes.sort; string result = bytes.assumeUTF; works too. That's a compiler bug. The code should not compile, because now you can mutate `result`'s elements through `bytes`. But

[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #4 from Vladimir Panteleev --- Actually, I believe we do count a breakage as a regression if something breaks for the end-user, regardless of what is going on under the hood. E.g. it's possible that for

[Issue 17651] Segfult when parsing Ddoc ESCAPES macro

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17651 Vladimir Panteleev changed: What|Removed |Added Keywords||ice

[Issue 17654] New: return value incorrectly considered unique when casting to another pointer type

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17654 Issue ID: 17654 Summary: return value incorrectly considered unique when casting to another pointer type Product: D Version: D2 Hardware: x86_64 OS: Linux

[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #3 from Vladimir Panteleev --- Interesting - looking at the PR, this doesn't really seem like a regression, rather that the addition of the @safe attribute exposed an out-of-bounds array access that was

[Issue 17650] [REG v2.075.0 b1-b4] std.getopt range violation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17650 --- Comment #2 from Vladimir Panteleev --- Introduced in https://github.com/dlang/phobos/pull/5351 --

[Issue 17648] dmd segfault on overload set introspection

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17648 Vladimir Panteleev changed: What|Removed |Added Keywords||ice

Re: Exported Class Error

2017-07-14 Thread rikki cattermole via Digitalmars-d-learn
On 15/07/2017 5:31 AM, Damien Gibson wrote: Hi. I find myself comming back here alot which is a little discouraging. This time around, I have a dll im making, right now its 32bit using dmd cause i have been getting better information when compile errors occur. if i have a class in it, and i

[Issue 14982] nogc inconsistency

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14982 --- Comment #3 from Vladimir Panteleev --- Just to confirm, by "fixed" you mean that all three now consistently fail to compile? FWIW, the change seems to have been accidental: the second and third function

[Issue 17646] dmd segfaults on missing foreach body in import

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17646 --- Comment #3 from Vladimir Panteleev --- FWIW, no segfault before https://github.com/dlang/dmd/pull/708. --

[Issue 17645] `pure` is transitively applied to all delegates inside a pure function

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17645 --- Comment #2 from Vladimir Panteleev --- FWIW, the test case works in DMD 2.013 through 2.027 :) --

Exported Class Error

2017-07-14 Thread Damien Gibson via Digitalmars-d-learn
Hi. I find myself comming back here alot which is a little discouraging. This time around, I have a dll im making, right now its 32bit using dmd cause i have been getting better information when compile errors occur. if i have a class in it, and i call export on all the functions i want

Re: Toward Go 2 (or D needs to collect experience reports)

2017-07-14 Thread Matt via Digitalmars-d
The one thing I got from that blog post is that the HN and reddit discussion was overwhelmingly about generics, and how the Go leadership seems to not give a damn about what its user community wants...

Auto-decoding

2017-07-14 Thread bauss via Digitalmars-d-learn
I understand what it is and how it works, but I don't understand anything of how it solves any problems? Could someone give an example of when auto-decoding actually is useful in contrast to not using it? Just trying to get an understanding of what exactly its purpose is. I did read

[Issue 17622] [REG2.075.0-b1] Wrong code with appender and -inline

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622 --- Comment #6 from Vladimir Panteleev --- Reduced: test.d /// struct S { int i; this(ubyte) { return; } void fun() { assert(i == 0); } } S make() {

Re: Hiring D programmers (with cryptography and blockchain knowledge are preferred)

2017-07-14 Thread rikki cattermole via Digitalmars-d-announce
On 14/07/2017 7:10 PM, Martin Tschierschke wrote: On Friday, 14 July 2017 at 15:21:09 UTC, rikki cattermole wrote: [...] Scale your dreams back a bit. If you want to put money into anything here is my list: 1. Get shared libraries 100% working, with clear articles on how to use it, on every

[Issue 17622] [REG2.075.0-b1] Wrong code with appender and -inline

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622 Vladimir Panteleev changed: What|Removed |Added Summary|inline for m64 fails web

[Issue 17622] inline for m64 fails web APPS

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17622 Vladimir Panteleev changed: What|Removed |Added Keywords|dll

[Issue 12963] posix.mak hardcodes $(CC) as cc on non Windows system

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12963 --- Comment #2 from Vladimir Panteleev --- (In reply to Jason King from comment #0) > This has the effect of hardcoding $CC to cc on non-Win32 systems. Wait, how so? Can't you just specify CC=... on the make

Toward Go 2 (or D needs to collect experience reports)

2017-07-14 Thread Seb via Digitalmars-d
Very interesting article: https://blog.golang.org/toward-go2 The highlights: Our goal for Go 2 is to fix the most significant ways Go fails to scale. Go 2 must bring along all those developers. We must ask them to unlearn old habits and learn new ones only when the reward is great. Go 2

[Issue 12867] std.traits.fullyQualifiedName fails on ClassName.staticMember.memberOfStruct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12867 Vladimir Panteleev changed: What|Removed |Added Resolution|WORKSFORME

[Issue 10502] Can't get fullyQualifiedName of a templated struct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10502 Vladimir Panteleev changed: What|Removed |Added CC|

[Issue 17639] Implicit conversion of bool to float should be rejected

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17639 Vladimir Panteleev changed: What|Removed |Added Keywords|

Re: sorting a string

2017-07-14 Thread Namal via Digitalmars-d-learn
On Friday, 14 July 2017 at 17:23:41 UTC, Steven Schveighoffer wrote: import std.string: representation, assumeUTF; import std.algorithm: sort; auto bytes = line.representation.dup; bytes.sort; auto result = bytes.assumeUTF; // result is now char[] Why does it have to be char[]? auto

[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541 Walter Bright changed: What|Removed |Added CC|

Re: Documentation licence

2017-07-14 Thread Seb via Digitalmars-d
On Friday, 30 June 2017 at 10:10:14 UTC, ANtlord wrote: Hello! I use service devdocs.io for some technologies. And I think that I able to add D to this service. Hi, Did you manage to make progress on this issue? As mentioned this is in my focus as well and I will be able to allocate some

Re: WTF is going on! Corrupt value that is never assigned

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Thursday, 13 July 2017 at 23:30:39 UTC, Moritz Maxeiner wrote: Okay, I'll setup a Windows VM when I have time and check it out (unless someone solves it beforehand). I have been unable to reproduce your reported behaviour with dmd 2.074.1 (same as Adam).

Re: [OT] .net is getting slices

2017-07-14 Thread via Digitalmars-d
On Friday, 14 July 2017 at 12:50:56 UTC, Kagamin wrote: On Friday, 14 July 2017 at 12:25:47 UTC, Petar Kirov [ZombineDev] wrote: core.atomic supports 2 * (void*).sizeof atomicLoad, atomicStore and cas (compare-and-swap) on platforms that support it (x86 and x86_64 for sure, and for others you

Re: Function attribute deduction depends on compile invocation

2017-07-14 Thread Walter Bright via Digitalmars-d
On 7/14/2017 9:53 AM, Johan Engelen wrote: What happens in that in one kind of compilation, @nogc is deduced for a function. But in another compilation, it isn't. Thus references to the function will have the wrong mangling, and linker errors happen:

Re: Request for a more powerful template specialization feature

2017-07-14 Thread data pulverizer via Digitalmars-d
On Friday, 14 July 2017 at 23:04:48 UTC, Stefan Koch wrote: One important characteristic about constraints, is that they are not bound to types. Also they can from conjunctions and disjunctions. Combined with ctfe they are very flexible and powerful. I do not know how you would do the same

Re: Exception handling

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 14 July 2017 at 23:09:23 UTC, Stefan Koch wrote: On Friday, 14 July 2017 at 23:02:24 UTC, Moritz Maxeiner wrote: On Friday, 14 July 2017 at 21:20:29 UTC, Jonathan M Davis wrote: Basically, the compiler _never_ looks at the bodies of other functions when determining which attributes

Re: Exception handling

2017-07-14 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jul 14, 2017 at 11:09:23PM +, Stefan Koch via Digitalmars-d-learn wrote: > On Friday, 14 July 2017 at 23:02:24 UTC, Moritz Maxeiner wrote: > > On Friday, 14 July 2017 at 21:20:29 UTC, Jonathan M Davis wrote: > > > Basically, the compiler _never_ looks at the bodies of other > > >

Re: D easily overlooked?

2017-07-14 Thread aberba via Digitalmars-d
On Friday, 14 July 2017 at 08:57:17 UTC, Wulfklaue wrote: https://blog.sourced.tech/post/language_migrations/ I know people will jump onboard and start yelling how D has very unique features but from the "outside world" its always the same response. While more people are downloading D and

Re: Compilation times and idiomatic D code

2017-07-14 Thread Seb via Digitalmars-d
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote: Result: 8MB executable size (!). Of course, this comes at a runtime cost of an added level of indirection (now you have to call a virtual function through the interface to integrate with earlier components in the pipeline). But at a

Re: Compilation times and idiomatic D code

2017-07-14 Thread H. S. Teoh via Digitalmars-d
On Fri, Jul 14, 2017 at 03:45:44PM -0700, H. S. Teoh via Digitalmars-d wrote: [...] > Here's a further update to the saga of combating ridiculously large > symbol sizes. [...] >.wrapWithInterface // <--- type erasure happens here [...] Some further thoughts about type erasure and UFCS

Re: Exception handling

2017-07-14 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 14 July 2017 at 23:02:24 UTC, Moritz Maxeiner wrote: On Friday, 14 July 2017 at 21:20:29 UTC, Jonathan M Davis wrote: Basically, the compiler _never_ looks at the bodies of other functions when determining which attributes apply. It always [...]. I'm well aware of that, but it

Re: Request for a more powerful template specialization feature

2017-07-14 Thread Stefan Koch via Digitalmars-d
On Friday, 14 July 2017 at 22:49:18 UTC, data pulverizer wrote: On Friday, 14 July 2017 at 22:25:15 UTC, data pulverizer wrote: I am aware that this suggestion touches the language and the compiler - and may significant implications. I would like to know whether this could be done without too

Re: Compilation times and idiomatic D code

2017-07-14 Thread Stefan Koch via Digitalmars-d
On Friday, 14 July 2017 at 22:45:44 UTC, H. S. Teoh wrote: On Thu, Jul 13, 2017 at 03:27:31PM -0700, H. S. Teoh via Digitalmars-d wrote: [...] [...] Here's a further update to the saga of combating ridiculously large symbol sizes. [...] You will be excited to hear that my template work

Re: Exception handling

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 14 July 2017 at 21:20:29 UTC, Jonathan M Davis wrote: On Friday, July 14, 2017 9:06:52 PM MDT Moritz Maxeiner via Digitalmars-d- learn wrote: On Friday, 14 July 2017 at 20:22:21 UTC, Ali Çehreli wrote: > Although it's obvious to us that there are only those two > exceptions, the

Re: Compilation times and idiomatic D code

2017-07-14 Thread H. S. Teoh via Digitalmars-d
On Thu, Jul 13, 2017 at 03:27:31PM -0700, H. S. Teoh via Digitalmars-d wrote: > On Thu, Jul 13, 2017 at 04:16:50PM -0400, Steven Schveighoffer via > Digitalmars-d wrote: > [...] > > http://www.schveiguy.com/blog/2016/05/have-your-voldemort-types-and-keep-your-disk-space-too/ > [...] > > Whoa. I

Re: Request for a more powerful template specialization feature

2017-07-14 Thread data pulverizer via Digitalmars-d
On Friday, 14 July 2017 at 22:25:15 UTC, data pulverizer wrote: I am aware that this suggestion touches the language and the compiler - and may significant implications. I would like to know whether this could be done without too much effort and whether it would break anything else? If you

Re: Request for a more powerful template specialization feature

2017-07-14 Thread data pulverizer via Digitalmars-d
On Friday, 14 July 2017 at 18:19:03 UTC, data pulverizer wrote: Dear all, Template specializations are a great feature in D. They allow the programmer to create template specializations but they can also be a powerful way of constraining templates by implementing only the specializations

Re: DIP 1011--extern(delegate)--Preliminary Review Round 1

2017-07-14 Thread Jonathan Marler via Digitalmars-d
On Friday, 14 July 2017 at 17:02:37 UTC, Dmitry Olshansky wrote: ...The dance with making an ABI wrapper can be left to compiler proper. This proposal doesn't make ABI wrappers, it changes the ABI of the function itself.

Re: Munich D Meetup July 2017

2017-07-14 Thread Dragos Carp via Digitalmars-d-announce
Bump the thread, the next Munich D Meetup is getting closer. Dragos On Monday, 3 July 2017 at 18:23:27 UTC, Dragos Carp wrote: Hi all, On 18 July, we will have our next Munich meetup. Mario will give a talk with the title "Avoiding the Big Ball of Mud". As usual before and after the talk we

[Issue 17194] [scope] Fwd reference error with nested struct

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17194 Elie Morisse changed: What|Removed |Added CC||syniu...@gmail.com

Re: Hiring D programmers (with cryptography and blockchain knowledge are preferred)

2017-07-14 Thread aberba via Digitalmars-d-announce
On Thursday, 13 July 2017 at 05:18:40 UTC, wigy wrote: On Wednesday, 12 July 2017 at 20:11:06 UTC, Vitor Rozsas wrote: So... suggestions... Centralized? Decentralized? I think the centralized wouldn't fit in any country. It would certainly contain pedophile posts... and any sane country

Re: Exception handling

2017-07-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, July 14, 2017 9:06:52 PM MDT Moritz Maxeiner via Digitalmars-d- learn wrote: > On Friday, 14 July 2017 at 20:22:21 UTC, Ali Çehreli wrote: > > Although it's obvious to us that there are only those two > > exceptions, the compiler cannot in general know that. > > Not in general, no, but

Re: Exception handling

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 14 July 2017 at 20:22:21 UTC, Ali Çehreli wrote: On 07/14/2017 12:36 PM, ANtlord wrote: > Hello! I've tried to use nothrow keyword and I couldn't get a state of > function satisfied the keyword. I have one more method that can throw an > exception; it is called inside nothrow method.

Re: Request for a more powerful template specialization feature

2017-07-14 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 14, 2017 4:45:10 PM MDT Andrei Alexandrescu via Digitalmars- d wrote: > On 07/14/2017 04:29 PM, Jonathan M Davis via Digitalmars-d wrote: > > I'd guess that you'd use staticIndexOf an check for > > -1 to implement it > > Given that constraints are user-facing, having a forwarding

Re: How to get value of type at CT given only an alias

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Friday, 14 July 2017 at 18:06:49 UTC, Steven Schveighoffer wrote: .init is the default value. I'm not sure you can get the default value of a non-default initializer, My attempts using init didn't work. e.g.: void foo(alias T)() { pragma(msg, T.init); } struct S { int y = 5;

Re: sorting a string

2017-07-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, July 14, 2017 7:50:17 PM MDT Anton Fediushin via Digitalmars-d- learn wrote: > On Friday, 14 July 2017 at 17:23:41 UTC, Steven Schveighoffer > > wrote: > > Don't do this, because it's not what you think. It's not > > actually calling std.algorithm.sort, but the builtin array sort > >

Re: Request for a more powerful template specialization feature

2017-07-14 Thread Andrei Alexandrescu via Digitalmars-d
On 07/14/2017 04:29 PM, Jonathan M Davis via Digitalmars-d wrote: I'd guess that you'd use staticIndexOf an check for -1 to implement it Given that constraints are user-facing, having a forwarding one-liner may be justifiable. -- Andrei

Re: proposed @noreturn attribute

2017-07-14 Thread Andrei Alexandrescu via Digitalmars-d
On 07/14/2017 03:06 PM, Lurker wrote: On Friday, 14 July 2017 at 15:39:01 UTC, Guillaume Boucher wrote: Example 1: Polymorphism class Bird { void fly() { ... } }; class Penguin : Bird { override void fly() @pragma(noreturn) { assert(0); } }; class EvolvedPenguin : Penguin { override void

Re: sorting a string

2017-07-14 Thread ag0aep6g via Digitalmars-d-learn
On 07/14/2017 09:50 PM, Anton Fediushin wrote: But why? This should be true for `char[]`, isn't it? - if ((ss == SwapStrategy.unstable && (hasSwappableElements!Range || hasAssignableElements!Range) || ss != SwapStrategy.unstable && hasAssignableElements!Range) && isRandomAccessRange!Range

[Issue 17653] New: Redefining symbol in separate but identical template namespaces is completely ignored

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17653 Issue ID: 17653 Summary: Redefining symbol in separate but identical template namespaces is completely ignored Product: D Version: D2 Hardware: All OS: All

Re: sorting a string

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/17 3:50 PM, Anton Fediushin wrote: On Friday, 14 July 2017 at 17:23:41 UTC, Steven Schveighoffer wrote: Don't do this, because it's not what you think. It's not actually calling std.algorithm.sort, but the builtin array sort property. This will be going away soon. This sucks. I know,

Re: Request for a more powerful template specialization feature

2017-07-14 Thread Jonathan M Davis via Digitalmars-d
On Friday, July 14, 2017 3:49:05 PM MDT Andrei Alexandrescu via Digitalmars- d wrote: > On 7/14/17 2:19 PM, data pulverizer wrote: > > template Construct(R: Union{double, int}, W: Union{string, char, dchar}) > > template Construct(R, W) > if ((is(R == double) || is(R == int)) > && (is(W ==

Re: Exception handling

2017-07-14 Thread Ali Çehreli via Digitalmars-d-learn
On 07/14/2017 12:36 PM, ANtlord wrote: > Hello! I've tried to use nothrow keyword and I couldn't get a state of > function satisfied the keyword. I have one more method that can throw an > exception; it is called inside nothrow method. Every type of an > exception from the throwable method is

Re: sorting a string

2017-07-14 Thread Anton Fediushin via Digitalmars-d-learn
On Friday, 14 July 2017 at 17:23:41 UTC, Steven Schveighoffer wrote: Don't do this, because it's not what you think. It's not actually calling std.algorithm.sort, but the builtin array sort property. This will be going away soon. This sucks. I know, that `.sort` will be removed, but I thought

Re: Request for a more powerful template specialization feature

2017-07-14 Thread Andrei Alexandrescu via Digitalmars-d
On 7/14/17 2:19 PM, data pulverizer wrote: template Construct(R: Union{double, int}, W: Union{string, char, dchar}) template Construct(R, W) if ((is(R == double) || is(R == int)) && (is(W == string) || is(W == char) || is(W == dchar)) It would be good to get comments and suggestions

Exception handling

2017-07-14 Thread ANtlord via Digitalmars-d-learn
Hello! I've tried to use nothrow keyword and I couldn't get a state of function satisfied the keyword. I have one more method that can throw an exception; it is called inside nothrow method. Every type of an exception from the throwable method is handled by the nothow method. ubyte

Re: proposed @noreturn attribute

2017-07-14 Thread Lurker via Digitalmars-d
On Friday, 14 July 2017 at 15:39:01 UTC, Guillaume Boucher wrote: Example 1: Polymorphism class Bird { void fly() { ... } }; class Penguin : Bird { override void fly() @pragma(noreturn) { assert(0); } }; class EvolvedPenguin : Penguin { override void fly() { ... } }; No matter how you

[Issue 17596] dmd d 2.073.2 and 2.074.1 interim generated dmd segfaults on FreeBSD 12-CURRENT

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17596 Nemanja Boric <4bur...@gmail.com> changed: What|Removed |Added CC||4bur...@gmail.com --

[Issue 16856] D does not work on FreeBSD current (what will eventually be 12) due to libunwind

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16856 --- Comment #14 from Nemanja Boric <4bur...@gmail.com> --- Thank you for writing back and you're very welcome! Thanks for pointing out to that issue, I'll follow it closely. --

Re: D easily overlooked?

2017-07-14 Thread Moritz Maxeiner via Digitalmars-d
On Friday, 14 July 2017 at 15:13:23 UTC, Andrew Chapman wrote: I agree with the others that having no major company behind DLang is not helping from a money/resource/exposure point of view. That said, there must be things we can do as a community to help improve the situation. I can

[Issue 16856] D does not work on FreeBSD current (what will eventually be 12) due to libunwind

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16856 --- Comment #13 from Jonathan M Davis --- I confirm that this works with the latest TrueOS, though I expect that it wouldn't work on the latest FreeBSD 12, because of the 64-bit inode issue (whereas even though TrueOS

Request for a more powerful template specialization feature

2017-07-14 Thread data pulverizer via Digitalmars-d
Dear all, Template specializations are a great feature in D. They allow the programmer to create template specializations but they can also be a powerful way of constraining templates by implementing only the specializations that you need. In contrast template constraints can quickly become

Re: How to get value of type at CT given only an alias

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/17 1:51 PM, FoxyBrown wrote: Trying to do some tricky stuff but I can't seem to get the value of a type(enum in my case, but must work in general). Basically, given a type T or an alias T(alias preferred), I'd like to be able to get the "default value" of that type. e.g., if it is

Code Construction

2017-07-14 Thread James Dean via Digitalmars-d-learn
Heres a module I just started working on, completely incompletely, but demonstrates an ideas that might be very useful in D: Code Construction. The idea is very simple: We have code strings like "class %%name%% { }" and %%name%% is replaced with the name of a type T. The idea is that we

Re: sorting a string

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/17 1:42 PM, Seb wrote: On Friday, 14 July 2017 at 17:28:29 UTC, Namal wrote: On Friday, 14 July 2017 at 16:43:42 UTC, Anton Fediushin wrote: On Friday, 14 July 2017 at 15:56:49 UTC, Namal wrote: Thx Steve! By sorting string I mean a function or series of functions that sorts a string

How to get value of type at CT given only an alias

2017-07-14 Thread FoxyBrown via Digitalmars-d-learn
Trying to do some tricky stuff but I can't seem to get the value of a type(enum in my case, but must work in general). Basically, given a type T or an alias T(alias preferred), I'd like to be able to get the "default value" of that type. e.g., if it is an enum and I have an alias to a

Re: sorting a string

2017-07-14 Thread Seb via Digitalmars-d-learn
On Friday, 14 July 2017 at 17:28:29 UTC, Namal wrote: On Friday, 14 July 2017 at 16:43:42 UTC, Anton Fediushin wrote: On Friday, 14 July 2017 at 15:56:49 UTC, Namal wrote: Thx Steve! By sorting string I mean a function or series of functions that sorts a string by ASCII code, "cabA" to "Aabc"

Re: DIP 1011--extern(delegate)--Preliminary Review Round 1

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d
On 7/14/17 1:18 PM, Jonathan Marler wrote: On Friday, 14 July 2017 at 12:52:56 UTC, Steven Schveighoffer wrote: On 7/14/17 6:43 AM, Mike Parker wrote: DIP 1011 is titled "extern(delegate)". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1011.md All review-related feedback on and

Re: sorting a string

2017-07-14 Thread Namal via Digitalmars-d-learn
On Friday, 14 July 2017 at 16:43:42 UTC, Anton Fediushin wrote: On Friday, 14 July 2017 at 15:56:49 UTC, Namal wrote: Thx Steve! By sorting string I mean a function or series of functions that sorts a string by ASCII code, "cabA" to "Aabc" for instance. import std.algorithm : sort; import

Re: Need help to get OpenSSL 64 work on Windows x64 | I hate D's GC!

2017-07-14 Thread Suliman via Digitalmars-d-learn
On Friday, 14 July 2017 at 14:50:04 UTC, bauss wrote: On Friday, 14 July 2017 at 13:16:17 UTC, Suliman wrote: It's look that GC in D is really suxx. There is already second toy-project where I am getting stuck on Windows with D for last 3 month. I'm using 32-bit build, because I can't

Re: sorting a string

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/17 12:43 PM, Anton Fediushin wrote: On Friday, 14 July 2017 at 15:56:49 UTC, Namal wrote: Thx Steve! By sorting string I mean a function or series of functions that sorts a string by ASCII code, "cabA" to "Aabc" for instance. import std.algorithm : sort; import std.stdio : writeln;

Re: DIP 1011--extern(delegate)--Preliminary Review Round 1

2017-07-14 Thread Jonathan Marler via Digitalmars-d
On Friday, 14 July 2017 at 12:52:56 UTC, Steven Schveighoffer wrote: On 7/14/17 6:43 AM, Mike Parker wrote: DIP 1011 is titled "extern(delegate)". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1011.md All review-related feedback on and discussion of the DIP should occur in this thread.

Re: DIP 1011--extern(delegate)--Preliminary Review Round 1

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d
On 7/14/17 1:02 PM, Dmitry Olshansky wrote: On Friday, 14 July 2017 at 10:43:05 UTC, Mike Parker wrote: DIP 1011 is titled "extern(delegate)". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1011.md Contrary to other poster I believe this is wrong way to solve a problem. A far simpler

Re: std.container.array of struct inside a struct fails

2017-07-14 Thread drug via Digitalmars-d-learn
14.07.2017 19:53, Anton Fediushin пишет: On Friday, 14 July 2017 at 16:42:59 UTC, drug wrote: It's because Array(T) is a value type and needs type size to define itself, so you have expected forward reference. But T[] is reference type and its size is known in advance - it doesn't depend on

[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541 Steven Schveighoffer changed: What|Removed |Added Keywords||wrong-code --

Re: DIP 1011--extern(delegate)--Preliminary Review Round 1

2017-07-14 Thread Dmitry Olshansky via Digitalmars-d
On Friday, 14 July 2017 at 10:43:05 UTC, Mike Parker wrote: DIP 1011 is titled "extern(delegate)". https://github.com/dlang/DIPs/blob/master/DIPs/DIP1011.md Contrary to other poster I believe this is wrong way to solve a problem. A far simpler approach is to allow compiler implicitly

Function attribute deduction depends on compile invocation

2017-07-14 Thread Johan Engelen via Digitalmars-d
The frontend is automatically deducing things like @nogc and nothrow, but it is flaky and results in linker errors for a complex codebase (Weka's). What happens in that in one kind of compilation, @nogc is deduced for a function. But in another compilation, it isn't. Thus references to the

Re: D easily overlooked?

2017-07-14 Thread bpr via Digitalmars-d
On Friday, 14 July 2017 at 09:02:58 UTC, Stefan Koch wrote: The beauty of D lies in it's holistic approach. The one unique feature to point out would be CTFE which is not to be found in other compiled langauges. CTFE is found in Nim, as well as inline assembler. Relatively easy to use AST

Re: std.container.array of struct inside a struct fails

2017-07-14 Thread Anton Fediushin via Digitalmars-d-learn
On Friday, 14 July 2017 at 16:42:59 UTC, drug wrote: It's because Array(T) is a value type and needs type size to define itself, so you have expected forward reference. But T[] is reference type and its size is known in advance - it doesn't depend on type, it's always pointer.sizeof +

[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541 --- Comment #4 from johanenge...@weka.io --- This problem is bigger than just templates. I am seeing more and more deduction errors, resulting in linker errors. --

Re: sorting a string

2017-07-14 Thread Anton Fediushin via Digitalmars-d-learn
On Friday, 14 July 2017 at 15:56:49 UTC, Namal wrote: Thx Steve! By sorting string I mean a function or series of functions that sorts a string by ASCII code, "cabA" to "Aabc" for instance. import std.algorithm : sort; import std.stdio : writeln; "cabA".dup.sort.writeln; `dup` is used,

Re: std.container.array of struct inside a struct fails

2017-07-14 Thread drug via Digitalmars-d-learn
14.07.2017 19:12, Anton Fediushin пишет: This code: - import std.container.array; struct Test { Array!Test t; } - Fails with an error: - /usr/include/dlang/dmd/std/traits.d(2404): Error: struct arrayissue.Test no size because of forward reference It's because Array(T) is a

[Issue 17541] Function attribute deduction depends on compile invocation

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17541 johanenge...@weka.io changed: What|Removed |Added Summary|Template attribute |Function attribute

std.container.array of struct inside a struct fails

2017-07-14 Thread Anton Fediushin via Digitalmars-d-learn
This code: - import std.container.array; struct Test { Array!Test t; } - Fails with an error: - /usr/include/dlang/dmd/std/traits.d(2404): Error: struct arrayissue.Test no size because of forward reference /usr/include/dlang/dmd/std/traits.d(3462): Error: template instance

Re: D easily overlooked?

2017-07-14 Thread Emil via Digitalmars-d
On Friday, 14 July 2017 at 08:57:17 UTC, Wulfklaue wrote: https://blog.sourced.tech/post/language_migrations/ A recent article where github programming languages popularity Are you aware this is a github infomercial ? That is how gamification works: make you compete over who has the most

[Issue 16232] std.experimental.logger.core.sharedLog isn't thread-safe

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16232 ag0ae...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED

Re: sorting a string

2017-07-14 Thread Namal via Digitalmars-d-learn
On Friday, 14 July 2017 at 15:15:42 UTC, Steven Schveighoffer wrote: import std.algorithm: filter; import std.uni: isWhite; line.filter!(c => !c.isWhite).to!string; be warned, this is going to be a bit slow, but that's the cost of autodecoding. If you are looking for just removing ascii

Re: proposed @noreturn attribute

2017-07-14 Thread Guillaume Boucher via Digitalmars-d
On Monday, 10 July 2017 at 04:02:59 UTC, Nicholas Wilson wrote: 1)@noreturn 2)@disable(return) 3)none w.r.t optimisation assuming both 1 & 3 impact DMD equally [...] I don't think that's true. A Bottom type does not cover all use cases of @noreturn/@pragma(noreturn). Example 1:

[Issue 17652] New: [DIP1000] opApply allow to escape reference to scope variable

2017-07-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17652 Issue ID: 17652 Summary: [DIP1000] opApply allow to escape reference to scope variable Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Hiring D programmers (with cryptography and blockchain knowledge are preferred)

2017-07-14 Thread rikki cattermole via Digitalmars-d-announce
On 14/07/2017 4:01 PM, Vitor Rozsas wrote: On Friday, 14 July 2017 at 14:37:56 UTC, Vitor Rozsas wrote: On Friday, 14 July 2017 at 14:23:49 UTC, rikki cattermole wrote: On 14/07/2017 3:17 PM, Vitor Rozsas wrote: On Friday, 14 July 2017 at 14:10:29 UTC, Vitor Rozsas wrote: [...] A

Re: char e string em linguagem D

2017-07-14 Thread crimaniak via Digitalmars-d-learn
On Thursday, 13 July 2017 at 22:36:47 UTC, Basile B. wrote: return cast(char[])` ... Never cast a literal to char[]. modifying the resulting char[] will lead to AV, at least under linux. `.dup` the literal if you really needs char[]. Hmm, yes, my bad. Probably, it was necessary even

Re: sorting a string

2017-07-14 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/14/17 11:06 AM, Namal wrote: Is there a 'easy' way to sort a string in D like it is possible in Python? Also how can I remove whitespace between characters if I am reading a line from a file and safe it as a string? string[] buffer; foreach (line ; File("test.txt").byLine)

  1   2   >