3 It is possible that at some point we decide to switch QC-compiler which requires some changes to the code.
7 In fteqcc there are some ambiguities regarding fieldpointers, function pointers, and field-return-types etc.
8 A clean syntax is needed, *SUGGESTIONS ARE WELCOME*, my(blub's) current suggestion is:
10 |_.definition|_.meaning|
11 |<code>float foo(void)</code>| function|
12 |<code>float foo*(void)</code>| function pointer|
13 |<code>.float foo(void)</code>| member: method/function pointer|
14 |<code>..float foo(void)</code>|/2. member: method/function pointer returning .float|
15 |<code>..*float foo(void)</code>|
16 |<code>.*float foo*(void)</code>| function pointer returning .float|
17 |<code>.*float</code>| fieldpointer|
18 |<code>.*float foo(void)</code>| fieldpointer: method/function pointer|
19 |<code>.*.float foo(void)</code>| fieldpointer: method/function pointer returning .float|
22 Additionally, at places where the definition of members or global functions is not allowed, they will be treated like fieldpointers.
23 So inside parameterlists or a functionbody the list is as follows:
25 |_.definition|_.meaning|
26 |<code>float foo(void)</code>| *function pointer*|
27 |<code>float foo*(void)</code>| function pointer|
28 |<code>.float foo(void)</code>| *fieldpointer: method/function pointer*|
29 |<code>..float foo(void)</code>|/2. *fieldpointer: method/function pointer returning .float*|
30 |<code>..*float foo(void)</code>|
31 |<code>.*float foo*(void)</code>| function pointer returning .float|
32 |<code>.*float</code>| fieldpointer|
33 |<code>.*float foo(void)</code>| fieldpointer: method/function pointer|
34 |<code>.*.float foo(void)</code>| fieldpointer: method/function pointer returning .float|
36 h2. Function definitions:
38 The old-style QC way of defining functions will not be supported, so
39 <pre>void(float x) something = { ... }</pre>
41 <pre>void something(float x) { ... }</pre>
42 which is the most common way to define functions in the xonotic code already anyway.
47 <pre>float x = 3</pre>
48 does what the first instinct tells you: it creates a global with the initial value 3. Contrary to old QC, where it created a constant.
49 To create a constant use:
50 <pre>const float x = 3</pre>
52 h2. Extendable functions:
54 Since menuQC has some funny macro: ACCUMULATE_FUNCTIONS, it seemed like a nice syntactical sugar to allow the following:
56 <pre>float myfunc() extendable