F.E.L.T.

Functionally Equivalent Language Translation

CLASS-CALL / ::

(class-call Classname MethodName arg1 arg2 ...argN)

(defvar db (class-call DBMS Open username password dbname))
(:: DBMS Close db)
;; non-portable short-forms of the above
(defvar db (DBMS::Open username password dbname))
(DBMS::Close db)

See also MCALL / -> CLASS

This is how FELT lets you call static methods on a class instance. It is pretty much the same as the MCALL / -> instruction except that it assumes that the receiver is a class not an instance of a class. The MethodName can be any valid expression that generates valid code.


Shortform and Portability

If you only ever intend to be generating a specific back-end then there is a short-form avilable as shown above, which can feel more natural for PHP applications. This short form allows you to put the class name and the method name together, concatenated by the :: operator but do not put any whitespace either side of :: or it will fail to parse.

The above sample code when rendered as PHP looks like this:

$db = DBMS::Open($username, $password, $dbname);
DBMS::Close($db);
$db = DBMS::Open($username, $password, $dbname);
DBMS::Close($db);

JavaScript Notes

JavaScript is a prototype based language and as such doesn't really have what Java or C++ might call a 'class' in the common sense of the word. FELT uses a particular way of creating 'classes' when the JSCoder or Nodejscoder back-ends are being used. For full details please refer to the CLASS documentation.