[Issue 18920] core.internal.hash of array of scalars should be `@safe`

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18920 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18920] core.internal.hash of array of scalars should be `@safe`

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18920 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/druntime https://github.com/dlang/druntime/commit/cb88e333c6d4989a2284c55f48c79dee74cf2457 Fix Issue 18920 - core.internal.hash of array of

[Issue 18922] New: dmd doesn't do substitutions for C++ namespaces in different module/file

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18922 Issue ID: 18922 Summary: dmd doesn't do substitutions for C++ namespaces in different module/file Product: D Version: D2 Hardware: All OS: All

[Issue 18922] dmd doesn't do substitutions for C++ namespaces in different module/file

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18922 Mathias LANG changed: What|Removed |Added Keywords||C++ --

Re: The problem with D's properties

2018-05-30 Thread Mike Franklin via Digitalmars-d
On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote: https://dpaste.dzfl.pl/6c6e614b58ac The problem given in the list, is that a ref getter is used when a setter does not exist. Why have a setter then? One problem is that if the setter has different behavior than the getter

Re: The problem with D's properties

2018-05-30 Thread Neia Neutuladh via Digitalmars-d
On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote: Using setters, we might want to trigger an event when the value changes. But since the getter is used and can modify the event won't be triggered. This is a bad design. Here's similar bad design: --- class Int { public int

Re: The problem with D's properties

2018-05-30 Thread Arun Chandrasekaran via Digitalmars-d
On Thursday, 31 May 2018 at 01:49:42 UTC, DigitalDesigns wrote: https://dpaste.dzfl.pl/6c6e614b58ac The problem given in the list, is that a ref getter is used when a setter does not exist. Why have a setter then? [...] Please report issues at https://issues.dlang.org otherwise it will be

Re: question about keeeping reference to toStringz()

2018-05-30 Thread Mike Parker via Digitalmars-d-learn
On Thursday, 31 May 2018 at 01:12:34 UTC, Dr.No wrote: is foo() is being called from a thread, how I am supposed to keep cstring "alive"? As Jonathan explained, you don't have to worry about it if foo() itself doesn't assign the pointer to anything internally. That will be the case for

The problem with D's properties

2018-05-30 Thread DigitalDesigns via Digitalmars-d
https://dpaste.dzfl.pl/6c6e614b58ac The problem given in the list, is that a ref getter is used when a setter does not exist. Why have a setter then? One problem is that if the setter has different behavior than the getter there will be problems. The other problem is that += modifies the

Re: question about keeeping reference to toStringz()

2018-05-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, May 31, 2018 01:12:34 Dr.No via Digitalmars-d-learn wrote: > On Wednesday, 30 May 2018 at 20:43:48 UTC, Ali Çehreli wrote: > > On 05/30/2018 01:09 PM, Dr.No wrote: > > > consider a C function with this prototype: > > >> void foo(const char *baa); > > > > > > Does it means I should do:

Re: What's the purpose of the 'in' keyword ?

2018-05-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 30, 2018 22:16:28 aberba via Digitalmars-d-learn wrote: > On Sunday, 27 May 2018 at 16:00:15 UTC, Jonathan M Davis wrote: > > On Sunday, May 27, 2018 16:28:56 Russel Winder via > > > > Digitalmars-d-learn wrote: > >> On Sun, 2018-05-27 at 13:10 +, Adam D. Ruppe via > >>

Re: question about keeeping reference to toStringz()

2018-05-30 Thread Dr.No via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 20:43:48 UTC, Ali Çehreli wrote: On 05/30/2018 01:09 PM, Dr.No wrote: > consider a C function with this prototype: >> void foo(const char *baa); > > Does it means I should do: > >> string s = ...; >> auto cstring = s.toStringz; >> foo(cstring); > > rather just: > >>

Re: What's the purpose of the 'in' keyword ?

2018-05-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 30, 2018 15:28:53 Ali Çehreli via Digitalmars-d-learn wrote: > On 05/30/2018 03:16 PM, aberba wrote: > > On Sunday, 27 May 2018 at 16:00:15 UTC, Jonathan M Davis wrote: > >> On Sunday, May 27, 2018 16:28:56 Russel Winder via Digitalmars-d-learn > >> > >> wrote: > >>> On Sun,

Re: D's Destructors are What Scott Meyers Warned Us About

2018-05-30 Thread sarn via Digitalmars-d
On Monday, 28 May 2018 at 22:53:03 UTC, 12345swordy wrote: Interesting... You don't mind me asking your assistance on writing DIP on this? I have one set up already, and I needed help as 1.) This is my first time writing a DIP 2.) I don't know what main course of action to take regarding

Re: Constructing text with astericks

2018-05-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 22:57:06 UTC, aberba wrote: How will you approach this problem in D idiomatically? Well, I never bother with "idiomatically", so I can't speak to that, but a simple solution that would work is to realize that what you're basically asking for here is a bitmap.

Re: Constructing text with astericks

2018-05-30 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 22:57:06 UTC, aberba wrote: I've been given a challenge to write texts using asterisks to form the letters. D happen to have an unlimited amount of idioms yet i'm out out ideas as to the simplest approach. Task is to basically take a piece of text and write them as

Re: Move and CTFE

2018-05-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 30, 2018 22:42:13 Q. Schroll via Digitalmars-d-learn wrote: > On Wednesday, 30 May 2018 at 21:02:07 UTC, Jonathan M Davis wrote: > > On Wednesday, May 30, 2018 20:42:38 Q. Schroll via > > > > Digitalmars-d-learn wrote: > >> It seems one cannot std.algorithm.mutation.move objects

Constructing text with astericks

2018-05-30 Thread aberba via Digitalmars-d-learn
I've been given a challenge to write texts using asterisks to form the letters. D happen to have an unlimited amount of idioms yet i'm out out ideas as to the simplest approach. Task is to basically take a piece of text and write them as asterisks to the console. * * * * * *

Re: Move and CTFE

2018-05-30 Thread Q. Schroll via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 21:02:07 UTC, Jonathan M Davis wrote: On Wednesday, May 30, 2018 20:42:38 Q. Schroll via Digitalmars-d-learn wrote: It seems one cannot std.algorithm.mutation.move objects explicitly. Say I have a non-copyable type [...] It fails because move() cannot be executed

Re: What's the purpose of the 'in' keyword ?

2018-05-30 Thread Ali Çehreli via Digitalmars-d-learn
On 05/30/2018 03:16 PM, aberba wrote: On Sunday, 27 May 2018 at 16:00:15 UTC, Jonathan M Davis wrote: On Sunday, May 27, 2018 16:28:56 Russel Winder via Digitalmars-d-learn wrote: On Sun, 2018-05-27 at 13:10 +, Adam D. Ruppe via Digitalmars-d-learn - Jonathan M Davis Jonathan, which

Re: What's the purpose of the 'in' keyword ?

2018-05-30 Thread aberba via Digitalmars-d-learn
On Sunday, 27 May 2018 at 16:00:15 UTC, Jonathan M Davis wrote: On Sunday, May 27, 2018 16:28:56 Russel Winder via Digitalmars-d-learn wrote: On Sun, 2018-05-27 at 13:10 +, Adam D. Ruppe via Digitalmars-d-learn - Jonathan M Davis Jonathan, which font were you using in your DConf

Re: Setter chaining

2018-05-30 Thread DigitalDesigns via Digitalmars-d-learn
The above idea can be emulated in code, abiet ugly and useless: https://dpaste.dzfl.pl/bd118bc1910c import std.stdio; struct CT(A,B) { A v; B t; alias v this; B opUnary(string s)() if (s == "~") { return t; } A opUnary(string s)() if

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread John Colvin via Digitalmars-d
On Wednesday, 30 May 2018 at 14:40:50 UTC, Steven Schveighoffer wrote: On 5/30/18 4:27 AM, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters:

Re: no [] operator overload for type Chunks!(char[])

2018-05-30 Thread Malte via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 21:27:44 UTC, Ali Çehreli wrote: On 05/30/2018 02:19 PM, Malte wrote: Why does this code complain at the last line about a missing [] operator overload? auto buffer = new char[6]; auto chunked = buffer.chunks(3); chunked[1][2] = '!'; Same happens with wchar.

[Issue 18921] make core.internal.hash cater to memberwise hash chaining

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18921 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/druntime/pull/2198 --

[Issue 18921] New: make core.internal.hash cater to memberwise hash chaining

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18921 Issue ID: 18921 Summary: make core.internal.hash cater to memberwise hash chaining Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: no [] operator overload for type Chunks!(char[])

2018-05-30 Thread Ali Çehreli via Digitalmars-d-learn
On 05/30/2018 02:19 PM, Malte wrote: Why does this code complain at the last line about a missing [] operator overload? auto buffer = new char[6]; auto chunked = buffer.chunks(3); chunked[1][2] = '!'; Same happens with wchar. Dchar and byte work as expected. UTF-8 auto decoding strikes

no [] operator overload for type Chunks!(char[])

2018-05-30 Thread Malte via Digitalmars-d-learn
Why does this code complain at the last line about a missing [] operator overload? auto buffer = new char[6]; auto chunked = buffer.chunks(3); chunked[1][2] = '!'; Same happens with wchar. Dchar and byte work as expected.

Re: Move and CTFE

2018-05-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, May 30, 2018 20:42:38 Q. Schroll via Digitalmars-d-learn wrote: > It seems one cannot std.algorithm.mutation.move objects > explicitly. Say I have a non-copyable type > > struct NoCopy > { > int payload; // some payload > pure nothrow @nogc @safe @disable: >

Re: Proposal?

2018-05-30 Thread H. S. Teoh via Digitalmars-d
On Wed, May 30, 2018 at 03:34:55PM -0400, Steven Schveighoffer via Digitalmars-d wrote: > On 5/30/18 3:05 PM, Daniel N wrote: > > > void func(NONE...)(string s, NONE, string file = __FILE__, size_t > > line = __LINE__) if(!NONE.length) > > { > > import std.stdio; > > writefln("%s:%d:

Re: cycle dependencies

2018-05-30 Thread DigitalDesigns via Digitalmars-d
On Wednesday, 30 May 2018 at 18:49:40 UTC, Steven Schveighoffer wrote: On 5/30/18 11:50 AM, Stefan wrote: On Wednesday, 30 May 2018 at 13:26:53 UTC, Steven Schveighoffer wrote: On 5/30/18 8:09 AM, DigitalDesigns wrote: ... it's really really hard to make it check real dependencies. For

[Issue 18920] core.internal.hash of array of scalars should be `@safe`

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18920 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/druntime/pull/2197 --

[Issue 18920] New: core.internal.hash of array of scalars should be `@safe`

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18920 Issue ID: 18920 Summary: core.internal.hash of array of scalars should be `@safe` Product: D Version: D2 Hardware: All OS: All Status: NEW

Re: Setter chaining

2018-05-30 Thread DigitalDesigns via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 15:46:36 UTC, Steven Schveighoffer wrote: On 5/30/18 10:49 AM, DigitalDesigns wrote: Does it sound good? class X {    double x;    @property X foo(double y) { x = y; return this; }    @property X bar(double y) { x = y + 5; return this; } } void main() { X

Move and CTFE

2018-05-30 Thread Q. Schroll via Digitalmars-d-learn
It seems one cannot std.algorithm.mutation.move objects explicitly. Say I have a non-copyable type struct NoCopy { int payload; // some payload pure nothrow @nogc @safe @disable: this(this); // make it non copyable } that is being used in a compile-time function

Re: question about keeeping reference to toStringz()

2018-05-30 Thread Ali Çehreli via Digitalmars-d-learn
On 05/30/2018 01:09 PM, Dr.No wrote: > consider a C function with this prototype: >> void foo(const char *baa); > > Does it means I should do: > >> string s = ...; >> auto cstring = s.toStringz; >> foo(cstring); > > rather just: > >> foo(s.toStringz); > > ? It depends. cstring method above is

Re: Proposal?

2018-05-30 Thread Daniel N via Digitalmars-d
On Wednesday, 30 May 2018 at 19:34:55 UTC, Steven Schveighoffer wrote: On 5/30/18 3:05 PM, Daniel N wrote: void func(NONE...)(string s, NONE, string file = __FILE__, size_t line = __LINE__) if(!NONE.length) { import std.stdio; writefln("%s:%d: msg=%s", file, line, s); } void main()

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 05/30/2018 10:40 AM, Steven Schveighoffer wrote: But if we fixed the behavior that causes your idea not to work, then we could probably easily define a function like so: CallerInfo __CALLER__(string file = __FILE__, size_t line = __LINE__) {     return CallerInfo(file, line); } Love

[Issue 18918] core.internal.hash should perform memberwise hashing of structs with references

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18918 --- Comment #1 from Nathan S. --- Pull request: https://github.com/dlang/druntime/pull/2195 --

question about keeeping reference to toStringz()

2018-05-30 Thread Dr.No via Digitalmars-d-learn
The documentation says: Important Note: When passing a char* to a C function, and the C function keeps it around for any reason, make sure that you keep a reference to it in your D code. Otherwise, it may become invalid during a garbage collection cycle and cause a nasty bug when the C code

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 10:40 AM, Steven Schveighoffer wrote: But if we fixed the behavior that causes your idea not to work, then we could probably easily define a function like so: CallerInfo __CALLER__(string file = __FILE__, size_t line = __LINE__) {     return CallerInfo(file, line); } Filed an

[Issue 18919] New: __FILE__ and __LINE__ should work when used in default argument expressions

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18919 Issue ID: 18919 Summary: __FILE__ and __LINE__ should work when used in default argument expressions Product: D Version: D2 Hardware: All OS: All

[Issue 18918] New: core.internal.hash should perform memberwise hashing of structs with references

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18918 Issue ID: 18918 Summary: core.internal.hash should perform memberwise hashing of structs with references Product: D Version: D2 Hardware: All OS: All

Re: Proposal?

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 3:05 PM, Daniel N wrote: void func(NONE...)(string s, NONE, string file = __FILE__, size_t line = __LINE__) if(!NONE.length) { import std.stdio; writefln("%s:%d: msg=%s", file, line, s); } void main() {func("hello"); func("there"); } Very cool and interesting pattern.

[Issue 16208] moduleinfo importedModules contains needless duplicates

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 --- Comment #4 from Steven Schveighoffer --- For archive purposes, on my system, that program prints: In module testcycle we import: In module core.bitop we import: core.cpuid core.cpuid In module core.cpuid we import: In module core.exception we

Re: Proposal?

2018-05-30 Thread Daniel N via Digitalmars-d
On Wednesday, 30 May 2018 at 12:22:28 UTC, FeepingCreature wrote: On Wednesday, 30 May 2018 at 10:05:42 UTC, H. S. Teoh wrote: What about this? -- struct EndOfArgs { } EndOfArgs eoa; void func(string s, EndOfArgs _ = eoa, string file = __FILE__, size_t line = __LINE__) {

[Issue 16208] moduleinfo importedModules contains needless duplicates

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 --- Comment #3 from Steven Schveighoffer --- Hm... any program has this problem. Example: import std.stdio; void main() { foreach(mi; ModuleInfo) { writeln("In module ", mi.name, " we import:"); foreach(imported;

Re: cycle dependencies

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 11:50 AM, Stefan wrote: On Wednesday, 30 May 2018 at 13:26:53 UTC, Steven Schveighoffer wrote: On 5/30/18 8:09 AM, DigitalDesigns wrote: ... it's really really hard to make it check real dependencies. For serious dependency checking, you could try

[Issue 16208] moduleinfo importedModules contains needless duplicates

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 Mike Franklin changed: What|Removed |Added CC||slavo5...@yahoo.com --- Comment #2 from

[Issue 18880] [REG2.079] Miscompilation of unittests when two are mixed-in on one line

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18880 johanenge...@weka.io changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: cycle dependencies

2018-05-30 Thread Stefan via Digitalmars-d
On Wednesday, 30 May 2018 at 13:26:53 UTC, Steven Schveighoffer wrote: On 5/30/18 8:09 AM, DigitalDesigns wrote: ... it's really really hard to make it check real dependencies. For serious dependency checking, you could try https://github.com/funkwerk/depend. It's used in quite large

Re: Setter chaining

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/30/18 10:49 AM, DigitalDesigns wrote: Does it sound good? class X {    double x;    @property X foo(double y) { x = y; return this; }    @property X bar(double y) { x = y + 5; return this; } } void main() { X x = new X(); x.foo(3).bar(4); } It sort of emulates UFCS but I'm

[Issue 18917] Default Value for Function-Type Template Value-Parameter Causes Conflicts in Instantiation

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18917 ZombineDev changed: What|Removed |Added Keywords||link-failure --

[Issue 18917] Default Value for Function-Type Template Value-Parameter Causes Conflicts in Instantiation

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18917 ZombineDev changed: What|Removed |Added Keywords||rejects-valid CC|

Re: What's the purpose of the 'in' keyword ?

2018-05-30 Thread Q. Schroll via Digitalmars-d-learn
On Sunday, 27 May 2018 at 16:00:15 UTC, Jonathan M Davis wrote: [...] Honestly, I'd suggest that folks never use in at this point. There's zero benefit to it. [...] Exactly. If you intend const, just write const. If you intend const scope, write const scope.

Setter chaining

2018-05-30 Thread DigitalDesigns via Digitalmars-d-learn
Does it sound good? class X { double x; @property X foo(double y) { x = y; return this; } @property X bar(double y) { x = y + 5; return this; } } void main() { X x = new X(); x.foo(3).bar(4); } It sort of emulates UFCS but I'm not sure if it's more trouble than it's

Re: SOLUTION DOES NOT WORK

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 4:46 AM, FeepingCreature wrote: Updated subject to be visible at a glance. Note that a compiler-based solution via __CALLER__ would still work. I saw this after I replied. Oops :) I think it's a good idea, and I'm also believing that the issue that causes it not to work really

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 4:27 AM, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters: void foo(string file = __FILE__, size_t line = __LINE__); What's wrong

Re: cycle dependencies

2018-05-30 Thread Steven Schveighoffer via Digitalmars-d
On 5/30/18 8:09 AM, DigitalDesigns wrote: Seriously stupid bug here! I had an enum an static this() { } (empty, forgot why I added it) one module and an struct in another module that converted values from the enum. I imported only that enum and guess what?!?! Cycle dependency! removed the

[Issue 16208] moduleinfo importedModules contains needless duplicates

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16208 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b60b669b4d92398f0fb770b895c2835a71c54e3f [Refactorization] Issue 16208 - curly braces on newlines

Re: cycle dependencies

2018-05-30 Thread Andrea Fontana via Digitalmars-d
On Wednesday, 30 May 2018 at 12:09:21 UTC, DigitalDesigns wrote: Seriously stupid bug here! I had an enum an static this() { } (empty, forgot why I added it) one module and an struct in another module that converted values from the enum. I imported only that enum and guess what?!?! Cycle

[Issue 18915] "Interface method not implemented" if interface reflects on implementing class

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18915 Basile B. changed: What|Removed |Added CC||b2.t...@gmx.com Hardware|x86

Re: Proposal?

2018-05-30 Thread FeepingCreature via Digitalmars-d
On Wednesday, 30 May 2018 at 10:05:42 UTC, H. S. Teoh wrote: What about this? -- struct EndOfArgs { } EndOfArgs eoa; void func(string s, EndOfArgs _ = eoa, string file = __FILE__, size_t line = __LINE__) { import std.stdio; writefln("%s:%d: msg=%s", file, line, s);

[Issue 18140] experimental allocators, bitmapped_block UB on OSX 64 bits

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18140 Basile B. changed: What|Removed |Added Severity|normal |blocker --

[Issue 18914] std.experimental.allocator randomly fails on Darwin_64_64

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18914 Basile B. changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 18140] experimental allocators, bitmapped_block UB on OSX 64 bits

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18140 Basile B. changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #2 from

Re: Build interface from abstract class

2018-05-30 Thread DigitalDesigns via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 10:31:27 UTC, Simen Kjærås wrote: On Monday, 28 May 2018 at 20:13:49 UTC, DigitalDesigns wrote: I do not think this is a problem in D. Infinite recursion can always be terminated with appropriate means. 1. Use attributes. methods in class A should be marked as

cycle dependencies

2018-05-30 Thread DigitalDesigns via Digitalmars-d
Seriously stupid bug here! I had an enum an static this() { } (empty, forgot why I added it) one module and an struct in another module that converted values from the enum. I imported only that enum and guess what?!?! Cycle dependency! removed the static this() { } and worked! The cycle

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread FeepingCreature via Digitalmars-d
On Wednesday, 30 May 2018 at 11:59:05 UTC, bauss wrote: On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread bauss via Digitalmars-d
On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters: [...] void foo(string file = __FILE__, size_t

[Issue 18916] ICE using Typedef and __LINE__

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18916 Mike Franklin changed: What|Removed |Added Keywords||pull CC|

Re: Build interface from abstract class

2018-05-30 Thread Simen Kjærås via Digitalmars-d-learn
On Monday, 28 May 2018 at 20:13:49 UTC, DigitalDesigns wrote: I do not think this is a problem in D. Infinite recursion can always be terminated with appropriate means. 1. Use attributes. methods in class A should be marked as being for the interface. When added to the interface they will not

[Issue 16206] traits getOverloads fails when one of the overload is a templatized function

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16206 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/ee9cb9ba7c43a7401f222e0c1cb2063e0c35dd3b Fix Issue 16206 - traits getOverloads fails when

[Issue 16206] traits getOverloads fails when one of the overload is a templatized function

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16206 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/b52561fc497b70380c2ecd8ebd92cf11c31f0a36 Fix issue 16206 - getOverloads fails when first overload is

[Issue 18917] Default Value for Function-Type Template Value-Parameter Causes Conflicts in Instantiation

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18917 Andrea Fontana changed: What|Removed |Added CC||trik...@gmail.com --- Comment #1 from

Re: Logging inside struct?

2018-05-30 Thread biocyberman via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 10:07:35 UTC, Simen Kjærås wrote: On Wednesday, 30 May 2018 at 09:58:16 UTC, biocyberman wrote: [...] This line: writeln("got num: %s, of type: %s", num, typeof(num)); [...] Problem solved. Thanks Simen!

[Issue 18916] ICE using Typedef and __LINE__

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18916 Basile B. changed: What|Removed |Added CC||b2.t...@gmx.com Hardware|x86_64

Re: Logging inside struct?

2018-05-30 Thread Simen Kjærås via Digitalmars-d-learn
On Wednesday, 30 May 2018 at 09:58:16 UTC, biocyberman wrote: How do I add logging for this struct? https://run.dlang.io/is/9N6N4o If not possible, what's the alternative? This line: writeln("got num: %s, of type: %s", num, typeof(num)); Gives this error message: onlineapp.d(7):

Re: Proposal?

2018-05-30 Thread H. S. Teoh via Digitalmars-d
What about this? -- struct EndOfArgs { } EndOfArgs eoa; void func(string s, EndOfArgs _ = eoa, string file = __FILE__, size_t line = __LINE__) { import std.stdio; writefln("%s:%d: msg=%s", file, line, s); } void main() { func("hello"); func("there");

Logging inside struct?

2018-05-30 Thread biocyberman via Digitalmars-d-learn
How do I add logging for this struct? https://run.dlang.io/is/9N6N4o If not possible, what's the alternative?

Re: CMake support for D

2018-05-30 Thread Stefan via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 14:32:54 UTC, King_DuckZ wrote: ... My problem is mixing D with C and C++ ... you found already Dragos cmake-d, but not sure if you also know Dragos talk about mixing D with C/C++. If not, have a look:

Re: Clash When Using Function as Template Value-Parameters?

2018-05-30 Thread Vijay Nayar via Digitalmars-d
On Tuesday, 29 May 2018 at 19:17:37 UTC, Vijay Nayar wrote: On Tuesday, 29 May 2018 at 12:58:20 UTC, Yuxuan Shui wrote: [...] I tried this again, this time completely ignoring lambdas and completely specifying the desired type like so: [...] Issue created:

[Issue 18917] New: Default Value for Function-Type Template Value-Parameter Causes Conflicts in Instantiation

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18917 Issue ID: 18917 Summary: Default Value for Function-Type Template Value-Parameter Causes Conflicts in Instantiation Product: D Version: D2 Hardware: All OS: All

Proposal?

2018-05-30 Thread FeepingCreature via Digitalmars-d
On Wednesday, 30 May 2018 at 08:27:16 UTC, FeepingCreature wrote: struct CallerInfo { string file; size_t line; } Let me try to flesh this out. void foo(CallContext caller = __CALL_CONTEXT__) { } // in druntime object.d struct CallContext { public size_t line; // expected to change for

[Issue 18916] New: ICE using Typedef and __LINE__

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18916 Issue ID: 18916 Summary: ICE using Typedef and __LINE__ Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority:

SOLUTION DOES NOT WORK

2018-05-30 Thread FeepingCreature via Digitalmars-d
Updated subject to be visible at a glance. Note that a compiler-based solution via __CALLER__ would still work.

Re: string mixin output works when directly used but when generator is used D fails

2018-05-30 Thread Simen Kjærås via Digitalmars-d-learn
On Tuesday, 29 May 2018 at 21:19:01 UTC, DigitalDesigns wrote: https://dpaste.dzfl.pl/67691db19ce8 Simplified: interface A { import std.meta : AliasSeq; alias a = AliasSeq!(__traits(getMember, B, "foo")); void foo(); } class B : A { void foo() { } } It seems the compiler is

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread FeepingCreature via Digitalmars-d
Shit it doesn't work, I only checked if it compiled; it gives the wrong file/line number. NEVERMIND ALL

[Issue 18915] New: "Interface method not implemented" if interface reflects on implementing class

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18915 Issue ID: 18915 Summary: "Interface method not implemented" if interface reflects on implementing class Product: D Version: D2 Hardware: x86 OS: Windows

Re: string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread rikki cattermole via Digitalmars-d
On 30/05/2018 8:27 PM, FeepingCreature wrote: There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters: void foo(string file = __FILE__, size_t line = __LINE__); What's

string file = __FILE__ considered harmful (and solution)

2018-05-30 Thread FeepingCreature via Digitalmars-d
There's a very common idiom where in order to report line numbers of an error or a log line at the callsite of a function, you pass __FILE__ and __LINE__ as default parameters: void foo(string file = __FILE__, size_t line = __LINE__); What's wrong with this? Say you add a string parameter,

[Issue 18914] New: std.experimental.allocator randomly fails on Darwin_64_64

2018-05-30 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18914 Issue ID: 18914 Summary: std.experimental.allocator randomly fails on Darwin_64_64 Product: D Version: D2 Hardware: x86_64 OS: Mac OS X Status: NEW

Re: CMake support for D

2018-05-30 Thread King_Duckz via Digitalmars-d-learn
On Tuesday, 27 February 2018 at 14:32:54 UTC, King_DuckZ wrote: On Tuesday, 27 February 2018 at 09:20:21 UTC, Russel Winder wrote: [...] Right, I stand corrected about Rust, though as you say there are those who use it with CMake. About cmake-d, there's this

Re: ost to pst convertes

2018-05-30 Thread John Watson via Digitalmars-d
EdbMails OST to PST Converter recovers corrupted OST file in to Outlook PST file. Which converts all the OST datfile into PST data file with all its attributes like Date & time, To, BCC, Subject, From, CC from corrupted OST file and also recovers Email body images, mails with all attachments,