Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Russel Winder via Digitalmars-d-learn
On Sun, 2014-08-10 at 04:37 +, Puming via Digitalmars-d-learn wrote: […] I didn't know about that. I don't actually know much about Rust except the hype on hackernews :-) But nonetheless, this indicates that a serious application like a browser is a good driving force for a language to

Re: 'with(Foo):' not allowed, why?

2014-08-10 Thread Era Scarecrow via Digitalmars-d-learn
I've given my thoughts on the D section. It would be heavily useful as a shorthand for enums you plan on using a lot in a switch case or something, beyond that it could be troublesome...

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Puming via Digitalmars-d-learn
On Sunday, 10 August 2014 at 05:34:49 UTC, thedeemon wrote: On Sunday, 10 August 2014 at 04:41:45 UTC, Puming wrote: Photo processing app: Disk space visualizer and redundancy searcher: A tool for watching some folders and processing video files there... Interesting :-) Unfortunately they

Re: Multidimensional slice

2014-08-10 Thread Remi Thebault via Digitalmars-d-learn
On Saturday, 9 August 2014 at 21:03:45 UTC, H. S. Teoh via Digitalmars-d-learn wrote: I think you need 2.066 or later to get this to work. After adding (size_t dim) to opSlice, your code compiles fine with git HEAD. Hi Thanks for the quick reply. Indeed I can get it to work with 2.066

Re: tuple slicing operator

2014-08-10 Thread via Digitalmars-d-learn
On Saturday, 9 August 2014 at 19:26:46 UTC, Meta wrote: On Saturday, 9 August 2014 at 16:39:34 UTC, Vlad Levenfeld wrote: I may be misunderstanding the intended semantics of the [] operator but I've come to interpret x[] to mean give me x as a range and this is the meaning I intend when I

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Joakim via Digitalmars-d-learn
On Sunday, 10 August 2014 at 04:37:20 UTC, Puming wrote: On Saturday, 9 August 2014 at 21:46:45 UTC, Peter Alexander wrote: On Saturday, 9 August 2014 at 00:34:43 UTC, Puming wrote: Yes, rust is a more infantile language compared to D, but people are already using them to create complicate

Class parameters that are either setable at run-time or compile-time

2014-08-10 Thread Markus Mayr via Digitalmars-d-learn
Hello, I am new to D. I am sorry if this question was already answered or if it is trivial. I am having a class. That class takes several parameters that may be known at either compile time or run time. I want users of my class to be able to pass the parameters either as template parameters

Re: Class parameters that are either setable at run-time or compile-time

2014-08-10 Thread Rikki Cattermole via Digitalmars-d-learn
On 10/08/2014 10:47 p.m., Markus Mayr wrote: Hello, I am new to D. I am sorry if this question was already answered or if it is trivial. I am having a class. That class takes several parameters that may be known at either compile time or run time. I want users of my class to be able to pass the

undefined references

2014-08-10 Thread Vlad Levenfeld via Digitalmars-d-learn
I'm compiling with DMD 2.065 using dub, and I've gotten some undefined reference errors for symbols inside my own project. Trying to run dustmite doesn't help, it keeps reporting that its done in one iteration, and gives me an empty results folder. I've used it before, its pretty

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
I wrote a terminal emulator in D a while ago https://github.com/adamdruppe/terminal-emulator terminal emulators are pretty boring as far as desktop applications go though. I have more on my to do list but haven't actually gotten to them yet.

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
My thing works on Windows and Linux btw, though the windows version pipes to the plink program to talk to ssh. It'd be pretty easy to make it a stand alone thing though with a few tweaks, then it could be like an escape sequence handling library.

Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
In D, arrays are dynamic. However, to the best of my knowledge, in C, they are static. I am having difficulty in imagining how to send D arrays to a C function. My first Idea was to make a pointer to the array. then find the size of the array, which itself is an array, therefore take the

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Puming via Digitalmars-d-learn
Wow, it just happens that I checked your terminal.d code on the list an hour ago :-) Definitely gonna look at it. What do you mean by 'boring'? I think a shell in D would be awesome. I'm planning to make a shell scripting lib in D, I would like it to be very powerful, but my coding skills

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Puming via Digitalmars-d-learn
Sorry for my misunderstanding. After looking at your code I realized that your terminal emulator is a GUI application and I was responding about a shell :-) Nonetheless, a terminal emulator is a very interesting tool. On Sunday, 10 August 2014 at 13:25:32 UTC, Adam D. Ruppe wrote: My thing

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread ketmar via Digitalmars-d-learn
On Sun, 10 Aug 2014 14:26:27 + seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: I am having difficulty in imagining how to send D arrays to a C function. do something like this: === C SIDE === void c_array_processing (int *items, size_t item_count) { // use items

Re: Class parameters that are either setable at run-time or compile-time

2014-08-10 Thread Martijn Pot via Digitalmars-d-learn
On Sunday, 10 August 2014 at 10:47:34 UTC, Markus Mayr wrote: Hello, I am new to D. I am sorry if this question was already answered or if it is trivial. I am having a class. That class takes several parameters that may be known at either compile time or run time. I want users of my class to

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
Thank you, so the running out of space problem is taken care of automatically?

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread ketmar via Digitalmars-d-learn
On Sun, 10 Aug 2014 15:24:29 + seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Thank you, so the running out of space problem is taken care of automatically? from D side -- yes. just don't store passed pointer on C side, 'cause it can be changed on array resize. but

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
On Sunday, 10 August 2014 at 15:34:30 UTC, ketmar via Digitalmars-d-learn wrote: from D side -- yes. just don't store passed pointer on C side, 'cause it can be changed on array resize. Excellent, So if I have int [] array; void * ptr_to_array = array; /* populate array here */

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread via Digitalmars-d-learn
On Sunday, 10 August 2014 at 14:26:29 UTC, seany wrote: In D, arrays are dynamic. However, to the best of my knowledge, in C, they are static. I am having difficulty in imagining how to send D arrays to a C function. My first Idea was to make a pointer to the array. then find the size of

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread anonymous via Digitalmars-d-learn
On Sunday, 10 August 2014 at 15:37:41 UTC, seany wrote: On Sunday, 10 August 2014 at 15:34:30 UTC, ketmar via Digitalmars-d-learn wrote: from D side -- yes. just don't store passed pointer on C side, 'cause it can be changed on array resize. Excellent, So if I have int [] array; void *

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 10 August 2014 at 14:28:33 UTC, Puming wrote: What do you mean by 'boring'? I think a shell in D would be awesome. tbh I think shells are a bit boring too, but like you said in the other message, they are two different things. But a terminal emulator isn't much of a gui because

opApply outside of struct/class scope

2014-08-10 Thread Freddy via Digitalmars-d-learn
I'm trying to implement a opApply outside of struct scope struct A{ int[] arr; } int opApply(ref A a,int delegate(ref int) dg){ return 0; } void main(){ A a; foreach(i;a){//i just want it to compile } } when i try compiling, the

Re: opApply outside of struct/class scope

2014-08-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, 10 August 2014 at 18:45:00 UTC, Freddy wrote: Is there any why i can put a opApply outside of a struct scope No overloaded operators in D can be put outside of a struct or class. They have to be member functions. - Jonathan M Davis

Re: opApply outside of struct/class scope

2014-08-10 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 10 August 2014 at 18:58:50 UTC, Jonathan M Davis wrote: No overloaded operators in D can be put outside of a struct or class. They have to be member functions. If I remember right, opApply was somewhat broken and only worked correctly in a few cases. But that was 18 months ago, a

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
So here is the final situtaion I have a file: software_pluginInterface.di Here I declare : extern (C): void performComputation(char lib[], char func[], void* ptr[], int varNum ); // lib and func will be used later Then i have the corresponding C file: software_pluginInterface.c, where I

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
of course I read this : http://dlang.org/interfaceToC.html I have 64 bit OS

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread seany via Digitalmars-d-learn
Solved : http://stackoverflow.com/questions/25232194/c-and-d-communication/25232265#25232265

Re: opApply outside of struct/class scope

2014-08-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, 10 August 2014 at 19:01:18 UTC, Era Scarecrow wrote: On Sunday, 10 August 2014 at 18:58:50 UTC, Jonathan M Davis wrote: No overloaded operators in D can be put outside of a struct or class. They have to be member functions. If I remember right, opApply was somewhat broken and only

Re: opApply outside of struct/class scope

2014-08-10 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 10 August 2014 at 21:57:29 UTC, Jonathan M Davis wrote: I'm not aware of opApply being broken, but I never use it, I remember very specifically it was brought up, that opApply was not working correctly and you could only use it with a very specific cases because... the

Re: opApply outside of struct/class scope

2014-08-10 Thread Era Scarecrow via Digitalmars-d-learn
On Sunday, 10 August 2014 at 22:03:28 UTC, Era Scarecrow wrote: I remember very specifically it was brought up, On Wed, Jul 09, 2014 at 03:16:37PM -0700, H. S. Teoh via Digitalmars-d wrote: Judging from this, a big missing piece of the current implementation is the actual enforcement of

Re: Are there desktop appications being developed in D currently?

2014-08-10 Thread Puming via Digitalmars-d-learn
On Sunday, 10 August 2014 at 18:40:23 UTC, Adam D. Ruppe wrote: On Sunday, 10 August 2014 at 14:28:33 UTC, Puming wrote: What do you mean by 'boring'? I think a shell in D would be awesome. tbh I think shells are a bit boring too, but like you said in the other message, they are two

Re: Communication between D and C with dynamic arrays

2014-08-10 Thread ketmar via Digitalmars-d-learn
On Sun, 10 Aug 2014 19:39:29 + seany via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: Solved : http://stackoverflow.com/questions/25232194/c-and-d-communication/25232265#25232265 almost exactly what i wrote in my first reply. except that i wrote about using .ptr and size_t

Re: opApply outside of struct/class scope

2014-08-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, 10 August 2014 at 22:03:28 UTC, Era Scarecrow wrote: On Sunday, 10 August 2014 at 21:57:29 UTC, Jonathan M Davis wrote: I'm not aware of opApply being broken, but I never use it, I remember very specifically it was brought up, that opApply was not working correctly and you could

Re: opApply outside of struct/class scope

2014-08-10 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 11 August 2014 at 02:03:15 UTC, Jonathan M Davis wrote: IIRC, opApply doesn't play well with various attributes, but I don't remember the details. That's the only issue with opApply that I'm aware of. It looks like you'll have to go digging into those other threads if you want to

Re: undefined references

2014-08-10 Thread Vlad Levenfeld via Digitalmars-d-learn
Ok, I've gotten to the bottom of this issue but I'm not totally sure how to submit a bug report for this (no SSCCE: can't get dustmite to work on it, and the problem won't show itself when I use the offending module in isolation) so I will try to sum up the issue and maybe I can provide some

Re: undefined references

2014-08-10 Thread uri via Digitalmars-d-learn
On Monday, 11 August 2014 at 03:12:45 UTC, Vlad Levenfeld wrote: [snip] this (Elements...)(Elements elements) if (Elements.length == length) { foreach (i, element; elements) components[i] = element; } this (Element

Re: undefined references

2014-08-10 Thread uri via Digitalmars-d-learn
On Monday, 11 August 2014 at 04:02:12 UTC, uri wrote: On Monday, 11 August 2014 at 03:12:45 UTC, Vlad Levenfeld wrote: [snip] this (Elements...)(Elements elements) if (Elements.length == length) { foreach (i, element; elements)

Identifying 32 vs 64 bit OS?

2014-08-10 Thread Jeremy DeHaan via Digitalmars-d-learn
I am looking at these versions as described here: http://dlang.org/version.html There are X86 and X86_64 version identifiers, but these specifically mention that they are versions for the processor type. Can they also be used to determine if the OS is running in 32 vs 64 bits?

Re: undefined references

2014-08-10 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Aug 11, 2014 at 03:12:43AM +, Vlad Levenfeld via Digitalmars-d-learn wrote: [...] So, while the mistake was mine, this should be an ambiguous overload error at compile-time, instead of a linker error. I realize that everyone contributing to D has their hands more than full, and