From 8bdb309e6b709c4f2e402a91cd777fe4b9e4c704 Mon Sep 17 00:00:00 2001 From: Blub Date: Sun, 28 Mar 2010 03:35:00 +0000 Subject: [PATCH] (Commit created by redmine exporter script from page "NewQC" version 1) --- NewQC.textile | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 NewQC.textile diff --git a/NewQC.textile b/NewQC.textile new file mode 100644 index 0000000..29328c8 --- /dev/null +++ b/NewQC.textile @@ -0,0 +1,53 @@ +h1. New QC Syntax + +It is possible that at some point we decide to switch QC-compiler which requires some changes to the code. + +h2. Clean syntax: + +In fteqcc there are some ambiguities regarding fieldpointers, function pointers, and field-return-types etc. +A clean syntax is needed, *SUGGESTIONS ARE WELCOME*, my(blub's) current suggestion is: + +|_.definition|_.meaning| +|float foo(void)| function| +|float foo*(void)| function pointer| +|.float foo(void)| member: method| +|.float foo*(void)| member: function pointer| +|..float foo(void)| member: method returning .float| +|..float foo*(void)| member: function pointer returning .float| +|.*float| fieldpointer| +|.*float foo(void)| fieldpointer: method returning float| +|.*float foo*(void)| fieldpointer: function pointer returning float| +|.*.float foo(void)| fieldpointer: method returning .float| +|.*.float foo*(void)|fieldpointer: function pointer returning .float| + +Additionally, at places where the definition of members or global functions is not allowed, they will be treated like fieldpointers. +So inside parameterlists or a functionbody the list is as follows: + +|_.definition|_.meaning| +|float foo(void)| *function pointer*| +|float foo*(void)| function pointer| +|.float foo(void)| *fieldpointer: method returning float*| +|.float foo*(void)| *fieldpointer: function pointer returning float*| +|..float foo(void)| *fieldpointer: method returning .float*| +|..float foo*(void)|*fieldpointer: function pointer returning .float*| +|.*float| fieldpointer| +|.*float foo(void)| fieldpointer: method returning float| +|.*float foo*(void)| fieldpointer: function pointer returning float| +|.*.float foo(void)| fieldpointer: method returning .float| +|.*.float foo*(void)|fieldpointer: function pointer returning .float| + +h2. Function definitions: + +The old-style QC way of defining functions will not be supported, so +
void(float x) something = { ... }
+becomes +
void something(float x) { ... }
+which is the most common way to define functions in the xonotic code already anyway. + +h2. Constants: + +From now on, the code +
float x = 3
+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. +To create a constant use: +
const float x = 3
-- 2.39.2