1
General Discussion / Re: C2 discord server
« on: October 21, 2019, 11:19:45 PM »
nice!
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
old | new | meaning |
const char* | in char* | contents may only be read |
char* | out char* | contents may be written, but must be considered uninitialized for reading at moment of call |
inout char* | contents may be read and written | |
char** | out char** | contents may be written, but must be considered uninitialized for reading at moment of call |
inout char** | contents may be read and written |
const int* const'
syntax. This is not yet supported in C2.const i32 Max = 10;
is no issue. It is roughly equivalent of using a define in C.type IntP int*; // alias type
const IntP ip = a; // is a 'const IntP' ... but weird, 'const IntP' is different from 'const int*'
void example(IN Buffer* buffer, OUT Result* result);
procedure TEST01 ( In_State : IN VECT_B ; Out_State : IN OUT VECT_B );
...
case A:
if (b == 10) fallthrough;
do_something();
case B:
..
// there is a list.List* mylist that points to the list (let's say a linked-list)
list.foreach(mylist, i) { // i is the name of the Element*
// use Element* i here
if (i.value == 10) break;
}
public macro foreach(List* thelist, iname) {
Element* iname = thelist.first;
while (iname != nil) {
// macro body should be here, How to specify?
iname = iname.next;
}
}
So this brings up a lot of questions: