Re: "not an lvalue"

2011-05-01 Thread CrypticMetaphor
On 5/1/2011 3:53 PM, Dmitry Olshansky wrote: Ehm.. Well, first things first: you shouldn't use classes for lightweight & plain data things like vectors. There are structs for that. In general, structs are value-like objects living on the stack while classes are reference-like objects living on th

Re: "not an lvalue"

2011-05-01 Thread CrypticMetaphor
Yes, you were right: Vector3 { // ... /// Binary operator for operator + and - public Vector3 opBinary(string op) (const ref Vector3 rhs) const if (op == "+" || op == "-") { mixin("return new Vector3(x" ~ op ~ "rhs.x, y" ~ op ~ "rhs.y, z" ~ op ~ "rhs.z);"); } // ... } I removed ref a

"not an lvalue"

2011-05-01 Thread CrypticMetaphor
Hi, I've been away from D for a while, but now I'm back and I'm stuck with an compile time error. I've got a Matrix33 class and a Vector3 class, but something is wrong with the way I return my Vector3 in my matrix class: If I do this I get an error: Matrix33 mtest = new Matrix33(); mtest.Set

Re: import from subdir

2010-12-23 Thread CrypticMetaphor
On 12/23/2010 1:38 PM, spir wrote: Is there a way to import util& data from test? I think this should work: util.d first line: module util; data.d first line module data.data; test.d first lines module test.test; import util; import data.data; Discl

d programming environment tutorial.

2010-12-21 Thread CrypticMetaphor
Hello, I've known D for about two weeks right now, and I kind of like it, a lot, but, I had a lot of trouble figuring out how to set up a programming environment. I mean, there were a few choices but some were abandoned, some things were only for D1(tango??) and others were so bug ridden that

Re: rdmd bug?

2010-12-19 Thread CrypticMetaphor
So, should I report this as a bug? What am i saying!? of course I should. It annoyed the hell outta me >_< *goes to report*

Re: rdmd bug?

2010-12-19 Thread CrypticMetaphor
Add -Ifullpath_to_projectfolder\src. It's the way it works IMHO, if you import something it must be relative to search path or to current dir. There may be a better way (replace current dir with the dir where source is, but it will take away control), but this works. There is a bug though,

rdmd bug?

2010-12-19 Thread CrypticMetaphor
Hello, I'm being driven nuts by this problem, I don't know 100% if it's it's a bug or if it's intended behavior, I'm new to D( also new to reporting bugs ) so I can't really tell. Anyway, the problem is, if I call rdmd from outside the folder in which the main source resides in, and main inclu

Re: rdmd executable location

2010-12-15 Thread CrypticMetaphor
On 12/15/2010 8:58 PM, Nick Voronin wrote: try -of option. rdmd -ofmain main.d works too! Thanks :P

Re: rdmd executable location

2010-12-15 Thread CrypticMetaphor
Sorry, that should be: rdmd -od%cd%\ filename.d Notice the backslash there. Otherwise it will create an executable on the root drive with the name of the folder you're compiling in. Funky.. Anyway there are more switches here: http://www.digitalmars.com/d/2.0/dmd-windows.html#switches Now tha

Re: rdmd executable location

2010-12-15 Thread CrypticMetaphor
If I run it with the rdmd version that came with the compiler, nothing special happens, it just compiles and runs the code, the executable doesn't end up in my current folder. ( rdmd build 20100913 ). If I run it with the compiler version of this code (rdmd build 20101215): http://dsource.org/p

rdmd executable location

2010-12-15 Thread CrypticMetaphor
Hello, I'm having a bit of trouble with rdmd. rdmd puts the executable in a temp folder, even with the --build-only option. Maybe this is a silly question but, how can I compile with rdmd so I get the executable in the folder I am currently at? other info: I'm programming in Windows XP with d

Re: Calling C functions

2010-12-09 Thread CrypticMetaphor
On 12/9/2010 10:04 PM, Jesse Phillips wrote: CrypticMetaphor Wrote: It is a linker bug, so Oplink is at fault. What is the bug number you submitted? bug number: 5337 http://d.puremagic.com/issues/show_bug.cgi?id=5337

Re: Calling C functions

2010-12-09 Thread CrypticMetaphor
On 12/9/2010 5:28 PM, Steven Schveighoffer wrote: On Thu, 09 Dec 2010 10:15:59 -0500, CrypticMetaphor wrote: On 12/9/2010 3:57 PM, Steven Schveighoffer wrote: On Thu, 09 Dec 2010 09:37:03 -0500, CrypticMetaphor wrote: I found this page that describes how to call c functions from D. I

Re: Calling C functions

2010-12-09 Thread CrypticMetaphor
On 12/9/2010 3:57 PM, Steven Schveighoffer wrote: On Thu, 09 Dec 2010 09:37:03 -0500, CrypticMetaphor wrote: I found this page that describes how to call c functions from D. I found this page that describes how: http://arsdnet.net/dtips/#cfunc on that page he uses gcc, and I use dmc, but I

Calling C functions

2010-12-09 Thread CrypticMetaphor
I found this page that describes how to call c functions from D. I found this page that describes how: http://arsdnet.net/dtips/#cfunc on that page he uses gcc, and I use dmc, but I get different results. This is what I did // cfile.c file extern int globalFromD; void functionFromC(int a) {