Fandom

Planet JFX

Syntax changes

118pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

Syntax differences between compiler and interpreterEdit

Class definition and declarationEdit

In the interpreter, the class includes only the member declarations, not their definitions; in the compiler, these are defined inside the class, just as in Java. Attribute change triggers have been moved into the class as well, using the "on change { block }" syntax.

Nonprivate class members must have explicit types; this means attributes must have an explicit type, and function signatures must have explicit types for return value and argument types.

Attribute values specified in a class are considered defaults only. If the object literal specifies a value, the defaults are not evaluated.

Interpreter:

 class Foo { 
   attribute foo;
   function moo(x);
 }
 
 attribute Foo.foo = 3;
 
 function Foo.moo(x) = { x + 1 }
 
 trigger on Foo.foo = newValue { code }


Compiler:

 class Foo { 
   attribute foo = 3
     on change { code };
   
   function moo(x) { x + 1 }
 }

Functions vs OperationsEdit

Currently, operations and functions have been folded together. Bind semantics are still up in the air.


InitializationEdit

Any code that must be run after the instance is created via the object literal can be placed in an optional init { } block within the class definition. This can be used to reject invalid arguments, perform additional initialization steps, etc.

Compiler:

 class Foo { 
   attribute foo = 3
     on change { code };
   
   function moo(x) { x + 1 }

   init { 
     initialization code here
   }
 }

ModifiersEdit

The compiler currently recognizes public, private, protected, abstract, and readonly as member modifiers.


Block ExpressionsEdit

  • to be filled in*


Use of extends instead of supertype on class definitionEdit

  • to be filled in*


ImportEdit

  • to be filled in*


CardinalityEdit

The only cardinality specifiers are nothing (instance) and [] (sequence).

Also on Fandom

Random Wiki