>>92,120
As >>120 speculates using constants produces much faster code. I remind myself of this every time I am inconvenienced by it. (The problem isn't so much evaluating a matching expr here or there, it's in eliminating it when it doesn't match--you might as well if-else if- cascade performance-wise. There's also the issue of expression overlap which muddies the notion of a switch, but that's just a nit.)
There’s this thing that’s alwasy bothered me… Why in the world do I have to end a struct or enum declaration with a semicolon? The declaration is already enclosed in curly braces, no need for anything more than that.
Make all numbers binary by default, the only other allowable numeric format/representation will be base64
Name:
Anonymous2010-04-29 16:58
>>126
You should try Common Lisp.
You can do this just by setting or binding *read-base*/*print-base* to 16 and maybe *print-radix* to t(only set those that you want. print is for output generated by your application, read is for read input, which also includes the source code which is to be compiled. *print-radix* will allow the base to be included in the output, #x for hexadecimal). I used to try setting them both to 16, but that proved to be a bad idea, some variables got treated as numbers (think of :a,b,c,d,e,f,ab,deadbeef,fade,babe, etc). It's best that hexadecimal numbers be prefixed by something, so that that they don't conflict with normal indentifiers. So currently, I don't rebind/set *read-base* unless I absolutely need it, and I know it would be safe. I do however set *print-base* to 16 and *print-radix* to t, as I prefer numbers to be printed in hex by default.
Make all numbers hexadecimal by default, and digital only if you put 0d in front of them.
so numbers would be analog unless they have 0d in front of them?
Name:
Anonymous2010-04-30 8:38
The only thing C needs, really, is native quaternion support.
Name:
Anonymous2010-04-30 9:16
>>134
I also miss unicode support and/or TeX-like markup, so I could name my variables \psi and \lambda and my editor would show them as proper symbols, ideally even storing them in the file as such (i.e. UTF-8 encoded). Without this C just feels slightly antiquated and inadequate for my specific requirements.
Name:
Anonymous2010-04-30 9:36
Little thing with a few example includes I'd like to see:
Also, this is mostly taken from C++ and Python /********
** ++C **
********/
// OOP
class board {
init:
// I like the 'init:' header, but this will
// need to be changed in order to work properly
initclass(int boardCols, int boardRows) {
int boardX = boardCols;
int boardY = boardRows;
}
private: //As C++, but can use vars from init:
int boardX;
int boardY;
public: //As C++, but can use vars from init:
bool board[boardX][boardY];
>>135
IIRC there's nothing in the standard that says that source files can't be UTF-8, and your "TeX-like markup" is an editor misfeature, not part of the language.
Name:
Anonymous2010-04-30 10:49
>>136
Several of these features ruin C for the tasks where it's the most useful.
If you want a high level language, start with Python, Lisp, or Haskell.
add directx to the standard lib so u can use it to make games
make it so u dont have to remember the ; everywhere, when its a new line it should now what i mean lol.
>>144
integral types of specific sizes are specified in C99's stdint.h
also, not sure why you would need binary literals; hex representation is so much nicer and I can do the conversions in my head