Re: Lookahead in unittest

2017-05-14 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 13, 2017 at 12:39:43PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 5/12/17 5:46 PM, H. S. Teoh via Digitalmars-d-learn wrote: [...] > > This advice, unfortunately, needs to be tempered with caution about > > namespace pollution and accidental dependency of things

[OFF TOPIC] Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Russel Winder via Digitalmars-d-announce
On Sun, 2017-05-14 at 20:09 -0700, Walter Bright via Digitalmars-d- announce wrote: > On 5/14/2017 7:44 PM, ketmar wrote: > > sorry for being rude, > > Then please do not post rude comments. We expect professional decorum > here. But in politics lying and being rude is completely the norm. Also,

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Walter Bright via Digitalmars-d-announce
On 5/14/2017 7:44 PM, ketmar wrote: sorry for being rude, Then please do not post rude comments. We expect professional decorum here.

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Russel Winder via Digitalmars-d-announce
On Mon, 2017-05-15 at 05:44 +0300, ketmar via Digitalmars-d-announce wrote: > […] > sorry for being rude, but this is exactly the example of things > programmers > like to write: fun, quite easy, and absolutely useless. most of the > time it > will be filtered away by ide/editor, and otherwise

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread ketmar via Digitalmars-d-announce
Walter Bright wrote: https://github.com/dlang/dmd/pull/6777 It turned out to be unexpectedly easy to implement. The only downside is now we have to rather tediously tweak the error message texts so they use backticks. sorry for being rude, but this is exactly the example of things

Re: DIP 1003 Formal Review

2017-05-14 Thread Basile B. via Digitalmars-d
On Monday, 15 May 2017 at 01:39:34 UTC, MysticZach wrote: Not that a whole new way of doing things is called for... but I think a better design would have been to allow 'in' and 'out' statements in the function itself, with no need for brackets if you only have one line's worth of contract,

Re: Mir Algorithm v0.5.16: @safe ndslice; shortcuts; topology.pairwise instead of isSorted and isStrictlyMonotonic

2017-05-14 Thread 9il via Digitalmars-d-announce
On Sunday, 14 May 2017 at 17:29:44 UTC, jmh530 wrote: On Saturday, 13 May 2017 at 08:10:20 UTC, 9il wrote: https://github.com/libmir/mir-algorithm/releases/tag/v0.5.16 The documentation for mir.functional might need an update based on the refTuple change. The links at the top are missing

Re: DIP 1003 Formal Review

2017-05-14 Thread MysticZach via Digitalmars-d
On Monday, 15 May 2017 at 01:39:34 UTC, MysticZach wrote: Not that a whole new way of doing things is called for... but I think a better design would have been to allow 'in' and 'out' statements in the function itself, with no need for brackets if you only have one line's worth of contract,

Re: DIP 1003 Formal Review

2017-05-14 Thread MysticZach via Digitalmars-d
On Monday, 15 May 2017 at 01:18:02 UTC, Jonathan M Davis wrote: Why would we want to introduce function as an alternative to body? Personally, I've always found the need to use body to be very odd and annoying. It doesn't need to be there when you don't have in or out contracts, and it just

DUB: "Invalid source/import path"

2017-05-14 Thread Ivan Trombley via Digitalmars-d-dwt
If I use DWT 3.0.0 as a dependency in my dub.json then DUB reports "Invalid source/import path" for ~/.dub/packages/dwtlib-3.0.0/dwtlib/dwt/src and ~/.dub/packages/dwtlib-3.0.0/dwtlib/dwt/views. Any ideas?

Re: DIP 1003 Formal Review

2017-05-14 Thread Jonathan M Davis via Digitalmars-d
On Sunday, May 14, 2017 08:39:12 Walter Bright via Digitalmars-d wrote: > On 5/12/2017 9:17 AM, Mike Parker wrote: > > The first stage of the formal review for DIP 1003 [1], "Remove body as a > > Keyword", is now underway. > > A combination of Options 1 and 2: > > 1. Introduce 'function' as an

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16246 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/6ff81f14057530484249dd4055e19c996b0485a7 Fix issue 16246 - cannot call iota with 3 [u]bytes or 3

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Basile B. via Digitalmars-d-announce
On Sunday, 14 May 2017 at 23:17:42 UTC, Vladimir Panteleev wrote: On Sunday, 14 May 2017 at 19:11:32 UTC, Basile B. wrote: Yes +1 for configurable. IDEs already parse and make things clickable. It's not just +1, it's mandatory. If you implement this you must add a new compiler switch. No

[Issue 15720] iota(long.max, long.min, step) does not work properly

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15720 Steven Schveighoffer changed: What|Removed |Added CC|

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Vladimir Panteleev via Digitalmars-d-announce
On Sunday, 14 May 2017 at 19:11:32 UTC, Basile B. wrote: Yes +1 for configurable. IDEs already parse and make things clickable. It's not just +1, it's mandatory. If you implement this you must add a new compiler switch. No problem, it could only print out the line if the output is a

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16246 Steven Schveighoffer changed: What|Removed |Added CC|

[Issue 15717] iota: "Error: cannot implicitly convert expression (cast(int)pastLast - 1) of type int to ushort"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15717 Steven Schveighoffer changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17289 --- Comment #17 from Vladimir Panteleev --- (In reply to Zach the Mystic from comment #16) > It's thousands of pages of warnings for one compile, using the > out-of-the-box experience of how to download and try D, as

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17289 --- Comment #16 from Zach the Mystic --- (In reply to Vladimir Panteleev from comment #15) > (In reply to Zach the Mystic from comment #13) > > If you're running a business, you wouldn't tell your customers, "Our > > supplier

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread MysticZach via Digitalmars-d-announce
On Sunday, 14 May 2017 at 16:25:36 UTC, Walter Bright wrote: On 5/14/2017 9:04 AM, Andre Pany wrote: Thanks a lot. In my opinion these kind of changes are small but have huge impact on the acceptance of a language. I agree. A couple other improvements needed for error messages: In the PR

Re: DUB: Multiprocess?

2017-05-14 Thread Sönke Ludwig via Digitalmars-d
On Sunday, 14 May 2017 at 21:41:58 UTC, Ivan Trombley wrote: On Sunday, 14 May 2017 at 21:01:37 UTC, Basile B. wrote: On Sunday, 14 May 2017 at 20:23:17 UTC, Ivan Trombley wrote: When I build C++ projects using make, I can specify how many processes I want to use (-j). This keeps the

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 22:00:58 UTC, Stanislav Blinov wrote: [...] Yep, it's an alias to template function instantiation, that is, concrete function - a symbol. Yes, my bad :( But of course, it *is* going to be called on every "dereference". GDC optimizes the call away starting at

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:55:01 UTC, ag0aep6g wrote: On 05/14/2017 11:35 PM, Moritz Maxeiner wrote: On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote: [...] T* ptrCast(T, alias ptr)() { return cast(T*)ptr; } [...] alias _state = ptrCast!(int, state); [...] That's a

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Stanislav Blinov via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:55:01 UTC, ag0aep6g wrote: On 05/14/2017 11:35 PM, Moritz Maxeiner wrote: On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote: [...] T* ptrCast(T, alias ptr)() { return cast(T*)ptr; } [...] alias _state = ptrCast!(int, state); [...] That's a

Re: What is Base64 part in Base64.encode

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:34:35 UTC, zabruk70 wrote: On Sunday, 14 May 2017 at 21:22:20 UTC, Moritz Maxeiner wrote: The full line is `alias Base64 = Base64Impl!('+', '/');` Yes. When we use it like this: const(char)[] encoded = Base64.encode(data); then template instantiated and

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

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

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17289 --- Comment #14 from Zach the Mystic --- (In reply to Steven Schveighoffer from comment #11) > Please, don't reopen bugs based on whether the fix is in a released compiler. > > I agree the warnings are jarring and bad, and this

Re: avoid extra variable during void pointer cast

2017-05-14 Thread ag0aep6g via Digitalmars-d-learn
On 05/14/2017 11:35 PM, Moritz Maxeiner wrote: On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote: [...] T* ptrCast(T, alias ptr)() { return cast(T*)ptr; } [...] alias _state = ptrCast!(int, state); [...] That's a pretty cool workaround, but not an alias to the cast, but an

Re: DUB: Multiprocess?

2017-05-14 Thread Ivan Trombley via Digitalmars-d
On Sunday, 14 May 2017 at 21:01:37 UTC, Basile B. wrote: On Sunday, 14 May 2017 at 20:23:17 UTC, Ivan Trombley wrote: When I build C++ projects using make, I can specify how many processes I want to use (-j). This keeps the processors full and happy and greatly reduces the overall build time.

Re: DIP 1003 Formal Review

2017-05-14 Thread Timon Gehr via Digitalmars-d
On 14.05.2017 17:39, Walter Bright wrote: On 5/12/2017 9:17 AM, Mike Parker wrote: The first stage of the formal review for DIP 1003 [1], "Remove body as a Keyword", is now underway. A combination of Options 1 and 2: 1. Introduce 'function' as an alternative to 'body'. 2. Turn 'body' into a

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:16:04 UTC, Stanislav Blinov wrote: On the point of "not possible...", "only a symbol...", etc: T* ptrCast(T, alias ptr)() { return cast(T*)ptr; } void addInt(void* state, void* data) { alias _state = ptrCast!(int, state); alias _data = ptrCast!(int, data);

Re: What is Base64 part in Base64.encode

2017-05-14 Thread zabruk70 via Digitalmars-d-learn
On Sunday, 14 May 2017 at 21:22:20 UTC, Moritz Maxeiner wrote: The full line is `alias Base64 = Base64Impl!('+', '/');` Yes. When we use it like this: const(char)[] encoded = Base64.encode(data); then template instantiated and produce ... what? I don't understand what you're trying to

Re: What is Base64 part in Base64.encode

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 20:04:07 UTC, zabruk70 wrote: I look to std.base64 module source. And dont unerstand what is the "Base64" part in "Base64.encode(data)" example. I see std.base64 module use template Base64Impl. I see alias Base64 = Base64Impl!... But down understand. Base64 not

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Stanislav Blinov via Digitalmars-d-learn
On the point of "not possible...", "only a symbol...", etc: T* ptrCast(T, alias ptr)() { return cast(T*)ptr; } void addInt(void* state, void* data) { alias _state = ptrCast!(int, state); alias _data = ptrCast!(int, data); static assert(!is(typeof(_state) == int*)); static

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17289 --- Comment #13 from Zach the Mystic --- (In reply to Vladimir Panteleev from comment #12) > Since the breaking change was in Xcode, it would be a regression in Xcode as > well, no? I'm not sure about the idea of D being

Re: D on AArch64 CPU

2017-05-14 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 14 May 2017 15:11:09 + schrieb Richard Delorme : > Or should I wait for an offcial support of this architecture? You ARE the official support now. :) -- Marco

Re: Fantastic exchange from DConf

2017-05-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 14 May 2017 at 21:01:40 UTC, Jack Stouffer wrote: On Sunday, 14 May 2017 at 10:10:41 UTC, Dibyendu Majumdar wrote: b) If you want to do things that C allows you to do, then Rust is no more safer than C. That's the entire bloody point isn't it? Maybe you shouldn't be doing a lot of

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Mike B Johnson via Digitalmars-d-learn
On Sunday, 14 May 2017 at 20:18:24 UTC, Kevin Brogan wrote: I have a piece of code that takes a callback function. The callback has the signature void callback(void* state, void* data) There are several of these functions. All of them use state and data as differing types. As an example,

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Marco Leise via Digitalmars-d-learn
Am Sun, 14 May 2017 20:18:24 + schrieb Kevin Brogan : > I have a piece of code that takes a callback function. > > The callback has the signature void callback(void* state, void* > data) > > There are several of these functions. All of them use state and > data as

Re: Fantastic exchange from DConf

2017-05-14 Thread Jack Stouffer via Digitalmars-d
On Sunday, 14 May 2017 at 10:10:41 UTC, Dibyendu Majumdar wrote: In real terms though tools like ASAN and Valgrind if used from the start usually allow you to catch most of the issues. Most likely even better tools for C will come about in time. See Walter's comment earlier in this thread and

Re: DUB: Multiprocess?

2017-05-14 Thread Basile B. via Digitalmars-d
On Sunday, 14 May 2017 at 20:23:17 UTC, Ivan Trombley wrote: When I build C++ projects using make, I can specify how many processes I want to use (-j). This keeps the processors full and happy and greatly reduces the overall build time. Does DUB have a similar way of compiling each file in

Re: avoid extra variable during void pointer cast

2017-05-14 Thread Moritz Maxeiner via Digitalmars-d-learn
On Sunday, 14 May 2017 at 20:18:24 UTC, Kevin Brogan wrote: I have a piece of code that takes a callback function. The callback has the signature void callback(void* state, void* data) There are several of these functions. All of them use state and data as differing types. As an example,

DUB: Multiprocess?

2017-05-14 Thread Ivan Trombley via Digitalmars-d
When I build C++ projects using make, I can specify how many processes I want to use (-j). This keeps the processors full and happy and greatly reduces the overall build time. Does DUB have a similar way of compiling each file in it's own process or thread?

avoid extra variable during void pointer cast

2017-05-14 Thread Kevin Brogan via Digitalmars-d-learn
I have a piece of code that takes a callback function. The callback has the signature void callback(void* state, void* data) There are several of these functions. All of them use state and data as differing types. As an example, let's look at one that uses both of them as int*.

Re: Fantastic exchange from DConf

2017-05-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 14 May 2017 at 19:10:05 UTC, Ola Fosheim Grøstad wrote: On Sunday, 14 May 2017 at 16:44:10 UTC, Patrick Schluter wrote: What does that snippet do ? What should it do? int caca(void) { for(int i=0x; i!=0x8000; i++) printf("coucou"); } Implicit coercion is a design

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread cym13 via Digitalmars-d-announce
On Sunday, 14 May 2017 at 19:11:32 UTC, Basile B. wrote: On Sunday, 14 May 2017 at 17:54:38 UTC, Jacob Carlborg wrote: On 2017-05-14 18:25, Walter Bright wrote: 1. print out the offending line I hope this one will be optional/configurable. I don't think it necessary to print the offending

What is Base64 part in Base64.encode

2017-05-14 Thread zabruk70 via Digitalmars-d-learn
I look to std.base64 module source. And dont unerstand what is the "Base64" part in "Base64.encode(data)" example. I see std.base64 module use template Base64Impl. I see alias Base64 = Base64Impl!... But down understand. Base64 not module, not structure, not class? Template Base64Impl shoud

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Basile B. via Digitalmars-d-announce
On Sunday, 14 May 2017 at 17:54:38 UTC, Jacob Carlborg wrote: On 2017-05-14 18:25, Walter Bright wrote: 1. print out the offending line I hope this one will be optional/configurable. I don't think it necessary to print the offending line within an editor/IDE. They usually can already map

Re: Fantastic exchange from DConf

2017-05-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 14 May 2017 at 16:44:10 UTC, Patrick Schluter wrote: What does that snippet do ? What should it do? int caca(void) { for(int i=0x; i!=0x8000; i++) printf("coucou"); } Implicit coercion is a design bug in both C and D... :-P

Re: DIP 1003 Formal Review

2017-05-14 Thread Timon Gehr via Digitalmars-d
On 14.05.2017 18:36, Kagamin wrote: On Friday, 12 May 2017 at 18:03:43 UTC, H. S. Teoh wrote: I disagree that `function` is not overloaded: it *will* be overloaded if option 2 is chosen, because `function` currently means function *pointer*, not the function body itself. For this reason, I

How to write parser?

2017-05-14 Thread Suliman via Digitalmars-d-learn
I am trying to learn how to write text parser. I have example doc with follow format: #Header my header text ##SubHeader my sub header text ###Sub3Header my sub 3 text #Header21 my header2 text ##SubHeader21 my header2 text ###SubHeader22 my header3 text I would like to wrap all level(#)

Re: DIP 1003 Formal Review

2017-05-14 Thread Meta via Digitalmars-d
On Sunday, 14 May 2017 at 16:35:32 UTC, Kagamin wrote: On Friday, 12 May 2017 at 16:17:03 UTC, Mike Parker wrote: [1] https://github.com/dlang/DIPs/blob/fbb797f61ac92300eda1d63202157cd2a30ba555/DIPs/DIP1003.md Currently function declarations with contracts don't require semicolon at the end.

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

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

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

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

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Jacob Carlborg via Digitalmars-d-announce
On 2017-05-14 18:25, Walter Bright wrote: 1. print out the offending line I hope this one will be optional/configurable. I don't think it necessary to print the offending line within an editor/IDE. They usually can already map the error to the offending line. -- /Jacob Carlborg

Re: Mir Algorithm v0.5.16: @safe ndslice; shortcuts; topology.pairwise instead of isSorted and isStrictlyMonotonic

2017-05-14 Thread jmh530 via Digitalmars-d-announce
On Saturday, 13 May 2017 at 08:10:20 UTC, 9il wrote: https://github.com/libmir/mir-algorithm/releases/tag/v0.5.16 The documentation for mir.functional might need an update based on the refTuple change. The links at the top are missing refTuple and RefTuple. tuple doesn't go anywhere, also

Re: "I made a game using Rust"

2017-05-14 Thread Marco Leise via Digitalmars-d
Am Fri, 12 May 2017 05:42:58 + schrieb Lewis : > Ah okay. If I understand correctly, the "game" itself is just the > two .d files in the Scripts folder, which get compiled then > linked with the prebuilt .lib for the engine. If so, a 10-12s > compile just for those

Re: weird empty string

2017-05-14 Thread Kagamin via Digitalmars-d
On Saturday, 13 May 2017 at 03:41:29 UTC, mogu wrote: Thanks very much. This is a little bit confusing. There was a lot of discussion about it: https://issues.dlang.org/show_bug.cgi?id=4733, https://forum.dlang.org/thread/rrrtkfosfnfuybble...@forum.dlang.org

[Issue 17398] Partial template struct instantiation with __FILE__ leading to link error

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17398 --- Comment #2 from Johan Engelen --- Also related: https://issues.dlang.org/show_bug.cgi?id=15318 (for the given testcase, the fix proposed by David in issue 15318 does not make a difference, but it does make a difference

Re: Fantastic exchange from DConf

2017-05-14 Thread Patrick Schluter via Digitalmars-d
What does that snippet do ? What should it do? int caca(void) { for(int i=0x; i!=0x8000; i++) printf("coucou"); }

Re: DIP 1003 Formal Review

2017-05-14 Thread Kagamin via Digitalmars-d
On Friday, 12 May 2017 at 18:03:43 UTC, H. S. Teoh wrote: I disagree that `function` is not overloaded: it *will* be overloaded if option 2 is chosen, because `function` currently means function *pointer*, not the function body itself. For this reason, I oppose Option 2. Function literal

Re: DIP 1003 Formal Review

2017-05-14 Thread Kagamin via Digitalmars-d
On Friday, 12 May 2017 at 16:17:03 UTC, Mike Parker wrote: [1] https://github.com/dlang/DIPs/blob/fbb797f61ac92300eda1d63202157cd2a30ba555/DIPs/DIP1003.md Currently function declarations with contracts don't require semicolon at the end. This conflicts with options 1 and 3 and is not

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Walter Bright via Digitalmars-d-announce
On 5/14/2017 9:04 AM, Andre Pany wrote: Thanks a lot. In my opinion these kind of changes are small but have huge impact on the acceptance of a language. I agree. A couple other improvements needed for error messages: 1. print out the offending line 2. have a clickable link to a more

[Issue 17398] Partial template struct instantiation with __FILE__ leading to link error

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17398 --- Comment #1 from Johan Engelen --- Related vaguely related issues I found: https://issues.dlang.org/show_bug.cgi?id=4767 https://issues.dlang.org/show_bug.cgi?id=14662 --

Re: Libdivide ported to D

2017-05-14 Thread David Nadlinger via Digitalmars-d-announce
On Sunday, 14 May 2017 at 15:30:19 UTC, Walter Bright wrote: On 5/14/2017 3:39 AM, Tomer Filiba wrote: Of course it only applies to runtime division -- the compiler can do the same if the divisor is known in compile time. I hate to say this, but modern compilers already do this for

[Issue 17398] Partial template struct instantiation with __FILE__ leading to link error

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17398 Johan Engelen changed: What|Removed |Added Keywords||industry --

[Issue 17398] New: Partial template struct instantiation with __FILE__ leading to link error

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17398 Issue ID: 17398 Summary: Partial template struct instantiation with __FILE__ leading to link error Product: D Version: D2 Hardware: All OS: All

Re: D on AArch64 CPU

2017-05-14 Thread kinke via Digitalmars-d-learn
On Sunday, 14 May 2017 at 15:11:09 UTC, Richard Delorme wrote: On Sunday, 14 May 2017 at 15:05:08 UTC, Richard Delorme wrote: I did not touch at std.conv nor std.stdio. On LDC, the only modification concerned math.d and gammafuntion.d, missing support for 128-bit floating points. On GDC, I had

Re: D is really cool

2017-05-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 13 May 2017 at 13:55:17 UTC, Russel Winder wrote: anecdotal, there is no statistically significant data. But then Reddit is mostly opinion and advocacy research. In my experience /r/programming has rather poor quality, but /r/cpp and other more specific groups tend to be much

Re: DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Andre Pany via Digitalmars-d-announce
On Sunday, 14 May 2017 at 14:07:20 UTC, Walter Bright wrote: https://github.com/dlang/dmd/pull/6777 It turned out to be unexpectedly easy to implement. The only downside is now we have to rather tediously tweak the error message texts so they use backticks. Thanks a lot. In my opinion these

Re: DIP 1003 Formal Review

2017-05-14 Thread Walter Bright via Digitalmars-d
On 5/12/2017 9:17 AM, Mike Parker wrote: The first stage of the formal review for DIP 1003 [1], "Remove body as a Keyword", is now underway. A combination of Options 1 and 2: 1. Introduce 'function' as an alternative to 'body'. 2. Turn 'body' into a contextual keyword. 3. Deprecate 'body' as

Re: Libdivide ported to D

2017-05-14 Thread Walter Bright via Digitalmars-d-announce
On 5/14/2017 3:39 AM, Tomer Filiba wrote: https://code.dlang.org/packages/divide Libdivide (http://libdivide.com/) allows converting the DIV instruction (in runtime) to a series of shifts and MULs, which is much more efficient in execution time. It works by taking a number (the divisor or

Re: D on AArch64 CPU

2017-05-14 Thread Richard Delorme via Digitalmars-d-learn
On Sunday, 14 May 2017 at 15:05:08 UTC, Richard Delorme wrote: I did not touch at std.conv nor std.stdio. On LDC, the only modification concerned math.d and gammafuntion.d, missing support for 128-bit floating points. On GDC, I had to complete the errno.d file (under linux the errors are

D on AArch64 CPU

2017-05-14 Thread Richard Delorme via Digitalmars-d-learn
I recently bought the infamous Raspberry pi 3, which has got a cortex-a53 4 cores 1.2 Ghz CPU (Broadcom). After installing on it a 64 bit OS (a non official fedora 25), I was wondering if it was possible to install a D compiler on it. I first try LDC 0.17.4 After modifying some phobos/runtime

[Issue 17042] [meta] check all range functions for proper laziness

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17042 Issue 17042 depends on issue 16326, which changed state. Issue 16326 Summary: filter is not lazy enough & has weird save behavior https://issues.dlang.org/show_bug.cgi?id=16326 What|Removed |Added

[Issue 16326] filter is not lazy enough & has weird save behavior

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16326 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/0e441a9d9e0f56b7a69d2c3fa4e157857239ee35 Fix Issue 16326 - filter is not lazy enough & has weird

Re: DIP 1003 Formal Review

2017-05-14 Thread Basile B. via Digitalmars-d
On Saturday, 13 May 2017 at 10:27:25 UTC, Timon Gehr wrote: [1] Also, here is a list of existing contextual keywords: exit success failure C C++ D Windows Pascal System Objective-C They are not used alone. They are used in a **statement** and surrounded by parens. It's important because

DMD now has colorized syntax highlighting in error messages

2017-05-14 Thread Walter Bright via Digitalmars-d-announce
https://github.com/dlang/dmd/pull/6777 It turned out to be unexpectedly easy to implement. The only downside is now we have to rather tediously tweak the error message texts so they use backticks.

Re: DIP 1003 Formal Review

2017-05-14 Thread Steven Schveighoffer via Digitalmars-d
On 5/14/17 9:53 AM, Petar Kirov [ZombineDev] wrote: Edit: I may be wrong. Here's a case that's on the edge of ambiguity: void main() { void inner(int x) in { } { writeln("WAT"); } } If 'body' was optional, what would be the output of the program? It turns out that the

Re: DIP 1003 Formal Review

2017-05-14 Thread via Digitalmars-d
On Sunday, 14 May 2017 at 13:55:44 UTC, Steven Schveighoffer wrote: On 5/14/17 9:24 AM, Petar Kirov [ZombineDev] wrote: By making body optional and a contextual keyword there should be no breaking changes (except for obscure code like `static assert (!__traits(compiles, { mixin ("int

Re: DIP 1003 Formal Review

2017-05-14 Thread Steven Schveighoffer via Digitalmars-d
On 5/14/17 9:24 AM, Petar Kirov [ZombineDev] wrote: By making body optional and a contextual keyword there should be no breaking changes (except for obscure code like `static assert (!__traits(compiles, { mixin ("int body;"); }))` :D). It doesn't even need to be optional. It can be required

Re: File Input

2017-05-14 Thread Ali Çehreli via Digitalmars-d-learn
On 05/13/2017 09:15 PM, JV wrote: > it doesn't pause and store but just keeps reading > > string studNum; > > readf("%s",); > write(studNum); That's the normal behavior for reading into strings. If you want to read to the end of the line, try this: import std.stdio;

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16246 --- Comment #4 from Andrei Alexandrescu --- (In reply to Steven Schveighoffer from comment #3) > Not fixed until the PR is merged. dlang-bot will do it automatically. Cool, thx. --

Re: DIP 1003 Formal Review

2017-05-14 Thread via Digitalmars-d
On Sunday, 14 May 2017 at 01:30:19 UTC, Timon Gehr wrote: On 14.05.2017 00:07, Petar Kirov [ZombineDev] wrote: How would you feel about: if(condition){ then(); } { otherwise(); } I don't see any problem, ... The intention is that in this _hypothetical_ (hence "would") grammar (which is

[Issue 17289] With Xcode 8.3 linker, warnings of "pointer not aligned"

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17289 Steven Schveighoffer changed: What|Removed |Added Status|REOPENED|RESOLVED

Re: Fantastic exchange from DConf

2017-05-14 Thread Ola Fosheim Grøstad via Digitalmars-d
On Sunday, 14 May 2017 at 12:07:40 UTC, Timon Gehr wrote: On 14.05.2017 11:42, Patrick Schluter wrote: But completely removing the code when one encounters for example: if(val+1 == INT_MIN) is simply nuts. Why? This is simple dead code elimination. The programmer clearly must have known

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16246 Steven Schveighoffer changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: DIP 1003 Formal Review

2017-05-14 Thread via Digitalmars-d
On Sunday, 14 May 2017 at 13:04:12 UTC, Steven Schveighoffer wrote: On 5/13/17 6:07 PM, Petar Kirov [ZombineDev] wrote: On Saturday, 13 May 2017 at 18:07:57 UTC, Timon Gehr wrote: On 13.05.2017 16:30, Petar Kirov [ZombineDev] wrote: On Saturday, 13 May 2017 at 10:27:25 UTC, Timon Gehr wrote:

[Issue 17397] New: Lazy attribute propagation incorrect

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17397 Issue ID: 17397 Summary: Lazy attribute propagation incorrect Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal

[Issue 17396] Add colorized syntax highlighting to error messages emitted by dmd

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17396 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/23a97cfb8fe1699e47bfd556c08d61eedd02493a fix Issue 17396 - Add colorized syntax highlighting to error

[Issue 16326] filter is not lazy enough & has weird save behavior

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

Re: DIP 1003 Formal Review

2017-05-14 Thread Steven Schveighoffer via Digitalmars-d
On 5/13/17 6:07 PM, Petar Kirov [ZombineDev] wrote: On Saturday, 13 May 2017 at 18:07:57 UTC, Timon Gehr wrote: On 13.05.2017 16:30, Petar Kirov [ZombineDev] wrote: On Saturday, 13 May 2017 at 10:27:25 UTC, Timon Gehr wrote: On 12.05.2017 18:17, Mike Parker wrote: The first stage of the

Re: Fantastic exchange from DConf

2017-05-14 Thread Guillaume Boucher via Digitalmars-d
On Sunday, 14 May 2017 at 09:42:05 UTC, Patrick Schluter wrote: But completely removing the code when one encounters for example: if(val+1 == INT_MIN) is simply nuts. Removing such code is precisely what dmd does: https://issues.dlang.org/show_bug.cgi?id=16268

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

2017-05-14 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16246 Andrei Alexandrescu changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16246] cannot call iota with 3 [u]bytes or 3 [u]shorts

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

Re: Do array literals still always allocate?

2017-05-14 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 14 May 2017 at 12:02:03 UTC, Eugene Wissner wrote: On Sunday, 14 May 2017 at 11:45:12 UTC, ag0aep6g wrote: On 05/14/2017 01:40 PM, Nicholas Wilson wrote: dynamic array literals is what I meant. I don't follow. Can you give an example in code? void main() { ubyte[] arr = [ 1,

Re: Fantastic exchange from DConf

2017-05-14 Thread bachmeier via Digitalmars-d
On Sunday, 14 May 2017 at 09:56:18 UTC, Dibyendu Majumdar wrote: On Sunday, 14 May 2017 at 02:11:36 UTC, bachmeier wrote: On Sunday, 14 May 2017 at 00:05:56 UTC, Dibyendu Majumdar wrote: (a) Trust the programmer. I don't understand this point. C doesn't offer the programmer much to work

Re: Fantastic exchange from DConf

2017-05-14 Thread Timon Gehr via Digitalmars-d
On 14.05.2017 11:42, Patrick Schluter wrote: ... (a) Trust the programmer. (b) Don't prevent the programmer from doing what needs to be done. (c) Keep the language small and simple. (d) Provide only one way to do an operation. (e) Make it fast, even if it is not guaranteed to be portable. (f)

Re: Do array literals still always allocate?

2017-05-14 Thread ag0aep6g via Digitalmars-d-learn
On 05/14/2017 02:02 PM, Eugene Wissner wrote: void main() { ubyte[] arr = [ 1, 2, 3, 4, 5 ]; assert(arr == [ 1, 2, 3, 4, 5 ]); } Both, assignment and comparison, allocate. Sure, but Nicholas said 1D arrays behave different from 2D arrays.

Re: Fantastic exchange from DConf

2017-05-14 Thread Adrian Matoga via Digitalmars-d
On Wednesday, 10 May 2017 at 12:18:40 UTC, Patrick Schluter wrote: On Wednesday, 10 May 2017 at 11:16:57 UTC, Atila Neves wrote: [...] The likelihood of a randomly picked C/C++ programmer not even knowing what a profiler is, much less having used one, is extremely high in my experience. I

  1   2   >