2005/5/10

     
 

AAL Functions

artefaktur

| Source Code | Preprocessor | Comments | Literals | Classes | Closures | Functions | Function Types |

Functions are free standing methods not bound to a class.

Content of this chapter:

   Defintion
   Sample
   Implementation

 Defintion

  ReturnType TypeName Arguments Body

 Sample

using acdk.lang;
String foo(String s, int i)
{
  return s.substr(i);

 Implementation

Freestanding function will translated into classes:
using acdk.lang;
String foo(String s, int i)
{
  return s.substr(i);

foo("Hallo", 1);

// will be translated into
class foo 
{
  public static String operator()(String s, int i)
  {
    return s.substr(i);
  }
}
foo.operator()("Hallo", 1);