Page 1 of 1

file f; non standard capitalization

Posted: Wed Jul 12, 2017 10:51 am
by rrTea
In ZExpression, everything is defined using
model m; //Model m; error
string s; //String s; error
int i; //Int i; error

but
file f;
doesn't work unless it's capitalized like File f; (also it doesn't turn bold / blue like the rest).

Re: file f; non standard capitalization

Posted: Wed Jul 12, 2017 11:37 am
by Kjell
Hi rrTea,

That's because int / float / string and even model ( a pointer to a Model instance ) are built-in data types, while Bitmap / File / Sound are component types.

K

Re: file f; non standard capitalization

Posted: Wed Jul 12, 2017 11:54 am
by VilleK
It is a bit inconsistent, I agree, but indeed it is like Kjell explains. I wanted to make the built in primitive datatypes similar to C-standard ("int" etc) but the component types with initial caps to give them a sense of being a "class type".

Re: file f; non standard capitalization

Posted: Wed Jul 12, 2017 12:07 pm
by rrTea
I can see the logic - a bit surprising the first time one bumps into it (at least to me - I'd find it easier to remember if it were all the same, especially since the int & co are used all the time) but not a problem really, I'll keep it in mind. Sorry for the false alarm!