Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Here's how to do a package. We will keep it in the one GELLO file but often these packages form a data model and/or a library of functions that can be imported. These would be saved  with the extension .gello_model (see earlier tutes)

Package SubatomicParticle
imports iso_21090_datatypes

    class Quark
      name: String
      electricCharge: String
      mass: PQ
      spin: String

EndPackage


This example uses useful ISO21090 datatypes, in this case highlighting a PQ which is a Physical Quantity.

Lets create an instance:

Let aQuark: Quark = Quark {name = 'Up',
                           electricCharge = '2/3',
                           mass = PQ{value = 2.2 , unit = 'MeV/c^2'},
                           spin = '1/2'
                          }

..and have a final declarative 'outer expression':

aQuark.mass > PQ{value=1.00, unit='MeV/c^2'}


When we run this, here are the variables and the result:

...