Re: Cast to left hand side

2014-11-09 Thread ketmar via Digitalmars-d-learn
On Sun, 09 Nov 2014 22:17:33 + bearophile via Digitalmars-d-learn wrote: > eles: > > > I am also strongly in favor of introducing an "uncast". For > > example, in C++'x const_cast and in D's cast for removing, for > > example immutability: > > > > immutable int* p = ...; > > int* q = cast(

Re: Cast to left hand side

2014-11-09 Thread Ali Çehreli via Digitalmars-d-learn
On 11/09/2014 10:59 AM, tcak wrote: > When I want to create a system where data types should match > each other automatically, 'alias this' can do that but unfortunately, the current compiler supports only one 'alias this' in a user-defined type. I think that limitation will be gone with 2.067

Re: Cast to left hand side

2014-11-09 Thread tcak via Digitalmars-d-learn
On Sunday, 9 November 2014 at 21:47:03 UTC, eles wrote: On Sunday, 9 November 2014 at 19:00:01 UTC, tcak wrote: I am also strongly in favor of introducing an "uncast". For example, in C++'x const_cast and in D's cast for removing, for example immutability: immutable int* p = ...; int* q = ca

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread Meta via Digitalmars-d-learn
On Sunday, 9 November 2014 at 16:31:46 UTC, bearophile wrote: H. S. Teoh: It's only a bad idea because people abuse assert() where it's not appropriate. It's a bad idea because Walter seems unable to understand the difference between verifying and proving. Bye, bearophile On the other ha

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 09, 2014 at 09:57:21PM +, eles via Digitalmars-d-learn wrote: > On Sunday, 9 November 2014 at 16:31:46 UTC, bearophile wrote: > >H. S. Teoh: > > > >>It's only a bad idea because people abuse assert() where it's not > >>appropriate. > > > >It's a bad idea because Walter seems unable

Re: joiner random access range?

2014-11-09 Thread bearophile via Digitalmars-d-learn
This was Issue 8405 opened by Jonathan M Davis two years ago, I have added my use cases: https://issues.dlang.org/show_bug.cgi?id=8405 Bye, bearophile

Re: Cast to left hand side

2014-11-09 Thread bearophile via Digitalmars-d-learn
eles: I am also strongly in favor of introducing an "uncast". For example, in C++'x const_cast and in D's cast for removing, for example immutability: immutable int* p = ...; int* q = cast(int*)p; I think this is supposed to work: void main() { immutable int* p; int* q = cast()p; }

Re: Cast to left hand side

2014-11-09 Thread ketmar via Digitalmars-d-learn
On Sun, 09 Nov 2014 21:47:02 + eles via Digitalmars-d-learn wrote: > On Sunday, 9 November 2014 at 19:00:01 UTC, tcak wrote: > > In some cases, I need to cast right hand side expression to > > left hand side. While it looks/feels simple for basic data > > types, it requires long lines with

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread eles via Digitalmars-d-learn
On Sunday, 9 November 2014 at 16:31:46 UTC, bearophile wrote: H. S. Teoh: It's only a bad idea because people abuse assert() where it's not appropriate. It's a bad idea because Walter seems unable to understand the difference between verifying and proving. I fail to see the difference betw

Re: Cast to left hand side

2014-11-09 Thread eles via Digitalmars-d-learn
On Sunday, 9 November 2014 at 19:00:01 UTC, tcak wrote: In some cases, I need to cast right hand side expression to left hand side. While it looks/feels simple for basic data types, it requires long lines with duplication when flexible code is desired to be written. Example: int a = 7; byte

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread Laeeth Isharc via Digitalmars-d-learn
Thanks. Laeeth.

Cast to left hand side

2014-11-09 Thread tcak via Digitalmars-d-learn
In some cases, I need to cast right hand side expression to left hand side. While it looks/feels simple for basic data types, it requires long lines with duplication when flexible code is desired to be written. Example: int a = 7; byte b; b = cast( byte )a; When I want to create a system w

Re: Live without debugger?

2014-11-09 Thread Gary Willoughby via Digitalmars-d-learn
On Sunday, 9 November 2014 at 08:26:59 UTC, Suliman wrote: I know that a lot of people are using for programming tools like Sublime. I am one of them. But if for very simple code it's ok, how to write hard code? Do you often need debugger when you are writing code? For which tasks debugger ar

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread bearophile via Digitalmars-d-learn
H. S. Teoh: It's only a bad idea because people abuse assert() where it's not appropriate. It's a bad idea because Walter seems unable to understand the difference between verifying and proving. Bye, bearophile

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 09, 2014 at 04:12:06PM +, bearophile via Digitalmars-d-learn wrote: > H. S. Teoh: > > >Walter *did* mention recently that he was planning to eventually take > >advantage of information in assert()'s as optimizer hints. Not sure > >when this will happen, though, but it seems inevit

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread bearophile via Digitalmars-d-learn
H. S. Teoh: Walter *did* mention recently that he was planning to eventually take advantage of information in assert()'s as optimizer hints. Not sure when this will happen, though, but it seems inevitable at some point. And it caused a storm, because it's an awfully bad idea. Bye, bearophil

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Nov 09, 2014 at 02:45:29PM +, bearophile via Digitalmars-d-learn wrote: > Laeeth Isharc: > > >Walter Bright suggests that a supplementary benefit of using contrats > >is helping the compiler make optimisations. > > I think no D compilers do this, currently. And no one knows when such

Re: status of D optimizers benefiting from contracts ?

2014-11-09 Thread bearophile via Digitalmars-d-learn
Laeeth Isharc: Walter Bright suggests that a supplementary benefit of using contrats is helping the compiler make optimisations. I think no D compilers do this, currently. And no one knows when such things will be added, if ever. Bye, bearophile

Re: Access Violation Tracking

2014-11-09 Thread ketmar via Digitalmars-d-learn
On Sun, 09 Nov 2014 09:33:29 -0500 Etienne via Digitalmars-d-learn wrote: > I've seen a lot more invalid memory operation errors since the GC calls > destructors. Letting the GC destroy objects out of order can be the > issue. We might have to make an associative array of static global flags >

status of D optimizers benefiting from contracts ?

2014-11-09 Thread Laeeth Isharc via Digitalmars-d-learn
https://www.youtube.com/watch?v=e2F2pqeMLuw&list=PL4EvMyUrlAJmEfs8l6oW2BlnALiDu7kGy 31 minutes in, Walter Bright suggests that a supplementary benefit of using contrats is helping the compiler make optimisations. He uses the example of being able to do faster 32 bit arithmetic when the variab

Re: Live without debugger?

2014-11-09 Thread ketmar via Digitalmars-d-learn
On Sun, 09 Nov 2014 08:26:57 + Suliman via Digitalmars-d-learn wrote: > Do you often need debugger when you are writing code? besides, it's very hard to write code in debugger. even 'ed' is better for this task. ;-) signature.asc Description: PGP signature

Re: Access Violation Tracking

2014-11-09 Thread Etienne via Digitalmars-d-learn
On 2014-11-05 6:09 AM, Bauss wrote: Is there any way to track down access violations, instead of me having to look through my source code manually. I have a pretty big source code and an access violation happens at runtime, but it's going to be a nightmare looking through it all to find the acce

Re: Live without debugger?

2014-11-09 Thread rcor via Digitalmars-d-learn
On Sunday, 9 November 2014 at 09:14:14 UTC, ketmar via Digitalmars-d-learn wrote: On Sun, 09 Nov 2014 08:26:57 + Suliman via Digitalmars-d-learn wrote: Do you often need debugger when you are writing code? almost never. For which tasks debugger are more needed for you? inspecting cor

Re: Live without debugger?

2014-11-09 Thread Paulo Pinto via Digitalmars-d-learn
Am 09.11.2014 um 09:26 schrieb Suliman: I know that a lot of people are using for programming tools like Sublime. I am one of them. But if for very simple code it's ok, how to write hard code? Do you often need debugger when you are writing code? For which tasks debugger are more needed for you?

Re: Live without debugger?

2014-11-09 Thread ketmar via Digitalmars-d-learn
On Sun, 09 Nov 2014 08:26:57 + Suliman via Digitalmars-d-learn wrote: > Do you often need debugger when you are writing code? almost never. > For which tasks debugger are more needed for you? inspecting coredumps. signature.asc Description: PGP signature

Live without debugger?

2014-11-09 Thread Suliman via Digitalmars-d-learn
I know that a lot of people are using for programming tools like Sublime. I am one of them. But if for very simple code it's ok, how to write hard code? Do you often need debugger when you are writing code? For which tasks debugger are more needed for you?