Full Metal Jacket is statically typed. As it lacks variables, types are assigned instead to vertex inputs and outputs (and by implication, the edges which connect them). Types are determined in much the same way as they are in Haskell, i.e. by Hindley-Milner type inference, a mechanism similar to unification in Prolog. However, in Full Metal Jacket, type inference occurs at the earliest possible stage: while the program is being edited, i.e. before running the code, and potentially before compiling it. This means the programmer doesn't need to specify any types, and is still prevented from entering an incorrectly typed program. Type inference is explained in detail in Keyboard? How quaint. Visual Dataflow Implemented in Lisp. The predefined types in Full Metal Jacket include
No additional elements are necessary for type definitions, as new types are defined using directed graphs (in practice, trees), by composing or extending existing types. The body of the type definition used for type inference is gradually built up as it flows downward through the graph, and constructors and deconstructors are automatically generated. ![]() The attributes of ![]()
(deftype Musician NIL (extend+ Person (List Track))) ![]() ![]() ![]() A Track could be defined in Lisp as (deftype Track NIL (compose+ Composition (AList Musician (List Sym)) Real)) © Copyright Donald Fisk 2016 |