From 5cf178bb02e939c1cde42306225e63ebdd79a3b3 Mon Sep 17 00:00:00 2001 From: Blub Date: Sun, 28 Mar 2010 04:47:00 +0000 Subject: [PATCH] (Commit created by redmine exporter script from page "NewQC" version 15) --- NewQC.textile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/NewQC.textile b/NewQC.textile index 07329ec..beef7e5 100644 --- a/NewQC.textile +++ b/NewQC.textile @@ -48,3 +48,28 @@ From now on, the code 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
+ +h2. Extendable functions: + +Since menuQC has some funny macro: ACCUMULATE_FUNCTIONS, it seemed like a nice syntactical sugar to allow the following: + +
float myfunc() extendable
+{
+    float mylocal = 3;
+}
+
+/* other code */
+
+float myfunc()
+{
+    mylocal += 5;
+    if (mylocal > 20)
+        return mylocal;
+}
+
+/* optionally: */
+float myfunc() final
+{
+    return 3;
+}
+
-- 2.39.2