Quote:
Originally Posted by Kenny_Strawn
Here is my problem: I have a Vala program that includes classes with nested classes. When I try to initialize classes (using the variable type and the variable, followed by the class's arguments [three unsigned 8-bit integers] in parentheses) and try to compile the Vala code to C code (thanks Steshenko, that's what I tried to AVOID doing, as I really wanted to create a shared object file, but now I know I have to use C code as a middleman), the compiler tells me it expects a semicolon between the class variable name and its members.
What?! A semicolon in a bad place, that's for sure! Why would I want to put a semicolon *BETWEEN* the class initialization and its members? Isn't the whole point of a class to *HAVE* different members?
Here is my class:
Code:
public class Gtk.rgba : GLib.Object {
public class fg_color : GLib.Object {
private uint8 red;
private uint8 green;
private uint8 blue;
//Constructor
public fg_color(uint8 r, uint8 g, uint8 b) {
r = red;
g = green;
b = blue;
uint full_color = red * green * blue;
}
}
public class bg_color : GLib.Object {
private uint8 red;
private uint8 green;
private uint8 blue;
//Constructor
public bg_color(uint8 r, uint8 g, uint8 b) {
r = red;
g = green;
b = blue;
uint full_color = red * green * blue;
}
}
//Toplevel constructor
public rgba(var bg, var fg) {
bg = bg_color;
fg = fg_color;
}
public static void init(double alpha) {
double alpha_t = alpha;
//Here's where the error is
for (alpha_t > 0; alpha_t < 1; ++alpha_t) {
fg_color fg_increment(red++, green++, blue++);
bg_color bg_decrement(red--, green--, blue--);
^ //The compiler is telling me to put a semicolon *HERE* <yawn>.
}
}
}
|
Prove that the compiler is wrong. I.e. take the language spec/standard, read it, show the relevant paragraphs and prove that the compiler is incompatible with the language spec/standard.
Had it been "C", I would have said "read the C99 standard". Notice, that the languages you are trying to use change, but your problems stay the say. The main problem typically is: expectations based on nothing.