From 74dadbcaa22a2075f792840e242d709a844e318a Mon Sep 17 00:00:00 2001 From: Rafal Kupiec Date: Sat, 21 Dec 2019 12:32:20 +0100 Subject: [PATCH] --- %5BDRAFT%5D-Future-AerScript-Versions-Ideas.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/%5BDRAFT%5D-Future-AerScript-Versions-Ideas.md b/%5BDRAFT%5D-Future-AerScript-Versions-Ideas.md index d1440a2..6b7afc6 100644 --- a/%5BDRAFT%5D-Future-AerScript-Versions-Ideas.md +++ b/%5BDRAFT%5D-Future-AerScript-Versions-Ideas.md @@ -12,7 +12,7 @@ A right associative \** operator can be added to support exponentiation, along w printf("2 ** 3 = %d\n", 2 ** 3); // 8 printf("2 ** 3 ** 2 = %d\n", 2 ** 3 ** 2); // 512 -### Operator overloading +### Operator Overloading It should be possible to redeclare or overload most of the built-in operators available in AerScript. Thus a programmer could use operators with user-defined object types as well. Overloaded operators are functions with special names the keyword operator followed by the symbol for the operator being defined. similar to any other function, an overloaded operator has a return type and a parameter list. class Box { @@ -27,4 +27,10 @@ It should be possible to redeclare or overload most of the built-in operators av $box->length = $box1->length + $box2->length; return $box; } - } \ No newline at end of file + } + +### Methods Annotation +Implement Java-like annotations as a form of syntactic metadata that can be added to source code. They should be limited to methods. Some proposed annotations: + * @Deprecated - Marks the method as obsolete. Causes a warning if the method is being called + * @Unimplemented - Marks the method as not implemented. Causes a warning if the method is being called + * @Executable - Mars the method as program entry point. Forces VM to launch this method instead of Program::main(). If such annotation is not specified, VM should fallback to Program::main() and throw error if none found \ No newline at end of file