A few new ideas:
Function, pointer, and typeid should be built-in types
I was thinking that it would be cool to borrow from python and have a class that has operator overloads for & and = that every class inherits from
Borrowing further from python, I like how I can make a substring using string[first:last], and a : operator could easily do that. If : is overloaded, then I don't think I'll keep bool?true:false.
I also like the idea of a tuple - maybe the class inherited by everything could include a , operator?
While I was thinking of a way to overload the () operator for the reference class, I thought of a really good idea - the () operator takes a va_list type, and the parameters that it's defined as having are just a shorthand for taking parameters out of the list:
1 2 3 4 5 6 7 8
|
//this
int add(int n1,int n2){
return n1+n2;}
//is the same as this
int add(va_list& args){
int n1=args.pop_front();
int n2=args.pop_front();
return n1+n2;}
|
One more thing: should I allow global variables as in C/C++, or require them to be encapsulated by a type as in Java?
What do you guys think?