licensing confusion :(

2014-07-13 Thread dcoder via Digitalmars-d
I am not sure if this is the right place to be posting a question on licensing, but hopefully so... I wonder if someone can explain the implications of using the dmd compiler which has (if my understanding is correct) a proprietary backend; how might this affect the commercial distribution of a

Re: licensing confusion :(

2014-07-13 Thread dcoder via Digitalmars-d
Well that was not so hard... Thanks everyone for nearly instantaneously clearing that up for me. :D

Is there a graphing library for D?

2012-07-17 Thread dcoder
I'm looking for a graphing library for D. Preferrably, something that uses Qt, but it doesn't have to. I am plotting sonar data, and I need to plot it 'live' so... I need something that is: 1. simple to use. I just want to graph x,y data. 2. ability to scale the display. 3. displaying more

Re: why is string not implicit convertable to const(char*) ?

2012-07-06 Thread dcoder
Thanks for the lengthy threaded explanations. I just use the language to write applications, I have no idea of the challenges that you must face to implement/design a language. Hence the stupid questions. :) Anyways, fascinating stuff.

Re: why is string not implicit convertable to const(char*) ?

2012-07-05 Thread dcoder
On Saturday, 30 June 2012 at 00:27:46 UTC, Jonathan M Davis wrote: On Saturday, June 30, 2012 02:12:22 mta`chrono wrote: does anyone know why string not implicit convertable to const(char*) ? --- import core.sys.posix.unistd; void main() { // ok unlink(foo.txt);

Re: problem with byLine

2012-05-15 Thread dcoder
On Monday, 14 May 2012 at 09:00:14 UTC, simendsjo wrote: On Mon, 14 May 2012 10:41:54 +0200, Christian Köstlin christian.koest...@gmail.com wrote: Hi, i wanted to output an ascii-file line by line, but reversed. the idea was to open the file, use byLine to read it line-by-line, make this

Re: problem with byLine

2012-05-15 Thread dcoder
On Tuesday, 15 May 2012 at 16:03:16 UTC, Matt Soucy wrote: I'm trying to learn D, by playing with code and reading this forum. I'm a slow learner. :) Anyways, I looked at std.stdio code and noticed that byLine resturns a struct ByLine, but where does the .map come from? Thanks! It comes

Object Serialization?

2012-04-24 Thread dcoder
Hello. I'm probably not looking hard enough, but Do we have any standard d-library for serializing an object/object tree into -for example- an xml file? thanks.

.empty and .length Amend language manual?

2012-04-18 Thread dcoder
I'm using the language reference on dlang.org (which is awesome), anyways, I can't find a description of .empty in the array section. Should it be there? I don't see it in the property section either. Could someone more expert than me, add it in somewhere? Thanks. Also, is there any

Question Object.factory and namespaces.

2012-04-12 Thread dcoder
Hello. I am reading through TDPL by Andresscu. The book has the following example, which I am abbreviating: void main( string[] args) { Stat [] stats; foreach( arg; args[1..$]) { auto newStat = cast(Stat) Object.factory( statsinc04. ~ arg); enforce( newStat, Invalid

Re: Question Object.factory and namespaces.

2012-04-12 Thread dcoder
On Thursday, 12 April 2012 at 15:36:25 UTC, Justin Whear wrote: On Thu, 12 Apr 2012 16:11:11 +0200, dcoder wrote: My question is, how do I change the code above so that it works even if I change the name of the file/module? I'm looking for clean solution something like a macro if one

inheriting ctors?

2010-08-05 Thread dcoder
Suppose I have a base class with many ctors(). I want to inherit from the base class and make one slight alteration to it, but I don't want to write X times the following: this(args) { super(args); } Does D have an easy way for the derived class to 'inherit' all or some of the base class

Re: Doubled newlines

2010-08-03 Thread dcoder
== Quote from bearophile (bearophileh...@lycos.com)'s article I think there is a bug here, but can you please try it a bit? The name of this program is test.d, so it loads its souce code: import std.file: readText; import std.stdio: write; void main() { string s = readText(test.d);

string initialization question.

2010-07-30 Thread dcoder
Hello. Is there anyway in D to convenient fill a string variable with a char say X times? So, I'd like to do something like: string divider( size, '-');// C++ notation. $divider = '-' x $size;// perl notation. I thought I could do the following: const char divider[rowstr.length]

Re: string initialization question.

2010-07-30 Thread dcoder
== Quote from Jonathan M Davis (jmdavisp...@gmail.com)'s article A makeArray() function wouldn't hurt any, but I don't think that it would really buy us much. Of course, truth be told, I've always thought that the ability to construct a string or vector in C++ all of a single value was pretty

D and cygwin io.

2010-07-27 Thread dcoder
Hello. Here's a short program that works in a dos window: import std.stdio; void main() { writef( What is your name?); string name = readln(); writefln( Hello ~ name); } The program prints a prompt without a newline and the user enters a name and a greeting is printed. The same

Re: Threading errors.

2010-07-27 Thread dcoder
== Quote from Rory Mcguire (rjmcgu...@gm_no_ail.com)'s article Philippe Sigaud wrote: Also, in my case, the return; in writer must be commented out, or DMD complains it cannot be reached. Interesting, I didn't have to comment out return; using dmd 2.047 on linux I think I

Re: string[int[][]] ??

2010-07-26 Thread dcoder
== Quote from Stewart Gordon (smjg_1...@yahoo.com)'s article Further to what others have said, why use strings? There are only 12 possible chess pieces (black and white), plus blank, so probably the most efficient approach is char[8][8] board; and use uppercase letters for white and

Threading errors.

2010-07-26 Thread dcoder
Hello. I am working through Alexandrescu's The D Programming Language. He has an example in his concurrency chapter which I can't compile. It looks to be missing a few import packages, but getting over that, I still can't get the example to work: import std.concurrency, std.stdio; import

string[int[][]] ??

2010-07-22 Thread dcoder
to assign anything to it. Any help would be appreciated. thanks! dcoder

Re: string[int[][]] ??

2010-07-22 Thread dcoder
== Quote from dcoder (dco...@devnull.com)'s article Hello. I want to use associative arrays, but have a 2-d int array as my index. so something like: string[int[][]] chessboard; chessboard[[0,0]] = Rook; chessboard[[0,1]] = Knight; Is this possible? I can declare chessboard without any

Re: string[int[][]] ??

2010-07-22 Thread dcoder
== Quote from awishformore (awishform...@nospam.plz)'s article How about string[][]? ;) yes, heheh... you are right. I'm over thinking things. Sorry about the noise.

Re: string[int[][]] ??

2010-07-22 Thread dcoder
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article This is what I think you should use: string[int[2]] Although, I'm not sure if you can then do something like: chessboard[[0,1]] = Rook; as the [0, 1] is typed as a dynamic array. If it does work, it may actually create [0,1]

Re: Higher level built-in strings

2010-07-20 Thread DCoder
== Quote from Michel Fortin (michel.for...@michelf.com)'s article On 2010-07-20 00:31:34 -0400, Walter Bright newshou...@digitalmars.com said: Steven Schveighoffer wrote: I agree here. Anything that uses indexing to perform a linear operation is bound for the scrap heap. But what about

Multi dimensional array question.

2010-07-11 Thread dcoder
Hello. I'm wondering why in D if you declare a fixed multi dimensional array, you have to reverse the index order to access an element. I know it has something to do with how tightly [] bind, but the consequence is that it seems so different to other languages, it makes it error prone. So

d compiler, Windows 7, and the new iX intel chips.

2010-07-11 Thread dcoder
Hello. Probably a stupid question, but does the dmd v2 compiler work with Windows 7, and the new intel chips like the i7? Since the download page on digitalmars references i386 and Win32, I'm assuming it doesn't? I'm thinking about getting a new computer, but would like D to work on it.

Re: Cannot initialize associative array.

2010-06-22 Thread dcoder
Sorry, I forgot to put some compiler output: For the declaration: uint[string] mywords = [ Hello : 1, World : 1, Cat : 1, Dog : 1 ]; I get: $ dmd test_01.d test_01.d(3): Error: non-constant expression [Hello:1u,World:1u,Cat:1u,Dog:1u]